Bug 12450 - Samba no longer builds with ld.gold linker
Summary: Samba no longer builds with ld.gold linker
Status: RESOLVED FIXED
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: Build (show other bugs)
Version: 4.2.14
Hardware: All Linux
: P5 normal (vote)
Target Milestone: ---
Assignee: Andreas Schneider
QA Contact: Samba QA Contact
URL: https://bugs.gentoo.org/show_bug.cgi?...
Keywords:
Depends on:
Blocks:
 
Reported: 2016-11-25 14:05 UTC by Mike Lothian
Modified: 2018-07-12 22:15 UTC (History)
4 users (show)

See Also:


Attachments
Samba build failure (355.35 KB, application/octet-stream)
2016-11-25 14:05 UTC, Mike Lothian
no flags Details
Proposed patch for master (114.46 KB, patch)
2016-11-26 17:18 UTC, Andreas Schneider
no flags Details
patch for 4.5 (35.04 KB, patch)
2016-12-05 12:43 UTC, Andreas Schneider
asn: review? (obnox)
asn: review? (ab)
abartlet: review+
Details
patch for 4.4 (35.69 KB, patch)
2016-12-05 12:43 UTC, Andreas Schneider
asn: review? (obnox)
asn: review? (ab)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Lothian 2016-11-25 14:05:56 UTC
Created attachment 12696 [details]
Samba build failure

Samba no longer builds with the ld.gold linker, I think this is a regression since binutils 2.17

The compilation fails with:

[2637/2782] Linking default/source3/smbd/smbd
default/source3/libsmbregistry-samba4.so: error: undefined reference to 'db_open'
default/source3/libsmbregistry-samba4.so: error: undefined reference to 'state_path'
collect2: error: ld returned 1 exit status
Waf: Leaving directory `/var/tmp/portage/net-fs/samba-4.2.14/work/samba-4.2.14-abi_x86_64.amd64/bin'
Build failed:  -> task failed (err #1):
        {task: cc_link epmd_28.o,lsasd_29.o,rpc_sock_helper_27.o,server_141.o -> smbd}
make: *** [Makefile:8: all] Error 1


This can be worked around by passing -fuse-ld=bfd to LDFLAGS


The Gentoo bug is https://bugs.gentoo.org/show_bug.cgi?id=600788
Comment 1 Andreas Schneider 2016-11-26 17:18:09 UTC
Created attachment 12697 [details]
Proposed patch for master
Comment 2 Andreas Schneider 2016-12-05 12:43:28 UTC
Created attachment 12721 [details]
patch for 4.5
Comment 3 Andreas Schneider 2016-12-05 12:43:46 UTC
Created attachment 12722 [details]
patch for 4.4
Comment 4 Karolin Seeger 2017-06-28 08:41:18 UTC
Patch does not apply on current v4-5-test (source3/wscript_build:453).
Comment 5 Andrew Bartlett 2018-07-12 22:15:17 UTC
Fixed in master by 4aa3a7f27548eda68f415a8f5bde013a7a9d58d4 for Samba 4.6.

Samba 4.5 is no longer supported so no backport will be done to these versions.