From e5c18e376acace3a818a2bcd5199777c643dd6c6 Mon Sep 17 00:00:00 2001 From: Stefan Fiedler Date: Thu, 23 Oct 2008 15:58:40 +0000 Subject: [PATCH] Stefan Fiedler: architecture/*/gcc-options: use GCC_WRAPPER_APPEND instead of _INSERT so the gcc -V option comes first; some configure tests might break otherwise architecture/arm: adapt for GCC 4.x CPU names architecture/mips: add new ISAs and ABIs to build for, remove unused -mtune option [2008100709173543750] (https://www.rocklinux.net/submaster) git-svn-id: http://www.rocklinux.org/svn/rock-linux/trunk@9105 c5f82cb5-29bc-0310-9cd0-bff59a50e3bc --- architecture/alpha/gcc-options | 3 +- architecture/arm/config.in | 6 ++-- architecture/arm/gcc-options | 12 +++++--- architecture/hppa/gcc-options | 7 +++-- architecture/mips/config.in | 16 +++++++--- architecture/mips/gcc-options | 7 +++-- architecture/powerpc/gcc-options | 5 +-- architecture/sparc/gcc-options | 7 +++-- architecture/x86/gcc-options | 53 ++++++++++++++++---------------- 9 files changed, 66 insertions(+), 50 deletions(-) diff --git a/architecture/alpha/gcc-options b/architecture/alpha/gcc-options index b048a6fb6..56066106e 100644 --- a/architecture/alpha/gcc-options +++ b/architecture/alpha/gcc-options @@ -1,5 +1,6 @@ if [ $ROCKCFG_ALPHA_OPT != generic ] ; then - var_append GCC3_WRAPPER_INSERT " " \ + # Append options so the gcc -V option always comes first. + var_append GCC3_WRAPPER_APPEND " " \ "-mtune=$ROCKCFG_ALPHA_OPT" fi diff --git a/architecture/arm/config.in b/architecture/arm/config.in index b63521b4e..be2b1ae2e 100644 --- a/architecture/arm/config.in +++ b/architecture/arm/config.in @@ -61,13 +61,13 @@ choice ROCKCFG_ARM_OPT generic \ arm9e "arm9e CPU" \ arm920 "arm920 CPU" \ arm920t "arm920t CPU" \ - arm926ejs "arm926ejs CPU" \ + arm926ej-s "arm926ej-s CPU" \ arm940t "arm940t CPU" \ arm9tdmi "arm9tdmi CPU" \ arm10tdmi "arm10tdmi CPU" \ arm1020t "arm1020t CPU" \ - arm1026ejs "arm1026ejs CPU" \ - arm1136js "arm1136js CPU" \ + arm1026ej-s "arm1026ej-s CPU" \ + arm1136j-s "arm1136j-s CPU" \ xscale "xscale CPU" \ iwmmxt "iwmmxt CPU" \ ep9312 "ep9312 CPU" diff --git a/architecture/arm/gcc-options b/architecture/arm/gcc-options index e1308a2ec..3e5659010 100644 --- a/architecture/arm/gcc-options +++ b/architecture/arm/gcc-options @@ -1,15 +1,17 @@ #!/bin/bash if [ $ROCKCFG_ARM_OPT != generic ] ; then - var_append GCC3_WRAPPER_INSERT " " \ - "-mcpu=$ROCKCFG_ARM_OPT" - var_append GCC4_WRAPPER_INSERT " " \ + # Append options so the gcc -V option always comes first. + # GCC 3.x uses CPU names without '-', eg. 926ejs instead of 926ej-s. + var_append GCC3_WRAPPER_APPEND " " \ + "-mcpu=${ROCKCFG_ARM_OPT/-s/s}" + var_append GCC4_WRAPPER_APPEND " " \ "-mcpu=$ROCKCFG_ARM_OPT" fi if [ $ROCKCFG_ARM_OPT_ARCH != generic ] ; then - var_append GCC3_WRAPPER_INSERT " " \ + var_append GCC3_WRAPPER_APPEND " " \ "-march=$ROCKCFG_ARM_OPT_ARCH" - var_append GCC4_WRAPPER_INSERT " " \ + var_append GCC4_WRAPPER_APPEND " " \ "-march=$ROCKCFG_ARM_OPT_ARCH" fi diff --git a/architecture/hppa/gcc-options b/architecture/hppa/gcc-options index 099002e35..ef0846c73 100644 --- a/architecture/hppa/gcc-options +++ b/architecture/hppa/gcc-options @@ -1,10 +1,11 @@ if [ "$ROCKCFG_HPPA_BITS" == "32" ] ; then - var_append GCC_WRAPPER_INSERT " " "-march=1.1" + # Append options so the gcc -V option always comes first. + var_append GCC_WRAPPER_APPEND " " "-march=1.1" fi if [ "$ROCKCFG_HPPA_BITS" == "64" ] ; then - var_append GCC_WRAPPER_INSERT " " "-march=2.0" + var_append GCC_WRAPPER_APPEND " " "-march=2.0" fi -var_append GCC_WRAPPER_INSERT " " "-fno-unit-at-a-time" +var_append GCC_WRAPPER_APPEND " " "-fno-unit-at-a-time" diff --git a/architecture/mips/config.in b/architecture/mips/config.in index 418d93cba..96554f7c6 100644 --- a/architecture/mips/config.in +++ b/architecture/mips/config.in @@ -23,7 +23,9 @@ choice ROCKCFG_MIPS_ABI 32 \ 32 "Build with -mabi=32" \ n32 "Build with -mabi=n32" \ - 64 "Build with -mabi=64" + 64 "Build with -mabi=64" \ + o64 "Build with -mabi=o64" \ + eabi "Build with -mabi=eabi" ROCKCFG_ID="$ROCKCFG_ID-$ROCKCFG_MIPS_ABI" @@ -34,7 +36,14 @@ choice ROCKCFG_MIPS_ENDIANESS EB \ ROCKCFG_ID="$ROCKCFG_ID-$ROCKCFG_MIPS_ENDIANESS" choice ROCKCFG_MIPS_OPT from-abi \ - from-abi "No special optimisation" \ + from-abi "Build for mips1 for 32-bit ABIs, mips3 for 64-bit ABIs" \ + mips1 "Build for MIPS1 ISA" \ + mips2 "Build for MIPS2 ISA" \ + mips3 "Build for MIPS3 ISA" \ + mips4 "Build for MIPS4 ISA" \ + mips32 "Build for MIPS32 ISA" \ + mips32r2 "Build for MIPS32r2 ISA" \ + mips64 "Build for MIPS64 ISA" \ r2000 "Build for R2000 CPU" \ r3000 "Build for R3000 CPU" \ r3900 "Build for R3900 CPU" \ @@ -59,9 +68,8 @@ choice ROCKCFG_MIPS_OPT from-abi \ vr5000 "Build for vr5000 CPU" \ vr5400 "Build for vr5400 CPU" \ vr5500 "Build for vr5500 CPU" \ - orion "Build for Orion CPU" + orion "Build for Orion CPU" if [ $ROCKCFG_MIPS_OPT != from-abi ] ; then ROCKCFG_ID="$ROCKCFG_ID-$ROCKCFG_MIPS_OPT" fi - diff --git a/architecture/mips/gcc-options b/architecture/mips/gcc-options index 60260f19d..5e8393591 100644 --- a/architecture/mips/gcc-options +++ b/architecture/mips/gcc-options @@ -1,3 +1,6 @@ -var_append GCC3_WRAPPER_INSERT " " \ - "-march=$ROCKCFG_MIPS_OPT -mtune=$ROCKCFG_MIPS_OPT -mabi=$ROCKCFG_MIPS_ABI" +# Append options so the gcc -V option always comes first. +var_append GCC3_WRAPPER_APPEND " " \ + "-march=$ROCKCFG_MIPS_OPT -mabi=$ROCKCFG_MIPS_ABI" +var_append GCC4_WRAPPER_APPEND " " \ + "-march=$ROCKCFG_MIPS_OPT -mabi=$ROCKCFG_MIPS_ABI" diff --git a/architecture/powerpc/gcc-options b/architecture/powerpc/gcc-options index 5aa01b4c3..ddeb5b557 100644 --- a/architecture/powerpc/gcc-options +++ b/architecture/powerpc/gcc-options @@ -1,8 +1,9 @@ if [ "$ROCKCFG_POWERPC_ISA" ] ; then - var_append GCC_WRAPPER_INSERT " " "-mcpu=$ROCKCFG_POWERPC_ISA" + # Append options so the gcc -V option always comes first. + var_append GCC_WRAPPER_APPEND " " "-mcpu=$ROCKCFG_POWERPC_ISA" fi if [ "$ROCKCFG_POWERPC_OPT" != "generic" ] ; then - var_append GCC_WRAPPER_INSERT " " "-mtune=$ROCKCFG_POWERPC_OPT" + var_append GCC_WRAPPER_APPEND " " "-mtune=$ROCKCFG_POWERPC_OPT" fi diff --git a/architecture/sparc/gcc-options b/architecture/sparc/gcc-options index 9867bd65c..31e50c366 100644 --- a/architecture/sparc/gcc-options +++ b/architecture/sparc/gcc-options @@ -1,16 +1,17 @@ if [ "$ROCKCFG_SPARC_OPT" != "generic" ] ; then - var_append GCC_WRAPPER_INSERT " " "-mcpu=$ROCKCFG_SPARC_OPT" + # Append options so the gcc -V option always comes first. + var_append GCC_WRAPPER_APPEND " " "-mcpu=$ROCKCFG_SPARC_OPT" case "$ROCKCFG_SPARC_OPT" in v7) tune=cypress ;; v8) tune=supersparc ;; v9) tune=ultrasparc ;; esac - [ "$tune" ] && var_append GCC_WRAPPER_INSERT " " "-mtune=$tune" + [ "$tune" ] && var_append GCC_WRAPPER_APPEND " " "-mtune=$tune" if [ $ROCKCFG_SPARC_BITS == 64 ] ; then - var_append GCC_WRAPPER_INSERT " " "-Wa,-Av9a -mno-app-regs" + var_append GCC_WRAPPER_APPEND " " "-Wa,-Av9a -mno-app-regs" fi fi diff --git a/architecture/x86/gcc-options b/architecture/x86/gcc-options index 89f374c94..42e90ad14 100644 --- a/architecture/x86/gcc-options +++ b/architecture/x86/gcc-options @@ -5,47 +5,46 @@ then case "$ROCKCFG_X86_OPT" in generic) - var_append GCC_WRAPPER_INSERT " " "-march=i486" + # Append options so the gcc -V option always comes first. + var_append GCC_WRAPPER_APPEND " " "-march=i486" ;; via-c3) - var_append GCC2_WRAPPER_INSERT " " "-march=k6" - var_append GCC3_WRAPPER_INSERT " " "-march=k62" - var_append GCC4_WRAPPER_INSERT " " "-march=k62" + var_append GCC2_WRAPPER_APPEND " " "-march=k6" + var_append GCC3_WRAPPER_APPEND " " "-march=k62" + var_append GCC4_WRAPPER_APPEND " " "-march=k62" ;; via-c3-improved) - var_append GCC_WRAPPER_INSERT " " "-march=i686" + var_append GCC_WRAPPER_APPEND " " "-march=i686" ;; via-c3-2) - var_append GCC2_WRAPPER_INSERT " " "-march=pentiumpro" - var_append GCC3_WRAPPER_INSERT " " "-march=pentium-mmx" - var_append GCC4_WRAPPER_INSERT " " "-march=pentium-mmx" + var_append GCC2_WRAPPER_APPEND " " "-march=pentiumpro" + var_append GCC3_WRAPPER_APPEND " " "-march=pentium-mmx" + var_append GCC4_WRAPPER_APPEND " " "-march=pentium-mmx" ;; k6*) - var_append GCC2_WRAPPER_INSERT " " "-march=k6" + var_append GCC2_WRAPPER_APPEND " " "-march=k6" - var_append GCC3_WRAPPER_INSERT " " "-march=$ROCKCFG_X86_OPT" + var_append GCC3_WRAPPER_APPEND " " "-march=$ROCKCFG_X86_OPT" # workaround and should be removed when gcc 3.x got fixed ... - var_append GCC3_WRAPPER_INSERT " " "-fno-branch-count-reg" + var_append GCC3_WRAPPER_APPEND " " "-fno-branch-count-reg" - var_append GCC4_WRAPPER_INSERT " " "-march=$ROCKCFG_X86_OPT" -# # workaround and should be removed when gcc 3.x got fixed ... -# var_append GCC4_WRAPPER_INSERT " " "-fno-branch-count-reg" + var_append GCC4_WRAPPER_APPEND " " "-march=$ROCKCFG_X86_OPT" ;; *) - var_append GCC3_WRAPPER_INSERT " " "-march=$ROCKCFG_X86_OPT" - var_append GCC4_WRAPPER_INSERT " " "-march=$ROCKCFG_X86_OPT" + var_append GCC3_WRAPPER_APPEND " " "-march=$ROCKCFG_X86_OPT" + var_append GCC4_WRAPPER_APPEND " " "-march=$ROCKCFG_X86_OPT" ;; esac case "$ROCKCFG_X86_OPT" in i486) - var_append GCC2_WRAPPER_INSERT " " "-march=$ROCKCFG_X86_OPT" ;; + var_append GCC2_WRAPPER_APPEND " " "-march=$ROCKCFG_X86_OPT" ;; pentium|pentium-mmx) - var_append GCC2_WRAPPER_INSERT " " "-march=pentium" ;; + var_append GCC2_WRAPPER_APPEND " " "-march=pentium" ;; pentium*) - var_append GCC2_WRAPPER_INSERT " " "-march=pentiumpro" ;; + var_append GCC2_WRAPPER_APPEND " " "-march=pentiumpro" ;; athlon*) - var_append GCC2_WRAPPER_INSERT " " "-march=k6" ;; + var_append GCC2_WRAPPER_APPEND " " "-march=k6" ;; esac else @@ -54,18 +53,18 @@ else # Other values like i686 or pentiumpro cause a build error in e.g. # glibc 2.6.1 when building with gcc 4.2.1. if [[ "$xpkg" = *-32bit ]] ; then - var_append GCC_WRAPPER_INSERT " " "-march=pentium4" + var_append GCC_WRAPPER_APPEND " " "-march=pentium4" fi ;; intel) - var_append GCC2_WRAPPER_INSERT " " "-march=x86_64" - var_append GCC3_WRAPPER_INSERT " " "-march=nocona" - var_append GCC4_WRAPPER_INSERT " " "-march=nocona" + var_append GCC2_WRAPPER_APPEND " " "-march=x86_64" + var_append GCC3_WRAPPER_APPEND " " "-march=nocona" + var_append GCC4_WRAPPER_APPEND " " "-march=nocona" ;; athlon) - var_append GCC2_WRAPPER_INSERT " " "-march=x86_64" - var_append GCC3_WRAPPER_INSERT " " "-march=k8" - var_append GCC4_WRAPPER_INSERT " " "-march=k8" + var_append GCC2_WRAPPER_APPEND " " "-march=x86_64" + var_append GCC3_WRAPPER_APPEND " " "-march=k8" + var_append GCC4_WRAPPER_APPEND " " "-march=k8" ;; esac fi