View previous topic :: View next topic |
Author |
Message |
shaumux Veteran
Joined: 13 May 2005 Posts: 1009 Location: Hong Kong
|
Posted: Fri Feb 20, 2009 5:12 am Post subject: Forcing CFLAGS? |
|
|
How do i force a particualr cflag from being filtered out universally?
Actually I enabled sse4.1 using -msse4.2 but it gets filtered out in some packages with other CFLAGS but its not a random cflag it just enables an instruction set?
So is there any way i can force -msse4.1 fro not being filetred out by portage? |
|
Back to top |
|
|
disi Veteran
Joined: 28 Nov 2003 Posts: 1354 Location: Out There ...
|
Posted: Fri Feb 20, 2009 7:12 am Post subject: |
|
|
Some ebuilds (e.g. grub) offer the use flag "custom-cflags" to use the one from your make.conf. (of course this disabled any warrenty that it works afterwards ) |
|
Back to top |
|
|
shaumux Veteran
Joined: 13 May 2005 Posts: 1009 Location: Hong Kong
|
Posted: Fri Feb 20, 2009 7:22 am Post subject: |
|
|
Yeah but thats not what i want, i just want a specific one to be not filtered out others are fine.
march=core2 includes only upto ssse3 but not 4.1 so i have to explictly enable it.
Is there any way to do that? |
|
Back to top |
|
|
desultory Bodhisattva
Joined: 04 Nov 2005 Posts: 9410
|
Posted: Fri Feb 20, 2009 7:28 am Post subject: |
|
|
Not easily. |
|
Back to top |
|
|
shaumux Veteran
Joined: 13 May 2005 Posts: 1009 Location: Hong Kong
|
Posted: Fri Feb 20, 2009 8:15 am Post subject: |
|
|
Ok,
how about the difficult way? |
|
Back to top |
|
|
krinn Watchman
Joined: 02 May 2003 Posts: 7470
|
Posted: Fri Feb 20, 2009 10:28 am Post subject: |
|
|
i think you took the problem from end, not from start.
you shoudn't ask how to enable that cflag, but why this cflag is filtered ?
It may cause some unwanted behavior to the program if you enable it or it hasn't been test with it.
you still have the possibility anyway to report a bug for any application where sse4 is disabled, requesting why and if it could be made enable again. (i suppose it could be that, the difficult way) |
|
Back to top |
|
|
shaumux Veteran
Joined: 13 May 2005 Posts: 1009 Location: Hong Kong
|
Posted: Fri Feb 20, 2009 6:59 pm Post subject: |
|
|
krinn wrote: | i think you took the problem from end, not from start.
you shoudn't ask how to enable that cflag, but why this cflag is filtered ?
It may cause some unwanted behavior to the program if you enable it or it hasn't been test with it.
you still have the possibility anyway to report a bug for any application where sse4 is disabled, requesting why and if it could be made enable again. (i suppose it could be that, the difficult way) | Umm I thoght that when filtering it filters any addtional cflags excepts the march.
Isn' that how it works? |
|
Back to top |
|
|
i92guboj Bodhisattva
Joined: 30 Nov 2004 Posts: 10315 Location: Córdoba (Spain)
|
Posted: Fri Feb 20, 2009 7:37 pm Post subject: |
|
|
shaumux wrote: | krinn wrote: | i think you took the problem from end, not from start.
you shoudn't ask how to enable that cflag, but why this cflag is filtered ?
It may cause some unwanted behavior to the program if you enable it or it hasn't been test with it.
you still have the possibility anyway to report a bug for any application where sse4 is disabled, requesting why and if it could be made enable again. (i suppose it could
Quote: |
be that, the difficult way) | Umm I thoght that when filtering it filters any addtional cflags excepts the march.
Isn' that how it works? |
|
I am not too smart about ebuilding, but as far as I know this functionality is provided via the flag-o-matic eclass, and the filter-flags function, to put just an example, filters only concrete flags and requires exact match.
So, in conclusion, if a flag is filtered we must assume it's for a very good reason. If it isn't so, file a bug. |
|
Back to top |
|
|
shaumux Veteran
Joined: 13 May 2005 Posts: 1009 Location: Hong Kong
|
Posted: Fri Feb 20, 2009 7:42 pm Post subject: |
|
|
The cflag iwnt is -msse4.1 which enabled the sse 4.1 instruction set.
Now if this were a part of the -march>core2(probably would bge in the future) then it wouldn't be filtered out.
Am i right?
If so then i can't se any reason to filter out this instriuction
Or does the filter eve filter out flags from within -march and -O? |
|
Back to top |
|
|
i92guboj Bodhisattva
Joined: 30 Nov 2004 Posts: 10315 Location: Córdoba (Spain)
|
Posted: Fri Feb 20, 2009 7:51 pm Post subject: |
|
|
shaumux wrote: | The cflag iwnt is -msse4.1 which enabled the sse 4.1 instruction set.
Now if this were a part of the -march>core2(probably would bge in the future) then it wouldn't be filtered out.
|
I don't know what your concrete problem is. If you enable it it MUST work unless the concrete ebuild you are using filters it out. I just change my cflags and started to compile grub to test (this is -march=athlon64, only sse3) and it started compiling with -msse4 without a problem. So I still don't get your point.
Code: |
x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I.. -I../stage1 -Wall -Wmissing-prototypes -Wunused -Wshadow -Wpointer-arith -falign-jumps=1 -falign-loops=1 -falign-functions=1 -Wundef -fno-builtin -nostdinc -DSUPPORT_SERIAL=1 -DSUPPORT_HERCULES=1 -DSUPPORT_GRAPHICS=1 -DFSYS_EXT2FS=1 -DFSYS_FAT=1 -DFSYS_FFS=1 -DFSYS_UFS2=1 -DFSYS_MINIX=1 -DFSYS_REISERFS=1 -DFSYS_VSTAFS=1 -DFSYS_JFS=1 -DFSYS_XFS=1 -DFSYS_ISO9660=1 -DUSE_MD5_PASSWORDS=1 -m32 -O2 -march=athlon64 -pipe -msse3 -msse4 -MT pre_stage2_exec-common.o -MD -MP -MF .deps/pre_stage2_exec-common.Tpo -c -o pre_stage2_exec-common.o `test -f 'common.c' || echo './'`common.c
|
Quote: | Or does the filter eve filter out flags from within -march and -O? |
The filter filters whatever you specify in the ebuild, and nothing else.
shaumux wrote: | (probably would bge in the future) |
I doubt it, since not all core2 support sse4. It's possible that there'll be a core2-sse4 just like there's an athlon64-sse3 though.
EDIT: What is the offending ebuild and what makes you think that -msse4 is not enabled when compiling it? |
|
Back to top |
|
|
shaumux Veteran
Joined: 13 May 2005 Posts: 1009 Location: Hong Kong
|
Posted: Fri Feb 20, 2009 7:58 pm Post subject: |
|
|
Code: | genlop -i xulrunner
* net-libs/xulrunner
Total builds: 5
Global build time: 2 hours, 28 minutes and 55 seconds.
Average merge time: 29 minutes and 47 seconds.
Info about currently installed ebuild:
* net-libs/xulrunner-1.9.0.6-r1
Install date: Sat Feb 7 00:00:52 2009
USE=""
CFLAGS="-march=core2 -pipe -fPIC -Wno-return-type -w" |
Code: | genlop -i mozilla-firefox
* www-client/mozilla-firefox
Total builds: 4
Global build time: 49 minutes and 1 second.
Average merge time: 12 minutes and 15 seconds.
Info about currently installed ebuild:
* www-client/mozilla-firefox-3.0.6
Install date: Thu Feb 5 03:24:18 2009
USE="java -mozdevelop -bindist -restrict-javascript -iceweasel -+xulrunner"
CFLAGS="-march=core2 -pipe -fPIC -Wno-return-type -w" |
|
|
Back to top |
|
|
i92guboj Bodhisattva
Joined: 30 Nov 2004 Posts: 10315 Location: Córdoba (Spain)
|
Posted: Fri Feb 20, 2009 8:15 pm Post subject: |
|
|
There's no reference to "sse4" in either the xulrunner or firefox ebuilds, neither in the eclasses. This reports nothing:
Code: | grep -R sse4 /usr/portage/{eclass,www-client/mozilla-firefox,net-libs/xulrunner} |
So I can't see how it would be filtered at all. I am guessing that either there's something wrong with genlop or any other strange thing is happening. I'd suggest making sure that CFLAGS are set ok, then start emerging firefox, and look at the CFLAGS directly in the output.
EDITED: By the way, you can also try about:buildconfig in the firefox url bar. |
|
Back to top |
|
|
shaumux Veteran
Joined: 13 May 2005 Posts: 1009 Location: Hong Kong
|
Posted: Fri Feb 20, 2009 8:31 pm Post subject: |
|
|
No the build doesn't show sse 4 either
Code: | x86_64-pc-linux-gnu-gcc -o host_nsinstall.o -c -march=core2 -pipe -fPIC -Wno-return-type -w -DXP_UNIX -O3 -I. -I. -I../dist/include -I/usr/lib64/xulrunner-1.9/include -I../dist/include -I/usr/include/nspr -I/usr/lib64/xulrunner-1.9/sdk/include -I/usr/include/nspr nsinstall.c |
Neither does about:buildconfig |
|
Back to top |
|
|
mv Watchman
Joined: 20 Apr 2005 Posts: 6747
|
Posted: Fri Feb 20, 2009 8:57 pm Post subject: |
|
|
Ebuilds of CFLAGS-sensible packages like xulrunner often use strip-flags which removes all CFLAGS except for those which are known to be good. |
|
Back to top |
|
|
shaumux Veteran
Joined: 13 May 2005 Posts: 1009 Location: Hong Kong
|
Posted: Fri Feb 20, 2009 9:10 pm Post subject: |
|
|
mv wrote: | Ebuilds of CFLAGS-sensible packages like xulrunner often use strip-flags which removes all CFLAGS except for those which are known to be good. | So i can't do anything till gcc introduces some march that includes sse4? |
|
Back to top |
|
|
i92guboj Bodhisattva
Joined: 30 Nov 2004 Posts: 10315 Location: Córdoba (Spain)
|
Posted: Fri Feb 20, 2009 9:53 pm Post subject: |
|
|
mv wrote: | Ebuilds of CFLAGS-sensible packages like xulrunner often use strip-flags which removes all CFLAGS except for those which are known to be good. |
That explains it. Thanks.
shaumux wrote: | mv wrote: | Ebuilds of CFLAGS-sensible packages like xulrunner often use strip-flags which removes all CFLAGS except for those which are known to be good. | So i can't do anything till gcc introduces some march that includes sse4? |
Well, you could copy the ebuilds to an overlay, but since this seems to be done at eclass level you would also need to overlay the relevant eclass(es) and then remove the filtering or tune it down a bit. |
|
Back to top |
|
|
shaumux Veteran
Joined: 13 May 2005 Posts: 1009 Location: Hong Kong
|
Posted: Fri Feb 20, 2009 9:57 pm Post subject: |
|
|
Should i file a bug asking to add the instruction-set flag to the deemed safe flag since it only enables an instruction set? |
|
Back to top |
|
|
Genone Retired Dev
Joined: 14 Mar 2003 Posts: 9532 Location: beyond the rim
|
Posted: Sat Feb 21, 2009 10:27 pm Post subject: |
|
|
shaumux wrote: | Should i file a bug asking to add the instruction-set flag to the deemed safe flag since it only enables an instruction set? |
Probably not that useful seeing the comment in the eclass:
mozilla.eclass wrote: | # Strip over-aggressive CFLAGS - Mozilla supplies its own
# fine-tuned CFLAGS and shouldn't be interfered with.. |
Also note that "just enabling an instruction set" alone isn't a good justification to enable a flag as the relevant parts of the compiler can still produce broken code (esp. if the flag is relatively new), e.g. for certain versions of gcc-3 the -msse2 flag is filtered for that reason. |
|
Back to top |
|
|
|