Bug 242053 - devel/binutils 2.33.1 Failed build: ld: error: undefined symbol: bswap_identity_64
Summary: devel/binutils 2.33.1 Failed build: ld: error: undefined symbol: bswap_identi...
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Only Me
Assignee: Baptiste Daroussin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-11-18 10:21 UTC by Martin Filla
Modified: 2019-11-24 08:59 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (bapt)


Attachments
config.log (94.06 KB, text/plain)
2019-11-22 13:52 UTC, Martin Filla
no flags Details
Replace problematic inline functions with macros (1.60 KB, patch)
2019-11-24 08:59 UTC, Matthieu Volat
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Filla 2019-11-18 10:21:57 UTC
Hi, 
i compiled binutils with portmaster on FreeBSD 12.1-RELEASE
but i have problem with linker.

v -f $depbase.Tpo $depbase.Po
depbase=`echo od-xcoff.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
cc -DHAVE_CONFIG_H -I.  -I. -I. -I../bfd -I./../bfd -I./../include -DLOCALEDIR="\"/usr/local/share/locale\"" -Dbin_dummy_emulation=bin_vanilla_emulation -isystem /usr/local/include -I/usr/local/include -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow  -pipe  -g -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing  -MT od-xcoff.o -MD -MP -MF $depbase.Tpo -c -o od-xcoff.o od-xcoff.c &&\
mv -f $depbase.Tpo $depbase.Po
/bin/sh ./libtool  --tag=CC   --mode=link cc -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow  -pipe  -g -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing   -fstack-protector-strong  -o objdump objdump.o dwarf.o prdbg.o rddbg.o debug.o stabs.o rdcoff.o bucomm.o version.o filemode.o elfcomm.o od-xcoff.o ../opcodes/libopcodes.la ../libctf/libctf.a ../bfd/libbfd.la ../libiberty/libiberty.a /usr/local/lib/libintl.so -Wl,-rpath -Wl,/usr/local/lib -L/usr/local/lib
libtool: link: cc -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -pipe -g -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing -fstack-protector-strong -o objdump objdump.o dwarf.o prdbg.o rddbg.o debug.o stabs.o rdcoff.o bucomm.o version.o filemode.o elfcomm.o od-xcoff.o /usr/local/lib/libintl.so -Wl,-rpath -Wl,/usr/local/lib  ../opcodes/.libs/libopcodes.a -L/usr/local/lib ../libctf/libctf.a ../bfd/.libs/libbfd.a -lz ../libiberty/libiberty.a
ld: error: undefined symbol: bswap_identity_64
>>> referenced by ctf-archive.c:112
>>>               ctf-archive.o:(ctf_arc_write) in archive ../libctf/libctf.a

ld: error: undefined symbol: bswap_identity_64
>>> referenced by ctf-archive.c:113
>>>               ctf-archive.o:(ctf_arc_write) in archive ../libctf/libctf.a

ld: error: undefined symbol: bswap_identity_64
>>> referenced by ctf-archive.c:114
>>>               ctf-archive.o:(ctf_arc_write) in archive ../libctf/libctf.a

ld: error: undefined symbol: bswap_identity_64
>>> referenced by ctf-archive.c:125
>>>               ctf-archive.o:(ctf_arc_write) in archive ../libctf/libctf.a

ld: error: undefined symbol: bswap_identity_64
>>> referenced by ctf-archive.c:134
>>>               ctf-archive.o:(ctf_arc_write) in archive ../libctf/libctf.a

ld: error: undefined symbol: bswap_identity_64
>>> referenced by ctf-archive.c:147
>>>               ctf-archive.o:(ctf_arc_write) in archive ../libctf/libctf.a

ld: error: undefined symbol: bswap_identity_64
>>> referenced by ctf-archive.c:167
>>>               ctf-archive.o:(ctf_arc_write) in archive ../libctf/libctf.a

ld: error: undefined symbol: bswap_identity_64
>>> referenced by ctf-archive.c:168
>>>               ctf-archive.o:(ctf_arc_write) in archive ../libctf/libctf.a

ld: error: undefined symbol: bswap_identity_64
>>> referenced by ctf-archive.c:175
>>>               ctf-archive.o:(ctf_arc_write) in archive ../libctf/libctf.a

ld: error: undefined symbol: bswap_identity_64
>>> referenced by ctf-archive.c:187
>>>               ctf-archive.o:(ctf_arc_write) in archive ../libctf/libctf.a

ld: error: undefined symbol: bswap_identity_64
>>> referenced by ctf-archive.c:266
>>>               ctf-archive.o:(arc_write_one_ctf) in archive ../libctf/libctf.a

ld: error: undefined symbol: bswap_identity_64
>>> referenced by ctf-archive.c:299
>>>               ctf-archive.o:(sort_modent_by_name) in archive ../libctf/libctf.a

ld: error: undefined symbol: bswap_identity_64
>>> referenced by ctf-archive.c:300
>>>               ctf-archive.o:(sort_modent_by_name) in archive ../libctf/libctf.a

ld: error: undefined symbol: bswap_identity_64
>>> referenced by ctf-archive.c:322
>>>               ctf-archive.o:(ctf_arc_bufopen) in archive ../libctf/libctf.a

ld: error: undefined symbol: bswap_identity_64
>>> referenced by ctf-archive.c:359
>>>               ctf-archive.o:(ctf_arc_open_internal) in archive ../libctf/libctf.a

ld: error: undefined symbol: bswap_identity_64
>>> referenced by ctf-archive.c:431
>>>               ctf-archive.o:(ctf_arc_open_by_name_internal) in archive ../libctf/libctf.a

ld: error: undefined symbol: bswap_identity_64
>>> referenced by ctf-archive.c:432
>>>               ctf-archive.o:(ctf_arc_open_by_name_internal) in archive ../libctf/libctf.a

ld: error: undefined symbol: bswap_identity_64
>>> referenced by ctf-archive.c:446
>>>               ctf-archive.o:(ctf_arc_open_by_name_internal) in archive ../libctf/libctf.a

ld: error: undefined symbol: bswap_identity_64
>>> referenced by ctf-archive.c:543
>>>               ctf-archive.o:(ctf_archive_raw_iter_internal) in archive ../libctf/libctf.a

ld: error: undefined symbol: bswap_identity_64
>>> referenced by ctf-archive.c:545
>>>               ctf-archive.o:(ctf_archive_raw_iter_internal) in archive ../libctf/libctf.a

ld: error: too many errors emitted, stopping now (use -error-limit=0 to see all errors)
cc: error: linker command failed with exit code 1 (use -v to see invocation)
gmake[6]: *** [Makefile:922: objdump] Error 1
gmake[6]: Leaving directory '/usr/ports/devel/binutils/work-native/binutils-2.33.1/binutils'
gmake[5]: *** [Makefile:1130: all-recursive] Error 1
gmake[5]: Leaving directory '/usr/ports/devel/binutils/work-native/binutils-2.33.1/binutils'
gmake[4]: *** [Makefile:757: all] Error 2
gmake[4]: Leaving directory '/usr/ports/devel/binutils/work-native/binutils-2.33.1/binutils'
gmake[3]: *** [Makefile:3612: all-binutils] Error 2
gmake[3]: Leaving directory '/usr/ports/devel/binutils/work-native/binutils-2.33.1'
gmake[2]: *** [Makefile:851: all] Error 2
gmake[2]: Leaving directory '/usr/ports/devel/binutils/work-native/binutils-2.33.1'
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/devel/binutils
*** Error code 1

Stop.
make: stopped in /usr/ports/devel/binutils

===>>> make build failed for devel/binutils
===>>> Aborting update

===>>> Update for devel/binutils failed
===>>> Aborting update
Comment 1 Martin Filla 2019-11-22 13:52:10 UTC
Created attachment 209338 [details]
config.log

config.log from compilation devel/binutils
Comment 2 Matthieu Volat 2019-11-24 08:59:37 UTC
Created attachment 209378 [details]
Replace problematic inline functions with macros

Hi, I've the same issue.

It seems to originate from some inlined (byte swapping) function declared in a header file that are never used so pruned from object files, but still expected at a link step.

Un-inlining is not really an option as it create multiple reference, I guess this could be worked around with the static keyword but I also managed to workaround this using preprocessor macros instead... I've attach a patch if that can be a temporary fix for some people.