Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 259563 Details for
Bug 351384
sys-devel/gcc-config should not enforce CFLAGS_${ABI}
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
wrapper-1.5.1-no-ABI.patch
wrapper-1.5.1-no-ABI.patch (text/plain), 2.83 KB, created by
Nathan Phillip Brink (binki) (RETIRED)
on 2011-01-11 19:31:57 UTC
(
hide
)
Description:
wrapper-1.5.1-no-ABI.patch
Filename:
MIME Type:
Creator:
Nathan Phillip Brink (binki) (RETIRED)
Created:
2011-01-11 19:31:57 UTC
Size:
2.83 KB
patch
obsolete
>Author: Nathan Phillip Brink <ohnobinki@ohnopublishing.net> >Purpose: To stop gcc-config from adding on to gcc's commandline to > enforce that the environment variable ${CFLAGS_${ABI}} is > respected by GCC. This causes problems and makes debugging > compilation failures harder. See > https://bugs.gentoo.org/351384 . > >--- a/wrapper.c Tue Jan 11 13:27:08 2011 -0500 >+++ b/wrapper.c Tue Jan 11 14:14:39 2011 -0500 >@@ -62,7 +62,6 @@ > return ret; \ > } > xmemwrap(malloc, (size_t size), (size)) >-xmemwrap(calloc, (size_t nemb, size_t size), (nemb, size)) > xmemwrap(strdup, (const char *s), (s)) > > /* check_for_target checks in path for the file we are seeking >@@ -270,49 +270,6 @@ > putenv(newpath); > } > >-static char *abi_flags[] = { >- "-m32", "-m64", "-mabi", >-}; >-static char **build_new_argv(char **argv, const char *newflags_str) >-{ >-#define MAX_NEWFLAGS 32 >- char *newflags[MAX_NEWFLAGS]; >- char **retargv; >- unsigned int argc, i; >- char *state, *flags_tokenized; >- >- retargv = argv; >- >- /* make sure user hasn't specified any ABI flags already ... >- * if they have, lets just get out of here ... this of course >- * is by no means complete, it's merely a hack that works most >- * of the time ... >- */ >- for (argc = 0; argv[argc]; ++argc) >- for (i = 0; i < ARRAY_SIZE(abi_flags); ++i) >- if (!strncmp(argv[argc], abi_flags[i], strlen(abi_flags[i]))) >- return retargv; >- >- /* Tokenize the flag list and put it into newflags array */ >- flags_tokenized = xstrdup(newflags_str); >- i = 0; >- newflags[i] = strtok_r(flags_tokenized, " \t\n", &state); >- while (newflags[i] != NULL && i < MAX_NEWFLAGS-1) >- newflags[++i] = strtok_r(NULL, " \t\n", &state); >- >- /* allocate memory for our spiffy new argv */ >- retargv = xcalloc(argc + i + 1, sizeof(char*)); >- /* start building retargv */ >- retargv[0] = argv[0]; >- /* insert the ABI flags first so cmdline always overrides ABI flags */ >- memcpy(retargv+1, newflags, i * sizeof(char*)); >- /* copy over the old argv */ >- if (argc > 1) >- memcpy(retargv+1+i, argv+1, (argc-1) * sizeof(char*)); >- >- return retargv; >-} >- > int main(int argc, char *argv[]) > { > struct wrapper_data data; >@@ -347,23 +304,8 @@ > */ > argv[0] = data.bin; > >- /* If $ABI is in env, add appropriate env flags */ >- char **newargv = argv; >- if (getenv("ABI")) { >- char envvar[50]; >- >- /* We use CFLAGS_${ABI} for gcc, g++, g77, etc as the flags that would >- * be in there are the same no matter which compiler we are using. >- */ >- snprintf(envvar, sizeof(envvar), "CFLAGS_%s", getenv("ABI")); >- envvar[sizeof(envvar)-1] = '\0'; >- >- if (getenv(envvar)) >- newargv = build_new_argv(argv, getenv(envvar)); >- } >- >- /* Ok, lets do it one more time ... */ >- execv(data.bin, newargv); >+ /* Ok, let's do it one more time ... */ >+ execv(data.bin, argv); > > /* shouldn't have made it here if things worked ... */ > wrapper_err("could not run/locate '%s'", data.name);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 351384
: 259563