FreeBSD Bugzilla – Attachment 228559 Details for
Bug 258812
devel/basu: broken LLD 13 build
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
v2 ("git am")
0001-devel-basu-unbreak-build-with-LLD-13.patch (text/plain), 3.51 KB, created by
Evgenii Khramtsov
on 2021-10-10 12:55:36 UTC
(
hide
)
Description:
v2 ("git am")
Filename:
MIME Type:
Creator:
Evgenii Khramtsov
Created:
2021-10-10 12:55:36 UTC
Size:
3.51 KB
patch
obsolete
>From 106a84a7a3175438d08ef8e7b024c7c1d09c286b Mon Sep 17 00:00:00 2001 >From: Evgeniy Khramtsov <evgeniy@khramtsov.org> >Date: Sat, 9 Oct 2021 15:37:45 +0000 >Subject: [PATCH] devel/basu: unbreak build with LLD 13 > >Backport change from systemd to unbreak build with LLD 13: > >ld: error: undefined symbol: __start_BUS_ERROR_MAP >>>> referenced by bus-error.c >>>> sd-bus_bus-error.c.o:(bus_error_name_to_errno) in archive src/libsystemd/libsystemd_static.a > >ld: error: undefined symbol: __stop_BUS_ERROR_MAP >>>> referenced by bus-error.c >>>> sd-bus_bus-error.c.o:(bus_error_name_to_errno) in archive src/libsystemd/libsystemd_static.a >>>> referenced by bus-error.c >>>> sd-bus_bus-error.c.o:(bus_error_name_to_errno) in archive src/libsystemd/libsystemd_static.a >clang-13: error: linker command failed with exit code 1 (use -v to see invocation) > >PR: 258812 >Obtained from: https://github.com/systemd/systemd/commit/945317a4b >--- > devel/basu/files/patch-attribute-retain | 48 +++++++++++++++++++++++++ > 1 file changed, 48 insertions(+) > create mode 100644 devel/basu/files/patch-attribute-retain > >diff --git a/devel/basu/files/patch-attribute-retain b/devel/basu/files/patch-attribute-retain >new file mode 100644 >index 000000000000..2c8203ae8b57 >--- /dev/null >+++ b/devel/basu/files/patch-attribute-retain >@@ -0,0 +1,48 @@ >+From 96ae9eb8abf5dc4b0686151142fe65b34ab45896 Mon Sep 17 00:00:00 2001 >+From: Fangrui Song <i@maskray.me> >+Date: Sun, 28 Mar 2021 23:35:06 -0700 >+Subject: [PATCH] sd-bus: set retain attribute on BUS_ERROR_MAP_ELF_REGISTER >+ >+LLD 13 and GNU ld 2.37 support -z start-stop-gc which allows garbage >+collection of C identifier name sections despite the __start_/__stop_ >+references. Simply set the retain attribute so that GCC 11 (if >+configure-time binutils is 2.36 or newer)/Clang 13 will set the >+SHF_GNU_RETAIN section attribute to prevent garbage collection. >+ >+Without the patch, there are linker errors like the following with -z >+start-stop-gc. >+ >+``` >+ld: error: undefined symbol: __start_SYSTEMD_BUS_ERROR_MAP >+>>> referenced by bus-error.c:93 (../src/libsystemd/sd-bus/bus-error.c:93) >+>>> sd-bus_bus-error.c.o:(bus_error_name_to_errno) in archive src/libsystemd/libsystemd_static.a >+``` >+--- >+ src/libsystemd/sd-bus/bus-error.h | 6 ++++++ >+ 1 file changed, 6 insertions(+) >+ >+diff --git src/libsystemd/sd-bus/bus-error.h src/libsystemd/sd-bus/bus-error.h >+index 06c478a..883213f 100644 >+--- src/libsystemd/sd-bus/bus-error.h >++++ src/libsystemd/sd-bus/bus-error.h >+@@ -28,11 +28,17 @@ int bus_error_set_errnofv(sd_bus_error *e, int error, const char *format, va_lis >+ * the bus error table, and BUS_ERROR_MAP_ELF_USE has to be used at >+ * least once per compilation unit (i.e. per library), to ensure that >+ * the error map is really added to the final binary. >++ * >++ * In addition, set the retain attribute so that the section cannot be >++ * discarded by ld --gc-sections -z start-stop-gc. Older compilers would >++ * warn for the unknown attribute, so just disable -Wattributes. >+ */ >+ >+ #define BUS_ERROR_MAP_ELF_REGISTER \ >++ _Pragma("GCC diagnostic ignored \"-Wattributes\"") \ >+ __attribute__ ((__section__("BUS_ERROR_MAP"))) \ >+ __attribute__ ((__used__)) \ >++ __attribute__ ((retain)) \ >+ __attribute__ ((aligned(8))) >+ >+ #define BUS_ERROR_MAP_ELF_USE(errors) \ >+-- >+2.32.0 >+ >-- >2.32.0 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
jbeich
:
maintainer-approval+
Actions:
View
|
Diff
Attachments on
bug 258812
:
228291
| 228559 |
229762