sewardj | 0126214 | 2006-01-04 01:20:28 +0000 | [diff] [blame] | 1 | |
sewardj | 944fbf2 | 2007-11-16 10:05:47 +0000 | [diff] [blame] | 2 | # Baseline flags for all compilations. Aim here is to maximise |
| 3 | # performance and get whatever useful warnings we can out of gcc. |
sewardj | 8cd42de | 2007-11-16 12:31:27 +0000 | [diff] [blame] | 4 | AM_CFLAGS_BASE = -O2 -g -Wmissing-prototypes -Wall -Wshadow \ |
sewardj | b5f2964 | 2007-11-16 12:02:43 +0000 | [diff] [blame] | 5 | -Wpointer-arith -Wstrict-prototypes -Wmissing-declarations \ |
bart | 9d865fa | 2008-06-23 12:11:49 +0000 | [diff] [blame] | 6 | @FLAG_W_NO_FORMAT_ZERO_LENGTH@ \ |
sewardj | b5f2964 | 2007-11-16 12:02:43 +0000 | [diff] [blame] | 7 | -fno-strict-aliasing |
tom | fb7bcde | 2005-11-07 15:24:38 +0000 | [diff] [blame] | 8 | |
sewardj | 944fbf2 | 2007-11-16 10:05:47 +0000 | [diff] [blame] | 9 | # These flags are used for building the preload shared objects. |
| 10 | # The aim is to give reasonable performance but also to have good |
| 11 | # stack traces, since users often see stack traces extending |
| 12 | # into (and through) the preloads. |
sewardj | b5f2964 | 2007-11-16 12:02:43 +0000 | [diff] [blame] | 13 | AM_CFLAGS_PIC = -O -g -fpic -fno-omit-frame-pointer -fno-strict-aliasing |
tom | fb7bcde | 2005-11-07 15:24:38 +0000 | [diff] [blame] | 14 | |
njn | f6ded8c | 2009-02-06 04:49:14 +0000 | [diff] [blame] | 15 | # Flags for specific targets. |
njn | 058f635 | 2009-04-15 23:58:26 +0000 | [diff] [blame] | 16 | # |
njn | f6ded8c | 2009-02-06 04:49:14 +0000 | [diff] [blame] | 17 | # Nb: the AM_CPPFLAGS_* values are suitable for building tools and auxprogs. |
| 18 | # For building the core, coregrind/Makefile.am files add some extra things. |
njn | 058f635 | 2009-04-15 23:58:26 +0000 | [diff] [blame] | 19 | # |
| 20 | # Also: in newer versions of automake (1.10 onwards?) asm files ending with |
| 21 | # '.S' are considered "pre-processed" (as opposed to those ending in '.s') |
| 22 | # and so the CPPFLAGS are passed to the assembler. But this is not true for |
| 23 | # older automakes (e.g. 1.8.5, 1.9.6), sigh. So we include |
| 24 | # AM_CPPFLAGS_<PLATFORM> in each AM_CCASFLAGS_<PLATFORM> variable. This |
| 25 | # means some of the flags are duplicated on systems with newer versions of |
| 26 | # automake, but this does not really matter and seems hard to avoid. |
| 27 | |
njn | f6ded8c | 2009-02-06 04:49:14 +0000 | [diff] [blame] | 28 | AM_CPPFLAGS_COMMON = \ |
njn | 058f635 | 2009-04-15 23:58:26 +0000 | [diff] [blame] | 29 | -I$(top_srcdir) \ |
njn | f6ded8c | 2009-02-06 04:49:14 +0000 | [diff] [blame] | 30 | -I$(top_srcdir)/include \ |
| 31 | -I@VEX_DIR@/pub |
| 32 | |
sewardj | 0126214 | 2006-01-04 01:20:28 +0000 | [diff] [blame] | 33 | AM_FLAG_M3264_X86_LINUX = @FLAG_M32@ |
njn | f6ded8c | 2009-02-06 04:49:14 +0000 | [diff] [blame] | 34 | AM_CPPFLAGS_X86_LINUX = $(AM_CPPFLAGS_COMMON) \ |
| 35 | -DVGA_x86=1 \ |
| 36 | -DVGO_linux=1 \ |
| 37 | -DVGP_x86_linux=1 |
njn | 8d1181d | 2009-02-25 23:19:46 +0000 | [diff] [blame] | 38 | AM_CFLAGS_X86_LINUX = @FLAG_M32@ @PREFERRED_STACK_BOUNDARY@ \ |
sewardj | 0126214 | 2006-01-04 01:20:28 +0000 | [diff] [blame] | 39 | $(AM_CFLAGS_BASE) |
njn | 058f635 | 2009-04-15 23:58:26 +0000 | [diff] [blame] | 40 | AM_CCASFLAGS_X86_LINUX = $(AM_CPPFLAGS_X86_LINUX) @FLAG_M32@ -g |
tom | fb7bcde | 2005-11-07 15:24:38 +0000 | [diff] [blame] | 41 | |
sewardj | 0126214 | 2006-01-04 01:20:28 +0000 | [diff] [blame] | 42 | AM_FLAG_M3264_AMD64_LINUX = @FLAG_M64@ |
njn | f6ded8c | 2009-02-06 04:49:14 +0000 | [diff] [blame] | 43 | AM_CPPFLAGS_AMD64_LINUX = $(AM_CPPFLAGS_COMMON) \ |
| 44 | -DVGA_amd64=1 \ |
| 45 | -DVGO_linux=1 \ |
| 46 | -DVGP_amd64_linux=1 |
njn | 8d1181d | 2009-02-25 23:19:46 +0000 | [diff] [blame] | 47 | AM_CFLAGS_AMD64_LINUX = @FLAG_M64@ -fomit-frame-pointer \ |
sewardj | 1eff82b | 2006-10-17 00:56:43 +0000 | [diff] [blame] | 48 | @PREFERRED_STACK_BOUNDARY@ $(AM_CFLAGS_BASE) |
njn | 058f635 | 2009-04-15 23:58:26 +0000 | [diff] [blame] | 49 | AM_CCASFLAGS_AMD64_LINUX = $(AM_CPPFLAGS_AMD64_LINUX) @FLAG_M64@ -g |
tom | fb7bcde | 2005-11-07 15:24:38 +0000 | [diff] [blame] | 50 | |
sewardj | 0126214 | 2006-01-04 01:20:28 +0000 | [diff] [blame] | 51 | AM_FLAG_M3264_PPC32_LINUX = @FLAG_M32@ |
njn | f6ded8c | 2009-02-06 04:49:14 +0000 | [diff] [blame] | 52 | AM_CPPFLAGS_PPC32_LINUX = $(AM_CPPFLAGS_COMMON) \ |
| 53 | -DVGA_ppc32=1 \ |
| 54 | -DVGO_linux=1 \ |
| 55 | -DVGP_ppc32_linux=1 |
njn | 8d1181d | 2009-02-25 23:19:46 +0000 | [diff] [blame] | 56 | AM_CFLAGS_PPC32_LINUX = @FLAG_M32@ $(AM_CFLAGS_BASE) |
njn | 058f635 | 2009-04-15 23:58:26 +0000 | [diff] [blame] | 57 | AM_CCASFLAGS_PPC32_LINUX = $(AM_CPPFLAGS_PPC32_LINUX) @FLAG_M32@ -g |
sewardj | 2c48c7b | 2005-11-29 13:05:56 +0000 | [diff] [blame] | 58 | |
sewardj | 0126214 | 2006-01-04 01:20:28 +0000 | [diff] [blame] | 59 | AM_FLAG_M3264_PPC64_LINUX = @FLAG_M64@ |
njn | f6ded8c | 2009-02-06 04:49:14 +0000 | [diff] [blame] | 60 | AM_CPPFLAGS_PPC64_LINUX = $(AM_CPPFLAGS_COMMON) \ |
| 61 | -DVGA_ppc64=1 \ |
| 62 | -DVGO_linux=1 \ |
| 63 | -DVGP_ppc64_linux=1 |
njn | 8d1181d | 2009-02-25 23:19:46 +0000 | [diff] [blame] | 64 | AM_CFLAGS_PPC64_LINUX = @FLAG_M64@ $(AM_CFLAGS_BASE) |
njn | 058f635 | 2009-04-15 23:58:26 +0000 | [diff] [blame] | 65 | AM_CCASFLAGS_PPC64_LINUX = $(AM_CPPFLAGS_PPC64_LINUX) @FLAG_M64@ -g |
sewardj | 1eff82b | 2006-10-17 00:56:43 +0000 | [diff] [blame] | 66 | |
| 67 | AM_FLAG_M3264_PPC32_AIX5 = @FLAG_MAIX32@ |
njn | f6ded8c | 2009-02-06 04:49:14 +0000 | [diff] [blame] | 68 | AM_CPPFLAGS_PPC32_AIX5 = $(AM_CPPFLAGS_COMMON) \ |
| 69 | -DVGA_ppc32=1 \ |
| 70 | -DVGO_aix5=1 \ |
| 71 | -DVGP_ppc32_aix5=1 |
njn | 8d1181d | 2009-02-25 23:19:46 +0000 | [diff] [blame] | 72 | AM_CFLAGS_PPC32_AIX5 = @FLAG_MAIX32@ -mcpu=powerpc $(AM_CFLAGS_BASE) |
njn | 058f635 | 2009-04-15 23:58:26 +0000 | [diff] [blame] | 73 | AM_CCASFLAGS_PPC32_AIX5 = $(AM_CPPFLAGS_PPC32_AIX5) \ |
| 74 | @FLAG_MAIX32@ -mcpu=powerpc -g |
sewardj | 1eff82b | 2006-10-17 00:56:43 +0000 | [diff] [blame] | 75 | |
| 76 | AM_FLAG_M3264_PPC64_AIX5 = @FLAG_MAIX64@ |
njn | f6ded8c | 2009-02-06 04:49:14 +0000 | [diff] [blame] | 77 | AM_CPPFLAGS_PPC64_AIX5 = $(AM_CPPFLAGS_COMMON) \ |
| 78 | -DVGA_ppc64=1 \ |
| 79 | -DVGO_aix5=1 \ |
| 80 | -DVGP_ppc64_aix5=1 |
njn | 8d1181d | 2009-02-25 23:19:46 +0000 | [diff] [blame] | 81 | AM_CFLAGS_PPC64_AIX5 = @FLAG_MAIX64@ -mcpu=powerpc64 $(AM_CFLAGS_BASE) |
njn | 058f635 | 2009-04-15 23:58:26 +0000 | [diff] [blame] | 82 | AM_CCASFLAGS_PPC64_AIX5 = $(AM_CPPFLAGS_PPC64_AIX5) \ |
| 83 | @FLAG_MAIX64@ -mcpu=powerpc64 -g |
tom | fb7bcde | 2005-11-07 15:24:38 +0000 | [diff] [blame] | 84 | |
sewardj | 0126214 | 2006-01-04 01:20:28 +0000 | [diff] [blame] | 85 | # Flags for the primary target. These must be used to build the |
| 86 | # regtests and performance tests. In fact, these must be used to |
| 87 | # build anything which is built only once on a dual-arch build. |
| 88 | # |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 89 | AM_FLAG_M3264_PRI = $(AM_FLAG_M3264_@VGCONF_PLATFORM_PRI_CAPS@) |
| 90 | AM_CPPFLAGS_PRI = $(AM_CPPFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) |
| 91 | AM_CFLAGS_PRI = $(AM_CFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) |
| 92 | AM_CCASFLAGS_PRI = $(AM_CCASFLAGS_@VGCONF_PLATFORM_PRI_CAPS@) |
sewardj | 1eff82b | 2006-10-17 00:56:43 +0000 | [diff] [blame] | 93 | |
njn | 7fd6d38 | 2009-01-22 21:56:32 +0000 | [diff] [blame] | 94 | if VGCONF_HAVE_PLATFORM_SEC_CAPS |
| 95 | AM_FLAG_M3264_SEC = $(AM_FLAG_M3264_@VGCONF_PLATFORM_SEC_CAPS@) |
sewardj | 1eff82b | 2006-10-17 00:56:43 +0000 | [diff] [blame] | 96 | else |
| 97 | AM_FLAG_M3264_SEC = |
| 98 | endif |
| 99 | |
| 100 | |
| 101 | # Baseline link flags for making dynamic shared objects. |
| 102 | # |
bart | 44ceea2 | 2008-04-16 18:19:45 +0000 | [diff] [blame] | 103 | PRELOAD_LDFLAGS_COMMON_LINUX = -nodefaultlibs -shared -Wl,-z,interpose,-z,initfirst |
| 104 | PRELOAD_LDFLAGS_COMMON_AIX5 = -nodefaultlibs -shared -Wl,-G -Wl,-bnogc |
sewardj | 1eff82b | 2006-10-17 00:56:43 +0000 | [diff] [blame] | 105 | PRELOAD_LDFLAGS_X86_LINUX = $(PRELOAD_LDFLAGS_COMMON_LINUX) @FLAG_M32@ |
| 106 | PRELOAD_LDFLAGS_AMD64_LINUX = $(PRELOAD_LDFLAGS_COMMON_LINUX) @FLAG_M64@ |
| 107 | PRELOAD_LDFLAGS_PPC32_LINUX = $(PRELOAD_LDFLAGS_COMMON_LINUX) @FLAG_M32@ |
| 108 | PRELOAD_LDFLAGS_PPC64_LINUX = $(PRELOAD_LDFLAGS_COMMON_LINUX) @FLAG_M64@ |
| 109 | PRELOAD_LDFLAGS_PPC32_AIX5 = $(PRELOAD_LDFLAGS_COMMON_AIX5) @FLAG_MAIX32@ |
| 110 | PRELOAD_LDFLAGS_PPC64_AIX5 = $(PRELOAD_LDFLAGS_COMMON_AIX5) @FLAG_MAIX64@ |