summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony G. Basile <blueness@gentoo.org>2014-12-09 13:28:56 -0500
committerAnthony G. Basile <blueness@gentoo.org>2014-12-09 13:28:56 -0500
commit4c522eb524b1b4ff954227d8633a161883c69b84 (patch)
treee60e4616e60a825ae8f3fc27a7b8a4ee0a66a344 /sys-devel/gcc/files/gcc-spec-env.patch
parentsys-apps/getent: moved to tree (diff)
downloadblueness-4c522eb524b1b4ff954227d8633a161883c69b84.tar.gz
blueness-4c522eb524b1b4ff954227d8633a161883c69b84.tar.bz2
blueness-4c522eb524b1b4ff954227d8633a161883c69b84.zip
sys-devel/gcc: import from tree
Package-Manager: portage-2.2.14 RepoMan-Options: --force Manifest-Sign-Key: 0xF52D4BBA
Diffstat (limited to 'sys-devel/gcc/files/gcc-spec-env.patch')
-rw-r--r--sys-devel/gcc/files/gcc-spec-env.patch42
1 files changed, 42 insertions, 0 deletions
diff --git a/sys-devel/gcc/files/gcc-spec-env.patch b/sys-devel/gcc/files/gcc-spec-env.patch
new file mode 100644
index 0000000..57e7567
--- /dev/null
+++ b/sys-devel/gcc/files/gcc-spec-env.patch
@@ -0,0 +1,42 @@
+ Add support for external spec file via the GCC_SPECS env var. This
+ allows us to easily control pie/ssp defaults with gcc-config profiles.
+
+ Original patch by Rob Holland
+ Extended to support multiple entries separated by ':' by Kevin F. Quinn
+ Modified to use getenv instead of poisoned GET_ENVIRONMENT by Ryan Hill
+
+--- gcc-4/gcc/gcc.c
++++ gcc-4/gcc/gcc.c
+@@ -6482,6 +6482,32 @@
+
+ /* Process any user specified specs in the order given on the command
+ line. */
++#if !(defined (__MSDOS__) || defined (OS2) || defined (VMS) || defined (WIN32))
++ /* Add specs listed in GCC_SPECS. Note; in the process of separating
++ * each spec listed, the string is overwritten at token boundaries
++ * (':') with '\0', an effect of strtok_r().
++ */
++ specs_file = getenv ("GCC_SPECS");
++ if (specs_file && (strlen(specs_file) > 0))
++ {
++ char *spec, *saveptr;
++ for (spec=strtok_r(specs_file,":",&saveptr);
++ spec!=NULL;
++ spec=strtok_r(NULL,":",&saveptr))
++ {
++ struct user_specs *user = (struct user_specs *)
++ xmalloc (sizeof (struct user_specs));
++
++ user->next = (struct user_specs *) 0;
++ user->filename = spec;
++ if (user_specs_tail)
++ user_specs_tail->next = user;
++ else
++ user_specs_head = user;
++ user_specs_tail = user;
++ }
++ }
++#endif
+ for (uptr = user_specs_head; uptr; uptr = uptr->next)
+ {
+ char *filename = find_a_file (&startfile_prefixes, uptr->filename,