Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 414641 - flag-o-matic: strip-flags removes everything also from non-C[XX]FLAGS vars
Summary: flag-o-matic: strip-flags removes everything also from non-C[XX]FLAGS vars
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-04 20:23 UTC by Fabian Groffen
Modified: 2012-06-18 06:45 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Fabian Groffen gentoo-dev 2012-05-04 20:23:48 UTC
# @FUNCTION: strip-flags
# @DESCRIPTION:
# Strip C[XX]FLAGS of everything except known good/safe flags.

however, it's implementation:

    for var in $(all-flag-vars) ; do

where all-flag-vars() returns amongst others LDFLAGS.

I need my -L and -R/-Wl,-rpath directions to get a non-crashing binutils during Prefix bootstrap, so please either:

a) update desc for strip-flags, and add -L/-R/-Wl,-rpath, to allowed flags, or
b) restrict strip-flags to only C[XX]FLAGS, as per description, or
c) suggest a backdoor which I can use to get binutils linked against the correct libraries
Comment 1 SpanKY gentoo-dev 2012-05-04 22:02:04 UTC
yes, the documentation needs updating, but the underlying change was on purpose

allowing those linker flags should be fine
Comment 2 Fabian Groffen gentoo-dev 2012-05-05 08:38:29 UTC
how about something like this?

Index: flag-o-matic.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/flag-o-matic.eclass,v
retrieving revision 1.169
diff -u -r1.169 flag-o-matic.eclass
--- flag-o-matic.eclass 26 Feb 2012 12:09:44 -0000      1.169
+++ flag-o-matic.eclass 5 May 2012 08:37:49 -0000
@@ -20,7 +20,7 @@
        echo {C,CPP,CXX,CCAS,F,FC,LD}FLAGS
 }
 
-# {C,CXX,F,FC}FLAGS that we allow in strip-flags
+# {C,CPP,CXX,CCAS,F,FC,LD}FLAGS that we allow in strip-flags
 # Note: shell globs and character lists are allowed
 setup-allowed-flags() {
        ALLOWED_FLAGS="-pipe"
@@ -52,6 +52,9 @@
        # 4.6
        ALLOWED_FLAGS+=" -mno-fsgsbase -mno-rdrnd -mno-f16c -mno-bmi -mno-tbm"
 
+       # LDFLAGS
+       ALLOWED_FLAGS+=" -L* -R* -Wl,*"
+
        export ALLOWED_FLAGS
        return 0
 }
@@ -311,7 +314,8 @@
 
 # @FUNCTION: strip-flags
 # @DESCRIPTION:
-# Strip C[XX]FLAGS of everything except known good/safe flags.
+# Strip *FLAGS of everything except known good/safe flags.  This runs over all
+# flags returned by all_flag_vars().
 strip-flags() {
        local x y var
 


Should things like -Wa,* be also allowed?
Comment 3 Fabian Groffen gentoo-dev 2012-06-05 18:32:41 UTC
ping
Comment 4 SpanKY gentoo-dev 2012-06-17 21:39:33 UTC
(In reply to comment #2)

LGTM
Comment 5 Fabian Groffen gentoo-dev 2012-06-18 06:45:38 UTC
thanks, comitted