diff --git a/base/gcc/arch/options.alpha.in b/base/gcc/arch/options.alpha.in new file mode 100644 index 000000000..69ab0e19c --- /dev/null +++ b/base/gcc/arch/options.alpha.in @@ -0,0 +1,19 @@ +# --- SDE-COPYRIGHT-NOTE-BEGIN --- +# This copyright note is auto-generated by ./scripts/Create-CopyPatch. +# +# Filename: package/.../gcc/arch/options.alpha.in +# Copyright (C) 2008 The OpenSDE Project +# Copyright (C) 2004 - 2006 The T2 SDE Project +# +# More information can be found in the files COPYING and README. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. A copy of the +# GNU General Public License can be found in the file COPYING. +# --- SDE-COPYRIGHT-NOTE-END --- + +if [ $SDECFG_ALPHA_OPT != generic ] ; then + var_append GCC3_WRAPPER_INSERT " " \ + "-mtune=$SDECFG_ALPHA_OPT" +fi diff --git a/base/gcc/arch/options.arm.in b/base/gcc/arch/options.arm.in new file mode 100644 index 000000000..e84208206 --- /dev/null +++ b/base/gcc/arch/options.arm.in @@ -0,0 +1,21 @@ +# --- SDE-COPYRIGHT-NOTE-BEGIN --- +# This copyright note is auto-generated by ./scripts/Create-CopyPatch. +# +# Filename: package/.../gcc/arch/options.arm.in +# Copyright (C) 2008 The OpenSDE Project +# Copyright (C) 2004 - 2006 The T2 SDE Project +# +# More information can be found in the files COPYING and README. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. A copy of the +# GNU General Public License can be found in the file COPYING. +# --- SDE-COPYRIGHT-NOTE-END --- + +[ "$SDECFG_ARM_OPT" != generic ] && + var_append GCC_WRAPPER_INSERT " " "-mcpu=$SDECFG_ARM_OPT" + +[ "$SDECFG_ARM_THUMB" = 1 ] && + var_append GCC_WRAPPER_INSERT " " "-mthumb -mthumb-interwork -D__arm__" + diff --git a/base/gcc/arch/options.hppa.in b/base/gcc/arch/options.hppa.in new file mode 100644 index 000000000..a1683ffa9 --- /dev/null +++ b/base/gcc/arch/options.hppa.in @@ -0,0 +1,19 @@ +# --- SDE-COPYRIGHT-NOTE-BEGIN --- +# This copyright note is auto-generated by ./scripts/Create-CopyPatch. +# +# Filename: package/.../gcc/arch/options.hppa.in +# Copyright (C) 2008 The OpenSDE Project +# Copyright (C) 2004 - 2006 The T2 SDE Project +# +# More information can be found in the files COPYING and README. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. A copy of the +# GNU General Public License can be found in the file COPYING. +# --- SDE-COPYRIGHT-NOTE-END --- + +if [ "$SDECFG_HPPA_OPT" != "generic" ] ; then + var_append GCC_WRAPPER_INSERT " " "-mcpu=$SDECFG_HPPA_OPT" +fi + diff --git a/base/gcc/arch/options.hppa64.in b/base/gcc/arch/options.hppa64.in new file mode 100644 index 000000000..edb969f5d --- /dev/null +++ b/base/gcc/arch/options.hppa64.in @@ -0,0 +1,19 @@ +# --- SDE-COPYRIGHT-NOTE-BEGIN --- +# This copyright note is auto-generated by ./scripts/Create-CopyPatch. +# +# Filename: package/.../gcc/arch/options.hppa64.in +# Copyright (C) 2008 The OpenSDE Project +# Copyright (C) 2004 - 2006 The T2 SDE Project +# +# More information can be found in the files COPYING and README. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. A copy of the +# GNU General Public License can be found in the file COPYING. +# --- SDE-COPYRIGHT-NOTE-END --- + +if [ "$SDECFG_HPPA64_OPT" != "generic" ] ; then + var_append GCC_WRAPPER_INSERT " " "-mcpu=$SDECFG_HPPA64_OPT" +fi + diff --git a/base/gcc/arch/options.mips.in b/base/gcc/arch/options.mips.in new file mode 100644 index 000000000..d70bb929e --- /dev/null +++ b/base/gcc/arch/options.mips.in @@ -0,0 +1,19 @@ +# --- SDE-COPYRIGHT-NOTE-BEGIN --- +# This copyright note is auto-generated by ./scripts/Create-CopyPatch. +# +# Filename: package/.../gcc/arch/options.mips.in +# Copyright (C) 2008 The OpenSDE Project +# Copyright (C) 2004 - 2006 The T2 SDE Project +# +# More information can be found in the files COPYING and README. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. A copy of the +# GNU General Public License can be found in the file COPYING. +# --- SDE-COPYRIGHT-NOTE-END --- + +if [ $SDECFG_MIPS_OPT != generic ] ; then + var_append GCC_WRAPPER_INSERT " " "-march=$SDECFG_MIPS_OPT" +fi + diff --git a/base/gcc/arch/options.mips64.in b/base/gcc/arch/options.mips64.in new file mode 100644 index 000000000..a908fb8ea --- /dev/null +++ b/base/gcc/arch/options.mips64.in @@ -0,0 +1,19 @@ +# --- SDE-COPYRIGHT-NOTE-BEGIN --- +# This copyright note is auto-generated by ./scripts/Create-CopyPatch. +# +# Filename: package/.../gcc/arch/options.mips64.in +# Copyright (C) 2008 The OpenSDE Project +# Copyright (C) 2004 - 2006 The T2 SDE Project +# +# More information can be found in the files COPYING and README. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. A copy of the +# GNU General Public License can be found in the file COPYING. +# --- SDE-COPYRIGHT-NOTE-END --- + +if [ $SDECFG_MIPS64_OPT != generic ] ; then + var_append GCC_WRAPPER_INSERT " " "-march=$SDECFG_MIPS64_OPT" +fi + diff --git a/base/gcc/arch/options.powerpc.in b/base/gcc/arch/options.powerpc.in new file mode 100644 index 000000000..1d3508fa9 --- /dev/null +++ b/base/gcc/arch/options.powerpc.in @@ -0,0 +1,22 @@ +# --- SDE-COPYRIGHT-NOTE-BEGIN --- +# This copyright note is auto-generated by ./scripts/Create-CopyPatch. +# +# Filename: package/.../gcc/arch/options.powerpc.in +# Copyright (C) 2008 The OpenSDE Project +# Copyright (C) 2004 - 2006 The T2 SDE Project +# +# More information can be found in the files COPYING and README. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. A copy of the +# GNU General Public License can be found in the file COPYING. +# --- SDE-COPYRIGHT-NOTE-END --- + +if [ "$SDECFG_POWERPC_ISA" ] ; then + var_append GCC_WRAPPER_INSERT " " "-mcpu=$SDECFG_POWERPC_ISA" +fi + +if [ "$SDECFG_POWERPC_OPT" != "generic" ] ; then + var_append GCC_WRAPPER_INSERT " " "-mtune=$SDECFG_POWERPC_OPT" +fi diff --git a/base/gcc/arch/options.powerpc64.in b/base/gcc/arch/options.powerpc64.in new file mode 100644 index 000000000..f7cd10316 --- /dev/null +++ b/base/gcc/arch/options.powerpc64.in @@ -0,0 +1,21 @@ +# --- SDE-COPYRIGHT-NOTE-BEGIN --- +# This copyright note is auto-generated by ./scripts/Create-CopyPatch. +# +# Filename: package/.../gcc/arch/options.powerpc64.in +# Copyright (C) 2008 The OpenSDE Project +# Copyright (C) 2004 - 2006 The T2 SDE Project +# +# More information can be found in the files COPYING and README. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. A copy of the +# GNU General Public License can be found in the file COPYING. +# --- SDE-COPYRIGHT-NOTE-END --- + +if [ "$SDECFG_POWERPC64_OPT" != "generic" ] ; then + var_append GCC_WRAPPER_INSERT " " "-mcpu=$SDECFG_POWERPC64_OPT" +else + var_append GCC_WRAPPER_INSERT " " "-mcpu=powerpc64" +fi + diff --git a/base/gcc/arch/options.sh.in b/base/gcc/arch/options.sh.in new file mode 100644 index 000000000..b97f4f094 --- /dev/null +++ b/base/gcc/arch/options.sh.in @@ -0,0 +1,26 @@ +# --- SDE-COPYRIGHT-NOTE-BEGIN --- +# This copyright note is auto-generated by ./scripts/Create-CopyPatch. +# +# Filename: package/.../gcc/arch/options.sh.in +# Copyright (C) 2008 The OpenSDE Project +# Copyright (C) 2004 - 2006 The T2 SDE Project +# +# More information can be found in the files COPYING and README. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. A copy of the +# GNU General Public License can be found in the file COPYING. +# --- SDE-COPYRIGHT-NOTE-END --- + +if [ "$SDECFG_SH_OPT" ] ; then + opt= + case "$SDECFG_SH_OPT" in + sh) opt="-m1" ;; + sh2) opt="-m2" ;; + sh3) opt="-m3" ;; + sh4) opt="-m4" ;; + esac + var_append GCC_WRAPPER_INSERT " " "$opt" +fi + diff --git a/base/gcc/arch/options.sh64.in b/base/gcc/arch/options.sh64.in new file mode 100644 index 000000000..a9e789e4b --- /dev/null +++ b/base/gcc/arch/options.sh64.in @@ -0,0 +1,23 @@ +# --- SDE-COPYRIGHT-NOTE-BEGIN --- +# This copyright note is auto-generated by ./scripts/Create-CopyPatch. +# +# Filename: package/.../gcc/arch/options.sh64.in +# Copyright (C) 2008 The OpenSDE Project +# Copyright (C) 2004 - 2006 The T2 SDE Project +# +# More information can be found in the files COPYING and README. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. A copy of the +# GNU General Public License can be found in the file COPYING. +# --- SDE-COPYRIGHT-NOTE-END --- + +if [ "$SDECFG_SH64_OPT" ] ; then + opt= + case "$SDECFG_SH64_OPT" in + sh5) opt="-m5" ;; + esac + var_append GCC_WRAPPER_INSERT " " "$opt" +fi + diff --git a/base/gcc/arch/options.sparc.in b/base/gcc/arch/options.sparc.in new file mode 100644 index 000000000..3ae359d38 --- /dev/null +++ b/base/gcc/arch/options.sparc.in @@ -0,0 +1,26 @@ +# --- SDE-COPYRIGHT-NOTE-BEGIN --- +# This copyright note is auto-generated by ./scripts/Create-CopyPatch. +# +# Filename: package/.../gcc/arch/options.sparc.in +# Copyright (C) 2008 The OpenSDE Project +# Copyright (C) 2004 - 2006 The T2 SDE Project +# +# More information can be found in the files COPYING and README. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. A copy of the +# GNU General Public License can be found in the file COPYING. +# --- SDE-COPYRIGHT-NOTE-END --- + +if [ "$SDECFG_SPARC_OPT" ] ; then + opt= + case "$SDECFG_SPARC_OPT" in + v7) opt="-mcpu=cypress -mtune=cypress" ;; + v8) opt="-mcpu=supersparc -mtune=supersparc" ;; + v9) opt="-mcpu=ultrasparc -mtune=ultrasparc" ;; + v9vis) opt="-mcpu=ultrasparc -mtune=ultrasparc -mvis" ;; + esac + var_append GCC_WRAPPER_INSERT " " "$opt" +fi + diff --git a/base/gcc/arch/options.sparc64.in b/base/gcc/arch/options.sparc64.in new file mode 100644 index 000000000..5e6ff12e7 --- /dev/null +++ b/base/gcc/arch/options.sparc64.in @@ -0,0 +1,21 @@ +# --- SDE-COPYRIGHT-NOTE-BEGIN --- +# This copyright note is auto-generated by ./scripts/Create-CopyPatch. +# +# Filename: package/.../gcc/arch/options.sparc64.in +# Copyright (C) 2008 The OpenSDE Project +# Copyright (C) 2006 The T2 SDE Project +# +# More information can be found in the files COPYING and README. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. A copy of the +# GNU General Public License can be found in the file COPYING. +# --- SDE-COPYRIGHT-NOTE-END --- + +case "$SDECFG_SPARC64_OPT" in + generic) ;; + *) + var_append GCC_WRAPPER_INSERT " " "-mcpu=$SDECFG_SPARC64_OPT" ;; +esac + diff --git a/base/gcc/arch/options.x86-64.in b/base/gcc/arch/options.x86-64.in new file mode 100644 index 000000000..25be99a79 --- /dev/null +++ b/base/gcc/arch/options.x86-64.in @@ -0,0 +1,23 @@ +# --- SDE-COPYRIGHT-NOTE-BEGIN --- +# This copyright note is auto-generated by ./scripts/Create-CopyPatch. +# +# Filename: package/.../gcc/arch/options.x86-64.in +# Copyright (C) 2008 The OpenSDE Project +# Copyright (C) 2004 - 2006 The T2 SDE Project +# +# More information can be found in the files COPYING and README. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. A copy of the +# GNU General Public License can be found in the file COPYING. +# --- SDE-COPYRIGHT-NOTE-END --- + +case "$SDECFG_X8664_OPT" in + generic) ;; + em64t) + var_append GCC_WRAPPER_INSERT " " "-march=nocona" ;; + *) + var_append GCC_WRAPPER_INSERT " " "-march=$SDECFG_X8664_OPT" ;; +esac + diff --git a/base/gcc/arch/options.x86.in b/base/gcc/arch/options.x86.in new file mode 100644 index 000000000..9b19aa1db --- /dev/null +++ b/base/gcc/arch/options.x86.in @@ -0,0 +1,31 @@ +# --- SDE-COPYRIGHT-NOTE-BEGIN --- +# This copyright note is auto-generated by ./scripts/Create-CopyPatch. +# +# Filename: package/.../gcc/arch/options.x86.in +# Copyright (C) 2008 The OpenSDE Project +# Copyright (C) 2004 - 2006 The T2 SDE Project +# +# More information can be found in the files COPYING and README. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. A copy of the +# GNU General Public License can be found in the file COPYING. +# --- SDE-COPYRIGHT-NOTE-END --- + +case "$SDECFG_X86_OPT" in + generic) ;; + k6*) + var_append GCC_WRAPPER_INSERT " " "-march=$SDECFG_X86_OPT" + # workaround and should be removed when gcc 3.x got fixed ... + var_append GCC_WRAPPER_INSERT " " "-fno-branch-count-reg" + ;; + pentium4) + var_append GCC_WRAPPER_INSERT " " "-march=$SDECFG_X86_OPT" + # workaround for gcc bug #15617 + var_append GCC_WRAPPER_INSERT " " "-mpreferred-stack-boundary=7" + ;; + *) + var_append GCC_WRAPPER_INSERT " " "-march=$SDECFG_X86_OPT" ;; +esac + diff --git a/base/gcc/parse-config b/base/gcc/parse-config index 12eac2c69..094f493fc 100644 --- a/base/gcc/parse-config +++ b/base/gcc/parse-config @@ -1,4 +1,3 @@ -#!/bin/sh # --- SDE-COPYRIGHT-NOTE-BEGIN --- # This copyright note is auto-generated by ./scripts/Create-CopyPatch. # @@ -134,9 +133,13 @@ fi # Add the architecture gcc optimisation options # -if [ -f architecture/$arch/gcc-options.in ] ; then - . architecture/$arch/gcc-options.in +gcc_arch_options="$(pkgdesc confdir gcc)/arch/options.$arch.in" +if [ -s "$gcc_arch_options" ]; then + . "$gcc_arch_options" +else + echo_warning "gcc: no mappings found for $arch architecture" fi +unset gcc_arch_options # Inject -fPIC if the package is marked to need a quirk ... # @@ -148,5 +151,3 @@ if hasflag NO-AS-NEEDED; then var_remove_regex GCC_WRAPPER_INSERT ' ' ".*-Wl,--as-needed" var_append GCC_WRAPPER_REMOVE ' ' "-Wl,--as-needed" fi - -