The Samba-Bugzilla – Attachment 16588 Details for
Bug 14288
OmniOS build/linking problem
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for 4.14, 4.13
BZ14288.patch (text/plain), 2.36 KB, created by
Martin Schwenke
on 2021-04-12 10:50:52 UTC
(
hide
)
Description:
Patch for 4.14, 4.13
Filename:
MIME Type:
Creator:
Martin Schwenke
Created:
2021-04-12 10:50:52 UTC
Size:
2.36 KB
patch
obsolete
>From 10e7196195aa512d883c864b64df767418a97c9d Mon Sep 17 00:00:00 2001 >From: Martin Schwenke <martin@meltin.net> >Date: Mon, 29 Mar 2021 16:30:37 +1100 >Subject: [PATCH] build: Only add -Wl,--as-needed when supported > >If -Wl,--as-needed is added to EXTRA_LDFLAGS (via ADD_LDFLAGS, as per >commit 996560191ac6bd603901dcd6c0de5d239e019ef4) then on some >platforms (at least CentOS 8 and Fedora 33), any indirect/recursive >dependencies (i.e. private libraries) are added to both the >binary (reqid_test in the CTDB case) and to samba-util.so. However, >only samba-util.so has rpath set to find private libraries. > >When ld.so tries to resolve these dependencies for the binary it >fails. This may be a bug on those platforms, but it occurs reliably >and our users will also hit the bug. For binaries that have other >private library dependencies (e.g. bundled talloc) rpath will contain >the private library directory so the duplicate private library >dependencies are then found... that is, when it works, it works by >accident! > >For some reason (deep in waf or wafsamba) if -Wl,--as-needed is added to >LINKFLAGS (as is done in conf.add_as_needed()) then it works: the direct >dependencies are only added to samba-util.so and the same depenencies >(indirect dependencies for binaries) are not added incorrectly to the >binaries. > >So, without changing 1/2 of waf/wafsamba the simplest fix is to revert >to adding -Wl,--as-needed to LINKFLAGS, which was the case before >commit 996560191ac6bd603901dcd6c0de5d239e019ef4. > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=14288 >RN: Fix the build on OmniOS > >Signed-off-by: Amitay Isaacs <amitay@gmail.com> >Signed-off-by: Martin Schwenke <martin@meltin.net> >Reviewed-by: Bjoern Jacke <bj@sernet.de> >Reviewed-by: Andrew Bartlett <abartlet@samba.org> >(backported from commit ff1c3af603b47a7e8f9faad8d1c2e4a489559155) >--- > wscript | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > >diff --git a/wscript b/wscript >index 334b2988234..172d05c052b 100644 >--- a/wscript >+++ b/wscript >@@ -340,7 +340,8 @@ def configure(conf): > # allows us to find problems on our development hosts faster. > # It also results in faster load time. > >- conf.add_as_needed() >+ if conf.CHECK_LDFLAGS('-Wl,--as-needed'): >+ conf.env.append_unique('LINKFLAGS', '-Wl,--as-needed') > > if not conf.CHECK_NEED_LC("-lc not needed"): > conf.ADD_LDFLAGS('-lc', testflags=False) >-- >2.30.2 >
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 Raw
Flags:
abartlet
:
review+
martins
:
ci-passed+
Actions:
View
Attachments on
bug 14288
:
15812
|
16494
| 16588