On Sun, 25 Jan 2004, Dimitri Torfs wrote:
> > Thanks for digging into it. Actually after fixing the typos I've noticed
> > gcc 2.95.4 always implies the ISA from the ABI unless overridden and
> > -mabi=64 implies -mips4, so it bails out with -march/-mcpu set to
> > something like r4600. This also proves the uncertainity about what's
> > passed to gas and so far including an ISA specification in gas settings is
> > tolerable if carefully chosen. So here's a set of new updates -- now the
> > ISA specifier is removed from gcc flags only if it actually works and the
> > ISA specifier for gas is untouched.
> >
> > Hopefully this is the last attempt. Please try it.
>
> Ok for me (tested the HEAD one).
Thanks. Ralf, OK to apply these?
--
+ Maciej W. Rozycki, Technical University of Gdansk, Poland +
+--------------------------------------------------------------+
+ e-mail: macro@ds2.pg.gda.pl, PGP key available +
patch-mips-2.4.23-20031209-mabi-8
diff -up --recursive --new-file
linux-mips-2.4.23-20031209.macro/arch/mips/Makefile
linux-mips-2.4.23-20031209/arch/mips/Makefile
--- linux-mips-2.4.23-20031209.macro/arch/mips/Makefile 2003-12-22
02:35:03.000000000 +0000
+++ linux-mips-2.4.23-20031209/arch/mips/Makefile 2004-01-21
23:53:31.000000000 +0000
@@ -98,6 +98,11 @@ while :; do \
gas_abi=; gas_opt=; gas_cpu=; gas_isa=; \
break; \
done; \
+if test "$$gcc_opt" = -march= && test -n "$$gcc_abi"; then \
+ $(CC) $$gcc_abi $$gcc_opt$$gcc_cpu -S -o /dev/null \
+ -xc /dev/null > /dev/null 2>&1 && \
+ gcc_isa=; \
+fi; \
echo $$gcc_abi $$gcc_opt$$gcc_cpu $$gcc_isa $$gas_abi $$gas_opt$$gas_cpu
$$gas_isa)
#
diff -up --recursive --new-file
linux-mips-2.4.23-20031209.macro/arch/mips64/Makefile
linux-mips-2.4.23-20031209/arch/mips64/Makefile
--- linux-mips-2.4.23-20031209.macro/arch/mips64/Makefile 2003-12-22
02:32:44.000000000 +0000
+++ linux-mips-2.4.23-20031209/arch/mips64/Makefile 2004-01-21
23:53:25.000000000 +0000
@@ -37,7 +37,7 @@ endif
# crossformat linking we rely on the elf2ecoff tool for format conversion.
#
GCCFLAGS := -I $(TOPDIR)/include/asm/gcc
-GCCFLAGS += -mabi=64 -G 0 -mno-abicalls -fno-pic -Wa,--trap -pipe
+GCCFLAGS += -G 0 -mno-abicalls -fno-pic -Wa,--trap -pipe
GCCFLAGS += $(call check_gcc, -finline-limit=100000,)
LINKFLAGS += -G 0 -static # -N
MODFLAGS += -mlong-calls
@@ -76,6 +76,7 @@ while :; do \
done; \
break; \
done; \
+gcc_abi=-mabi=64; \
gcc_cpu=$$cpu; gcc_isa=$$isa; \
gas_cpu=$$cpu; gas_isa=-Wa,$$isa; \
while :; do \
@@ -87,7 +88,12 @@ while :; do \
gas_opt=; gas_cpu=; gas_isa=; \
break; \
done; \
-echo $$gcc_opt$$gcc_cpu $$gcc_isa $$gas_opt$$gas_cpu $$gas_isa)
+if test "$$gcc_opt" = -march=; then \
+ $(CC) $$gcc_abi $$gcc_opt$$gcc_cpu -S -o /dev/null \
+ -xc /dev/null > /dev/null 2>&1 && \
+ gcc_isa=; \
+fi; \
+echo $$gcc_abi $$gcc_opt$$gcc_cpu $$gcc_isa $$gas_opt$$gas_cpu $$gas_isa)
#
# CPU-dependent compiler/assembler options for optimization.
patch-mips-2.6.0-20040108-mabi-8
diff -up --recursive --new-file
linux-mips-2.6.0-20040108.macro/arch/mips/Makefile
linux-mips-2.6.0-20040108/arch/mips/Makefile
--- linux-mips-2.6.0-20040108.macro/arch/mips/Makefile 2004-01-07
04:56:39.000000000 +0000
+++ linux-mips-2.6.0-20040108/arch/mips/Makefile 2004-01-21
23:53:58.000000000 +0000
@@ -108,9 +108,14 @@ while :; do \
gas_abi=; gas_opt=; gas_cpu=; gas_isa=; \
break; \
done; \
-if test x$(gcc-abi) != x$(gas-abi); then \
+if test "$(gcc-abi)" != "$(gas-abi)"; then \
gas_abi="-Wa,-$(gas-abi) -Wa,-mgp$(gcc-abi)"; \
fi; \
+if test "$$gcc_opt" = -march= && test -n "$$gcc_abi"; then \
+ $(CC) $$gcc_abi $$gcc_opt$$gcc_cpu -S -o /dev/null \
+ -xc /dev/null > /dev/null 2>&1 && \
+ gcc_isa=; \
+fi; \
echo $$gcc_abi $$gcc_opt$$gcc_cpu $$gcc_isa $$gas_abi $$gas_opt$$gas_cpu
$$gas_isa)
#
|