Re: FYI: amd64 built with WITH_LLD_IS_LD= vs. devel/libunwind : cannot preempt symbol (for various symbols)

From: Mark Millard <markmi_at_dsl-only.net>
Date: Sun, 16 Apr 2017 02:03:45 -0700
On 2017-Apr-16, at 1:10 AM, Mark Millard <markmi at dsl-only.net> wrote:

> Context: amd64 FreeBSD -r316952 as a VirtualBox guest
> that was built using WITH_LLD_IS_LD= . ports -r438577.
> 
> x11/xorg-minimal indirectly gets to devel/libunwind and
> devel/libunwind fails to build from source:
> 
> 
> --- Lperf-simple ---
> libtool: link: cc -O2 -pipe -g -fstack-protector -fno-strict-aliasing -fexceptions -Wall -Wsign-compare -fstack-protector -o .libs/Lperf-simple Lperf-simple.o  ../src/.libs/libunwind.so -lgcc -llzma -Wl,-rpath -Wl,/usr/local/lib
> /usr/bin/ld: error: ./Gperf-simple.c:195: cannot preempt symbol '_ULx86_64_init_local' defined in ../src/.libs/libunwind.so
> /usr/bin/ld: error: ./Gperf-simple.c:219: cannot preempt symbol '_ULx86_64_init_local' defined in ../src/.libs/libunwind.so
> /usr/bin/ld: error: ./Gperf-simple.c:252: cannot preempt symbol '_ULx86_64_local_addr_space' defined in ../src/.libs/libunwind.so
> /usr/bin/ld: error: ./Gperf-simple.c:252: cannot preempt symbol '_ULx86_64_set_caching_policy' defined in ../src/.libs/libunwind.so
> /usr/bin/ld: error: ./Gperf-simple.c:255: cannot preempt symbol '_ULx86_64_local_addr_space' defined in ../src/.libs/libunwind.so
> /usr/bin/ld: error: ./Gperf-simple.c:255: cannot preempt symbol '_ULx86_64_set_caching_policy' defined in ../src/.libs/libunwind.so
> /usr/bin/ld: error: ./Gperf-simple.c:258: cannot preempt symbol '_ULx86_64_local_addr_space' defined in ../src/.libs/libunwind.so
> /usr/bin/ld: error: ./Gperf-simple.c:258: cannot preempt symbol '_ULx86_64_set_caching_policy' defined in ../src/.libs/libunwind.so
> /usr/bin/ld: error: ./Gperf-simple.c:66: cannot preempt symbol '_ULx86_64_init_local' defined in ../src/.libs/libunwind.so
> /usr/bin/ld: error: ./Gperf-simple.c:73: cannot preempt symbol '_ULx86_64_step' defined in ../src/.libs/libunwind.so
> cc: error: linker command failed with exit code 1 (use -v to see invocation)
> *** [Lperf-simple] Error code 1
> 
> make[2]: stopped in /usr/obj/portswork/usr/ports/devel/libunwind/work/libunwind-1.1/tests
> --- Lperf-trace ---
> libtool: link: cc -O2 -pipe -g -fstack-protector -fno-strict-aliasing -fexceptions -Wall -Wsign-compare -fstack-protector -o .libs/Lperf-trace Lperf-trace.o  ../src/.libs/libunwind.so -lgcc -llzma -Wl,-rpath -Wl,/usr/local/lib
> --- Gperf-simple ---
> libtool: link: cc -O2 -pipe -g -fstack-protector -fno-strict-aliasing -fexceptions -Wall -Wsign-compare -fstack-protector -o .libs/Gperf-simple Gperf-simple.o  ../src/.libs/libunwind-x86_64.so /usr/obj/portswork/usr/ports/devel/libunwind/work/libunwind-1.1/src/.libs/libunwind.so ../src/.libs/libunwind.so -lgcc -llzma -Wl,-rpath -Wl,/usr/local/lib
> --- Lperf-trace ---
> /usr/bin/ld: error: ./Gperf-trace.c:181: cannot preempt symbol '_ULx86_64_init_local' defined in ../src/.libs/libunwind.so
> /usr/bin/ld: error: ./Gperf-trace.c:205: cannot preempt symbol '_ULx86_64_init_local' defined in ../src/.libs/libunwind.so
> /usr/bin/ld: error: ./Gperf-trace.c:238: cannot preempt symbol '_ULx86_64_local_addr_space' defined in ../src/.libs/libunwind.so
> /usr/bin/ld: error: ./Gperf-trace.c:238: cannot preempt symbol '_ULx86_64_set_caching_policy' defined in ../src/.libs/libunwind.so
> /usr/bin/ld: error: ./Gperf-trace.c:241: cannot preempt symbol '_ULx86_64_local_addr_space' defined in ../src/.libs/libunwind.so
> --- Gperf-trace ---
> libtool: link: cc -O2 -pipe -g -fstack-protector -fno-strict-aliasing -fexceptions -Wall -Wsign-compare -fstack-protector -o .libs/Gperf-trace Gperf-trace.o  ../src/.libs/libunwind-x86_64.so /usr/obj/portswork/usr/ports/devel/libunwind/work/libunwind-1.1/src/.libs/libunwind.so ../src/.libs/libunwind.so -lgcc -llzma -Wl,-rpath -Wl,/usr/local/lib
> --- Lperf-trace ---
> /usr/bin/ld: error: ./Gperf-trace.c:241: cannot preempt symbol '_ULx86_64_set_caching_policy' defined in ../src/.libs/libunwind.so
> /usr/bin/ld: error: ./Gperf-trace.c:244: cannot preempt symbol '_ULx86_64_local_addr_space' defined in ../src/.libs/libunwind.so
> /usr/bin/ld: error: ./Gperf-trace.c:244: cannot preempt symbol '_ULx86_64_set_caching_policy' defined in ../src/.libs/libunwind.so
> cc: error: linker command failed with exit code 1 (use -v to see invocation)
> *** [Lperf-trace] Error code 1
> 
> make[2]: stopped in /usr/obj/portswork/usr/ports/devel/libunwind/work/libunwind-1.1/tests
> --- Gperf-simple ---
> /usr/bin/ld: error: Gperf-simple.c:195: cannot preempt symbol '_Ux86_64_init_local' defined in ../src/.libs/libunwind-x86_64.so
> /usr/bin/ld: error: Gperf-simple.c:219: cannot preempt symbol '_Ux86_64_init_local' defined in ../src/.libs/libunwind-x86_64.so
> /usr/bin/ld: error: Gperf-simple.c:252: cannot preempt symbol '_Ux86_64_local_addr_space' defined in ../src/.libs/libunwind-x86_64.so
> /usr/bin/ld: error: Gperf-simple.c:252: cannot preempt symbol '_Ux86_64_set_caching_policy' defined in ../src/.libs/libunwind-x86_64.so
> /usr/bin/ld: error: Gperf-simple.c:255: cannot preempt symbol '_Ux86_64_local_addr_space' defined in ../src/.libs/libunwind-x86_64.so
> /usr/bin/ld: error: Gperf-simple.c:255: cannot preempt symbol '_Ux86_64_set_caching_policy' defined in ../src/.libs/libunwind-x86_64.so
> /usr/bin/ld: error: Gperf-simple.c:258: cannot preempt symbol '_Ux86_64_local_addr_space' defined in ../src/.libs/libunwind-x86_64.so
> /usr/bin/ld: error: Gperf-simple.c:258: cannot preempt symbol '_Ux86_64_set_caching_policy' defined in ../src/.libs/libunwind-x86_64.so
> /usr/bin/ld: error: Gperf-simple.c:66: cannot preempt symbol '_Ux86_64_init_local' defined in ../src/.libs/libunwind-x86_64.so
> /usr/bin/ld: error: Gperf-simple.c:73: cannot preempt symbol '_Ux86_64_step' defined in ../src/.libs/libunwind-x86_64.so
> --- Gperf-trace ---
> /usr/bin/ld: error: Gperf-trace.c:181: cannot preempt symbol '_Ux86_64_init_local' defined in ../src/.libs/libunwind-x86_64.so
> /usr/bin/ld: error: Gperf-trace.c:205: cannot preempt symbol '_Ux86_64_init_local' defined in ../src/.libs/libunwind-x86_64.so
> /usr/bin/ld: error: Gperf-trace.c:238: cannot preempt symbol '_Ux86_64_local_addr_space' defined in ../src/.libs/libunwind-x86_64.so
> /usr/bin/ld: error: Gperf-trace.c:238: cannot preempt symbol '_Ux86_64_set_caching_policy' defined in ../src/.libs/libunwind-x86_64.so
> /usr/bin/ld: error: Gperf-trace.c:241: cannot preempt symbol '_Ux86_64_local_addr_space' defined in ../src/.libs/libunwind-x86_64.so
> /usr/bin/ld: error: Gperf-trace.c:241: cannot preempt symbol '_Ux86_64_set_caching_policy' defined in ../src/.libs/libunwind-x86_64.so
> /usr/bin/ld: error: Gperf-trace.c:244: cannot preempt symbol '_Ux86_64_local_addr_space' defined in ../src/.libs/libunwind-x86_64.so
> /usr/bin/ld: error: Gperf-trace.c:244: cannot preempt symbol '_Ux86_64_set_caching_policy' defined in ../src/.libs/libunwind-x86_64.so
> --- Gperf-simple ---
> cc: error: linker command failed with exit code 1 (use -v to see invocation)
> --- Gperf-trace ---
> cc: error: linker command failed with exit code 1 (use -v to see invocation)
> --- Gperf-simple ---
> *** [Gperf-simple] Error code 1
> 
> make[2]: stopped in /usr/obj/portswork/usr/ports/devel/libunwind/work/libunwind-1.1/tests
> --- Gperf-trace ---
> *** [Gperf-trace] Error code 1
> 
> 
> I do have:
> 
> # svnlite diff /usr/ports/Mk
> Index: /usr/ports/Mk/bsd.port.mk
> ===================================================================
> --- /usr/ports/Mk/bsd.port.mk	(revision 436747)
> +++ /usr/ports/Mk/bsd.port.mk	(working copy)
> _at__at_ -1646,7 +1646,11 _at__at_
> STRIP_CMD=	${TRUE}
> .endif
> DEBUG_FLAGS?=	-g
> +.if defined(ALLOW_OPTIMIZATIONS_FOR_WITH_DEBUG)
> +CFLAGS:=		${CFLAGS} ${DEBUG_FLAGS}
> +.else
> CFLAGS:=		${CFLAGS:N-O*:N-fno-strict*} ${DEBUG_FLAGS}
> +.endif
> .if defined(INSTALL_TARGET)
> INSTALL_TARGET:=	${INSTALL_TARGET:S/^install-strip$/install/g}
> .endif
> 
> and use ALLOW_OPTIMIZATIONS_FOR_WITH_DEBUG= and WITH_DEBUG= :
> 
> # more /etc/make.conf 
> WANT_QT_VERBOSE_CONFIGURE=1
> #
> DEFAULT_VERSIONS+=perl5=5.24
> WRKDIRPREFIX=/usr/obj/portswork
> #
> # From a local /usr/ports/Mk/bsd.port.mk extension:
> ALLOW_OPTIMIZATIONS_FOR_WITH_DEBUG=
> #
> .if ${.CURDIR:M*/devel/*llvm*}
> #WITH_DEBUG=
> .elif ${.CURDIR:M*/www/webkit-qt5*}
> #WITH_DEBUG=
> .else
> WITH_DEBUG=
> .endif
> WITH_DEBUG_FILES=
> MALLOC_PRODUCTION=

I reverted my amd64 FreeBSD context to be based on
WITHOUT_LLD_IS_LD= and tried the above again.

devel/libunwind did not have the problem when
the system's ld was from the system binutils.

===
Mark Millard
markmi at dsl-only.net
Received on Sun Apr 16 2017 - 07:03:49 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:11 UTC