Created
July 3, 2014 15:00
-
-
Save jperkin/e40dd387b531a2aedb89 to your computer and use it in GitHub Desktop.
gcc abi env var
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$NetBSD$ | |
--- gcc/common/config/i386/i386-common.c.orig 2011-12-22 14:39:35.000000000 +0000 | |
+++ gcc/common/config/i386/i386-common.c | |
@@ -160,6 +160,18 @@ ix86_handle_option (struct gcc_options * | |
{ | |
size_t code = decoded->opt_index; | |
int value = decoded->value; | |
+ const char *abi; | |
+ | |
+ /* ABI environment variable takes precedence. */ | |
+ if ((abi = getenv("ABI")) != NULL) { | |
+ if (strcmp(abi, "32") == 0 || strcmp(abi, "i86") == 0) { | |
+ opts->x_ix86_isa_flags &= ~OPTION_MASK_ISA_64BIT; | |
+ opts->x_ix86_isa_flags_explicit &= ~OPTION_MASK_ISA_64BIT; | |
+ } else if (strcmp(abi, "64") == 0 || strcmp(abi, "amd64") == 0) { | |
+ opts->x_ix86_isa_flags |= OPTION_MASK_ISA_64BIT; | |
+ opts->x_ix86_isa_flags_explicit |= OPTION_MASK_ISA_64BIT; | |
+ } | |
+ } | |
switch (code) | |
{ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment