binutils 2.24 linkers: enable plugin capability
authorJohn Marino <draco@marino.st>
Mon, 9 Dec 2013 23:00:24 +0000 (00:00 +0100)
committerJohn Marino <draco@marino.st>
Tue, 10 Dec 2013 05:27:20 +0000 (06:27 +0100)
Binutils 2.22 linkers have plugins enabled already.

gnu/usr.bin/binutils224/ld/Makefile
gnu/usr.bin/binutils224/libgold/config.h

index c07332e..4354f4d 100644 (file)
@@ -23,7 +23,8 @@ SRCS+=        ldgram.y        \
        ldver.c         \
        ldmisc.c        \
        ldfile.c        \
-       ldcref.c
+       ldcref.c        \
+       plugin.c
 
 SRCS+= ldemul-list.h
 
@@ -32,8 +33,11 @@ CFLAGS+= -DSCRIPTDIR=\"${TOOLS_PREFIX}${LIBEXEC_BINUTILS}\"
 CFLAGS+= -I${SRCDIR}/ld -I${SRCDIR}/bfd -I${.OBJDIR}/../libbfd
 CFLAGS+= -DBINDIR=\"${TOOLS_PREFIX}${LIBEXEC_BINUTILS}\"
 CFLAGS+= -DTOOLBINDIR=\"${TOOLS_PREFIX}${LIBEXEC_BINUTILS}\"
+CFLAGS+= -DENABLE_PLUGINS -DHAVE_CONFIG_H
 CFLAGS+= -DTARGET_SYSTEM_ROOT=\"${USRDATA_PREFIX}\"
-NOSHARED?= yes
+# link-time optimization requires dlopen() which means ld cannot be built
+# statically (e.g. NOSHARED=yes) and also support -plugin.
+#NOSHARED?= yes
 
 CLEANDIRS+=    ldscripts tmpdir
 CLEANFILES+=   ldemul-list.h stringify.sed
index 3b70eb0..06b0cf0 100644 (file)
@@ -16,7 +16,7 @@
 /* #undef ENABLE_NLS */
 
 /* Define to enable linker plugins */
-/* #undef ENABLE_PLUGINS */
+#define ENABLE_PLUGINS 1
 
 /* Define to do multi-threaded linking */
 /* #undef ENABLE_THREADS */