Source-Changes-HG archive

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

[src/trunk]: src/external/gpl3/gcc/lib/liblto_plugin Link liblto_plugin with ...



details:   https://anonhg.NetBSD.org/src/rev/fbcd1ef5ba94
branches:  trunk
changeset: 827601:fbcd1ef5ba94
user:      kamil <kamil%NetBSD.org@localhost>
date:      Sat Nov 04 16:03:12 2017 +0000

description:
Link liblto_plugin with -liberty (gcc)

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 Makefiles and sources inspection, liblto_plugin.so shall be linked with \
libiberty (-liberty), a utility GNU library for internal usage with helping \
functions.

PR 52674 by myself

diffstat:

 external/gpl3/gcc/lib/liblto_plugin/Makefile |  6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diffs (20 lines):

diff -r 69624c14d06d -r fbcd1ef5ba94 external/gpl3/gcc/lib/liblto_plugin/Makefile
--- a/external/gpl3/gcc/lib/liblto_plugin/Makefile      Sat Nov 04 15:59:16 2017 +0000
+++ b/external/gpl3/gcc/lib/liblto_plugin/Makefile      Sat Nov 04 16:03:12 2017 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.4 2016/04/20 17:18:52 christos Exp $
+#      $NetBSD: Makefile,v 1.5 2017/11/04 16:03:12 kamil Exp $
 
 .include <bsd.init.mk>
 .include <bsd.shlib.mk>
@@ -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}



Home | Main Index | Thread Index | Old Index