2016-03-14 21:11:56 +01:00
|
|
|
# $NetBSD: transform-gcc,v 1.32 2016/03/14 20:11:56 markd Exp $
|
2006-11-30 11:01:29 +01:00
|
|
|
#
|
|
|
|
# This file handles the transformations needed for gcc that can be done
|
|
|
|
# looking at only one argument at a time.
|
2006-11-26 10:56:46 +01:00
|
|
|
#
|
|
|
|
|
|
|
|
transform_setname "transform-gcc"
|
2006-11-26 11:00:04 +01:00
|
|
|
|
2006-11-26 10:56:46 +01:00
|
|
|
case $arg in
|
2006-11-26 14:02:53 +01:00
|
|
|
|
2006-11-30 12:34:23 +01:00
|
|
|
# Standard options.
|
2006-11-30 11:01:29 +01:00
|
|
|
-[EcgOos] |\
|
|
|
|
-[DILlU]?* |\
|
2006-11-30 12:34:23 +01:00
|
|
|
-O[01] ) transform_pass ;;
|
2006-11-30 11:01:29 +01:00
|
|
|
|
2007-01-06 03:20:10 +01:00
|
|
|
# Needed for the GNU configure scripts:
|
|
|
|
-V |\
|
|
|
|
-v |\
|
|
|
|
--version ) transform_pass ;;
|
|
|
|
|
2012-07-23 13:58:41 +02:00
|
|
|
# We occasionally override specs to force particular options.
|
|
|
|
-specs=* |\
|
|
|
|
-specs ) transform_pass ;;
|
|
|
|
|
2006-11-30 12:34:23 +01:00
|
|
|
# GCC extensions.
|
2007-01-06 03:20:10 +01:00
|
|
|
- |\
|
|
|
|
-dynamic |\
|
|
|
|
-export-dynamic |\
|
2007-02-06 20:35:41 +01:00
|
|
|
-falign-functions=* |\
|
|
|
|
-falign-loops=* |\
|
|
|
|
-falign-jumps=* |\
|
|
|
|
-fexpensive-optimizations |\
|
2007-01-06 03:20:10 +01:00
|
|
|
-ffast-math |\
|
2007-02-06 20:35:41 +01:00
|
|
|
-ffloat-store |\
|
2011-01-23 20:07:24 +01:00
|
|
|
-fhonour-copts |\
|
2007-01-06 03:20:10 +01:00
|
|
|
-finline-functions |\
|
2012-02-06 14:03:55 +01:00
|
|
|
-fno-align-* |\
|
2007-02-06 20:35:41 +01:00
|
|
|
-fno-builtin* |\
|
|
|
|
-fno-common |\
|
2006-12-09 13:06:55 +01:00
|
|
|
-fno-implicit-templates |\
|
2007-02-06 20:35:41 +01:00
|
|
|
-fno-inline-functions |\
|
|
|
|
-fno-strict-aliasing |\
|
|
|
|
-fomit-frame-pointer |\
|
2007-01-06 03:20:10 +01:00
|
|
|
-fPIC |\
|
2007-09-08 15:37:51 +02:00
|
|
|
-fpic |\
|
2016-03-12 00:03:31 +01:00
|
|
|
-fPIE |\
|
|
|
|
-fpie |\
|
2007-02-06 21:26:51 +01:00
|
|
|
-fpcc-struct-return |\
|
|
|
|
-freg-struct-return |\
|
2012-02-06 14:03:55 +01:00
|
|
|
-frename-registers |\
|
2007-02-06 20:35:41 +01:00
|
|
|
-fsigned-char |\
|
2016-03-12 00:03:31 +01:00
|
|
|
-fstack-protector |\
|
|
|
|
-fstack-protector-all |\
|
2007-02-06 20:35:41 +01:00
|
|
|
-funroll-loops |\
|
|
|
|
-funsigned-char |\
|
2012-02-06 14:03:55 +01:00
|
|
|
-fweb |\
|
|
|
|
-fwrapv |\
|
2006-12-07 01:32:36 +01:00
|
|
|
-ggdb |\
|
2016-03-14 21:11:56 +01:00
|
|
|
-isystem,* |\
|
2006-12-10 01:18:17 +01:00
|
|
|
-M |\
|
2006-12-09 13:06:55 +01:00
|
|
|
-M[DFMPT] |\
|
2007-02-06 20:35:41 +01:00
|
|
|
-MMD |\
|
2009-08-15 15:36:48 +02:00
|
|
|
-m32 |\
|
|
|
|
-m64 |\
|
2008-02-19 17:50:11 +01:00
|
|
|
-mabi=* |\
|
2007-04-10 05:44:34 +02:00
|
|
|
-march=* |\
|
2007-02-06 20:35:41 +01:00
|
|
|
-mcpu=* |\
|
2012-02-06 14:03:55 +01:00
|
|
|
-momit-leaf-frame-pointer |\
|
|
|
|
-mpreferred-stack-boundary=* |\
|
|
|
|
-mpush-args |\
|
2012-01-21 13:05:03 +01:00
|
|
|
-mschedule=* |\
|
2007-02-06 20:35:41 +01:00
|
|
|
-mieee-fp |\
|
2006-11-30 11:01:29 +01:00
|
|
|
-O[23s] |\
|
2007-01-06 03:20:10 +01:00
|
|
|
-pedantic |\
|
2007-02-06 20:35:41 +01:00
|
|
|
-pedantic-errors |\
|
2016-03-12 22:22:04 +01:00
|
|
|
-pie |\
|
2006-12-01 22:10:18 +01:00
|
|
|
-pipe |\
|
2006-11-30 11:01:29 +01:00
|
|
|
-pthread |\
|
2007-01-06 03:20:10 +01:00
|
|
|
-print-prog-name=* |\
|
2007-02-06 20:35:41 +01:00
|
|
|
-print-search-dirs |\
|
|
|
|
-S |\
|
2006-11-30 11:01:29 +01:00
|
|
|
-shared |\
|
2016-03-12 00:03:31 +01:00
|
|
|
-shared-gcc |\
|
|
|
|
-shared-libgcc |\
|
2006-11-30 11:01:29 +01:00
|
|
|
-static |\
|
|
|
|
-std=c99 |\
|
2007-02-06 21:26:51 +01:00
|
|
|
-std=gnu89 |\
|
2006-11-30 11:01:29 +01:00
|
|
|
-std=gnu99 |\
|
|
|
|
-W |\
|
|
|
|
-W[cLlS],* |\
|
|
|
|
-Wall |\
|
2011-01-23 20:07:24 +01:00
|
|
|
-Wbounded |\
|
2006-12-07 01:32:36 +01:00
|
|
|
-Wcast-align |\
|
2006-11-30 11:01:29 +01:00
|
|
|
-Wcast-qual |\
|
2007-02-06 20:35:41 +01:00
|
|
|
-Wchar-subscripts |\
|
|
|
|
-Wconversion |\
|
2006-11-30 11:01:29 +01:00
|
|
|
-Wextra |\
|
|
|
|
-Werror |\
|
2007-01-06 03:20:10 +01:00
|
|
|
-Werror-implicit-function-declaration |\
|
2012-02-06 14:03:55 +01:00
|
|
|
-Wformat* |\
|
2016-03-12 00:03:31 +01:00
|
|
|
-Winline |\
|
2007-01-06 03:20:10 +01:00
|
|
|
-Wmissing-declarations |\
|
2007-02-06 20:35:41 +01:00
|
|
|
-Wmissing-format-attribute |\
|
2006-11-30 11:01:29 +01:00
|
|
|
-Wmissing-prototypes |\
|
2007-02-06 20:35:41 +01:00
|
|
|
-Wnested-externs |\
|
2006-11-30 11:01:29 +01:00
|
|
|
-Wno-error |\
|
2007-02-06 20:35:41 +01:00
|
|
|
-Wno-format-y2k |\
|
|
|
|
-Wno-format-zero-length |\
|
2006-12-01 22:10:18 +01:00
|
|
|
-Wno-implicit-int |\
|
2007-02-06 20:35:41 +01:00
|
|
|
-Wno-import |\
|
|
|
|
-Wno-inline |\
|
2006-11-30 11:01:29 +01:00
|
|
|
-Wno-long-long |\
|
2007-02-06 20:35:41 +01:00
|
|
|
-Wno-sign-compare |\
|
2006-11-30 11:01:29 +01:00
|
|
|
-Wno-traditional |\
|
2007-01-06 03:20:10 +01:00
|
|
|
-Wno-undef |\
|
2006-11-30 11:01:29 +01:00
|
|
|
-Wno-uninitialized |\
|
|
|
|
-Wno-unused |\
|
2007-02-21 20:29:56 +01:00
|
|
|
-Wno-unused-parameter |\
|
2006-11-30 11:01:29 +01:00
|
|
|
-Wno-write-strings |\
|
2007-01-06 03:20:10 +01:00
|
|
|
-Wparentheses |\
|
2006-11-30 11:01:29 +01:00
|
|
|
-Wpointer-arith |\
|
2016-03-12 00:03:31 +01:00
|
|
|
-Wredundant-decls |\
|
2006-11-30 11:01:29 +01:00
|
|
|
-Wreturn-type |\
|
|
|
|
-Wshadow |\
|
|
|
|
-Wsign-compare |\
|
2007-02-06 20:35:41 +01:00
|
|
|
-Wstrict-aliasing |\
|
2006-11-30 11:01:29 +01:00
|
|
|
-Wstrict-prototypes |\
|
|
|
|
-Wswitch |\
|
2016-03-12 00:03:31 +01:00
|
|
|
-Wtrigraphs |\
|
2007-02-06 21:26:51 +01:00
|
|
|
-Wunused |\
|
2007-01-06 03:20:10 +01:00
|
|
|
-Wundef |\
|
2006-11-30 12:34:23 +01:00
|
|
|
-Wwrite-strings ) transform_pass ;;
|
|
|
|
|
2007-02-06 20:35:41 +01:00
|
|
|
# There are some packages suppressing all warnings. We don't want that.
|
|
|
|
-w ) transform_discard ;;
|
|
|
|
|
2006-12-07 01:32:36 +01:00
|
|
|
# Options specific to g++.
|
2007-02-06 20:35:41 +01:00
|
|
|
-fexceptions |\
|
2006-12-07 01:32:36 +01:00
|
|
|
-fmessage-length=* |\
|
2007-01-06 03:20:10 +01:00
|
|
|
-fno-check-new |\
|
2006-12-07 01:32:36 +01:00
|
|
|
-fno-exceptions |\
|
2007-01-06 03:20:10 +01:00
|
|
|
-fno-rtti |\
|
2007-02-06 20:35:41 +01:00
|
|
|
-Wno-non-virtual-dtor |\
|
|
|
|
-ftemplate-depth=* ) transform_pass ;;
|
|
|
|
|
|
|
|
# Options specific to Objective C
|
|
|
|
-fgnu-runtime |\
|
|
|
|
-fconstant-string-class=* ) transform_pass ;;
|
2006-12-07 01:32:36 +01:00
|
|
|
|
2012-03-07 13:55:53 +01:00
|
|
|
# Old-style rpath specifier, may come from autoconf's AC_PATH_XTRA.
|
|
|
|
# Our gcc re-orders -R args relative to -Wl,-R specifiers (puts -R
|
|
|
|
# args at the front of the "ld" invocation), which messes up the relative
|
|
|
|
# search order. Fix this by rewriting -R to -Wl,-R.
|
|
|
|
-R* ) transform_to "-Wl,$arg" ;;
|
|
|
|
|
2006-11-30 12:34:23 +01:00
|
|
|
# Other compiler's options that have corresponding GCC options.
|
2007-10-17 09:30:10 +02:00
|
|
|
-Kpic |\
|
2009-08-15 15:36:48 +02:00
|
|
|
-kpic |\
|
2006-11-30 12:34:23 +01:00
|
|
|
-KPIC |\
|
|
|
|
-kPIC ) transform_to "-fPIC" ;;
|
2013-12-31 14:56:35 +01:00
|
|
|
-mt ) transform_discard ;;
|
2007-02-19 15:43:05 +01:00
|
|
|
-64 ) transform_to "-m64" ;;
|
2006-11-30 12:34:23 +01:00
|
|
|
|
2012-06-08 13:39:44 +02:00
|
|
|
# Ignore SunPRO flags to prevent it from being recognized as a entry point
|
|
|
|
# option for `ld'.
|
|
|
|
-errwarn=* |\
|
|
|
|
-errwarn ) transform_discard_with_warning ;;
|
|
|
|
|
2006-11-30 12:34:23 +01:00
|
|
|
# Unknown options.
|
|
|
|
-* ) transform_pass_with_warning ;;
|
2006-11-26 11:00:04 +01:00
|
|
|
|
2006-11-26 10:56:46 +01:00
|
|
|
esac
|