git: d752d10e5383 - main - cross-build: Add __weak_symbol definition for libdwarf bootstrap

From: Jessica Clarke <jrtc27_at_FreeBSD.org>
Date: Wed, 15 Dec 2021 04:36:40 UTC
The branch main has been updated by jrtc27:

URL: https://cgit.FreeBSD.org/src/commit/?id=d752d10e53839ad0654c9c564c6ef6c6e462c96d

commit d752d10e53839ad0654c9c564c6ef6c6e462c96d
Author:     Jessica Clarke <jrtc27@FreeBSD.org>
AuthorDate: 2021-12-15 04:36:11 +0000
Commit:     Jessica Clarke <jrtc27@FreeBSD.org>
CommitDate: 2021-12-15 04:36:11 +0000

    cross-build: Add __weak_symbol definition for libdwarf bootstrap
    
    Fixes:          3aa0bc89c6a1 ("libdwarf: Add a weak uncompress() symbol")
    MFC after:      1 week
---
 tools/build/cross-build/include/common/sys/cdefs.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tools/build/cross-build/include/common/sys/cdefs.h b/tools/build/cross-build/include/common/sys/cdefs.h
index 6d62333bcffe..d69e4369e01e 100644
--- a/tools/build/cross-build/include/common/sys/cdefs.h
+++ b/tools/build/cross-build/include/common/sys/cdefs.h
@@ -109,6 +109,9 @@
 #define __predict_false(exp) __builtin_expect((exp), 0)
 #endif
 
+#ifndef __weak_symbol
+#define __weak_symbol __attribute__((__weak__))
+#endif
 #ifndef __weak_reference
 #ifdef __ELF__
 #define __weak_reference(sym, alias) \