summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/binutils
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/binutils')
-rw-r--r--meta/recipes-devtools/binutils/binutils-2.24.inc36
-rw-r--r--meta/recipes-devtools/binutils/binutils-cross-canadian.inc27
-rw-r--r--meta/recipes-devtools/binutils/binutils-cross-canadian_2.24.bb3
-rw-r--r--meta/recipes-devtools/binutils/binutils-cross.inc27
-rw-r--r--meta/recipes-devtools/binutils/binutils-cross_2.24.bb3
-rw-r--r--meta/recipes-devtools/binutils/binutils-crosssdk_2.24.bb11
-rw-r--r--meta/recipes-devtools/binutils/binutils.inc153
-rw-r--r--meta/recipes-devtools/binutils/binutils/binutils-armv5e.patch25
-rw-r--r--meta/recipes-devtools/binutils/binutils/binutils-poison.patch259
-rw-r--r--meta/recipes-devtools/binutils/binutils/binutils-uclibc-100-uclibc-conf.patch40
-rw-r--r--meta/recipes-devtools/binutils/binutils/binutils-uclibc-300-001_ld_makefile_patch.patch55
-rw-r--r--meta/recipes-devtools/binutils/binutils/binutils-uclibc-300-006_better_file_error.patch45
-rw-r--r--meta/recipes-devtools/binutils/binutils/binutils-uclibc-300-012_check_ldrunpath_length.patch49
-rw-r--r--meta/recipes-devtools/binutils/binutils/binutils-uclibc-gas-needs-libm.patch38
-rw-r--r--meta/recipes-devtools/binutils/binutils/binutils-xlp-support.patch402
-rw-r--r--meta/recipes-devtools/binutils/binutils/fix-pr15815.patch36
-rw-r--r--meta/recipes-devtools/binutils/binutils/fix-pr16428a.patch75
-rw-r--r--meta/recipes-devtools/binutils/binutils/fix-pr16428b.patch75
-rw-r--r--meta/recipes-devtools/binutils/binutils/fix-pr16476.patch220
-rw-r--r--meta/recipes-devtools/binutils/binutils/fix-pr2404.patch76
-rw-r--r--meta/recipes-devtools/binutils/binutils/libiberty_path_fix.patch22
-rw-r--r--meta/recipes-devtools/binutils/binutils/libtool-2.4-update.patch19317
-rw-r--r--meta/recipes-devtools/binutils/binutils/libtool-rpath-fix.patch39
-rw-r--r--meta/recipes-devtools/binutils/binutils/mips64-default-ld-emulation.patch54
-rw-r--r--meta/recipes-devtools/binutils/binutils/relocatable_sdk.patch49
-rw-r--r--meta/recipes-devtools/binutils/binutils_2.24.bb39
26 files changed, 21175 insertions, 0 deletions
diff --git a/meta/recipes-devtools/binutils/binutils-2.24.inc b/meta/recipes-devtools/binutils/binutils-2.24.inc
new file mode 100644
index 0000000..6415a6f
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils-2.24.inc
@@ -0,0 +1,36 @@
1LIC_FILES_CHKSUM="\
2 file://src-release;endline=17;md5=4830a9ef968f3b18dd5e9f2c00db2d35\
3 file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552\
4 file://COPYING.LIB;md5=9f604d8a4f8e74f4f5140845a21b6674\
5 file://COPYING3;md5=d32239bcb673463ab874e80d47fae504\
6 file://COPYING3.LIB;md5=6a6a8e020838b23406c81b19c1d46df6\
7 file://gas/COPYING;md5=d32239bcb673463ab874e80d47fae504\
8 file://include/COPYING;md5=59530bdf33659b29e73d4adb9f9f6552\
9 file://include/COPYING3;md5=d32239bcb673463ab874e80d47fae504\
10 file://libiberty/COPYING.LIB;md5=a916467b91076e631dd8edb7424769c7\
11 file://bfd/COPYING;md5=d32239bcb673463ab874e80d47fae504\
12 "
13
14SRC_URI = "\
15 ${GNU_MIRROR}/binutils/binutils-${PV}.tar.bz2 \
16 file://binutils-uclibc-100-uclibc-conf.patch \
17 file://binutils-uclibc-300-001_ld_makefile_patch.patch \
18 file://binutils-uclibc-300-006_better_file_error.patch \
19 file://binutils-uclibc-300-012_check_ldrunpath_length.patch \
20 file://binutils-uclibc-gas-needs-libm.patch \
21 file://libtool-2.4-update.patch \
22 file://libiberty_path_fix.patch \
23 file://binutils-poison.patch \
24 file://libtool-rpath-fix.patch \
25 file://binutils-armv5e.patch \
26 file://mips64-default-ld-emulation.patch \
27 file://binutils-xlp-support.patch \
28 file://fix-pr15815.patch \
29 file://fix-pr2404.patch \
30 file://fix-pr16476.patch \
31 file://fix-pr16428a.patch \
32 file://fix-pr16428b.patch \
33 "
34
35SRC_URI[md5sum] = "e0f71a7b2ddab0f8612336ac81d9636b"
36SRC_URI[sha256sum] = "e5e8c5be9664e7f7f96e0d09919110ab5ad597794f5b1809871177a0f0f14137"
diff --git a/meta/recipes-devtools/binutils/binutils-cross-canadian.inc b/meta/recipes-devtools/binutils/binutils-cross-canadian.inc
new file mode 100644
index 0000000..b4e610c
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils-cross-canadian.inc
@@ -0,0 +1,27 @@
1inherit cross-canadian
2
3SUMMARY = "GNU binary utilities (cross-canadian for ${TARGET_ARCH} target)"
4PN = "binutils-cross-canadian-${TRANSLATED_TARGET_ARCH}"
5BPN = "binutils"
6
7DEPENDS = "flex-native bison-native virtual/${HOST_PREFIX}gcc-crosssdk virtual/nativesdk-libc nativesdk-zlib nativesdk-gettext"
8EXTRA_OECONF += "--with-sysroot=${SDKPATH}/sysroots/${TUNE_PKGARCH}${TARGET_VENDOR}-${TARGET_OS} \
9 "
10
11# We have to point binutils at a sysroot but we don't need to rebuild if this changes
12# e.g. we switch between different machines with different tunes.
13EXTRA_OECONF[vardepsexclude] = "TUNE_PKGARCH"
14
15do_install () {
16 autotools_do_install
17
18 # We're not interested in the libs or headers, these would come from the
19 # nativesdk or target version of the binutils recipe
20 rm -rf ${D}${prefix}/${TARGET_SYS}
21 rm -f ${D}${libdir}/libbfd*
22 rm -f ${D}${libdir}/libiberty*
23 rm -f ${D}${libdir}/libopcodes*
24 rm -f ${D}${includedir}/*.h
25}
26
27BBCLASSEXTEND = ""
diff --git a/meta/recipes-devtools/binutils/binutils-cross-canadian_2.24.bb b/meta/recipes-devtools/binutils/binutils-cross-canadian_2.24.bb
new file mode 100644
index 0000000..5dbaa03
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils-cross-canadian_2.24.bb
@@ -0,0 +1,3 @@
1require binutils.inc
2require binutils-${PV}.inc
3require binutils-cross-canadian.inc
diff --git a/meta/recipes-devtools/binutils/binutils-cross.inc b/meta/recipes-devtools/binutils/binutils-cross.inc
new file mode 100644
index 0000000..300a1d3
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils-cross.inc
@@ -0,0 +1,27 @@
1inherit cross
2PROVIDES = "virtual/${TARGET_PREFIX}binutils"
3
4INHIBIT_DEFAULT_DEPS = "1"
5INHIBIT_AUTOTOOLS_DEPS = "1"
6
7EXTRA_OECONF += "--with-sysroot=${STAGING_DIR_TARGET} \
8 --disable-install-libbfd \
9 --enable-poison-system-directories \
10 "
11do_install () {
12 oe_runmake 'DESTDIR=${D}' install
13
14 # We don't really need these, so we'll remove them...
15 rm -rf ${D}${STAGING_DIR_NATIVE}${libdir_native}/libiberty.a
16 rm -rf ${D}${STAGING_DIR_NATIVE}${prefix_native}/${TARGET_SYS}
17 rm -rf ${D}${STAGING_DIR_NATIVE}${prefix_native}/lib/ldscripts
18 rm -rf ${D}${STAGING_DIR_NATIVE}${prefix_native}/share/info
19 rm -rf ${D}${STAGING_DIR_NATIVE}${prefix_native}/share/locale
20 rm -rf ${D}${STAGING_DIR_NATIVE}${prefix_native}/share/man
21 rmdir ${D}${STAGING_DIR_NATIVE}${prefix_native}/share || :
22 rmdir ${D}${STAGING_DIR_NATIVE}${prefix_native}/${libdir}/gcc-lib || :
23 rmdir ${D}${STAGING_DIR_NATIVE}${prefix_native}/${libdir}64/gcc-lib || :
24 rmdir ${D}${STAGING_DIR_NATIVE}${prefix_native}/${libdir} || :
25 rmdir ${D}${STAGING_DIR_NATIVE}${prefix_native}/${libdir}64 || :
26 rmdir ${D}${STAGING_DIR_NATIVE}${prefix_native}/${prefix} || :
27}
diff --git a/meta/recipes-devtools/binutils/binutils-cross_2.24.bb b/meta/recipes-devtools/binutils/binutils-cross_2.24.bb
new file mode 100644
index 0000000..fbd1f7d
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils-cross_2.24.bb
@@ -0,0 +1,3 @@
1require binutils.inc
2require binutils-${PV}.inc
3require binutils-cross.inc
diff --git a/meta/recipes-devtools/binutils/binutils-crosssdk_2.24.bb b/meta/recipes-devtools/binutils/binutils-crosssdk_2.24.bb
new file mode 100644
index 0000000..8af407f
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils-crosssdk_2.24.bb
@@ -0,0 +1,11 @@
1require binutils-cross_${PV}.bb
2
3inherit crosssdk
4
5PROVIDES = "virtual/${TARGET_PREFIX}binutils-crosssdk"
6
7SRC_URI += "file://relocatable_sdk.patch"
8
9do_configure_prepend () {
10 sed -i 's#/usr/local/lib /lib /usr/lib#${SDKPATHNATIVE}/lib ${SDKPATHNATIVE}/usr/lib /usr/local/lib /lib /usr/lib#' ${S}/ld/configure.tgt
11}
diff --git a/meta/recipes-devtools/binutils/binutils.inc b/meta/recipes-devtools/binutils/binutils.inc
new file mode 100644
index 0000000..7f084b5
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils.inc
@@ -0,0 +1,153 @@
1SUMMARY = "GNU binary utilities"
2DESCRIPTION = "The GNU Binutils are a collection of binary tools. \
3The main ones are ld (GNU Linker), and as (GNU Assembler). This \
4package also includes addition tools such as addr2line (Converts \
5addresses into filenames and line numbers), ar (utility for creating, \
6modifying and extracting archives), nm (list symbols in object \
7files), objcopy (copy and translate object files), objdump (Display \
8object information), and other tools and related libraries."
9HOMEPAGE = "http://www.gnu.org/software/binutils/"
10BUGTRACKER = "http://sourceware.org/bugzilla/"
11SECTION = "devel"
12LICENSE = "GPLv3"
13
14DEPENDS = "flex-native bison-native zlib-native gnu-config-native autoconf-native"
15
16inherit autotools gettext multilib_header
17
18FILES_${PN} = " \
19 ${bindir}/${TARGET_PREFIX}* \
20 ${libdir}/lib*-*.so \
21 ${prefix}/${TARGET_SYS}/bin/* \
22 ${bindir}/embedspu"
23
24RPROVIDES_${PN} += "${PN}-symlinks"
25
26FILES_${PN}-dev = " \
27 ${includedir} \
28 ${libdir}/*.la \
29 ${libdir}/libbfd.so \
30 ${libdir}/libopcodes.so"
31
32# Rather than duplicating multiple entries for these, make one
33# list and reuse it.
34
35USE_ALTERNATIVES_FOR = " \
36 addr2line \
37 ar \
38 as \
39 c++filt \
40 elfedit \
41 gprof \
42 ld \
43 ld.bfd \
44 ${@base_contains('DISTRO_FEATURES', 'ld-is-gold', 'ld.gold dwp', '', d)} \
45 nm \
46 objcopy \
47 objdump \
48 ranlib \
49 readelf \
50 size \
51 strings \
52 strip \
53"
54
55python do_package_prepend() {
56 make_alts = d.getVar("USE_ALTERNATIVES_FOR", True) or ""
57 prefix = d.getVar("TARGET_PREFIX", True)
58 bindir = d.getVar("bindir", True)
59 for alt in make_alts.split():
60 d.setVarFlag('ALTERNATIVE_TARGET', alt, bindir + "/" + prefix + alt)
61 d.setVarFlag('ALTERNATIVE_LINK_NAME', alt, bindir + "/" + alt)
62}
63
64# FILES_${PN}-dbg = "${prefix}/${TARGET_SYS}/bin/.debug ${prefix}/${libdir}/.debug"
65
66B = "${S}/build.${HOST_SYS}.${TARGET_SYS}"
67
68EXTRA_OECONF = "--program-prefix=${TARGET_PREFIX} \
69 --disable-werror \
70 --enable-plugins \
71 ${LDGOLD} \
72 ${@base_contains('DISTRO_FEATURES', 'multiarch', '--enable-64-bit-bfd', '', d)}"
73
74LDGOLD_class-native = ""
75LDGOLD_class-crosssdk = ""
76LDGOLD ?= "${@base_contains('DISTRO_FEATURES', 'ld-is-gold', '--enable-gold=default --enable-threads', '', d)}"
77
78# This is necessary due to a bug in the binutils Makefiles
79# EXTRA_OEMAKE = "configure-build-libiberty all"
80
81export AR = "${HOST_PREFIX}ar"
82export AS = "${HOST_PREFIX}as"
83export LD = "${HOST_PREFIX}ld"
84export NM = "${HOST_PREFIX}nm"
85export RANLIB = "${HOST_PREFIX}ranlib"
86export OBJCOPY = "${HOST_PREFIX}objcopy"
87export OBJDUMP = "${HOST_PREFIX}objdump"
88
89export AR_FOR_TARGET = "${TARGET_PREFIX}ar"
90export AS_FOR_TARGET = "${TARGET_PREFIX}as"
91export LD_FOR_TARGET = "${TARGET_PREFIX}ld"
92export NM_FOR_TARGET = "${TARGET_PREFIX}nm"
93export RANLIB_FOR_TARGET = "${TARGET_PREFIX}ranlib"
94
95export CC_FOR_HOST = "${CCACHE}${HOST_PREFIX}gcc ${HOST_CC_ARCH}"
96export CXX_FOR_HOST = "${CCACHE}${HOST_PREFIX}gcc ${HOST_CC_ARCH}"
97
98# autotools.bbclass sets the _FOR_BUILD variables, but for some reason we need
99# to unset LD_LIBRARY_PATH.
100export CC_FOR_BUILD = "LD_LIBRARY_PATH= ${BUILD_CC}"
101
102MULTIARCH := "${@bb.utils.contains("DISTRO_FEATURES", "multiarch", "yes", "no", d)}"
103do_configure[vardeps] += "MULTIARCH"
104do_configure () {
105 (cd ${S}; gnu-configize) || die "Failed to run gnu-configize"
106 oe_runconf
107#
108# must prime config.cache to ensure the build of libiberty
109#
110 mkdir -p ${B}/build-${BUILD_SYS}
111 for i in ${CONFIG_SITE}; do
112 cat $i >> ${B}/build-${BUILD_SYS}/config.cache || true
113 done
114}
115
116do_install () {
117 autotools_do_install
118
119 # We don't really need these, so we'll remove them...
120 rm -rf ${D}${libdir}/ldscripts
121
122 # Fix the /usr/${TARGET_SYS}/bin/* links
123 for l in ${D}${prefix}/${TARGET_SYS}/bin/*; do
124 rm -f $l
125 ln -sf `echo ${prefix}/${TARGET_SYS}/bin \
126 | tr -s / \
127 | sed -e 's,^/,,' -e 's,[^/]*,..,g'`${bindir}/${TARGET_PREFIX}`basename $l` $l
128 done
129
130 # Install the libiberty header
131 install -d ${D}${includedir}
132 install -m 644 ${S}/include/ansidecl.h ${D}${includedir}
133 install -m 644 ${S}/include/libiberty.h ${D}${includedir}
134
135 cd ${D}${bindir}
136
137 # Symlinks for ease of running these on the native target
138 for p in ${TARGET_PREFIX}* ; do
139 ln -sf $p `echo $p | sed -e s,${TARGET_PREFIX},,`
140 done
141
142 for alt in ${USE_ALTERNATIVES_FOR}; do
143 rm -f ${D}${bindir}/$alt
144 done
145
146 oe_multilib_header bfd.h
147}
148
149inherit update-alternatives
150
151ALTERNATIVE_PRIORITY = "100"
152
153ALTERNATIVE_${PN}_class-target = "${USE_ALTERNATIVES_FOR}"
diff --git a/meta/recipes-devtools/binutils/binutils/binutils-armv5e.patch b/meta/recipes-devtools/binutils/binutils/binutils-armv5e.patch
new file mode 100644
index 0000000..97ad6df
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils/binutils-armv5e.patch
@@ -0,0 +1,25 @@
1Add the armv5e architecture to binutils
2
3Binutils has a comment that indicates it is supposed to match gcc for all of
4the support "-march=" settings, but it was lacking the armv5e setting. This
5was a simple way to add it, as thumb instructions shouldn't be generated by
6the compiler anyway.
7
8Upstream-Status: Denied
9Upstream maintainer indicated that we should not be using armv5e, even though
10it is a legal archicture defined by our gcc.
11
12Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
13
14Index: binutils-2.22.90/gas/config/tc-arm.c
15===================================================================
16--- binutils-2.22.90.orig/gas/config/tc-arm.c 2012-07-24 09:38:32.000000000 -0700
17+++ binutils-2.22.90/gas/config/tc-arm.c 2012-08-07 23:41:59.822564075 -0700
18@@ -23162,6 +23162,7 @@
19 ARM_ARCH_OPT ("armv4t", ARM_ARCH_V4T, FPU_ARCH_FPA),
20 ARM_ARCH_OPT ("armv4txm", ARM_ARCH_V4TxM, FPU_ARCH_FPA),
21 ARM_ARCH_OPT ("armv5", ARM_ARCH_V5, FPU_ARCH_VFP),
22+ ARM_ARCH_OPT ("armv5e", ARM_ARCH_V5TE, FPU_ARCH_VFP),
23 ARM_ARCH_OPT ("armv5t", ARM_ARCH_V5T, FPU_ARCH_VFP),
24 ARM_ARCH_OPT ("armv5txm", ARM_ARCH_V5TxM, FPU_ARCH_VFP),
25 ARM_ARCH_OPT ("armv5te", ARM_ARCH_V5TE, FPU_ARCH_VFP),
diff --git a/meta/recipes-devtools/binutils/binutils/binutils-poison.patch b/meta/recipes-devtools/binutils/binutils/binutils-poison.patch
new file mode 100644
index 0000000..996c023
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils/binutils-poison.patch
@@ -0,0 +1,259 @@
1Upstream-Status: Inappropriate [distribution: codesourcery]
2
3Patch originally created by Mark Hatle, forward-ported to
4binutils 2.21 by Scott Garman.
5
6purpose: warn for uses of system directories when cross linking
7
8Code Merged from Sourcery G++ binutils 2.19 - 4.4-277
9
102008-07-02 Joseph Myers <joseph@codesourcery.com>
11
12 ld/
13 * ld.h (args_type): Add error_poison_system_directories.
14 * ld.texinfo (--error-poison-system-directories): Document.
15 * ldfile.c (ldfile_add_library_path): Check
16 command_line.error_poison_system_directories.
17 * ldmain.c (main): Initialize
18 command_line.error_poison_system_directories.
19 * lexsup.c (enum option_values): Add
20 OPTION_ERROR_POISON_SYSTEM_DIRECTORIES.
21 (ld_options): Add --error-poison-system-directories.
22 (parse_args): Handle new option.
23
242007-06-13 Joseph Myers <joseph@codesourcery.com>
25
26 ld/
27 * config.in: Regenerate.
28 * ld.h (args_type): Add poison_system_directories.
29 * ld.texinfo (--no-poison-system-directories): Document.
30 * ldfile.c (ldfile_add_library_path): Check
31 command_line.poison_system_directories.
32 * ldmain.c (main): Initialize
33 command_line.poison_system_directories.
34 * lexsup.c (enum option_values): Add
35 OPTION_NO_POISON_SYSTEM_DIRECTORIES.
36 (ld_options): Add --no-poison-system-directories.
37 (parse_args): Handle new option.
38
392007-04-20 Joseph Myers <joseph@codesourcery.com>
40
41 Merge from Sourcery G++ binutils 2.17:
42
43 2007-03-20 Joseph Myers <joseph@codesourcery.com>
44 Based on patch by Mark Hatle <mark.hatle@windriver.com>.
45 ld/
46 * configure.in (--enable-poison-system-directories): New option.
47 * configure, config.in: Regenerate.
48 * ldfile.c (ldfile_add_library_path): If
49 ENABLE_POISON_SYSTEM_DIRECTORIES defined, warn for use of /lib,
50 /usr/lib, /usr/local/lib or /usr/X11R6/lib.
51
52Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
53Signed-off-by: Scott Garman <scott.a.garman@intel.com>
54
55Index: binutils-2.24/ld/config.in
56===================================================================
57--- binutils-2.24.orig/ld/config.in 2013-12-15 11:46:17.000000000 -0800
58+++ binutils-2.24/ld/config.in 2013-12-15 11:46:59.810435651 -0800
59@@ -11,6 +11,9 @@
60 language is requested. */
61 #undef ENABLE_NLS
62
63+/* Define to warn for use of native system library directories */
64+#undef ENABLE_POISON_SYSTEM_DIRECTORIES
65+
66 /* Additional extension a shared object might have. */
67 #undef EXTRA_SHLIB_EXTENSION
68
69Index: binutils-2.24/ld/configure
70===================================================================
71--- binutils-2.24.orig/ld/configure 2013-12-15 11:46:17.000000000 -0800
72+++ binutils-2.24/ld/configure 2013-12-15 11:46:59.810435651 -0800
73@@ -777,6 +777,7 @@
74 enable_targets
75 enable_64_bit_bfd
76 with_sysroot
77+enable_poison_system_directories
78 enable_gold
79 enable_got
80 enable_werror
81@@ -1433,6 +1434,8 @@
82 (and sometimes confusing) to the casual installer
83 --enable-targets alternative target configurations
84 --enable-64-bit-bfd 64-bit support (on hosts with narrower word sizes)
85+ --enable-poison-system-directories
86+ warn for use of native system library directories
87 --enable-gold[=ARG] build gold [ARG={default,yes,no}]
88 --enable-got=<type> GOT handling scheme (target, single, negative,
89 multigot)
90@@ -4345,7 +4348,18 @@
91 fi
92
93
94+# Check whether --enable-poison-system-directories was given.
95+if test "${enable_poison_system_directories+set}" = set; then :
96+ enableval=$enable_poison_system_directories;
97+else
98+ enable_poison_system_directories=no
99+fi
100+
101+if test "x${enable_poison_system_directories}" = "xyes"; then
102
103+$as_echo "#define ENABLE_POISON_SYSTEM_DIRECTORIES 1" >>confdefs.h
104+
105+fi
106
107 # Check whether --enable-got was given.
108 if test "${enable_got+set}" = set; then :
109Index: binutils-2.24/ld/configure.in
110===================================================================
111--- binutils-2.24.orig/ld/configure.in 2013-12-15 11:46:17.000000000 -0800
112+++ binutils-2.24/ld/configure.in 2013-12-15 11:46:59.810435651 -0800
113@@ -87,6 +87,16 @@
114 AC_SUBST(TARGET_SYSTEM_ROOT)
115 AC_SUBST(TARGET_SYSTEM_ROOT_DEFINE)
116
117+AC_ARG_ENABLE([poison-system-directories],
118+ AS_HELP_STRING([--enable-poison-system-directories],
119+ [warn for use of native system library directories]),,
120+ [enable_poison_system_directories=no])
121+if test "x${enable_poison_system_directories}" = "xyes"; then
122+ AC_DEFINE([ENABLE_POISON_SYSTEM_DIRECTORIES],
123+ [1],
124+ [Define to warn for use of native system library directories])
125+fi
126+
127 dnl Use --enable-gold to decide if this linker should be the default.
128 dnl "install_as_default" is set to false if gold is the default linker.
129 dnl "installed_linker" is the installed BFD linker name.
130Index: binutils-2.24/ld/ldfile.c
131===================================================================
132--- binutils-2.24.orig/ld/ldfile.c 2013-12-15 11:46:17.000000000 -0800
133+++ binutils-2.24/ld/ldfile.c 2013-12-15 11:46:59.813768989 -0800
134@@ -116,6 +116,23 @@
135 new_dirs->name = concat (ld_sysroot, name + 1, (const char *) NULL);
136 else
137 new_dirs->name = xstrdup (name);
138+
139+#ifdef ENABLE_POISON_SYSTEM_DIRECTORIES
140+ if (command_line.poison_system_directories
141+ && ((!strncmp (name, "/lib", 4))
142+ || (!strncmp (name, "/usr/lib", 8))
143+ || (!strncmp (name, "/usr/local/lib", 14))
144+ || (!strncmp (name, "/usr/X11R6/lib", 14))))
145+ {
146+ if (command_line.error_poison_system_directories)
147+ einfo (_("%X%P: error: library search path \"%s\" is unsafe for "
148+ "cross-compilation\n"), name);
149+ else
150+ einfo (_("%P: warning: library search path \"%s\" is unsafe for "
151+ "cross-compilation\n"), name);
152+ }
153+#endif
154+
155 }
156
157 /* Try to open a BFD for a lang_input_statement. */
158Index: binutils-2.24/ld/ld.h
159===================================================================
160--- binutils-2.24.orig/ld/ld.h 2013-12-15 11:46:17.000000000 -0800
161+++ binutils-2.24/ld/ld.h 2013-12-15 11:46:59.813768989 -0800
162@@ -180,6 +180,14 @@
163 /* If TRUE we'll just print the default output on stdout. */
164 bfd_boolean print_output_format;
165
166+ /* If TRUE (the default) warn for uses of system directories when
167+ cross linking. */
168+ bfd_boolean poison_system_directories;
169+
170+ /* If TRUE (default FALSE) give an error for uses of system
171+ directories when cross linking instead of a warning. */
172+ bfd_boolean error_poison_system_directories;
173+
174 /* Big or little endian as set on command line. */
175 enum endian_enum endian;
176
177Index: binutils-2.24/ld/ldmain.c
178===================================================================
179--- binutils-2.24.orig/ld/ldmain.c 2013-12-15 11:46:17.000000000 -0800
180+++ binutils-2.24/ld/ldmain.c 2013-12-15 11:48:12.087101740 -0800
181@@ -266,6 +266,8 @@
182 command_line.warn_mismatch = TRUE;
183 command_line.warn_search_mismatch = TRUE;
184 command_line.check_section_addresses = -1;
185+ command_line.poison_system_directories = TRUE;
186+ command_line.error_poison_system_directories = FALSE;
187
188 /* We initialize DEMANGLING based on the environment variable
189 COLLECT_NO_DEMANGLE. The gcc collect2 program will demangle the
190Index: binutils-2.24/ld/ld.texinfo
191===================================================================
192--- binutils-2.24.orig/ld/ld.texinfo 2013-12-15 11:46:17.000000000 -0800
193+++ binutils-2.24/ld/ld.texinfo 2013-12-15 11:46:59.813768989 -0800
194@@ -2175,6 +2175,18 @@
195
196 Passing @code{none} for @var{style} disables the setting from any
197 @code{--build-id} options earlier on the command line.
198+
199+@kindex --no-poison-system-directories
200+@item --no-poison-system-directories
201+Do not warn for @option{-L} options using system directories such as
202+@file{/usr/lib} when cross linking. This option is intended for use
203+in chroot environments when such directories contain the correct
204+libraries for the target system rather than the host.
205+
206+@kindex --error-poison-system-directories
207+@item --error-poison-system-directories
208+Give an error instead of a warning for @option{-L} options using
209+system directories when cross linking.
210 @end table
211
212 @c man end
213Index: binutils-2.24/ld/lexsup.c
214===================================================================
215--- binutils-2.24.orig/ld/lexsup.c 2013-12-15 11:46:17.000000000 -0800
216+++ binutils-2.24/ld/lexsup.c 2013-12-15 11:49:28.950434490 -0800
217@@ -507,6 +507,14 @@
218 OPTION_IGNORE_UNRESOLVED_SYMBOL},
219 '\0', N_("SYMBOL"),
220 N_("Unresolved SYMBOL will not cause an error or warning"), TWO_DASHES },
221+ { {"no-poison-system-directories", no_argument, NULL,
222+ OPTION_NO_POISON_SYSTEM_DIRECTORIES},
223+ '\0', NULL, N_("Do not warn for -L options using system directories"),
224+ TWO_DASHES },
225+ { {"error-poison-system-directories", no_argument, NULL,
226+ + OPTION_ERROR_POISON_SYSTEM_DIRECTORIES},
227+ '\0', NULL, N_("Give an error for -L options using system directories"),
228+ TWO_DASHES },
229 };
230
231 #define OPTION_COUNT ARRAY_SIZE (ld_options)
232@@ -1442,6 +1450,14 @@
233 einfo (_("%P%X: --hash-size needs a numeric argument\n"));
234 }
235 break;
236+
237+ case OPTION_NO_POISON_SYSTEM_DIRECTORIES:
238+ command_line.poison_system_directories = FALSE;
239+ break;
240+
241+ case OPTION_ERROR_POISON_SYSTEM_DIRECTORIES:
242+ command_line.error_poison_system_directories = TRUE;
243+ break;
244 }
245 }
246
247Index: binutils-2.24/ld/ldlex.h
248===================================================================
249--- binutils-2.24.orig/ld/ldlex.h 2013-12-15 11:46:17.000000000 -0800
250+++ binutils-2.24/ld/ldlex.h 2013-12-15 11:47:43.230435299 -0800
251@@ -138,6 +138,8 @@
252 OPTION_DEFAULT_SCRIPT,
253 OPTION_PRINT_OUTPUT_FORMAT,
254 OPTION_IGNORE_UNRESOLVED_SYMBOL,
255+ OPTION_NO_POISON_SYSTEM_DIRECTORIES,
256+ OPTION_ERROR_POISON_SYSTEM_DIRECTORIES,
257 };
258
259 /* The initial parser states. */
diff --git a/meta/recipes-devtools/binutils/binutils/binutils-uclibc-100-uclibc-conf.patch b/meta/recipes-devtools/binutils/binutils/binutils-uclibc-100-uclibc-conf.patch
new file mode 100644
index 0000000..b5a25c2
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils/binutils-uclibc-100-uclibc-conf.patch
@@ -0,0 +1,40 @@
1Upstream-Status: Pending
2
3Index: binutils-2.22/configure
4===================================================================
5--- binutils-2.22.orig/configure
6+++ binutils-2.22/configure
7@@ -3130,7 +3130,7 @@ case "${target}" in
8 ;;
9 s390-*-* | s390x-*-*)
10 ;;
11- sh-*-* | sh[34]*-*-*)
12+ sh*-*-* | sh[34]*-*-*)
13 ;;
14 sh64-*-* | sh5*-*-*)
15 ;;
16@@ -3570,7 +3570,7 @@ case "${target}" in
17 mips*-*-*)
18 noconfigdirs="$noconfigdirs gprof"
19 ;;
20- sh-*-* | sh64-*-*)
21+ sh*-*-* | sh64-*-*)
22 case "${target}" in
23 sh*-*-elf)
24 ;;
25Index: binutils-2.22/gprof/configure
26===================================================================
27--- binutils-2.22.orig/gprof/configure
28+++ binutils-2.22/gprof/configure
29@@ -6103,6 +6103,11 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu)
30 lt_cv_deplibs_check_method=pass_all
31 ;;
32
33+linux-uclibc*)
34+ lt_cv_deplibs_check_method=pass_all
35+ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
36+ ;;
37+
38 netbsd*)
39 if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
40 lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
diff --git a/meta/recipes-devtools/binutils/binutils/binutils-uclibc-300-001_ld_makefile_patch.patch b/meta/recipes-devtools/binutils/binutils/binutils-uclibc-300-001_ld_makefile_patch.patch
new file mode 100644
index 0000000..c6e1efc
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils/binutils-uclibc-300-001_ld_makefile_patch.patch
@@ -0,0 +1,55 @@
1#!/bin/sh -e
2## 001_ld_makefile_patch.dpatch
3##
4## All lines beginning with `## DP:' are a description of the patch.
5## DP: Description: correct where ld scripts are installed
6## DP: Author: Chris Chimelis <chris@debian.org>
7## DP: Upstream status: N/A
8## DP: Date: ??
9
10if [ $# -ne 1 ]; then
11 echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
12 exit 1
13fi
14
15[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
16patch_opts="${patch_opts:--f --no-backup-if-mismatch}"
17
18case "$1" in
19 -patch) patch $patch_opts -p1 < $0;;
20 -unpatch) patch $patch_opts -p1 -R < $0;;
21 *)
22 echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
23 exit 1;;
24esac
25
26exit 0
27Upstream-Status: Inappropriate [debian patch]
28
29@DPATCH@
30Index: binutils-2.22/ld/Makefile.am
31===================================================================
32--- binutils-2.22.orig/ld/Makefile.am
33+++ binutils-2.22/ld/Makefile.am
34@@ -37,7 +37,7 @@ endif
35 # We put the scripts in the directory $(scriptdir)/ldscripts.
36 # We can't put the scripts in $(datadir) because the SEARCH_DIR
37 # directives need to be different for native and cross linkers.
38-scriptdir = $(tooldir)/lib
39+scriptdir = $(libdir)
40
41 EMUL = @EMUL@
42 EMULATION_OFILES = @EMULATION_OFILES@
43Index: binutils-2.22/ld/Makefile.in
44===================================================================
45--- binutils-2.22.orig/ld/Makefile.in
46+++ binutils-2.22/ld/Makefile.in
47@@ -366,7 +366,7 @@ AM_CFLAGS = $(WARN_CFLAGS)
48 # We put the scripts in the directory $(scriptdir)/ldscripts.
49 # We can't put the scripts in $(datadir) because the SEARCH_DIR
50 # directives need to be different for native and cross linkers.
51-scriptdir = $(tooldir)/lib
52+scriptdir = $(libdir)
53 BASEDIR = $(srcdir)/..
54 BFDDIR = $(BASEDIR)/bfd
55 INCDIR = $(BASEDIR)/include
diff --git a/meta/recipes-devtools/binutils/binutils/binutils-uclibc-300-006_better_file_error.patch b/meta/recipes-devtools/binutils/binutils/binutils-uclibc-300-006_better_file_error.patch
new file mode 100644
index 0000000..47bd8ff
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils/binutils-uclibc-300-006_better_file_error.patch
@@ -0,0 +1,45 @@
1#!/bin/sh -e
2## 006_better_file_error.dpatch by David Kimdon <dwhedon@gordian.com>
3##
4## All lines beginning with `## DP:' are a description of the patch.
5## DP: Specify which filename is causing an error if the filename is a
6## DP: directory. (#45832)
7
8if [ $# -ne 1 ]; then
9 echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
10 exit 1
11fi
12
13[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
14patch_opts="${patch_opts:--f --no-backup-if-mismatch}"
15
16case "$1" in
17 -patch) patch $patch_opts -p1 < $0;;
18 -unpatch) patch $patch_opts -p1 -R < $0;;
19 *)
20 echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
21 exit 1;;
22esac
23
24exit 0
25Upstream-Status: Inappropriate [debian patch]
26
27@DPATCH@
28Index: binutils-2.22/bfd/opncls.c
29===================================================================
30--- binutils-2.22.orig/bfd/opncls.c
31+++ binutils-2.22/bfd/opncls.c
32@@ -197,6 +197,13 @@ bfd_fopen (const char *filename, const c
33 {
34 bfd *nbfd;
35 const bfd_target *target_vec;
36+ struct stat s;
37+
38+ if (stat (filename, &s) == 0)
39+ if (S_ISDIR(s.st_mode)) {
40+ bfd_set_error (bfd_error_file_not_recognized);
41+ return NULL;
42+ }
43
44 nbfd = _bfd_new_bfd ();
45 if (nbfd == NULL)
diff --git a/meta/recipes-devtools/binutils/binutils/binutils-uclibc-300-012_check_ldrunpath_length.patch b/meta/recipes-devtools/binutils/binutils/binutils-uclibc-300-012_check_ldrunpath_length.patch
new file mode 100644
index 0000000..d31f80c
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils/binutils-uclibc-300-012_check_ldrunpath_length.patch
@@ -0,0 +1,49 @@
1#!/bin/sh -e
2## 012_check_ldrunpath_length.dpatch by Chris Chimelis <chris@debian.org>
3##
4## All lines beginning with `## DP:' are a description of the patch.
5## DP: Only generate an RPATH entry if LD_RUN_PATH is not empty, for
6## DP: cases where -rpath isn't specified. (#151024)
7
8if [ $# -ne 1 ]; then
9 echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
10 exit 1
11fi
12
13[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
14patch_opts="${patch_opts:--f --no-backup-if-mismatch}"
15
16case "$1" in
17 -patch) patch $patch_opts -p1 < $0;;
18 -unpatch) patch $patch_opts -p1 -R < $0;;
19 *)
20 echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
21 exit 1;;
22esac
23
24exit 0
25Upstream-Status: Inappropriate [debian patch]
26
27@DPATCH@
28Index: binutils-2.22/ld/emultempl/elf32.em
29===================================================================
30--- binutils-2.22.orig/ld/emultempl/elf32.em
31+++ binutils-2.22/ld/emultempl/elf32.em
32@@ -1273,6 +1273,8 @@ fragment <<EOF
33 && command_line.rpath == NULL)
34 {
35 lib_path = (const char *) getenv ("LD_RUN_PATH");
36+ if ((lib_path) && (strlen (lib_path) == 0))
37+ lib_path = NULL;
38 if (gld${EMULATION_NAME}_search_needed (lib_path, &n,
39 force))
40 break;
41@@ -1500,6 +1502,8 @@ gld${EMULATION_NAME}_before_allocation (
42 rpath = command_line.rpath;
43 if (rpath == NULL)
44 rpath = (const char *) getenv ("LD_RUN_PATH");
45+ if ((rpath) && (strlen (rpath) == 0))
46+ rpath = NULL;
47
48 for (abfd = link_info.input_bfds; abfd; abfd = abfd->link_next)
49 if (bfd_get_flavour (abfd) == bfd_target_elf_flavour)
diff --git a/meta/recipes-devtools/binutils/binutils/binutils-uclibc-gas-needs-libm.patch b/meta/recipes-devtools/binutils/binutils/binutils-uclibc-gas-needs-libm.patch
new file mode 100644
index 0000000..3869faf
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils/binutils-uclibc-gas-needs-libm.patch
@@ -0,0 +1,38 @@
1Source: Khem Raj <raj.khem@gmail.com>
2Disposition: submit upstream.
3Upstream-Status: Pending
4
5Description:
6
7We do not need to have the libtool patch anymore for binutils after
8libtool has been updated upstream it include support for it. However
9for building gas natively on uclibc systems we have to link it with
10-lm so that it picks up missing symbols.
11
12/local/build_area/BUILD/arm_v5t_le_uclibc/binutils-2.17.50/objdir/libiberty/pic/libiberty.a(floatformat.o): In function `floatformat_from_double':
13floatformat.c:(.text+0x1ec): undefined reference to `frexp'
14floatformat.c:(.text+0x2f8): undefined reference to `ldexp'
15/local/build_area/BUILD/arm_v5t_le_uclibc/binutils-2.17.50/objdir/libiberty/pic/libiberty.a(floatformat.o): In function `floatformat_to_double':
16floatformat.c:(.text+0x38a): undefined reference to `ldexp'
17floatformat.c:(.text+0x3d2): undefined reference to `ldexp'
18floatformat.c:(.text+0x43e): undefined reference to `ldexp' floatformat.c:(.text+0x4e2): undefined reference to `ldexp'
19collect2: ld returned 1 exit status
20make[4]: *** [as-new] Error 1
21
22Index: binutils-2.22/gas/configure.tgt
23===================================================================
24--- binutils-2.22.orig/gas/configure.tgt
25+++ binutils-2.22/gas/configure.tgt
26@@ -428,6 +428,12 @@ case ${generic_target} in
27 *-*-netware) fmt=elf em=netware ;;
28 esac
29
30+case ${generic_target} in
31+ arm-*-*uclibc*)
32+ need_libm=yes
33+ ;;
34+esac
35+
36 case ${cpu_type} in
37 alpha | arm | i386 | ia64 | microblaze | mips | ns32k | pdp11 | ppc | sparc | z80 | z8k)
38 bfd_gas=yes
diff --git a/meta/recipes-devtools/binutils/binutils/binutils-xlp-support.patch b/meta/recipes-devtools/binutils/binutils/binutils-xlp-support.patch
new file mode 100644
index 0000000..a199918
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils/binutils-xlp-support.patch
@@ -0,0 +1,402 @@
1Upstream-Status: Unknown
2Signed-off-by: Khem Raj <raj.khem@gmail.com>
3
4From 26adb06ce515aadfec08ce13109b4b98287f677b Mon Sep 17 00:00:00 2001
5From: Nebu Philips <nphilips@netlogicmicro.com>
6Date: Fri, 30 Jul 2010 15:10:03 -0700
7Subject: [PATCH] Add support for Netlogic XLP
8
9Using the mipsisa64r2nlm target, add support for XLP from
10Netlogic. Also, update vendor name to NLM wherever applicable.
11---
12 bfd/aoutx.h | 1 +
13 bfd/archures.c | 1 +
14 bfd/bfd-in2.h | 1 +
15 bfd/config.bfd | 5 +++++
16 bfd/cpu-mips.c | 6 ++++--
17 bfd/elfxx-mips.c | 8 ++++++++
18 binutils/readelf.c | 1 +
19 config.sub | 6 ++++++
20 gas/config/tc-mips.c | 7 ++++++-
21 gas/configure | 3 +++
22 gas/configure.tgt | 2 +-
23 gas/doc/c-mips.texi | 3 ++-
24 include/elf/mips.h | 1 +
25 include/opcode/mips.h | 6 +++++-
26 ld/configure.tgt | 2 ++
27 opcodes/mips-dis.c | 6 ++++++
28 opcodes/mips-opc.c | 31 ++++++++++++++++++++-----------
29 17 files changed, 73 insertions(+), 17 deletions(-)
30
31Index: binutils-2.24/bfd/aoutx.h
32===================================================================
33--- binutils-2.24.orig/bfd/aoutx.h 2013-12-15 13:07:57.180399300 -0800
34+++ binutils-2.24/bfd/aoutx.h 2013-12-15 13:08:03.397065919 -0800
35@@ -798,6 +798,7 @@
36 case bfd_mach_mipsisa64r2:
37 case bfd_mach_mips_sb1:
38 case bfd_mach_mips_xlr:
39+ case bfd_mach_mips_xlp:
40 /* FIXME: These should be MIPS3, MIPS4, MIPS16, MIPS32, etc. */
41 arch_flags = M_MIPS2;
42 break;
43Index: binutils-2.24/bfd/archures.c
44===================================================================
45--- binutils-2.24.orig/bfd/archures.c 2013-12-15 13:07:57.180399300 -0800
46+++ binutils-2.24/bfd/archures.c 2013-12-15 13:08:03.397065919 -0800
47@@ -178,6 +178,7 @@
48 .#define bfd_mach_mips_octeonp 6601
49 .#define bfd_mach_mips_octeon2 6502
50 .#define bfd_mach_mips_xlr 887682 {* decimal 'XLR' *}
51+.#define bfd_mach_mips_xlp 887680 {* decimal 'XLP' *}
52 .#define bfd_mach_mipsisa32 32
53 .#define bfd_mach_mipsisa32r2 33
54 .#define bfd_mach_mipsisa64 64
55Index: binutils-2.24/bfd/bfd-in2.h
56===================================================================
57--- binutils-2.24.orig/bfd/bfd-in2.h 2013-12-15 13:07:57.180399300 -0800
58+++ binutils-2.24/bfd/bfd-in2.h 2013-12-15 13:08:03.400399254 -0800
59@@ -1933,6 +1933,7 @@
60 #define bfd_mach_mips_octeonp 6601
61 #define bfd_mach_mips_octeon2 6502
62 #define bfd_mach_mips_xlr 887682 /* decimal 'XLR' */
63+#define bfd_mach_mips_xlp 887680 /* decimal 'XLP' */
64 #define bfd_mach_mipsisa32 32
65 #define bfd_mach_mipsisa32r2 33
66 #define bfd_mach_mipsisa64 64
67Index: binutils-2.24/bfd/config.bfd
68===================================================================
69--- binutils-2.24.orig/bfd/config.bfd 2013-12-15 13:08:03.047065922 -0800
70+++ binutils-2.24/bfd/config.bfd 2013-12-15 13:08:03.400399254 -0800
71@@ -1032,6 +1032,11 @@
72 targ_defvec=bfd_elf32_littlemips_vec
73 targ_selvecs="bfd_elf32_bigmips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec"
74 ;;
75+ mipsisa64*-*-elf*)
76+ targ_defvec=bfd_elf32_tradbigmips_vec
77+ targ_selvecs="bfd_elf32_tradlittlemips_vec bfd_elf64_tradbigmips_vec bfd_elf64_tradlittlemips_vec"
78+ want64=true
79+ ;;
80 mips*-*-elf* | mips*-*-rtems* | mips*-*-vxworks | mips*-*-windiss)
81 targ_defvec=bfd_elf32_bigmips_vec
82 targ_selvecs="bfd_elf32_littlemips_vec bfd_elf64_bigmips_vec bfd_elf64_littlemips_vec"
83Index: binutils-2.24/bfd/cpu-mips.c
84===================================================================
85--- binutils-2.24.orig/bfd/cpu-mips.c 2013-12-15 13:07:57.180399300 -0800
86+++ binutils-2.24/bfd/cpu-mips.c 2013-12-15 13:08:03.400399254 -0800
87@@ -99,7 +99,8 @@
88 I_mipsocteonp,
89 I_mipsocteon2,
90 I_xlr,
91- I_micromips
92+ I_micromips,
93+ I_xlp
94 };
95
96 #define NN(index) (&arch_info_struct[(index) + 1])
97@@ -143,7 +144,8 @@
98 N (64, 64, bfd_mach_mips_octeonp,"mips:octeon+", FALSE, NN(I_mipsocteonp)),
99 N (64, 64, bfd_mach_mips_octeon2,"mips:octeon2", FALSE, NN(I_mipsocteon2)),
100 N (64, 64, bfd_mach_mips_xlr, "mips:xlr", FALSE, NN(I_xlr)),
101- N (64, 64, bfd_mach_mips_micromips,"mips:micromips",FALSE,0)
102+ N (64, 64, bfd_mach_mips_micromips,"mips:micromips",FALSE,NN(I_micromips)),
103+ N (64, 64, bfd_mach_mips_xlp, "mips:xlp", FALSE, 0)
104 };
105
106 /* The default architecture is mips:3000, but with a machine number of
107Index: binutils-2.24/bfd/elfxx-mips.c
108===================================================================
109--- binutils-2.24.orig/bfd/elfxx-mips.c 2013-12-15 13:07:57.180399300 -0800
110+++ binutils-2.24/bfd/elfxx-mips.c 2013-12-15 13:08:03.400399254 -0800
111@@ -6404,6 +6404,9 @@
112 case E_MIPS_MACH_XLR:
113 return bfd_mach_mips_xlr;
114
115+ case E_MIPS_MACH_XLP:
116+ return bfd_mach_mips_xlp;
117+
118 default:
119 switch (flags & EF_MIPS_ARCH)
120 {
121@@ -11622,6 +11625,10 @@
122 val = E_MIPS_ARCH_64R2 | E_MIPS_MACH_OCTEON2;
123 break;
124
125+ case bfd_mach_mips_xlp:
126+ val = E_MIPS_ARCH_64R2 | E_MIPS_MACH_XLP;
127+ break;
128+
129 case bfd_mach_mipsisa32:
130 val = E_MIPS_ARCH_32;
131 break;
132@@ -14202,6 +14209,7 @@
133 { bfd_mach_mips_octeon2, bfd_mach_mips_octeonp },
134 { bfd_mach_mips_octeonp, bfd_mach_mips_octeon },
135 { bfd_mach_mips_octeon, bfd_mach_mipsisa64r2 },
136+ { bfd_mach_mips_xlp, bfd_mach_mipsisa64r2 },
137
138 /* MIPS64 extensions. */
139 { bfd_mach_mipsisa64r2, bfd_mach_mipsisa64 },
140Index: binutils-2.24/binutils/readelf.c
141===================================================================
142--- binutils-2.24.orig/binutils/readelf.c 2013-12-15 13:07:57.180399300 -0800
143+++ binutils-2.24/binutils/readelf.c 2013-12-15 13:08:03.403732587 -0800
144@@ -2602,6 +2602,7 @@
145 case E_MIPS_MACH_OCTEON: strcat (buf, ", octeon"); break;
146 case E_MIPS_MACH_OCTEON2: strcat (buf, ", octeon2"); break;
147 case E_MIPS_MACH_XLR: strcat (buf, ", xlr"); break;
148+ case E_MIPS_MACH_XLP: strcat (buf, ", xlp"); break;
149 case 0:
150 /* We simply ignore the field in this case to avoid confusion:
151 MIPS ELF does not specify EF_MIPS_MACH, it is a GNU
152Index: binutils-2.24/gas/config/tc-mips.c
153===================================================================
154--- binutils-2.24.orig/gas/config/tc-mips.c 2013-12-15 13:07:57.180399300 -0800
155+++ binutils-2.24/gas/config/tc-mips.c 2013-12-15 13:17:19.943728439 -0800
156@@ -486,6 +486,7 @@
157 || mips_opts.arch == CPU_RM7000 \
158 || mips_opts.arch == CPU_VR5500 \
159 || mips_opts.micromips \
160+ || mips_opts.arch == CPU_XLP \
161 )
162
163 /* Whether the processor uses hardware interlocks to protect reads
164@@ -515,6 +516,7 @@
165 && mips_opts.isa != ISA_MIPS3) \
166 || mips_opts.arch == CPU_R4300 \
167 || mips_opts.micromips \
168+ || mips_opts.arch == CPU_XLP \
169 )
170
171 /* Whether the processor uses hardware interlocks to protect reads
172@@ -17794,7 +17796,7 @@
173 /* Broadcom XLP.
174 XLP is mostly like XLR, with the prominent exception that it is
175 MIPS64R2 rather than MIPS64. */
176- { "xlp", 0, 0, ISA_MIPS64R2, CPU_XLR },
177+ { "xlp", 0, 0, ISA_MIPS64R2, CPU_XLP },
178
179 /* End marker */
180 { NULL, 0, 0, 0, 0 }
181Index: binutils-2.24/gas/configure
182===================================================================
183--- binutils-2.24.orig/gas/configure 2013-12-15 13:08:01.127065936 -0800
184+++ binutils-2.24/gas/configure 2013-12-15 13:08:03.407065920 -0800
185@@ -12697,6 +12697,9 @@
186 mipsisa64r2 | mipsisa64r2el)
187 mips_cpu=mips64r2
188 ;;
189+ mipsisa64r2nlm | mipsisa64r2nlmel)
190+ mips_cpu=xlp
191+ ;;
192 mipstx39 | mipstx39el)
193 mips_cpu=r3900
194 ;;
195Index: binutils-2.24/gas/configure.tgt
196===================================================================
197--- binutils-2.24.orig/gas/configure.tgt 2013-12-15 13:08:00.783732605 -0800
198+++ binutils-2.24/gas/configure.tgt 2013-12-15 13:08:03.407065920 -0800
199@@ -325,7 +325,7 @@
200 fmt=elf em=freebsd ;;
201 mips-*-sysv4*MP* | mips-*-gnu*) fmt=elf em=tmips ;;
202 mips*-sde-elf* | mips*-mti-elf*) fmt=elf em=tmips ;;
203- mips-*-elf* | mips-*-rtems*) fmt=elf ;;
204+ mips-*-elf* | mips-*-rtems*) fmt=elf em=tmips ;;
205 mips-*-netbsd*) fmt=elf em=tmips ;;
206 mips-*-openbsd*) fmt=elf em=tmips ;;
207
208Index: binutils-2.24/include/elf/mips.h
209===================================================================
210--- binutils-2.24.orig/include/elf/mips.h 2013-12-15 13:07:57.180399300 -0800
211+++ binutils-2.24/include/elf/mips.h 2013-12-15 13:08:03.407065920 -0800
212@@ -274,6 +274,7 @@
213 #define E_MIPS_MACH_SB1 0x008a0000
214 #define E_MIPS_MACH_OCTEON 0x008b0000
215 #define E_MIPS_MACH_XLR 0x008c0000
216+#define E_MIPS_MACH_XLP 0x008e0000
217 #define E_MIPS_MACH_OCTEON2 0x008d0000
218 #define E_MIPS_MACH_5400 0x00910000
219 #define E_MIPS_MACH_5900 0x00920000
220Index: binutils-2.24/include/opcode/mips.h
221===================================================================
222--- binutils-2.24.orig/include/opcode/mips.h 2013-12-15 13:07:57.180399300 -0800
223+++ binutils-2.24/include/opcode/mips.h 2013-12-15 13:40:11.130384844 -0800
224@@ -1092,8 +1092,10 @@
225 #define INSN_LOONGSON_2F 0x80000000
226 /* Loongson 3A. */
227 #define INSN_LOONGSON_3A 0x00000400
228-/* RMI Xlr instruction */
229-#define INSN_XLR 0x00000020
230+/* Netlogic Xlr instruction */
231+#define INSN_XLR 0x00000020
232+/* Netlogic XlP instruction */
233+#define INSN_XLP 0x00000040
234
235 /* DSP ASE */
236 #define ASE_DSP 0x00000001
237@@ -1172,6 +1174,7 @@
238 #define CPU_OCTEONP 6601
239 #define CPU_OCTEON2 6502
240 #define CPU_XLR 887682 /* decimal 'XLR' */
241+#define CPU_XLP 887680 /* decimal 'XLP' */
242
243 /* Return true if the given CPU is included in INSN_* mask MASK. */
244
245@@ -1239,6 +1242,9 @@
246 case CPU_XLR:
247 return (mask & INSN_XLR) != 0;
248
249+ case CPU_XLP:
250+ return (mask & INSN_XLP) != 0;
251+
252 default:
253 return FALSE;
254 }
255Index: binutils-2.24/ld/configure.tgt
256===================================================================
257--- binutils-2.24.orig/ld/configure.tgt 2013-12-15 13:08:03.047065922 -0800
258+++ binutils-2.24/ld/configure.tgt 2013-12-15 13:08:03.407065920 -0800
259@@ -457,6 +457,8 @@
260 mips*-sde-elf* | mips*-mti-elf*)
261 targ_emul=elf32btsmip
262 targ_extra_emuls="elf32ltsmip elf32btsmipn32 elf64btsmip elf32ltsmipn32 elf64ltsmip" ;;
263+mipsisa64*-*-elf*) targ_emul=elf32btsmip
264+ targ_extra_emuls="elf32ltsmip elf64btsmip elf64ltsmip" ;;
265 mips64*el-ps2-elf*) targ_emul=elf32lr5900n32
266 targ_extra_emuls="elf32lr5900"
267 targ_extra_libpath=$targ_extra_emuls ;;
268Index: binutils-2.24/opcodes/mips-dis.c
269===================================================================
270--- binutils-2.24.orig/opcodes/mips-dis.c 2013-12-15 13:07:57.180399300 -0800
271+++ binutils-2.24/opcodes/mips-dis.c 2013-12-15 13:39:50.243718329 -0800
272@@ -554,13 +554,11 @@
273 mips_cp0sel_names_xlr, ARRAY_SIZE (mips_cp0sel_names_xlr),
274 mips_hwr_names_numeric },
275
276- /* XLP is mostly like XLR, with the prominent exception it is being
277- MIPS64R2. */
278- { "xlp", 1, bfd_mach_mips_xlr, CPU_XLR,
279- ISA_MIPS64R2 | INSN_XLR, 0,
280- mips_cp0_names_xlr,
281- mips_cp0sel_names_xlr, ARRAY_SIZE (mips_cp0sel_names_xlr),
282- mips_hwr_names_numeric },
283+ { "xlp", 1, bfd_mach_mips_xlp, CPU_XLP,
284+ ISA_MIPS64R2 | INSN_XLP, 0,
285+ mips_cp0_names_mips3264r2,
286+ mips_cp0sel_names_mips3264r2, ARRAY_SIZE (mips_cp0sel_names_mips3264r2),
287+ mips_hwr_names_mips3264r2 },
288
289 /* This entry, mips16, is here only for ISA/processor selection; do
290 not print its name. */
291Index: binutils-2.24/opcodes/mips-opc.c
292===================================================================
293--- binutils-2.24.orig/opcodes/mips-opc.c 2013-12-15 13:07:57.180399300 -0800
294+++ binutils-2.24/opcodes/mips-opc.c 2013-12-15 13:27:30.573724118 -0800
295@@ -262,7 +262,8 @@
296 #define IOCT (INSN_OCTEON | INSN_OCTEONP | INSN_OCTEON2)
297 #define IOCTP (INSN_OCTEONP | INSN_OCTEON2)
298 #define IOCT2 INSN_OCTEON2
299-#define XLR INSN_XLR
300+#define XLR INSN_XLR
301+#define XLP INSN_XLP
302 #define IVIRT ASE_VIRT
303 #define IVIRT64 ASE_VIRT64
304
305@@ -881,6 +882,7 @@
306 {"cins", "t,r,+p,+S", 0x70000032, 0xfc00003f, WR_1|RD_2, 0, IOCT, 0, 0 },
307 {"clo", "U,s", 0x70000021, 0xfc0007ff, WR_1|RD_2, 0, I32|N55, 0, 0 },
308 {"clz", "U,s", 0x70000020, 0xfc0007ff, WR_1|RD_2, 0, I32|N55, 0, 0 },
309+{"crc", "d,s,t", 0x7000001c, 0xfc0007ff, WR_1|RD_2|RD_3, 0, XLP, 0, 0 },
310 {"ctc0", "t,G", 0x40c00000, 0xffe007ff, RD_1|WR_CC|COD, 0, I1, 0, IOCT|IOCTP|IOCT2 },
311 {"ctc1", "t,G", 0x44c00000, 0xffe007ff, RD_1|WR_CC|COD|FP_S, 0, I1, 0, 0 },
312 {"ctc1", "t,S", 0x44c00000, 0xffe007ff, RD_1|WR_CC|COD|FP_S, 0, I1, 0, 0 },
313@@ -913,10 +915,11 @@
314 {"daddiu", "t,r,j", 0x64000000, 0xfc000000, WR_1|RD_2, 0, I3, 0, 0 },
315 {"daddu", "d,v,t", 0x0000002d, 0xfc0007ff, WR_1|RD_2|RD_3, 0, I3, 0, 0 },
316 {"daddu", "t,r,I", 0, (int) M_DADDU_I, INSN_MACRO, 0, I3, 0, 0 },
317-{"daddwc", "d,s,t", 0x70000038, 0xfc0007ff, WR_1|RD_2|RD_3|WR_C0|RD_C0, 0, XLR, 0, 0 },
318+{"daddwc", "d,s,t", 0x70000038, 0xfc0007ff, WR_1|RD_2|RD_3|WR_C0|RD_C0, 0, XLR|XLP, 0, 0 },
319 {"dbreak", "", 0x7000003f, 0xffffffff, 0, 0, N5, 0, 0 },
320 {"dclo", "U,s", 0x70000025, 0xfc0007ff, WR_1|RD_2, 0, I64|N55, 0, 0 },
321 {"dclz", "U,s", 0x70000024, 0xfc0007ff, WR_1|RD_2, 0, I64|N55, 0, 0 },
322+{"dcrc", "d,s,t", 0x7000001d, 0xfc0007ff, WR_1|RD_2|RD_3, 0, XLP, 0, 0 },
323 /* dctr and dctw are used on the r5000. */
324 {"dctr", "o(b)", 0xbc050000, 0xfc1f0000, RD_2, 0, I3, 0, 0 },
325 {"dctw", "o(b)", 0xbc090000, 0xfc1f0000, RD_2, 0, I3, 0, 0 },
326@@ -980,6 +983,7 @@
327 {"dmfc0", "t,G,H", 0x40200000, 0xffe007f8, WR_1|RD_C0|LCD, 0, I64, 0, 0 },
328 {"dmfgc0", "t,G", 0x40600100, 0xffe007ff, WR_1|RD_C0|LCD, 0, 0, IVIRT64, 0 },
329 {"dmfgc0", "t,G,H", 0x40600100, 0xffe007f8, WR_1|RD_C0|LCD, 0, 0, IVIRT64, 0 },
330+{"dmfur", "t,d", 0x7000001e, 0xffe007ff, WR_1, 0, XLP, 0, 0 },
331 {"dmt", "", 0x41600bc1, 0xffffffff, TRAP, 0, 0, MT32, 0 },
332 {"dmt", "t", 0x41600bc1, 0xffe0ffff, WR_1|TRAP, 0, 0, MT32, 0 },
333 {"dmtc0", "t,G", 0x40a00000, 0xffe007ff, RD_1|WR_C0|WR_CC|COD, 0, I3, 0, EE },
334@@ -994,6 +998,8 @@
335 /* dmtc2 is at the bottom of the table. */
336 /* dmfc3 is at the bottom of the table. */
337 /* dmtc3 is at the bottom of the table. */
338+{"dmtur", "t,d", 0x7000001f, 0xffe007ff, RD_1, 0, XLP, 0, 0 },
339+{"dmul", "d,s,t", 0x70000006, 0xfc0007ff, WR_1|RD_2|RD_3, 0, XLP, 0, 0 },
340 {"dmul", "d,v,t", 0x70000003, 0xfc0007ff, WR_1|RD_2|RD_3|WR_HILO, 0, IOCT, 0, 0 },
341 {"dmul", "d,v,t", 0, (int) M_DMUL, INSN_MACRO, 0, I3, 0, M32 },
342 {"dmul", "d,v,I", 0, (int) M_DMUL_I, INSN_MACRO, 0, I3, 0, M32 },
343@@ -1134,9 +1140,9 @@
344 /* The macro has to be first to handle o32 correctly. */
345 {"ld", "t,A(b)", 0, (int) M_LD_AB, INSN_MACRO, 0, I1, 0, 0 },
346 {"ld", "t,o(b)", 0xdc000000, 0xfc000000, WR_1|RD_3, 0, I3, 0, 0 },
347-{"ldaddw", "t,b", 0x70000010, 0xfc00ffff, MOD_1|RD_2|SM, 0, XLR, 0, 0 },
348-{"ldaddwu", "t,b", 0x70000011, 0xfc00ffff, MOD_1|RD_2|SM, 0, XLR, 0, 0 },
349-{"ldaddd", "t,b", 0x70000012, 0xfc00ffff, MOD_1|RD_2|SM, 0, XLR, 0, 0 },
350+{"ldaddw", "t,b", 0x70000010, 0xfc00ffff, MOD_1|RD_2|SM, 0, XLR|XLP, 0, 0 },
351+{"ldaddwu", "t,b", 0x70000011, 0xfc00ffff, MOD_1|RD_2|SM, 0, XLR|XLP, 0, 0 },
352+{"ldaddd", "t,b", 0x70000012, 0xfc00ffff, MOD_1|RD_2|SM, 0, XLR|XLP, 0, 0 },
353 {"ldc1", "T,o(b)", 0xd4000000, 0xfc000000, WR_1|RD_3|CLD|FP_D, 0, I2, 0, SF },
354 {"ldc1", "E,o(b)", 0xd4000000, 0xfc000000, WR_1|RD_3|CLD|FP_D, 0, I2, 0, SF },
355 {"ldc1", "T,A(b)", 0, (int) M_LDC1_AB, INSN_MACRO, INSN2_M_FP_D, I2, 0, SF },
356@@ -1288,7 +1294,7 @@
357 {"mflo", "d,9", 0x00000012, 0xff9f07ff, WR_1|RD_LO, 0, 0, D32, 0 },
358 {"mflo1", "d", 0x70000012, 0xffff07ff, WR_1|RD_LO, 0, EE, 0, 0 },
359 {"mflhxu", "d", 0x00000052, 0xffff07ff, WR_1|MOD_HILO, 0, 0, SMT, 0 },
360-{"mfcr", "t,s", 0x70000018, 0xfc00ffff, WR_1, 0, XLR, 0, 0 },
361+{"mfcr", "t,s", 0x70000018, 0xfc00ffff, WR_1, 0, XLR|XLP, 0, 0 },
362 {"mfsa", "d", 0x00000028, 0xffff07ff, WR_1, 0, EE, 0, 0 },
363 {"min.ob", "X,Y,Q", 0x78000006, 0xfc20003f, WR_1|RD_2|RD_3|FP_D, 0, SB1, MX, 0 },
364 {"min.ob", "D,S,Q", 0x48000006, 0xfc20003f, WR_1|RD_2|RD_3|FP_D, 0, N54, 0, 0 },
365@@ -1332,10 +1338,13 @@
366 /* move is at the top of the table. */
367 {"msgn.qh", "X,Y,Q", 0x78200000, 0xfc20003f, WR_1|RD_2|RD_3|FP_D, 0, 0, MX, 0 },
368 {"msgsnd", "t", 0, (int) M_MSGSND, INSN_MACRO, 0, XLR, 0, 0 },
369+{"msgsnds", "d,t", 0x4a000001, 0xffe007ff, WR_1|RD_2|RD_C0|WR_C0, 0, XLP, 0, 0 },
370 {"msgld", "", 0, (int) M_MSGLD, INSN_MACRO, 0, XLR, 0, 0 },
371 {"msgld", "t", 0, (int) M_MSGLD_T, INSN_MACRO, 0, XLR, 0, 0 },
372-{"msgwait", "", 0, (int) M_MSGWAIT, INSN_MACRO, 0, XLR, 0, 0 },
373-{"msgwait", "t", 0, (int) M_MSGWAIT_T,INSN_MACRO, 0, XLR, 0, 0 },
374+{"msglds", "d,t", 0x4a000002, 0xffe007ff, WR_1|RD_2|RD_C0|WR_C0, 0, XLP, 0, 0 },
375+{"msgwait", "", 0, (int) M_MSGWAIT, INSN_MACRO, 0, XLR|XLP, 0, 0 },
376+{"msgwait", "t", 0, (int) M_MSGWAIT_T,INSN_MACRO, 0, XLR|XLP, 0, 0 },
377+{"msgsync", "", 0x4a000004, 0xffffffff,0, 0, XLP, 0, 0 },
378 {"msub.d", "D,R,S,T", 0x4c000029, 0xfc00003f, WR_1|RD_2|RD_3|RD_4|FP_D, 0, I4_33, 0, 0 },
379 {"msub.d", "D,S,T", 0x46200019, 0xffe0003f, WR_1|RD_2|RD_3|FP_D, 0, IL2E, 0, 0 },
380 {"msub.d", "D,S,T", 0x72200019, 0xffe0003f, WR_1|RD_2|RD_3|FP_D, 0, IL2F, 0, 0 },
381@@ -1381,7 +1390,7 @@
382 {"mtlo", "s,7", 0x00000013, 0xfc1fe7ff, RD_1|WR_LO, 0, 0, D32, 0 },
383 {"mtlo1", "s", 0x70000013, 0xfc1fffff, RD_1|WR_LO, 0, EE, 0, 0 },
384 {"mtlhx", "s", 0x00000053, 0xfc1fffff, RD_1|MOD_HILO, 0, 0, SMT, 0 },
385-{"mtcr", "t,s", 0x70000019, 0xfc00ffff, RD_1, 0, XLR, 0, 0 },
386+{"mtcr", "t,s", 0x70000019, 0xfc00ffff, RD_1, 0, XLR|XLP, 0, 0 },
387 {"mtm0", "s", 0x70000008, 0xfc1fffff, RD_1, 0, IOCT, 0, 0 },
388 {"mtm1", "s", 0x7000000c, 0xfc1fffff, RD_1, 0, IOCT, 0, 0 },
389 {"mtm2", "s", 0x7000000d, 0xfc1fffff, RD_1, 0, IOCT, 0, 0 },
390@@ -1802,9 +1811,9 @@
391 {"suxc1", "S,t(b)", 0x4c00000d, 0xfc0007ff, RD_1|RD_2|RD_3|SM|FP_D, 0, I5_33|N55, 0, 0},
392 {"sw", "t,o(b)", 0xac000000, 0xfc000000, RD_1|RD_3|SM, 0, I1, 0, 0 },
393 {"sw", "t,A(b)", 0, (int) M_SW_AB, INSN_MACRO, 0, I1, 0, 0 },
394-{"swapw", "t,b", 0x70000014, 0xfc00ffff, MOD_1|RD_2|SM, 0, XLR, 0, 0 },
395-{"swapwu", "t,b", 0x70000015, 0xfc00ffff, MOD_1|RD_2|SM, 0, XLR, 0, 0 },
396-{"swapd", "t,b", 0x70000016, 0xfc00ffff, MOD_1|RD_2|SM, 0, XLR, 0, 0 },
397+{"swapw", "t,b", 0x70000014, 0xfc00ffff, MOD_1|RD_2|SM, 0, XLR|XLP, 0, 0 },
398+{"swapwu", "t,b", 0x70000015, 0xfc00ffff, MOD_1|RD_2|SM, 0, XLR|XLP, 0, 0 },
399+{"swapd", "t,b", 0x70000016, 0xfc00ffff, MOD_1|RD_2|SM, 0, XLR|XLP, 0, 0 },
400 {"swc0", "E,o(b)", 0xe0000000, 0xfc000000, RD_3|RD_C0|SM, 0, I1, 0, IOCT|IOCTP|IOCT2 },
401 {"swc0", "E,A(b)", 0, (int) M_SWC0_AB, INSN_MACRO, 0, I1, 0, IOCT|IOCTP|IOCT2 },
402 {"swc1", "T,o(b)", 0xe4000000, 0xfc000000, RD_1|RD_3|SM|FP_S, 0, I1, 0, 0 },
diff --git a/meta/recipes-devtools/binutils/binutils/fix-pr15815.patch b/meta/recipes-devtools/binutils/binutils/fix-pr15815.patch
new file mode 100644
index 0000000..9f53f41
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils/fix-pr15815.patch
@@ -0,0 +1,36 @@
1This patch fixes the problem where libiberty is not installed in spite of
2asking it via --enable-install-libiberty, the problem is that target_header_dir
3is reset explicitly which means libiberty.a will never get installed
4
5also check
6
7https://sourceware.org/bugzilla/show_bug.cgi?id=15815
8
9Upstream-Status: Pending
10
11Signed-off-by: Khem Raj <raj.khem@gmail.com>
12
13Index: binutils-2.24/libiberty/configure
14===================================================================
15--- binutils-2.24.orig/libiberty/configure 2013-12-16 00:08:09.280103157 -0800
16+++ binutils-2.24/libiberty/configure 2013-12-16 00:08:29.753436339 -0800
17@@ -5507,7 +5507,6 @@
18
19 setobjs=
20 CHECK=
21-target_header_dir=
22 if test -n "${with_target_subdir}"; then
23
24 # We are being configured as a target library. AC_REPLACE_FUNCS
25Index: binutils-2.24/libiberty/configure.ac
26===================================================================
27--- binutils-2.24.orig/libiberty/configure.ac 2013-11-08 02:13:49.000000000 -0800
28+++ binutils-2.24/libiberty/configure.ac 2013-12-16 00:07:45.133436672 -0800
29@@ -405,7 +405,6 @@
30
31 setobjs=
32 CHECK=
33-target_header_dir=
34 if test -n "${with_target_subdir}"; then
35
36 # We are being configured as a target library. AC_REPLACE_FUNCS
diff --git a/meta/recipes-devtools/binutils/binutils/fix-pr16428a.patch b/meta/recipes-devtools/binutils/binutils/fix-pr16428a.patch
new file mode 100644
index 0000000..5b3edfb
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils/fix-pr16428a.patch
@@ -0,0 +1,75 @@
1From d1ec1e40b5b457c92aaa23f7af40e026e4596a99 Mon Sep 17 00:00:00 2001
2From: H.J. Lu <hjl.tools@gmail.com>
3Date: Tue, 14 Jan 2014 10:48:39 -0800
4Subject: [PATCH 1/1] Don't update reloc count if there are any non pc-relative relocs
5
6 PR ld/16428
7 * elf32-i386.c (elf_i386_allocate_dynrelocs): Don't update reloc
8 count if there are any non pc-relative relocs.
9 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewise.
10---
11 bfd/ChangeLog | 7 +++++++
12 bfd/elf32-i386.c | 9 +++++++--
13 bfd/elf64-x86-64.c | 9 +++++++--
14 3 files changed, 21 insertions(+), 4 deletions(-)
15
16Upstream-Status: Backport
17
18#diff --git a/bfd/ChangeLog b/bfd/ChangeLog
19#index a8f1f94..7a49fd1 100644
20#--- a/bfd/ChangeLog
21#+++ b/bfd/ChangeLog
22#@@ -1,3 +1,10 @@
23#+2014-01-14 H.J. Lu <hongjiu.lu@intel.com>
24#+
25#+ PR ld/16428
26#+ * elf32-i386.c (elf_i386_allocate_dynrelocs): Don't update reloc
27#+ count if there are any non pc-relative relocs.
28#+ * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewise.
29#+
30# 2014-01-14 Michael Hudson-Doyle <michael.hudson@linaro.org>
31# Kugan Vivekanandarajah <kugan.vivekanandarajah@linaro.org>
32#
33diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c
34index 4d391e1..d7f59e5 100644
35--- a/bfd/elf32-i386.c
36+++ b/bfd/elf32-i386.c
37@@ -2368,8 +2368,13 @@ elf_i386_allocate_dynrelocs (struct elf_link_hash_entry *h, void *inf)
38
39 for (pp = &eh->dyn_relocs; (p = *pp) != NULL; )
40 {
41- p->count -= p->pc_count;
42- p->pc_count = 0;
43+ /* Don't update reloc count if there are any non
44+ pc-relative relocs. */
45+ if (!h->pointer_equality_needed)
46+ {
47+ p->count -= p->pc_count;
48+ p->pc_count = 0;
49+ }
50 if (p->count == 0)
51 *pp = p->next;
52 else
53diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c
54index edee8ec..999011b 100644
55--- a/bfd/elf64-x86-64.c
56+++ b/bfd/elf64-x86-64.c
57@@ -2463,8 +2463,13 @@ elf_x86_64_allocate_dynrelocs (struct elf_link_hash_entry *h, void * inf)
58
59 for (pp = &eh->dyn_relocs; (p = *pp) != NULL; )
60 {
61- p->count -= p->pc_count;
62- p->pc_count = 0;
63+ /* Don't update reloc count if there are any non
64+ pc-relative relocs. */
65+ if (!h->pointer_equality_needed)
66+ {
67+ p->count -= p->pc_count;
68+ p->pc_count = 0;
69+ }
70 if (p->count == 0)
71 *pp = p->next;
72 else
73--
741.7.1
75
diff --git a/meta/recipes-devtools/binutils/binutils/fix-pr16428b.patch b/meta/recipes-devtools/binutils/binutils/fix-pr16428b.patch
new file mode 100644
index 0000000..35aa7b5
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils/fix-pr16428b.patch
@@ -0,0 +1,75 @@
1From 818d220a6fe3d0512a226188e9164245a02c9185 Mon Sep 17 00:00:00 2001
2From: H.J. Lu <hjl.tools@gmail.com>
3Date: Tue, 14 Jan 2014 16:42:35 -0800
4Subject: [PATCH] Don't discard relocs against __ehdr_start
5
6__ehdr_start will be defined by assign_file_positions_for_non_load_sections
7later.
8
9 PR ld/16428
10 * elf32-i386.c (elf_i386_allocate_dynrelocs): Don't discard relocs
11 against __ehdr_start.
12 * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewise.
13---
14 bfd/ChangeLog | 7 +++++++
15 bfd/elf32-i386.c | 7 +++++--
16 bfd/elf64-x86-64.c | 7 +++++--
17 3 files changed, 17 insertions(+), 4 deletions(-)
18
19Upstream-Status: Backport
20
21#diff --git a/bfd/ChangeLog b/bfd/ChangeLog
22#index 7d13a35..f4acda0 100644
23#--- a/bfd/ChangeLog
24#+++ b/bfd/ChangeLog
25#@@ -1,5 +1,12 @@
26# 2014-01-14 H.J. Lu <hongjiu.lu@intel.com>
27#
28#+ PR ld/16428
29#+ * elf32-i386.c (elf_i386_allocate_dynrelocs): Don't discard relocs
30#+ against __ehdr_start.
31#+ * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewise.
32#+
33#+2014-01-14 H.J. Lu <hongjiu.lu@intel.com>
34#+
35# * elf32-i386.c (elf_i386_allocate_dynrelocs): Revert the last
36# change.
37# * elf64-x86-64.c (elf_x86_64_allocate_dynrelocs): Likewise.
38Index: binutils-2.24/bfd/elf32-i386.c
39===================================================================
40--- binutils-2.24.orig/bfd/elf32-i386.c 2014-03-25 10:26:54.818385608 +0000
41+++ binutils-2.24/bfd/elf32-i386.c 2014-03-25 10:26:54.814385607 +0000
42@@ -2395,9 +2395,12 @@
43 }
44
45 /* Also discard relocs on undefined weak syms with non-default
46- visibility. */
47+ visibility. Don't discard relocs against __ehdr_start which
48+ will be defined by assign_file_positions_for_non_load_sections
49+ later. */
50 if (eh->dyn_relocs != NULL
51- && h->root.type == bfd_link_hash_undefweak)
52+ && h->root.type == bfd_link_hash_undefweak
53+ && strcmp (h->root.root.string, "__ehdr_start") != 0)
54 {
55 if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT)
56 eh->dyn_relocs = NULL;
57Index: binutils-2.24/bfd/elf64-x86-64.c
58===================================================================
59--- binutils-2.24.orig/bfd/elf64-x86-64.c 2014-03-25 10:26:54.818385608 +0000
60+++ binutils-2.24/bfd/elf64-x86-64.c 2014-03-25 10:26:54.814385607 +0000
61@@ -2478,9 +2478,12 @@
62 }
63
64 /* Also discard relocs on undefined weak syms with non-default
65- visibility. */
66+ visibility. Don't discard relocs against __ehdr_start which
67+ will be defined by assign_file_positions_for_non_load_sections
68+ later. */
69 if (eh->dyn_relocs != NULL
70- && h->root.type == bfd_link_hash_undefweak)
71+ && h->root.type == bfd_link_hash_undefweak
72+ && strcmp (h->root.root.string, "__ehdr_start") != 0)
73 {
74 if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT)
75 eh->dyn_relocs = NULL;
diff --git a/meta/recipes-devtools/binutils/binutils/fix-pr16476.patch b/meta/recipes-devtools/binutils/binutils/fix-pr16476.patch
new file mode 100644
index 0000000..65d62bc
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils/fix-pr16476.patch
@@ -0,0 +1,220 @@
1From: H.J. Lu <hjl.tools@gmail.com>
2Date: Tue, 21 Jan 2014 23:42:43 +0000 (-0800)
3Subject: Check incompatible existing default symbol definition
4X-Git-Tag: hjl/linux/release/2.24.51.0.3~1^2~8^2~16
5X-Git-Url: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commitdiff_plain;h=4584ec12076e088cf36965b88ef8710ca85491f9
6
7Check incompatible existing default symbol definition
8
9After resolving a versioned reference, foo@VER1, to a default versioned
10definition, foo@@VER1, from a shared object, we also merge it with
11the existing regular default symbol definition, foo. When foo is IFUNC
12and foo@@VER1 aren't, we will merge 2 incompatible definitions. This
13patch avoids merging foo@@VER1 definition with foo definition if
14one is IFUNC and the other isn't.
15
16Upstream-Status: Backport
17---
18
19#diff --git a/bfd/ChangeLog b/bfd/ChangeLog
20#index 5923bc3..c70a7db 100644
21#--- a/bfd/ChangeLog
22#+++ b/bfd/ChangeLog
23#@@ -1,5 +1,13 @@
24# 2014-01-21 H.J. Lu <hongjiu.lu@intel.com>
25#
26#+ PR ld/16467
27#+ * elflink.c (_bfd_elf_merge_symbol): When types of the existing
28#+ regular default symbol definition and the versioned dynamic
29#+ symbol definition mismatch, skip the default symbol definition
30#+ if one of them is IFUNC.
31#+
32#+2014-01-21 H.J. Lu <hongjiu.lu@intel.com>
33#+
34# PR ld/2404
35# * elflink.c (_bfd_elf_merge_symbol): Don't check info->shared,
36# info->export_dynamic nor h->ref_dynamic for type mismatch when
37diff --git a/bfd/elflink.c b/bfd/elflink.c
38index d0006da..792e14e 100644
39--- a/bfd/elflink.c
40+++ b/bfd/elflink.c
41@@ -1092,11 +1092,14 @@ _bfd_elf_merge_symbol (bfd *abfd,
42 && newdyn
43 && newdef
44 && !olddyn
45- && (olddef || h->root.type == bfd_link_hash_common)
46- && ELF_ST_TYPE (sym->st_info) != h->type
47- && ELF_ST_TYPE (sym->st_info) != STT_NOTYPE
48- && h->type != STT_NOTYPE
49- && !(newfunc && oldfunc))
50+ && (((olddef || h->root.type == bfd_link_hash_common)
51+ && ELF_ST_TYPE (sym->st_info) != h->type
52+ && ELF_ST_TYPE (sym->st_info) != STT_NOTYPE
53+ && h->type != STT_NOTYPE
54+ && !(newfunc && oldfunc))
55+ || (olddef
56+ && ((h->type == STT_GNU_IFUNC)
57+ != (ELF_ST_TYPE (sym->st_info) == STT_GNU_IFUNC)))))
58 {
59 *skip = TRUE;
60 return TRUE;
61#diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog
62#index ac65a3a..a092428 100644
63#--- a/ld/testsuite/ChangeLog
64#+++ b/ld/testsuite/ChangeLog
65#@@ -1,5 +1,19 @@
66# 2014-01-21 H.J. Lu <hongjiu.lu@intel.com>
67#
68#+ PR ld/16467
69#+ * ld-ifunc/dummy.c: New file.
70#+ * ld-ifunc/pr16467.out: Likewise.
71##+ * ld-ifunc/pr16467a.c: Likewise.
72#+ * ld-ifunc/pr16467a.map: Likewise.
73#+ * ld-ifunc/pr16467b.c: Likewise.
74#+ * ld-ifunc/pr16467b.map: Likewise.
75#+ * ld-ifunc/pr16467c.c: Likewise.
76#+
77#+ * ld-ifunc/ifunc.exp (run_cc_link_tests): New.
78#+ (run_ld_link_exec_tests): Run pr16467.
79#+
80#+2014-01-21 H.J. Lu <hongjiu.lu@intel.com>
81#+
82# PR ld/2404
83# * ld-elf/shared.exp: Add a PIE test for PR ld/2404.
84#
85diff --git a/ld/testsuite/ld-ifunc/dummy.c b/ld/testsuite/ld-ifunc/dummy.c
86new file mode 100644
87index 0000000..5c03287
88--- /dev/null
89+++ b/ld/testsuite/ld-ifunc/dummy.c
90@@ -0,0 +1 @@
91+/* An empty file. */
92diff --git a/ld/testsuite/ld-ifunc/ifunc.exp b/ld/testsuite/ld-ifunc/ifunc.exp
93index fb106c6..d7ff445 100644
94--- a/ld/testsuite/ld-ifunc/ifunc.exp
95+++ b/ld/testsuite/ld-ifunc/ifunc.exp
96@@ -349,6 +349,42 @@ if { $verbose < 1 } {
97 remote_file host delete "tmpdir/static_nonifunc_prog"
98 }
99
100+run_cc_link_tests [list \
101+ [list \
102+ "Build libpr16467a.so" \
103+ "-shared -Wl,--version-script=pr16467a.map" \
104+ "-fPIC" \
105+ { pr16467a.c } \
106+ {} \
107+ "libpr16467a.so" \
108+ ] \
109+ [list \
110+ "Build libpr16467b.a" \
111+ "" \
112+ "-fPIC" \
113+ { pr16467b.c } \
114+ {} \
115+ "libpr16467b.a" \
116+ ] \
117+ [list \
118+ "Build libpr16467b.so" \
119+ "-shared tmpdir/pr16467b.o tmpdir/libpr16467a.so \
120+ -Wl,--version-script=pr16467b.map" \
121+ "-fPIC" \
122+ { dummy.c } \
123+ {} \
124+ "libpr16467b.so" \
125+ ] \
126+ [list \
127+ "Build libpr16467c.a" \
128+ "" \
129+ "" \
130+ { pr16467c.c } \
131+ {} \
132+ "libpr16467c.a" \
133+ ] \
134+]
135+
136 run_ld_link_exec_tests [] [list \
137 [list \
138 "Common symbol override ifunc test 1a" \
139@@ -368,6 +404,15 @@ run_ld_link_exec_tests [] [list \
140 "ifunc-common-1.out" \
141 "-g" \
142 ] \
143+ [list \
144+ "Run pr16467" \
145+ "tmpdir/pr16467c.o tmpdir/libpr16467b.so tmpdir/libpr16467a.so" \
146+ "" \
147+ { dummy.c } \
148+ "pr16467" \
149+ "pr16467.out" \
150+ "" \
151+ ] \
152 ]
153
154 set test_list [lsort [glob -nocomplain $srcdir/$subdir/*.d]]
155diff --git a/ld/testsuite/ld-ifunc/pr16467.out b/ld/testsuite/ld-ifunc/pr16467.out
156new file mode 100644
157index 0000000..d86bac9
158--- /dev/null
159+++ b/ld/testsuite/ld-ifunc/pr16467.out
160@@ -0,0 +1 @@
161+OK
162diff --git a/ld/testsuite/ld-ifunc/pr16467a.c b/ld/testsuite/ld-ifunc/pr16467a.c
163new file mode 100644
164index 0000000..ae3f084
165--- /dev/null
166+++ b/ld/testsuite/ld-ifunc/pr16467a.c
167@@ -0,0 +1,5 @@
168+const char *
169+sd_get_seats(void)
170+{
171+ return "OK";
172+}
173diff --git a/ld/testsuite/ld-ifunc/pr16467a.map b/ld/testsuite/ld-ifunc/pr16467a.map
174new file mode 100644
175index 0000000..d677f37
176--- /dev/null
177+++ b/ld/testsuite/ld-ifunc/pr16467a.map
178@@ -0,0 +1,4 @@
179+LIBSYSTEMD_209 {
180+global:
181+ sd_get_seats;
182+};
183diff --git a/ld/testsuite/ld-ifunc/pr16467b.c b/ld/testsuite/ld-ifunc/pr16467b.c
184new file mode 100644
185index 0000000..264f6cf
186--- /dev/null
187+++ b/ld/testsuite/ld-ifunc/pr16467b.c
188@@ -0,0 +1,7 @@
189+void new_sd_get_seats(void);
190+__asm__(".symver new_sd_get_seats,sd_get_seats@LIBSYSTEMD_209");
191+void (*resolve_sd_get_seats(void)) (void) __asm__ ("sd_get_seats");
192+void (*resolve_sd_get_seats(void)) (void) {
193+ return new_sd_get_seats;
194+}
195+__asm__(".type sd_get_seats, %gnu_indirect_function");
196diff --git a/ld/testsuite/ld-ifunc/pr16467b.map b/ld/testsuite/ld-ifunc/pr16467b.map
197new file mode 100644
198index 0000000..1f263de
199--- /dev/null
200+++ b/ld/testsuite/ld-ifunc/pr16467b.map
201@@ -0,0 +1,4 @@
202+LIBSYSTEMD_208 {
203+global:
204+ sd_get_seats;
205+};
206diff --git a/ld/testsuite/ld-ifunc/pr16467c.c b/ld/testsuite/ld-ifunc/pr16467c.c
207new file mode 100644
208index 0000000..e2a901c
209--- /dev/null
210+++ b/ld/testsuite/ld-ifunc/pr16467c.c
211@@ -0,0 +1,9 @@
212+#include <stdio.h>
213+const char* sd_get_seats(void);
214+
215+int
216+main (int argc, char **argv)
217+{
218+ printf("%s\n", sd_get_seats());
219+ return 0;
220+}
diff --git a/meta/recipes-devtools/binutils/binutils/fix-pr2404.patch b/meta/recipes-devtools/binutils/binutils/fix-pr2404.patch
new file mode 100644
index 0000000..41f3504
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils/fix-pr2404.patch
@@ -0,0 +1,76 @@
1From: H.J. Lu <hjl.tools@gmail.com>
2Date: Tue, 21 Jan 2014 13:33:48 +0000 (-0800)
3Subject: Don't check shared/export_dynamic/ref_dynamic for type mismatch
4X-Git-Tag: hjl/linux/release/2.24.51.0.3~1^2~8^2~22
5X-Git-Url: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commitdiff_plain;h=22ef172a21663abb477d72284b4d59c8eabcbb82
6
7Don't check shared/export_dynamic/ref_dynamic for type mismatch
8
9There is nothing linker can do when a type mismatched default definition
10are made dynamic by info->shared, info->export_dynamic or h->ref_dynamic.
11But we do want to avoid exporting it when building PIE. Let's remove
12those checks.
13
14bfd/
15
16 PR ld/2404
17 * elflink.c (_bfd_elf_merge_symbol): Don't check info->shared,
18 info->export_dynamic, nor !h->ref_dynamic for type mismatch when
19 adding the default version.
20
21ld/testsuite/
22
23 PR ld/2404
24 * ld-elf/shared.exp: Add a PIE test for PR ld/2404.
25
26Upstream-Status: Backport
27---
28
29Index: binutils-2.24/bfd/elflink.c
30===================================================================
31--- binutils-2.24.orig/bfd/elflink.c 2014-02-08 13:20:08.628378267 +0000
32+++ binutils-2.24/bfd/elflink.c 2014-02-08 13:20:08.624378267 +0000
33@@ -1090,9 +1090,6 @@
34 the type of existing regular definition mismatch. We only do it
35 if the existing regular definition won't be dynamic. */
36 if (pold_alignment == NULL
37- && !info->shared
38- && !info->export_dynamic
39- && !h->ref_dynamic
40 && newdyn
41 && newdef
42 && !olddyn
43Index: binutils-2.24/ld/testsuite/ld-elf/shared.exp
44===================================================================
45--- binutils-2.24.orig/ld/testsuite/ld-elf/shared.exp 2014-02-08 13:20:08.628378267 +0000
46+++ binutils-2.24/ld/testsuite/ld-elf/shared.exp 2014-02-08 13:20:08.624378267 +0000
47@@ -432,3 +432,29 @@
48
49 run_cc_link_tests $build_cxx_tests
50 run_ld_link_exec_tests [] $run_cxx_tests
51+
52+if { [istarget *-*-linux*]
53+ || [istarget *-*-nacl*]
54+ || [istarget *-*-gnu*] } {
55+ run_cc_link_tests [list \
56+ [list \
57+ "Build libpr2404b.a with PIE" \
58+ "" \
59+ "-fPIE" \
60+ { pr2404b.c } \
61+ {} \
62+ "libpr2404b.a" \
63+ ] \
64+ ]
65+ run_ld_link_exec_tests [] [list \
66+ [list \
67+ "Run pr2404 with PIE" \
68+ "-pie tmpdir/pr2404b.o tmpdir/libpr2404a.so" \
69+ "" \
70+ { dummy.c } \
71+ "pr2404pie" \
72+ "pr2404.out" \
73+ "-fPIE" \
74+ ] \
75+ ]
76+}
diff --git a/meta/recipes-devtools/binutils/binutils/libiberty_path_fix.patch b/meta/recipes-devtools/binutils/binutils/libiberty_path_fix.patch
new file mode 100644
index 0000000..6e732fb
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils/libiberty_path_fix.patch
@@ -0,0 +1,22 @@
1Upstream-Status: Inappropriate [embedded specific]
2
3don't let the distro compiler point to the wrong installation location
4
5Thanks to RP for helping find the source code causing the issue.
6
72010/08/13
8Nitin A Kamble <nitin.a.kamble@intel.com>
9Index: binutils-2.22/libiberty/Makefile.in
10===================================================================
11--- binutils-2.22.orig/libiberty/Makefile.in
12+++ binutils-2.22/libiberty/Makefile.in
13@@ -350,7 +350,8 @@ install-strip: install
14 # multilib-specific flags, it's overridden by FLAGS_TO_PASS from the
15 # default multilib, so we have to take CFLAGS into account as well,
16 # since it will be passed the multilib flags.
17-MULTIOSDIR = `$(CC) $(CFLAGS) -print-multi-os-directory`
18+#MULTIOSDIR = `$(CC) $(CFLAGS) -print-multi-os-directory`
19+MULTIOSDIR = ""
20 install_to_libdir: all
21 ${mkinstalldirs} $(DESTDIR)$(libdir)/$(MULTIOSDIR)
22 $(INSTALL_DATA) $(TARGETLIB) $(DESTDIR)$(libdir)/$(MULTIOSDIR)/$(TARGETLIB)n
diff --git a/meta/recipes-devtools/binutils/binutils/libtool-2.4-update.patch b/meta/recipes-devtools/binutils/binutils/libtool-2.4-update.patch
new file mode 100644
index 0000000..2e621f1
--- /dev/null
+++ b/meta/recipes-devtools/binutils/binutils/libtool-2.4-update.patch
@@ -0,0 +1,19317 @@
1Upstream-Status: Inappropriate [embedded specific]
2
3Index: binutils-2.24/libtool.m4
4===================================================================
5--- binutils-2.24.orig/libtool.m4 2013-11-04 07:33:40.000000000 -0800
6+++ binutils-2.24/libtool.m4 2013-12-15 11:10:23.863785363 -0800
7@@ -1,7 +1,8 @@
8 # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
9 #
10 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
11-# 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
12+# 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
13+# Inc.
14 # Written by Gordon Matzigkeit, 1996
15 #
16 # This file is free software; the Free Software Foundation gives
17@@ -10,7 +11,8 @@
18
19 m4_define([_LT_COPYING], [dnl
20 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
21-# 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
22+# 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
23+# Inc.
24 # Written by Gordon Matzigkeit, 1996
25 #
26 # This file is part of GNU Libtool.
27@@ -37,7 +39,7 @@
28 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
29 ])
30
31-# serial 56 LT_INIT
32+# serial 57 LT_INIT
33
34
35 # LT_PREREQ(VERSION)
36@@ -92,7 +94,8 @@
37 LIBTOOL_DEPS="$ltmain"
38
39 # Always use our own libtool.
40-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
41+LIBTOOL='$(SHELL) $(top_builddir)'
42+LIBTOOL="$LIBTOOL/${host_alias}-libtool"
43 AC_SUBST(LIBTOOL)dnl
44
45 _LT_SETUP
46@@ -166,10 +169,13 @@
47 dnl
48 m4_require([_LT_FILEUTILS_DEFAULTS])dnl
49 m4_require([_LT_CHECK_SHELL_FEATURES])dnl
50+m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
51 m4_require([_LT_CMD_RELOAD])dnl
52 m4_require([_LT_CHECK_MAGIC_METHOD])dnl
53+m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
54 m4_require([_LT_CMD_OLD_ARCHIVE])dnl
55 m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
56+m4_require([_LT_WITH_SYSROOT])dnl
57
58 _LT_CONFIG_LIBTOOL_INIT([
59 # See if we are running on zsh, and set the options which allow our
60@@ -199,7 +205,7 @@
61 esac
62
63 # Global variables:
64-ofile=libtool
65+ofile=${host_alias}-libtool
66 can_build_shared=yes
67
68 # All known linkers require a `.a' archive for static linking (except MSVC,
69@@ -632,7 +638,7 @@
70 m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
71 configured by $[0], generated by m4_PACKAGE_STRING.
72
73-Copyright (C) 2009 Free Software Foundation, Inc.
74+Copyright (C) 2010 Free Software Foundation, Inc.
75 This config.lt script is free software; the Free Software Foundation
76 gives unlimited permision to copy, distribute and modify it."
77
78@@ -746,15 +752,12 @@
79 # if finds mixed CR/LF and LF-only lines. Since sed operates in
80 # text mode, it properly converts lines to CR/LF. This bash problem
81 # is reportedly fixed, but why not run on old versions too?
82- sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
83- || (rm -f "$cfgfile"; exit 1)
84+ sed '$q' "$ltmain" >> "$cfgfile" \
85+ || (rm -f "$cfgfile"; exit 1)
86
87- _LT_PROG_XSI_SHELLFNS
88+ _LT_PROG_REPLACE_SHELLFNS
89
90- sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
91- || (rm -f "$cfgfile"; exit 1)
92-
93- mv -f "$cfgfile" "$ofile" ||
94+ mv -f "$cfgfile" "$ofile" ||
95 (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
96 chmod +x "$ofile"
97 ],
98@@ -980,6 +983,8 @@
99 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
100 echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
101 $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
102+ echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
103+ $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
104 cat > conftest.c << _LT_EOF
105 int main() { return 0;}
106 _LT_EOF
107@@ -1069,30 +1074,41 @@
108 fi
109 ])
110
111-# _LT_SYS_MODULE_PATH_AIX
112-# -----------------------
113+# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
114+# ----------------------------------
115 # Links a minimal program and checks the executable
116 # for the system default hardcoded library path. In most cases,
117 # this is /usr/lib:/lib, but when the MPI compilers are used
118 # the location of the communication and MPI libs are included too.
119 # If we don't find anything, use the default library path according
120 # to the aix ld manual.
121+# Store the results from the different compilers for each TAGNAME.
122+# Allow to override them for all tags through lt_cv_aix_libpath.
123 m4_defun([_LT_SYS_MODULE_PATH_AIX],
124 [m4_require([_LT_DECL_SED])dnl
125-AC_LINK_IFELSE(AC_LANG_PROGRAM,[
126-lt_aix_libpath_sed='
127- /Import File Strings/,/^$/ {
128- /^0/ {
129- s/^0 *\(.*\)$/\1/
130- p
131- }
132- }'
133-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
134-# Check for a 64-bit object if we didn't find anything.
135-if test -z "$aix_libpath"; then
136- aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
137-fi],[])
138-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
139+if test "${lt_cv_aix_libpath+set}" = set; then
140+ aix_libpath=$lt_cv_aix_libpath
141+else
142+ AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
143+ [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
144+ lt_aix_libpath_sed='[
145+ /Import File Strings/,/^$/ {
146+ /^0/ {
147+ s/^0 *\([^ ]*\) *$/\1/
148+ p
149+ }
150+ }]'
151+ _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
152+ # Check for a 64-bit object if we didn't find anything.
153+ if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
154+ _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
155+ fi],[])
156+ if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
157+ _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib"
158+ fi
159+ ])
160+ aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
161+fi
162 ])# _LT_SYS_MODULE_PATH_AIX
163
164
165@@ -1117,7 +1133,7 @@
166
167 AC_MSG_CHECKING([how to print strings])
168 # Test print first, because it will be a builtin if present.
169-if test "X`print -r -- -n 2>/dev/null`" = X-n && \
170+if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
171 test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
172 ECHO='print -r --'
173 elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
174@@ -1161,6 +1177,39 @@
175 ])# _LT_PROG_ECHO_BACKSLASH
176
177
178+# _LT_WITH_SYSROOT
179+# ----------------
180+AC_DEFUN([_LT_WITH_SYSROOT],
181+[AC_MSG_CHECKING([for sysroot])
182+AC_ARG_WITH([libtool-sysroot],
183+[ --with-libtool-sysroot[=DIR] Search for dependent libraries within DIR
184+ (or the compiler's sysroot if not specified).],
185+[], [with_libtool_sysroot=no])
186+
187+dnl lt_sysroot will always be passed unquoted. We quote it here
188+dnl in case the user passed a directory name.
189+lt_sysroot=
190+case ${with_libtool_sysroot} in #(
191+ yes)
192+ if test "$GCC" = yes; then
193+ lt_sysroot=`$CC --print-sysroot 2>/dev/null`
194+ fi
195+ ;; #(
196+ /*)
197+ lt_sysroot=`echo "$with_libtool_sysroot" | sed -e "$sed_quote_subst"`
198+ ;; #(
199+ no|'')
200+ ;; #(
201+ *)
202+ AC_MSG_RESULT([${with_libtool_sysroot}])
203+ AC_MSG_ERROR([The sysroot must be an absolute path.])
204+ ;;
205+esac
206+
207+ AC_MSG_RESULT([${lt_sysroot:-no}])
208+_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
209+[dependent libraries, and in which our libraries should be installed.])])
210+
211 # _LT_ENABLE_LOCK
212 # ---------------
213 m4_defun([_LT_ENABLE_LOCK],
214@@ -1320,14 +1369,47 @@
215 ])# _LT_ENABLE_LOCK
216
217
218+# _LT_PROG_AR
219+# -----------
220+m4_defun([_LT_PROG_AR],
221+[AC_CHECK_TOOLS(AR, [ar], false)
222+: ${AR=ar}
223+: ${AR_FLAGS=cru}
224+_LT_DECL([], [AR], [1], [The archiver])
225+_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
226+
227+AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
228+ [lt_cv_ar_at_file=no
229+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
230+ [echo conftest.$ac_objext > conftest.lst
231+ lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
232+ AC_TRY_EVAL([lt_ar_try])
233+ if test "$ac_status" -eq 0; then
234+ # Ensure the archiver fails upon bogus file names.
235+ rm -f conftest.$ac_objext libconftest.a
236+ AC_TRY_EVAL([lt_ar_try])
237+ if test "$ac_status" -ne 0; then
238+ lt_cv_ar_at_file=@
239+ fi
240+ fi
241+ rm -f conftest.* libconftest.a
242+ ])
243+ ])
244+
245+if test "x$lt_cv_ar_at_file" = xno; then
246+ archiver_list_spec=
247+else
248+ archiver_list_spec=$lt_cv_ar_at_file
249+fi
250+_LT_DECL([], [archiver_list_spec], [1],
251+ [How to feed a file listing to the archiver])
252+])# _LT_PROG_AR
253+
254+
255 # _LT_CMD_OLD_ARCHIVE
256 # -------------------
257 m4_defun([_LT_CMD_OLD_ARCHIVE],
258-[AC_CHECK_TOOL(AR, ar, false)
259-test -z "$AR" && AR=ar
260-test -z "$AR_FLAGS" && AR_FLAGS=cru
261-_LT_DECL([], [AR], [1], [The archiver])
262-_LT_DECL([], [AR_FLAGS], [1])
263+[_LT_PROG_AR
264
265 AC_CHECK_TOOL(STRIP, strip, :)
266 test -z "$STRIP" && STRIP=:
267@@ -1623,7 +1705,7 @@
268 lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
269 lt_status=$lt_dlunknown
270 cat > conftest.$ac_ext <<_LT_EOF
271-[#line __oline__ "configure"
272+[#line $LINENO "configure"
273 #include "confdefs.h"
274
275 #if HAVE_DLFCN_H
276@@ -1667,10 +1749,10 @@
277 /* When -fvisbility=hidden is used, assume the code has been annotated
278 correspondingly for the symbols needed. */
279 #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
280-void fnord () __attribute__((visibility("default")));
281+int fnord () __attribute__((visibility("default")));
282 #endif
283
284-void fnord () { int i=42; }
285+int fnord () { return 42; }
286 int main ()
287 {
288 void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
289@@ -2210,8 +2292,9 @@
290 need_version=no
291 need_lib_prefix=no
292
293- case $GCC,$host_os in
294- yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
295+ case $GCC,$cc_basename in
296+ yes,*)
297+ # gcc
298 library_names_spec='$libname.dll.a'
299 # DLL is installed to $(libdir)/../bin by postinstall_cmds
300 postinstall_cmds='base_file=`basename \${file}`~
301@@ -2244,13 +2327,71 @@
302 library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
303 ;;
304 esac
305+ dynamic_linker='Win32 ld.exe'
306+ ;;
307+
308+ *,cl*)
309+ # Native MSVC
310+ libname_spec='$name'
311+ soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
312+ library_names_spec='${libname}.dll.lib'
313+
314+ case $build_os in
315+ mingw*)
316+ sys_lib_search_path_spec=
317+ lt_save_ifs=$IFS
318+ IFS=';'
319+ for lt_path in $LIB
320+ do
321+ IFS=$lt_save_ifs
322+ # Let DOS variable expansion print the short 8.3 style file name.
323+ lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
324+ sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
325+ done
326+ IFS=$lt_save_ifs
327+ # Convert to MSYS style.
328+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
329+ ;;
330+ cygwin*)
331+ # Convert to unix form, then to dos form, then back to unix form
332+ # but this time dos style (no spaces!) so that the unix form looks
333+ # like /cygdrive/c/PROGRA~1:/cygdr...
334+ sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
335+ sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
336+ sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
337+ ;;
338+ *)
339+ sys_lib_search_path_spec="$LIB"
340+ if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
341+ # It is most probably a Windows format PATH.
342+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
343+ else
344+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
345+ fi
346+ # FIXME: find the short name or the path components, as spaces are
347+ # common. (e.g. "Program Files" -> "PROGRA~1")
348+ ;;
349+ esac
350+
351+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
352+ postinstall_cmds='base_file=`basename \${file}`~
353+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
354+ dldir=$destdir/`dirname \$dlpath`~
355+ test -d \$dldir || mkdir -p \$dldir~
356+ $install_prog $dir/$dlname \$dldir/$dlname'
357+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
358+ dlpath=$dir/\$dldll~
359+ $RM \$dlpath'
360+ shlibpath_overrides_runpath=yes
361+ dynamic_linker='Win32 link.exe'
362 ;;
363
364 *)
365+ # Assume MSVC wrapper
366 library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
367+ dynamic_linker='Win32 ld.exe'
368 ;;
369 esac
370- dynamic_linker='Win32 ld.exe'
371 # FIXME: first we should search . and the directory the executable is in
372 shlibpath_var=PATH
373 ;;
374@@ -2342,7 +2483,7 @@
375 soname_spec='${libname}${release}${shared_ext}$major'
376 shlibpath_var=LIBRARY_PATH
377 shlibpath_overrides_runpath=yes
378- sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/beos/system/lib'
379+ sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
380 hardcode_into_libs=yes
381 ;;
382
383@@ -2950,6 +3091,11 @@
384 esac
385 reload_cmds='$LD$reload_flag -o $output$reload_objs'
386 case $host_os in
387+ cygwin* | mingw* | pw32* | cegcc*)
388+ if test "$GCC" != yes; then
389+ reload_cmds=false
390+ fi
391+ ;;
392 darwin*)
393 if test "$GCC" = yes; then
394 reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
395@@ -3016,7 +3162,8 @@
396 lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
397 lt_cv_file_magic_cmd='func_win32_libid'
398 else
399- lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
400+ # Keep this pattern in sync with the one in func_win32_libid.
401+ lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
402 lt_cv_file_magic_cmd='$OBJDUMP -f'
403 fi
404 ;;
405@@ -3167,6 +3314,21 @@
406 ;;
407 esac
408 ])
409+
410+file_magic_glob=
411+want_nocaseglob=no
412+if test "$build" = "$host"; then
413+ case $host_os in
414+ mingw* | pw32*)
415+ if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
416+ want_nocaseglob=yes
417+ else
418+ file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
419+ fi
420+ ;;
421+ esac
422+fi
423+
424 file_magic_cmd=$lt_cv_file_magic_cmd
425 deplibs_check_method=$lt_cv_deplibs_check_method
426 test -z "$deplibs_check_method" && deplibs_check_method=unknown
427@@ -3174,7 +3336,11 @@
428 _LT_DECL([], [deplibs_check_method], [1],
429 [Method to check whether dependent libraries are shared objects])
430 _LT_DECL([], [file_magic_cmd], [1],
431- [Command to use when deplibs_check_method == "file_magic"])
432+ [Command to use when deplibs_check_method = "file_magic"])
433+_LT_DECL([], [file_magic_glob], [1],
434+ [How to find potential files when deplibs_check_method = "file_magic"])
435+_LT_DECL([], [want_nocaseglob], [1],
436+ [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
437 ])# _LT_CHECK_MAGIC_METHOD
438
439
440@@ -3277,6 +3443,67 @@
441 dnl AC_DEFUN([AM_PROG_NM], [])
442 dnl AC_DEFUN([AC_PROG_NM], [])
443
444+# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
445+# --------------------------------
446+# how to determine the name of the shared library
447+# associated with a specific link library.
448+# -- PORTME fill in with the dynamic library characteristics
449+m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
450+[m4_require([_LT_DECL_EGREP])
451+m4_require([_LT_DECL_OBJDUMP])
452+m4_require([_LT_DECL_DLLTOOL])
453+AC_CACHE_CHECK([how to associate runtime and link libraries],
454+lt_cv_sharedlib_from_linklib_cmd,
455+[lt_cv_sharedlib_from_linklib_cmd='unknown'
456+
457+case $host_os in
458+cygwin* | mingw* | pw32* | cegcc*)
459+ # two different shell functions defined in ltmain.sh
460+ # decide which to use based on capabilities of $DLLTOOL
461+ case `$DLLTOOL --help 2>&1` in
462+ *--identify-strict*)
463+ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
464+ ;;
465+ *)
466+ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
467+ ;;
468+ esac
469+ ;;
470+*)
471+ # fallback: assume linklib IS sharedlib
472+ lt_cv_sharedlib_from_linklib_cmd="$ECHO"
473+ ;;
474+esac
475+])
476+sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
477+test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
478+
479+_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
480+ [Command to associate shared and link libraries])
481+])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
482+
483+
484+# _LT_PATH_MANIFEST_TOOL
485+# ----------------------
486+# locate the manifest tool
487+m4_defun([_LT_PATH_MANIFEST_TOOL],
488+[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
489+test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
490+AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
491+ [lt_cv_path_mainfest_tool=no
492+ echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
493+ $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
494+ cat conftest.err >&AS_MESSAGE_LOG_FD
495+ if $GREP 'Manifest Tool' conftest.out > /dev/null; then
496+ lt_cv_path_mainfest_tool=yes
497+ fi
498+ rm -f conftest*])
499+if test "x$lt_cv_path_mainfest_tool" != xyes; then
500+ MANIFEST_TOOL=:
501+fi
502+_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
503+])# _LT_PATH_MANIFEST_TOOL
504+
505
506 # LT_LIB_M
507 # --------
508@@ -3403,8 +3630,8 @@
509 lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
510
511 # Transform an extracted symbol line into symbol name and symbol address
512-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'"
513-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'"
514+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'"
515+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'"
516
517 # Handle CRLF in mingw tool chain
518 opt_cr=
519@@ -3440,6 +3667,7 @@
520 else
521 lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
522 fi
523+ lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
524
525 # Check to see that the pipe works correctly.
526 pipe_works=no
527@@ -3473,6 +3701,18 @@
528 if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
529 if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
530 cat <<_LT_EOF > conftest.$ac_ext
531+/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
532+#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
533+/* DATA imports from DLLs on WIN32 con't be const, because runtime
534+ relocations are performed -- see ld's documentation on pseudo-relocs. */
535+# define LT@&t@_DLSYM_CONST
536+#elif defined(__osf__)
537+/* This system does not cope well with relocations in const data. */
538+# define LT@&t@_DLSYM_CONST
539+#else
540+# define LT@&t@_DLSYM_CONST const
541+#endif
542+
543 #ifdef __cplusplus
544 extern "C" {
545 #endif
546@@ -3484,7 +3724,7 @@
547 cat <<_LT_EOF >> conftest.$ac_ext
548
549 /* The mapping between symbol names and symbols. */
550-const struct {
551+LT@&t@_DLSYM_CONST struct {
552 const char *name;
553 void *address;
554 }
555@@ -3510,15 +3750,15 @@
556 _LT_EOF
557 # Now try linking the two files.
558 mv conftest.$ac_objext conftstm.$ac_objext
559- lt_save_LIBS="$LIBS"
560- lt_save_CFLAGS="$CFLAGS"
561+ lt_globsym_save_LIBS=$LIBS
562+ lt_globsym_save_CFLAGS=$CFLAGS
563 LIBS="conftstm.$ac_objext"
564 CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
565 if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
566 pipe_works=yes
567 fi
568- LIBS="$lt_save_LIBS"
569- CFLAGS="$lt_save_CFLAGS"
570+ LIBS=$lt_globsym_save_LIBS
571+ CFLAGS=$lt_globsym_save_CFLAGS
572 else
573 echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
574 fi
575@@ -3551,6 +3791,13 @@
576 AC_MSG_RESULT(ok)
577 fi
578
579+# Response file support.
580+if test "$lt_cv_nm_interface" = "MS dumpbin"; then
581+ nm_file_list_spec='@'
582+elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
583+ nm_file_list_spec='@'
584+fi
585+
586 _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
587 [Take the output of nm and produce a listing of raw symbols and C names])
588 _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
589@@ -3561,6 +3808,8 @@
590 _LT_DECL([global_symbol_to_c_name_address_lib_prefix],
591 [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
592 [Transform the output of nm in a C name address pair when lib prefix is needed])
593+_LT_DECL([], [nm_file_list_spec], [1],
594+ [Specify filename containing input files for $NM])
595 ]) # _LT_CMD_GLOBAL_SYMBOLS
596
597
598@@ -3572,7 +3821,6 @@
599 _LT_TAGVAR(lt_prog_compiler_pic, $1)=
600 _LT_TAGVAR(lt_prog_compiler_static, $1)=
601
602-AC_MSG_CHECKING([for $compiler option to produce PIC])
603 m4_if([$1], [CXX], [
604 # C++ specific cases for pic, static, wl, etc.
605 if test "$GXX" = yes; then
606@@ -3678,6 +3926,12 @@
607 ;;
608 esac
609 ;;
610+ mingw* | cygwin* | os2* | pw32* | cegcc*)
611+ # This hack is so that the source file can tell whether it is being
612+ # built for inclusion in a dll (and should export symbols for example).
613+ m4_if([$1], [GCJ], [],
614+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
615+ ;;
616 dgux*)
617 case $cc_basename in
618 ec++*)
619@@ -3830,7 +4084,7 @@
620 ;;
621 solaris*)
622 case $cc_basename in
623- CC*)
624+ CC* | sunCC*)
625 # Sun C++ 4.2, 5.x and Centerline C++
626 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
627 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
628@@ -4053,6 +4307,12 @@
629 _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
630 _LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
631 ;;
632+ nagfor*)
633+ # NAG Fortran compiler
634+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
635+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
636+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
637+ ;;
638 pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
639 # Portland Group compilers (*not* the Pentium gcc compiler,
640 # which looks to be a dead project)
641@@ -4115,7 +4375,7 @@
642 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
643 _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
644 case $cc_basename in
645- f77* | f90* | f95*)
646+ f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
647 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
648 *)
649 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
650@@ -4172,9 +4432,11 @@
651 _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
652 ;;
653 esac
654-AC_MSG_RESULT([$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
655-_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
656- [How to pass a linker flag through the compiler])
657+
658+AC_CACHE_CHECK([for $compiler option to produce PIC],
659+ [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
660+ [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
661+_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
662
663 #
664 # Check to make sure the PIC flag actually works.
665@@ -4193,6 +4455,8 @@
666 _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
667 [Additional compiler flags for building library objects])
668
669+_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
670+ [How to pass a linker flag through the compiler])
671 #
672 # Check to make sure the static flag actually works.
673 #
674@@ -4213,6 +4477,7 @@
675 m4_defun([_LT_LINKER_SHLIBS],
676 [AC_REQUIRE([LT_PATH_LD])dnl
677 AC_REQUIRE([LT_PATH_NM])dnl
678+m4_require([_LT_PATH_MANIFEST_TOOL])dnl
679 m4_require([_LT_FILEUTILS_DEFAULTS])dnl
680 m4_require([_LT_DECL_EGREP])dnl
681 m4_require([_LT_DECL_SED])dnl
682@@ -4221,6 +4486,7 @@
683 AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
684 m4_if([$1], [CXX], [
685 _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
686+ _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
687 case $host_os in
688 aix[[4-9]]*)
689 # If we're using GNU nm, then we don't want the "-C" option.
690@@ -4235,15 +4501,20 @@
691 ;;
692 pw32*)
693 _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
694- ;;
695+ ;;
696 cygwin* | mingw* | cegcc*)
697- _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
698- ;;
699+ case $cc_basename in
700+ cl*) ;;
701+ *)
702+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
703+ _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
704+ ;;
705+ esac
706+ ;;
707 *)
708 _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
709- ;;
710+ ;;
711 esac
712- _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
713 ], [
714 runpath_var=
715 _LT_TAGVAR(allow_undefined_flag, $1)=
716@@ -4411,7 +4682,8 @@
717 _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
718 _LT_TAGVAR(always_export_symbols, $1)=no
719 _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
720- _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
721+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
722+ _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
723
724 if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
725 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
726@@ -4459,7 +4731,7 @@
727 if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
728 && test "$tmp_diet" = no
729 then
730- tmp_addflag=
731+ tmp_addflag=' $pic_flag'
732 tmp_sharedflag='-shared'
733 case $cc_basename,$host_cpu in
734 pgcc*) # Portland Group C compiler
735@@ -4510,12 +4782,12 @@
736 _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
737 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
738 _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
739- _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib'
740+ _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
741 if test "x$supports_anon_versioning" = xyes; then
742 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
743 cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
744 echo "local: *; };" >> $output_objdir/$libname.ver~
745- $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
746+ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
747 fi
748 ;;
749 esac
750@@ -4529,8 +4801,8 @@
751 _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
752 wlarc=
753 else
754- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
755- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
756+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
757+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
758 fi
759 ;;
760
761@@ -4548,8 +4820,8 @@
762
763 _LT_EOF
764 elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
765- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
766- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
767+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
768+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
769 else
770 _LT_TAGVAR(ld_shlibs, $1)=no
771 fi
772@@ -4595,8 +4867,8 @@
773
774 *)
775 if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
776- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
777- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
778+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
779+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
780 else
781 _LT_TAGVAR(ld_shlibs, $1)=no
782 fi
783@@ -4726,7 +4998,7 @@
784 _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
785 # Determine the default libpath from the value encoded in an
786 # empty executable.
787- _LT_SYS_MODULE_PATH_AIX
788+ _LT_SYS_MODULE_PATH_AIX([$1])
789 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
790 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
791 else
792@@ -4737,7 +5009,7 @@
793 else
794 # Determine the default libpath from the value encoded in an
795 # empty executable.
796- _LT_SYS_MODULE_PATH_AIX
797+ _LT_SYS_MODULE_PATH_AIX([$1])
798 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
799 # Warning - without using the other run time loading flags,
800 # -berok will link without error, but may produce a broken library.
801@@ -4781,20 +5053,63 @@
802 # Microsoft Visual C++.
803 # hardcode_libdir_flag_spec is actually meaningless, as there is
804 # no search path for DLLs.
805- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
806- _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
807- # Tell ltmain to make .lib files, not .a files.
808- libext=lib
809- # Tell ltmain to make .dll files, not .so files.
810- shrext_cmds=".dll"
811- # FIXME: Setting linknames here is a bad hack.
812- _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
813- # The linker will automatically build a .lib file if we build a DLL.
814- _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
815- # FIXME: Should let the user specify the lib program.
816- _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
817- _LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
818- _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
819+ case $cc_basename in
820+ cl*)
821+ # Native MSVC
822+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
823+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
824+ _LT_TAGVAR(always_export_symbols, $1)=yes
825+ _LT_TAGVAR(file_list_spec, $1)='@'
826+ # Tell ltmain to make .lib files, not .a files.
827+ libext=lib
828+ # Tell ltmain to make .dll files, not .so files.
829+ shrext_cmds=".dll"
830+ # FIXME: Setting linknames here is a bad hack.
831+ _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
832+ _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
833+ sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
834+ else
835+ sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
836+ fi~
837+ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
838+ linknames='
839+ # The linker will not automatically build a static lib if we build a DLL.
840+ # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
841+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
842+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
843+ # Don't use ranlib
844+ _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
845+ _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
846+ lt_tool_outputfile="@TOOL_OUTPUT@"~
847+ case $lt_outputfile in
848+ *.exe|*.EXE) ;;
849+ *)
850+ lt_outputfile="$lt_outputfile.exe"
851+ lt_tool_outputfile="$lt_tool_outputfile.exe"
852+ ;;
853+ esac~
854+ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
855+ $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
856+ $RM "$lt_outputfile.manifest";
857+ fi'
858+ ;;
859+ *)
860+ # Assume MSVC wrapper
861+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
862+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
863+ # Tell ltmain to make .lib files, not .a files.
864+ libext=lib
865+ # Tell ltmain to make .dll files, not .so files.
866+ shrext_cmds=".dll"
867+ # FIXME: Setting linknames here is a bad hack.
868+ _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
869+ # The linker will automatically build a .lib file if we build a DLL.
870+ _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
871+ # FIXME: Should let the user specify the lib program.
872+ _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
873+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
874+ ;;
875+ esac
876 ;;
877
878 darwin* | rhapsody*)
879@@ -4828,7 +5143,7 @@
880
881 # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
882 freebsd* | dragonfly*)
883- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
884+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
885 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
886 _LT_TAGVAR(hardcode_direct, $1)=yes
887 _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
888@@ -4836,7 +5151,7 @@
889
890 hpux9*)
891 if test "$GCC" = yes; then
892- _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
893+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
894 else
895 _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
896 fi
897@@ -4852,7 +5167,7 @@
898
899 hpux10*)
900 if test "$GCC" = yes && test "$with_gnu_ld" = no; then
901- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
902+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
903 else
904 _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
905 fi
906@@ -4876,10 +5191,10 @@
907 _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
908 ;;
909 ia64*)
910- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
911+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
912 ;;
913 *)
914- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
915+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
916 ;;
917 esac
918 else
919@@ -4926,16 +5241,31 @@
920
921 irix5* | irix6* | nonstopux*)
922 if test "$GCC" = yes; then
923- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
924+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
925 # Try to use the -exported_symbol ld option, if it does not
926 # work, assume that -exports_file does not work either and
927 # implicitly export all symbols.
928- save_LDFLAGS="$LDFLAGS"
929- LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
930- AC_LINK_IFELSE(int foo(void) {},
931- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
932- )
933- LDFLAGS="$save_LDFLAGS"
934+ # This should be the same for all languages, so no per-tag cache variable.
935+ AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
936+ [lt_cv_irix_exported_symbol],
937+ [save_LDFLAGS="$LDFLAGS"
938+ LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
939+ AC_LINK_IFELSE(
940+ [AC_LANG_SOURCE(
941+ [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
942+ [C++], [[int foo (void) { return 0; }]],
943+ [Fortran 77], [[
944+ subroutine foo
945+ end]],
946+ [Fortran], [[
947+ subroutine foo
948+ end]])])],
949+ [lt_cv_irix_exported_symbol=yes],
950+ [lt_cv_irix_exported_symbol=no])
951+ LDFLAGS="$save_LDFLAGS"])
952+ if test "$lt_cv_irix_exported_symbol" = yes; then
953+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
954+ fi
955 else
956 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
957 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
958@@ -5020,7 +5350,7 @@
959 osf4* | osf5*) # as osf3* with the addition of -msym flag
960 if test "$GCC" = yes; then
961 _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
962- _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
963+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
964 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
965 else
966 _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
967@@ -5039,9 +5369,9 @@
968 _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
969 if test "$GCC" = yes; then
970 wlarc='${wl}'
971- _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
972+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
973 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
974- $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
975+ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
976 else
977 case `$CC -V 2>&1` in
978 *"Compilers 5.0"*)
979@@ -5313,8 +5643,6 @@
980 to runtime path list])
981 _LT_TAGDECL([], [link_all_deplibs], [0],
982 [Whether libtool must link a program against all its dependency libraries])
983-_LT_TAGDECL([], [fix_srcfile_path], [1],
984- [Fix the shell variable $srcfile for the compiler])
985 _LT_TAGDECL([], [always_export_symbols], [0],
986 [Set to "yes" if exported symbols are required])
987 _LT_TAGDECL([], [export_symbols_cmds], [2],
988@@ -5325,6 +5653,8 @@
989 [Symbols that must always be exported])
990 _LT_TAGDECL([], [prelink_cmds], [2],
991 [Commands necessary for linking programs (against libraries) with templates])
992+_LT_TAGDECL([], [postlink_cmds], [2],
993+ [Commands necessary for finishing linking programs])
994 _LT_TAGDECL([], [file_list_spec], [1],
995 [Specify filename containing input files])
996 dnl FIXME: Not yet implemented
997@@ -5426,6 +5756,7 @@
998 m4_defun([_LT_LANG_CXX_CONFIG],
999 [m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1000 m4_require([_LT_DECL_EGREP])dnl
1001+m4_require([_LT_PATH_MANIFEST_TOOL])dnl
1002 if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
1003 ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
1004 (test "X$CXX" != "Xg++"))) ; then
1005@@ -5487,6 +5818,7 @@
1006
1007 # Allow CC to be a program name with arguments.
1008 lt_save_CC=$CC
1009+ lt_save_CFLAGS=$CFLAGS
1010 lt_save_LD=$LD
1011 lt_save_GCC=$GCC
1012 GCC=$GXX
1013@@ -5504,6 +5836,7 @@
1014 fi
1015 test -z "${LDCXX+set}" || LD=$LDCXX
1016 CC=${CXX-"c++"}
1017+ CFLAGS=$CXXFLAGS
1018 compiler=$CC
1019 _LT_TAGVAR(compiler, $1)=$CC
1020 _LT_CC_BASENAME([$compiler])
1021@@ -5525,8 +5858,8 @@
1022 # Check if GNU C++ uses GNU ld as the underlying linker, since the
1023 # archiving commands below assume that GNU ld is being used.
1024 if test "$with_gnu_ld" = yes; then
1025- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
1026- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
1027+ _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
1028+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
1029
1030 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
1031 _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
1032@@ -5667,7 +6000,7 @@
1033 _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
1034 # Determine the default libpath from the value encoded in an empty
1035 # executable.
1036- _LT_SYS_MODULE_PATH_AIX
1037+ _LT_SYS_MODULE_PATH_AIX([$1])
1038 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
1039
1040 _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
1041@@ -5679,7 +6012,7 @@
1042 else
1043 # Determine the default libpath from the value encoded in an
1044 # empty executable.
1045- _LT_SYS_MODULE_PATH_AIX
1046+ _LT_SYS_MODULE_PATH_AIX([$1])
1047 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
1048 # Warning - without using the other run time loading flags,
1049 # -berok will link without error, but may produce a broken library.
1050@@ -5721,29 +6054,75 @@
1051 ;;
1052
1053 cygwin* | mingw* | pw32* | cegcc*)
1054- # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
1055- # as there is no search path for DLLs.
1056- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
1057- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
1058- _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
1059- _LT_TAGVAR(always_export_symbols, $1)=no
1060- _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
1061-
1062- if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
1063- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
1064- # If the export-symbols file already is a .def file (1st line
1065- # is EXPORTS), use it as is; otherwise, prepend...
1066- _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
1067- cp $export_symbols $output_objdir/$soname.def;
1068- else
1069- echo EXPORTS > $output_objdir/$soname.def;
1070- cat $export_symbols >> $output_objdir/$soname.def;
1071- fi~
1072- $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
1073- else
1074- _LT_TAGVAR(ld_shlibs, $1)=no
1075- fi
1076- ;;
1077+ case $GXX,$cc_basename in
1078+ ,cl* | no,cl*)
1079+ # Native MSVC
1080+ # hardcode_libdir_flag_spec is actually meaningless, as there is
1081+ # no search path for DLLs.
1082+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
1083+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
1084+ _LT_TAGVAR(always_export_symbols, $1)=yes
1085+ _LT_TAGVAR(file_list_spec, $1)='@'
1086+ # Tell ltmain to make .lib files, not .a files.
1087+ libext=lib
1088+ # Tell ltmain to make .dll files, not .so files.
1089+ shrext_cmds=".dll"
1090+ # FIXME: Setting linknames here is a bad hack.
1091+ _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
1092+ _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
1093+ $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
1094+ else
1095+ $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
1096+ fi~
1097+ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
1098+ linknames='
1099+ # The linker will not automatically build a static lib if we build a DLL.
1100+ # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
1101+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
1102+ # Don't use ranlib
1103+ _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
1104+ _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
1105+ lt_tool_outputfile="@TOOL_OUTPUT@"~
1106+ case $lt_outputfile in
1107+ *.exe|*.EXE) ;;
1108+ *)
1109+ lt_outputfile="$lt_outputfile.exe"
1110+ lt_tool_outputfile="$lt_tool_outputfile.exe"
1111+ ;;
1112+ esac~
1113+ func_to_tool_file "$lt_outputfile"~
1114+ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
1115+ $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
1116+ $RM "$lt_outputfile.manifest";
1117+ fi'
1118+ ;;
1119+ *)
1120+ # g++
1121+ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
1122+ # as there is no search path for DLLs.
1123+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
1124+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
1125+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
1126+ _LT_TAGVAR(always_export_symbols, $1)=no
1127+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
1128+
1129+ if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
1130+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
1131+ # If the export-symbols file already is a .def file (1st line
1132+ # is EXPORTS), use it as is; otherwise, prepend...
1133+ _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
1134+ cp $export_symbols $output_objdir/$soname.def;
1135+ else
1136+ echo EXPORTS > $output_objdir/$soname.def;
1137+ cat $export_symbols >> $output_objdir/$soname.def;
1138+ fi~
1139+ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
1140+ else
1141+ _LT_TAGVAR(ld_shlibs, $1)=no
1142+ fi
1143+ ;;
1144+ esac
1145+ ;;
1146 darwin* | rhapsody*)
1147 _LT_DARWIN_LINKER_FEATURES($1)
1148 ;;
1149@@ -5818,7 +6197,7 @@
1150 ;;
1151 *)
1152 if test "$GXX" = yes; then
1153- _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
1154+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
1155 else
1156 # FIXME: insert proper C++ library support
1157 _LT_TAGVAR(ld_shlibs, $1)=no
1158@@ -5889,10 +6268,10 @@
1159 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
1160 ;;
1161 ia64*)
1162- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
1163+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
1164 ;;
1165 *)
1166- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
1167+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
1168 ;;
1169 esac
1170 fi
1171@@ -5933,9 +6312,9 @@
1172 *)
1173 if test "$GXX" = yes; then
1174 if test "$with_gnu_ld" = no; then
1175- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
1176+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
1177 else
1178- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib'
1179+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib'
1180 fi
1181 fi
1182 _LT_TAGVAR(link_all_deplibs, $1)=yes
1183@@ -6005,20 +6384,20 @@
1184 _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
1185 rm -rf $tpldir~
1186 $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
1187- compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"'
1188+ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
1189 _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
1190 rm -rf $tpldir~
1191 $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
1192- $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~
1193+ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
1194 $RANLIB $oldlib'
1195 _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
1196 rm -rf $tpldir~
1197 $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
1198- $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
1199+ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
1200 _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
1201 rm -rf $tpldir~
1202 $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
1203- $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
1204+ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
1205 ;;
1206 *) # Version 6 and above use weak symbols
1207 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
1208@@ -6213,7 +6592,7 @@
1209 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
1210 ;;
1211 *)
1212- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
1213+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
1214 ;;
1215 esac
1216
1217@@ -6259,7 +6638,7 @@
1218
1219 solaris*)
1220 case $cc_basename in
1221- CC*)
1222+ CC* | sunCC*)
1223 # Sun C++ 4.2, 5.x and Centerline C++
1224 _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
1225 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
1226@@ -6300,9 +6679,9 @@
1227 if test "$GXX" = yes && test "$with_gnu_ld" = no; then
1228 _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
1229 if $CC --version | $GREP -v '^2\.7' > /dev/null; then
1230- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
1231+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
1232 _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
1233- $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
1234+ $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
1235
1236 # Commands to make compiler produce verbose output that lists
1237 # what "hidden" libraries, object files and flags are used when
1238@@ -6431,6 +6810,7 @@
1239 fi # test -n "$compiler"
1240
1241 CC=$lt_save_CC
1242+ CFLAGS=$lt_save_CFLAGS
1243 LDCXX=$LD
1244 LD=$lt_save_LD
1245 GCC=$lt_save_GCC
1246@@ -6445,6 +6825,29 @@
1247 ])# _LT_LANG_CXX_CONFIG
1248
1249
1250+# _LT_FUNC_STRIPNAME_CNF
1251+# ----------------------
1252+# func_stripname_cnf prefix suffix name
1253+# strip PREFIX and SUFFIX off of NAME.
1254+# PREFIX and SUFFIX must not contain globbing or regex special
1255+# characters, hashes, percent signs, but SUFFIX may contain a leading
1256+# dot (in which case that matches only a dot).
1257+#
1258+# This function is identical to the (non-XSI) version of func_stripname,
1259+# except this one can be used by m4 code that may be executed by configure,
1260+# rather than the libtool script.
1261+m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
1262+AC_REQUIRE([_LT_DECL_SED])
1263+AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
1264+func_stripname_cnf ()
1265+{
1266+ case ${2} in
1267+ .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
1268+ *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
1269+ esac
1270+} # func_stripname_cnf
1271+])# _LT_FUNC_STRIPNAME_CNF
1272+
1273 # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
1274 # ---------------------------------
1275 # Figure out "hidden" library dependencies from verbose
1276@@ -6453,6 +6856,7 @@
1277 # objects, libraries and library flags.
1278 m4_defun([_LT_SYS_HIDDEN_LIBDEPS],
1279 [m4_require([_LT_FILEUTILS_DEFAULTS])dnl
1280+AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
1281 # Dependencies to place before and after the object being linked:
1282 _LT_TAGVAR(predep_objects, $1)=
1283 _LT_TAGVAR(postdep_objects, $1)=
1284@@ -6503,6 +6907,13 @@
1285 };
1286 _LT_EOF
1287 ])
1288+
1289+_lt_libdeps_save_CFLAGS=$CFLAGS
1290+case "$CC $CFLAGS " in #(
1291+*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
1292+*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
1293+esac
1294+
1295 dnl Parse the compiler output and extract the necessary
1296 dnl objects, libraries and library flags.
1297 if AC_TRY_EVAL(ac_compile); then
1298@@ -6514,7 +6925,7 @@
1299 pre_test_object_deps_done=no
1300
1301 for p in `eval "$output_verbose_link_cmd"`; do
1302- case $p in
1303+ case ${prev}${p} in
1304
1305 -L* | -R* | -l*)
1306 # Some compilers place space between "-{L,R}" and the path.
1307@@ -6523,13 +6934,22 @@
1308 test $p = "-R"; then
1309 prev=$p
1310 continue
1311- else
1312- prev=
1313 fi
1314
1315+ # Expand the sysroot to ease extracting the directories later.
1316+ if test -z "$prev"; then
1317+ case $p in
1318+ -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
1319+ -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
1320+ -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
1321+ esac
1322+ fi
1323+ case $p in
1324+ =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
1325+ esac
1326 if test "$pre_test_object_deps_done" = no; then
1327- case $p in
1328- -L* | -R*)
1329+ case ${prev} in
1330+ -L | -R)
1331 # Internal compiler library paths should come after those
1332 # provided the user. The postdeps already come after the
1333 # user supplied libs so there is no need to process them.
1334@@ -6549,8 +6969,10 @@
1335 _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
1336 fi
1337 fi
1338+ prev=
1339 ;;
1340
1341+ *.lto.$objext) ;; # Ignore GCC LTO objects
1342 *.$objext)
1343 # This assumes that the test object file only shows up
1344 # once in the compiler output.
1345@@ -6586,6 +7008,7 @@
1346 fi
1347
1348 $RM -f confest.$objext
1349+CFLAGS=$_lt_libdeps_save_CFLAGS
1350
1351 # PORTME: override above test on systems where it is broken
1352 m4_if([$1], [CXX],
1353@@ -6622,7 +7045,7 @@
1354
1355 solaris*)
1356 case $cc_basename in
1357- CC*)
1358+ CC* | sunCC*)
1359 # The more standards-conforming stlport4 library is
1360 # incompatible with the Cstd library. Avoid specifying
1361 # it if it's in CXXFLAGS. Ignore libCrun as
1362@@ -6735,7 +7158,9 @@
1363 # Allow CC to be a program name with arguments.
1364 lt_save_CC="$CC"
1365 lt_save_GCC=$GCC
1366+ lt_save_CFLAGS=$CFLAGS
1367 CC=${F77-"f77"}
1368+ CFLAGS=$FFLAGS
1369 compiler=$CC
1370 _LT_TAGVAR(compiler, $1)=$CC
1371 _LT_CC_BASENAME([$compiler])
1372@@ -6789,6 +7214,7 @@
1373
1374 GCC=$lt_save_GCC
1375 CC="$lt_save_CC"
1376+ CFLAGS="$lt_save_CFLAGS"
1377 fi # test "$_lt_disable_F77" != yes
1378
1379 AC_LANG_POP
1380@@ -6865,7 +7291,9 @@
1381 # Allow CC to be a program name with arguments.
1382 lt_save_CC="$CC"
1383 lt_save_GCC=$GCC
1384+ lt_save_CFLAGS=$CFLAGS
1385 CC=${FC-"f95"}
1386+ CFLAGS=$FCFLAGS
1387 compiler=$CC
1388 GCC=$ac_cv_fc_compiler_gnu
1389
1390@@ -6921,7 +7349,8 @@
1391 fi # test -n "$compiler"
1392
1393 GCC=$lt_save_GCC
1394- CC="$lt_save_CC"
1395+ CC=$lt_save_CC
1396+ CFLAGS=$lt_save_CFLAGS
1397 fi # test "$_lt_disable_FC" != yes
1398
1399 AC_LANG_POP
1400@@ -6958,10 +7387,12 @@
1401 _LT_LINKER_BOILERPLATE
1402
1403 # Allow CC to be a program name with arguments.
1404-lt_save_CC="$CC"
1405+lt_save_CC=$CC
1406+lt_save_CFLAGS=$CFLAGS
1407 lt_save_GCC=$GCC
1408 GCC=yes
1409 CC=${GCJ-"gcj"}
1410+CFLAGS=$GCJFLAGS
1411 compiler=$CC
1412 _LT_TAGVAR(compiler, $1)=$CC
1413 _LT_TAGVAR(LD, $1)="$LD"
1414@@ -6992,7 +7423,8 @@
1415 AC_LANG_RESTORE
1416
1417 GCC=$lt_save_GCC
1418-CC="$lt_save_CC"
1419+CC=$lt_save_CC
1420+CFLAGS=$lt_save_CFLAGS
1421 ])# _LT_LANG_GCJ_CONFIG
1422
1423
1424@@ -7027,9 +7459,11 @@
1425
1426 # Allow CC to be a program name with arguments.
1427 lt_save_CC="$CC"
1428+lt_save_CFLAGS=$CFLAGS
1429 lt_save_GCC=$GCC
1430 GCC=
1431 CC=${RC-"windres"}
1432+CFLAGS=
1433 compiler=$CC
1434 _LT_TAGVAR(compiler, $1)=$CC
1435 _LT_CC_BASENAME([$compiler])
1436@@ -7042,7 +7476,8 @@
1437
1438 GCC=$lt_save_GCC
1439 AC_LANG_RESTORE
1440-CC="$lt_save_CC"
1441+CC=$lt_save_CC
1442+CFLAGS=$lt_save_CFLAGS
1443 ])# _LT_LANG_RC_CONFIG
1444
1445
1446@@ -7101,6 +7536,15 @@
1447 AC_SUBST([OBJDUMP])
1448 ])
1449
1450+# _LT_DECL_DLLTOOL
1451+# ----------------
1452+# Ensure DLLTOOL variable is set.
1453+m4_defun([_LT_DECL_DLLTOOL],
1454+[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
1455+test -z "$DLLTOOL" && DLLTOOL=dlltool
1456+_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
1457+AC_SUBST([DLLTOOL])
1458+])
1459
1460 # _LT_DECL_SED
1461 # ------------
1462@@ -7194,8 +7638,8 @@
1463 # Try some XSI features
1464 xsi_shell=no
1465 ( _lt_dummy="a/b/c"
1466- test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
1467- = c,a/b,, \
1468+ test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
1469+ = c,a/b,b/c, \
1470 && eval 'test $(( 1 + 1 )) -eq 2 \
1471 && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
1472 && xsi_shell=yes
1473@@ -7234,206 +7678,162 @@
1474 ])# _LT_CHECK_SHELL_FEATURES
1475
1476
1477-# _LT_PROG_XSI_SHELLFNS
1478-# ---------------------
1479-# Bourne and XSI compatible variants of some useful shell functions.
1480-m4_defun([_LT_PROG_XSI_SHELLFNS],
1481-[case $xsi_shell in
1482- yes)
1483- cat << \_LT_EOF >> "$cfgfile"
1484-
1485-# func_dirname file append nondir_replacement
1486-# Compute the dirname of FILE. If nonempty, add APPEND to the result,
1487-# otherwise set result to NONDIR_REPLACEMENT.
1488-func_dirname ()
1489-{
1490- case ${1} in
1491- */*) func_dirname_result="${1%/*}${2}" ;;
1492- * ) func_dirname_result="${3}" ;;
1493- esac
1494-}
1495-
1496-# func_basename file
1497-func_basename ()
1498-{
1499- func_basename_result="${1##*/}"
1500-}
1501-
1502-# func_dirname_and_basename file append nondir_replacement
1503-# perform func_basename and func_dirname in a single function
1504-# call:
1505-# dirname: Compute the dirname of FILE. If nonempty,
1506-# add APPEND to the result, otherwise set result
1507-# to NONDIR_REPLACEMENT.
1508-# value returned in "$func_dirname_result"
1509-# basename: Compute filename of FILE.
1510-# value retuned in "$func_basename_result"
1511-# Implementation must be kept synchronized with func_dirname
1512-# and func_basename. For efficiency, we do not delegate to
1513-# those functions but instead duplicate the functionality here.
1514-func_dirname_and_basename ()
1515-{
1516- case ${1} in
1517- */*) func_dirname_result="${1%/*}${2}" ;;
1518- * ) func_dirname_result="${3}" ;;
1519- esac
1520- func_basename_result="${1##*/}"
1521-}
1522-
1523-# func_stripname prefix suffix name
1524-# strip PREFIX and SUFFIX off of NAME.
1525-# PREFIX and SUFFIX must not contain globbing or regex special
1526-# characters, hashes, percent signs, but SUFFIX may contain a leading
1527-# dot (in which case that matches only a dot).
1528-func_stripname ()
1529-{
1530- # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
1531- # positional parameters, so assign one to ordinary parameter first.
1532- func_stripname_result=${3}
1533- func_stripname_result=${func_stripname_result#"${1}"}
1534- func_stripname_result=${func_stripname_result%"${2}"}
1535-}
1536-
1537-# func_opt_split
1538-func_opt_split ()
1539-{
1540- func_opt_split_opt=${1%%=*}
1541- func_opt_split_arg=${1#*=}
1542-}
1543-
1544-# func_lo2o object
1545-func_lo2o ()
1546-{
1547- case ${1} in
1548- *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
1549- *) func_lo2o_result=${1} ;;
1550- esac
1551-}
1552-
1553-# func_xform libobj-