/usr/src/gcc-4.6/debian/patches/config-ml.diff is in gcc-4.6-source 4.6.4-6ubuntu2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 | # DP: - Disable some biarch libraries for biarch builds.
# DP: - Fix multilib builds on kernels which don't support all multilibs.
Index: b/src/config-ml.in
===================================================================
--- a/src/config-ml.in
+++ b/src/config-ml.in
@@ -467,6 +467,25 @@
;;
esac
+if [ -z "$biarch_multidir_names" ]; then
+ biarch_multidir_names="libiberty libstdc++-v3 libgfortran libmudflap libssp libffi libobjc libgomp"
+ echo "WARNING: biarch_multidir_names is unset. Use default value:"
+ echo " $biarch_multidir_names"
+fi
+ml_srcbase=`basename $ml_realsrcdir`
+old_multidirs="${multidirs}"
+multidirs=""
+for x in ${old_multidirs}; do
+ case " $x " in
+ " 32 "|" n32 "|" x32 "|" 64 "|" hf "|" sf ")
+ case "$biarch_multidir_names" in
+ *"$ml_srcbase"*) multidirs="${multidirs} ${x}" ;;
+ esac
+ ;;
+ *) multidirs="${multidirs} ${x}" ;;
+ esac
+done
+
# Remove extraneous blanks from multidirs.
# Tests like `if [ -n "$multidirs" ]' require it.
multidirs=`echo "$multidirs" | sed -e 's/^[ ][ ]*//' -e 's/[ ][ ]*$//' -e 's/[ ][ ]*/ /g'`
@@ -654,6 +673,35 @@
for ml_dir in ${multidirs}; do
+ # a native build fails if the running kernel doesn't support the multilib
+ # variant; force cross compilation for these cases.
+ ml_host_arg=
+ case "${host}" in
+ i[34567]86-*-linux*)
+ case "${ml_dir}" in
+ 64) ml_host_arg="--host=x86_64-linux-gnu";;
+ x32) ml_host_arg="--host=x86_64-linux-gnux32";;
+ esac
+ ;;
+ powerpc-*-linux*)
+ case "${ml_dir}" in
+ 64) ml_host_arg="--host=powerpc64-linux-gnu"
+ esac
+ ;;
+ s390-*-linux*)
+ case "${ml_dir}" in
+ 64) ml_host_arg="--host=s390x-linux-gnu"
+ esac
+ ;;
+ x86_64-*-linux*)
+ case "${ml_dir}" in
+ x32) ml_host_arg="--host=x86_64-linux-gnux32"
+ esac
+ esac
+ if [ -n "${ml_host_arg}" ]; then
+ ml_host_arg="${ml_host_arg} --with-default-host-alias=${host_alias}"
+ fi
+
if [ "${ml_verbose}" = --verbose ]; then
echo "Running configure in multilib subdir ${ml_dir}"
echo "pwd: `${PWDCMD-pwd}`"
@@ -858,9 +906,20 @@
fi
fi
+ ml_configure_args=
+ for arg in ${ac_configure_args}
+ do
+ case $arg in
+ *CC=*) ml_configure_args=${ml_config_env} ;;
+ *CXX=*) ml_configure_args=${ml_config_env} ;;
+ *GCJ=*) ml_configure_args=${ml_config_env} ;;
+ *) ;;
+ esac
+ done
+
if eval ${ml_config_env} ${ml_config_shell} ${ml_recprog} \
--with-multisubdir=${ml_dir} --with-multisrctop=${multisrctop} \
- ${ac_configure_args} ${ml_config_env} ${ml_srcdiroption} ; then
+ ${ac_configure_args} ${ml_configure_args} ${ml_host_arg} ${ml_srcdiroption} ; then
true
else
exit 1
Index: b/src/libstdc++-v3/include/Makefile.am
===================================================================
--- a/src/libstdc++-v3/include/Makefile.am
+++ b/src/libstdc++-v3/include/Makefile.am
@@ -829,8 +829,9 @@
endif
host_srcdir = ${glibcxx_srcdir}/$(OS_INC_SRCDIR)
-host_builddir = ./${host_alias}/bits
-host_installdir = ${gxx_include_dir}/${host_alias}$(MULTISUBDIR)/bits
+default_host_alias = @default_host_alias@
+host_builddir = ./${default_host_alias}/bits
+host_installdir = ${gxx_include_dir}/${default_host_alias}$(MULTISUBDIR)/bits
host_headers = \
${host_srcdir}/ctype_base.h \
${host_srcdir}/ctype_inline.h \
@@ -1050,6 +1051,7 @@
stamp-${host_alias}:
@-mkdir -p ${host_builddir}
+ @test ${default_host_alias} = ${host_alias} || ln -sf ${default_host_alias} ${host_alias}
@$(STAMP) stamp-${host_alias}
# Host includes static.
Index: b/src/libstdc++-v3/include/Makefile.in
===================================================================
--- a/src/libstdc++-v3/include/Makefile.in
+++ b/src/libstdc++-v3/include/Makefile.in
@@ -1082,8 +1082,9 @@
# For --enable-cheaders=c_std
@GLIBCXX_C_HEADERS_COMPATIBILITY_TRUE@c_compatibility_headers_extra = ${c_compatibility_headers}
host_srcdir = ${glibcxx_srcdir}/$(OS_INC_SRCDIR)
-host_builddir = ./${host_alias}/bits
-host_installdir = ${gxx_include_dir}/${host_alias}$(MULTISUBDIR)/bits
+default_host_alias = @default_host_alias@
+host_builddir = ./${default_host_alias}/bits
+host_installdir = ${gxx_include_dir}/${default_host_alias}$(MULTISUBDIR)/bits
host_headers = \
${host_srcdir}/ctype_base.h \
${host_srcdir}/ctype_inline.h \
@@ -1461,6 +1462,7 @@
stamp-${host_alias}:
@-mkdir -p ${host_builddir}
+ @test ${default_host_alias} = ${host_alias} || ln -sf ${default_host_alias} ${host_alias}
@$(STAMP) stamp-${host_alias}
# Host includes static.
Index: b/src/libstdc++-v3/configure.ac
===================================================================
--- a/src/libstdc++-v3/configure.ac
+++ b/src/libstdc++-v3/configure.ac
@@ -458,6 +458,16 @@
multilib_arg=
fi
+AC_ARG_WITH(default-host-alias,
+[AS_HELP_STRING([--with-default-host-alias=TRIPLET],
+ [specifies host triplet used for the default multilib build])],
+[case "${withval}" in
+yes) AC_MSG_ERROR(bad value ${withval} given for default host triplet) ;;
+no) default_host_alias='${host_alias}' ;;
+*) default_host_alias=${withval} ;;
+esac],[default_host_alias='${host_alias}'])
+AC_SUBST(default_host_alias)
+
# Export all the install information.
GLIBCXX_EXPORT_INSTALL_INFO
|