Summary: | lang/gcc: gcc48 doesn't accept -march=nehalem | ||||||
---|---|---|---|---|---|---|---|
Product: | Ports & Packages | Reporter: | Ting-Wei Lan <lantw44> | ||||
Component: | Individual Port(s) | Assignee: | Gerald Pfeifer <gerald> | ||||
Status: | Closed FIXED | ||||||
Severity: | Affects Only Me | CC: | jkim | ||||
Priority: | --- | Keywords: | patch | ||||
Version: | Latest | ||||||
Hardware: | amd64 | ||||||
OS: | Any | ||||||
Attachments: |
|
Description
Ting-Wei Lan
2016-11-03 18:24:17 UTC
Created attachment 176595 [details]
Patch to treat nehalem as corei7
This patch is for lang/gcc.
Gerald, please take a look. FYI, the upstream replaced "corei7" with "nehalem" in 4.9: https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=206178 Later, they did this: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59601 https://gcc.gnu.org/viewcvs/gcc?view=revision&revision=206212 Basically, my patch is the smallest hack to accept "-march=nehalem" instead of back-porting everything. The patch works with ports using native FreeBSD gcc, but linux-* ports using CentOS gcc is still broken. CentOS 7 gcc, which is also gcc 4.8, doesn't know -march=nehalem, and CentOS 6 gcc know neither -march=nehalem nor -march=corei7. # make -C audio/linux-skype_oss_wrapper ===> Building for linux-skype_oss_wrapper-0.1.1 --- skype_oss --- --- libpulse.o --- --- skype_oss --- echo "#!/bin/sh" > skype_oss && echo "LD_LIBRARY_PATH=/compat/linux/lib/skype_oss_wrapper:\$LD_LIBRARY_PATH skype" >> skype_oss && chmod +x skype_oss --- libpulse.o --- /compat/linux/usr/bin/gcc -O2 -pipe -march=nehalem -fstack-protector -fno-strict-aliasing -m32 -fPIC -c libpulse.c -o libpulse.o libpulse.c:1: error: bad value (nehalem) for -march= switch libpulse.c:1: error: bad value (nehalem) for -mtune= switch *** [libpulse.o] Error code 1 (In reply to Ting-Wei Lan from comment #4) This is a separate issue, i.e., CFLAGS for FreeBSD/amd64 should never be used for Linux/i386. In other words, audio/linux-skype_oss_wrapper must be fixed. (In reply to Jung-uk Kim from comment #5) OK, I think your patch is good enough, and I will open another bug for the linux-* issue. I filed two bugs for Linux ports. Bug 214512 - audio/linux-skype_oss_wrapper Bug 214513 - devel/linux_libusb Thanks for your analysis, guys, and the suggested patch, Jung-uk! Instead of patching lang/gcc in this direction, I continued my efforts to finally upgrade lang/gcc to GCC 4.9 today which added support for -march=nehalem and others. Which is even nicer! :-) So, users of the canonical version of GCC in the Ports Collection will now be fine (and I don't think we should keep patching compilers three generations behind, so I suggest we leave lang/gcc48 as is). |