NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

lib/52674: liblto_plugin.so missing symbol xstrerror



>Number:         52674
>Category:       lib
>Synopsis:       liblto_plugin.so missing symbol xstrerror
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    lib-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Oct 30 02:50:00 +0000 2017
>Originator:     Kamil Rytarowski
>Release:        NetBSD 8.99.5 amd64
>Organization:
TNF
>Environment:
NetBSD chieftec 8.99.5 NetBSD 8.99.5 (GENERIC) #1: Fri Oct 27 18:16:18 CEST 2017  root@chieftec:/public/netbsd-root/sys/arch/amd64/compile/GENERIC amd64
>Description:
GCC passes liblto_plugin.so in the linker invocation (part of "gcc -v file.c"):

 ld -plugin /usr/libexec/liblto_plugin.so -plugin-opt=/usr/libexec/lto-wrapper -plugin-opt=-fresolution=/var/tmp//ccxda9Ar.res -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --eh-frame-hdr -dc -dp -e _start -dynamic-linker /usr/libexec/ld.elf_so /usr/lib/crt0.o /usr/lib/crti.o /usr/lib/crtbegin.o /var/tmp//cc7A7mOK.o --as-needed -lgcc_s --no-as-needed -lgcc -lc --as-needed -lgcc_s --no-as-needed -lgcc /usr/lib/crtend.o /usr/lib/crtn.o

When attempting to use GNU GOLD, liblto_plugin.so cannot be used because it has missing symbol xstrerror:

ld: error: /usr/libexec/liblto_plugin.so: could not load plugin library: /usr/libexec/liblto_plugin.so: Undefined PLT symbol "xstrerror" (symnum = 38)

From code and sources inspection, liblto_plugin.so shall be linked with libiberty (-liberty), a utility GNU library for internal usage with helping functions.


liberty.a is already linked with liblto_plugin.so for tools.:

$ nm /public/netbsd-root/tooldir.NetBSD-8.99.4-amd64/libexec/gcc/x86_64--netbsd/5.4.0/liblto_plugin.so|grep xstr
000000000000c8e7 T xstrdup
000000000000c921 T xstrerror
0000000000210960 b xstrerror_buf

>How-To-Repeat:
$ nm /usr/libexec/liblto_plugin.so|grep xstr
                 U xstrerror


>Fix:
Verified to work:

Index: Makefile
===================================================================
RCS file: /cvsroot/src/external/gpl3/gcc.old/lib/liblto_plugin/Makefile,v
retrieving revision 1.3
diff -u -r1.3 Makefile
--- Makefile    23 Jul 2017 01:12:06 -0000      1.3
+++ Makefile    30 Oct 2017 02:38:19 -0000
@@ -31,6 +31,10 @@
 SHLIB_MAJOR=   0
 SHLIB_MINOR=   0
 
+LIBIBERTYDIR!= cd ${.CURDIR}/../../lib/libiberty && ${PRINTOBJDIR}
+LDADD+=                -L${LIBIBERTYDIR} -liberty
+DPADD+=                ${LIBIBERTYDIR}/libiberty.a
+
 # Yuck, we have to run configure to generate this one...
 CLEANFILES+=   config.h
 HOST_CFLAGS+= -I${.OBJDIR}



If this is the proper solution, it should be backported to -8 and to gcc/ (HEAD uses gcc.old/ on NetBSD/amd64).



Home | Main Index | Thread Index | Old Index