git: b65517ccd760 - stable/13 - cross-build: Add __weak_symbol definition for libdwarf bootstrap

From: Jessica Clarke <jrtc27_at_FreeBSD.org>
Date: Tue, 25 Jan 2022 01:40:11 UTC
The branch stable/13 has been updated by jrtc27:

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

commit b65517ccd760e1fc2a2899aebf598282228e6299
Author:     Jessica Clarke <jrtc27@FreeBSD.org>
AuthorDate: 2021-12-15 04:36:11 +0000
Commit:     Jessica Clarke <jrtc27@FreeBSD.org>
CommitDate: 2022-01-24 23:59:40 +0000

    cross-build: Add __weak_symbol definition for libdwarf bootstrap
    
    Fixes:          3aa0bc89c6a1 ("libdwarf: Add a weak uncompress() symbol")
    MFC after:      1 week
    
    (cherry picked from commit d752d10e53839ad0654c9c564c6ef6c6e462c96d)
---
 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) \