This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Pass multilib flags to multilib configures
- To: egcs-patches at egcs dot cygnus dot com
- Subject: Pass multilib flags to multilib configures
- From: Rainer Orth <ro at TechFak dot Uni-Bielefeld dot DE>
- Date: Mon, 28 Jun 1999 21:30:28 +0200 (MET DST)
When bootstrapping a bi-arch (32/64-bit) SPARC Solaris 7 gcc, I noticed
some test failures since the 64-bit shared libstdc++ referenced sys_nerr,
which doesn't exist in 64-bit libc. This happens since configure runs for
multilib libraries don't get the necessary compiler flags, i.e. configure
runs a 32-bit gcc, but uses it's findings for a 64-bit compilation. The
same problem occurs e.g. on IRIX 6 with n32/n64 libraries, but there such
differences don't seem to exist, so this causes no harm. The fix below
simply passes the necessary flags to CC. It may be necessary to expand
this along the lines of config-ml.in (multi-do), namely augment all of
CFLAGS, CXXFLAGS, LIBCFLAGS, LIBCXXFLAGS, and LDFLAGS by the multilib
flags.
Rainer
Fri Jun 25 01:24:46 1999 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
* config-ml.in: Pass compiler flag corresponding to multidirs to
subdir configures.
Index: config-ml.in
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/config-ml.in,v
retrieving revision 1.6
diff -u -p -r1.6 config-ml.in
--- config-ml.in 1999/04/11 23:00:24 1.6
+++ config-ml.in 1999/06/28 18:54:38
@@ -627,7 +651,18 @@ if [ -n "${multidirs}" ] && [ -z "${ml_n
if [ -f ${ml_newsrcdir}/configure ]; then
ml_recprog=${ml_newsrcdir}/configure
fi
- if eval ${ml_config_shell} ${ml_recprog} \
+
+ # find compiler flag corresponding to ${ml_dir}
+ for i in `${CC-gcc} --print-multi-lib 2>/dev/null`; do
+ dir=`echo $i | sed -e 's/;.*$//'`
+ if [ "${dir}" = "${ml_dir}" ]; then
+ flags=`echo $i | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`
+ break
+ fi
+ done
+ ml_config_env='CC="${CC} $flags"'
+
+ if eval ${ml_config_env} ${ml_config_shell} ${ml_recprog} \
--with-multisubdir=${ml_dir} --with-multisrctop=${multisrctop} \
${ml_arguments} ${ml_srcdiroption} ; then
true