The binutils 2.22 ld.bfd and ld.gold linkers were not configured to support
link-time optimization plugins (-plugin switch) previously. This changeset
adds -plugin support to both linkers. The ld.bfd linker was previously
built statically, but it was necessary to change this to use the libc and
libz shared libraries because the -plugin option requires the dynamic
function dlopen().
The same update was not applied to binutils 2.21 linkers.
ldver.c \
ldmisc.c \
ldfile.c \
- ldcref.c
+ ldcref.c \
+ plugin.c
SRCS+= ldemul-list.h
CFLAGS+= -I${SRCDIR}/ld -I${SRCDIR}/bfd -I${.OBJDIR}/../libbfd
CFLAGS+= -DBINDIR=\"${TOOLS_PREFIX}${LIBEXEC_BINUTILS}\"
CFLAGS+= -DTOOLBINDIR=\"${TOOLS_PREFIX}${LIBEXEC_BINUTILS}\"
-NOSHARED?= yes
+CFLAGS+= -DENABLE_PLUGINS -DHAVE_CONFIG_H
+# 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
#define HAVE_GLOB 1
/* Define .init_array/.fini_array sections are available and working. */
-/* #undef HAVE_INITFINI_ARRAY */
+#define HAVE_INITFINI_ARRAY 1
/* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1
/* #undef ENABLE_NLS */
/* Define to enable linker plugins */
-/* #undef ENABLE_PLUGINS */
+#define ENABLE_PLUGINS 1
/* Define to do multi-threaded linking */
/* #undef ENABLE_THREADS */