View previous topic :: View next topic |
Author |
Message |
mike155 Advocate
Joined: 17 Sep 2010 Posts: 4438 Location: Frankfurt, Germany
|
Posted: Mon Sep 05, 2011 6:39 pm Post subject: [Solved] Firefox and Thunderbird won't run (-march=native) |
|
|
I have a strange problem on my new amd64 / Sandy Bridge / gcc 4.5.3 notebook.
When I emerge Firefox 3.6.20 and Thunderbird 3.1.12 with
Code: | CFLAGS="-march=native -O2 -pipe"
emerge --oneshot xulrunner firefox thunderbird |
nothing happens when I start Thunderbird or Firefox: no windows appear and
no error message is displayed or written to any log file. After a few seconds
Firefox returns with ERC 1.
When I emerge the ebuilds with
Code: | CFLAGS="-O2 -pipe"
emerge --oneshot xulrunner firefox thunderbird |
Thunderbird and Firefox work as expected.
Am I the only one who experiences this?
Regards
Michael
Last edited by mike155 on Wed Sep 07, 2011 11:22 pm; edited 1 time in total |
|
Back to top |
|
|
DONAHUE Watchman
Joined: 09 Dec 2006 Posts: 7651 Location: Goose Creek SC
|
Posted: Mon Sep 05, 2011 7:09 pm Post subject: |
|
|
http://www.gentoo.org/doc/en/gcc-optimization.xml suggests cflags should == cxxflags and that they should be specified in /etc/make.conf for emerge from portage packages lest trouble ensue. Looks like trouble has indeed ensued. _________________ Defund the FCC. |
|
Back to top |
|
|
mike155 Advocate
Joined: 17 Sep 2010 Posts: 4438 Location: Frankfurt, Germany
|
Posted: Mon Sep 05, 2011 8:25 pm Post subject: |
|
|
well, of course, I set my CFLAGS in /etc/make.conf.
Here is the contents of /etc/make.conf:
Code: | # Please consult /etc/make.conf.example for a more detailed example
#CFLAGS="-O2 -pipe"
CFLAGS="-march=native -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CXXFLAGS="${CFLAGS}"
SYNC="rsync://88.198.224.205/gentoo-portage"
GENTOO_MIRRORS="ftp://ftp.tu-clausthal.de/pub/linux/gentoo/ http://ftp.uni-erlangen.de/pub/mirrors/gentoo http://ftp-stud.fht-esslingen.de/pub/Mirrors/gentoo/"
MAKEOPTS="-j4"
ACCEPT_LICENSE="*"
USE="mmx mmxext sse sse2 sse3 ssse3 sse4 sse4_1 smp openmp
unicode enca nptl nptlonly mmap fftw
nls nfs nfsv4 nis pam acl ssl X509 fortran java java6 perl python berkdb cairo pdf svg ncurses imlib maildir truetype spell xml fftw
zip zlib lzo bzip2 lzma uuencode git
acpi usb lm_sensors udev dvd dvdr cdio scanner dri rtc obex bluetooth irda
X xorg dbus opengl qt4 qt3support kde semantic-desktop gnome gtk motif vaapi
alsa midi gstreamer encode ogg vorbis flac mp3 mad sdl speex aac lame wma a52 dts
v4l v4l2 mpeg theora quicktime ffmpeg mng wma mplayer xine wav wavpack srt dirac schroedinger xvid amr x264
png gif tiff jpeg jpeg2k mjpeg exif xmp kipi lensfun lcms
cups gnutls foomaticdb ppds gimp css
apache2 gpm postgres subversion emacs tidy latex kpathsea spell firefox nsplugin xulrunner webkit xv
cli gd sql mysql sockets vhosts consolekit policykit
-oss -esd -ldap -apm -ipv6 -imap -kerberos -R -gfortran -gcj -dso
-akonadi"
LINGUAS="de en"
INPUT_DEVICES="evdev"
VIDEO_CARDS="intel v4l"
ALSA_CARDS="hda-intel usb-audio"
CAMERAS="canon ptp2"
APACHE2_MODULES="(deleted)"
QEMU_SOFTMMU_TARGETS="x86 x86_64"
QEMU_USER_TARGETS="x86 x86_64"
source /var/lib/layman/make.conf
|
|
|
Back to top |
|
|
DirtyHairy l33t
Joined: 03 Jul 2006 Posts: 608 Location: Würzburg, Deutschland
|
Posted: Tue Sep 06, 2011 9:19 am Post subject: |
|
|
I have the same issue on a core-i7, thunderbird doesn't start, and firefox is unstable. Remerging thunderbird, firefox and xulrunner with -march downgraded to core2 fixes the issue. I have opened a bug https://bugs.gentoo.org/show_bug.cgi?id=382023 |
|
Back to top |
|
|
mark_alec Bodhisattva
Joined: 11 Sep 2004 Posts: 6066 Location: Melbourne, Australia
|
Posted: Tue Sep 06, 2011 9:28 am Post subject: |
|
|
I'll note that -march=native works fine for firefox and thunderbird here on a Sandybridge i3 with GCC 4.5.3. _________________ www.gentoo.org.au || #gentoo-au |
|
Back to top |
|
|
depontius Advocate
Joined: 05 May 2004 Posts: 3509
|
Posted: Tue Sep 06, 2011 12:27 pm Post subject: |
|
|
I'm running stable gcc-4.4.5 on a Core-I7. From what I've read, that level of gcc does not yet support "-march=native" for Core-I7, because the processor is effectively newer than the gcc. If you run "-march=native" you'll get something, but not necessarily what you want. After some searching and reading, I'm running "-march=core2 -mtune=generic". I'm not sure what level of gcc picks up support for Core-I7, nor Sandy Bridge, for that matter, though the latter will obviously be later yet.
EDIT - I did a little more searching, and the gcc patch to add native support for at least Core-I7 was checked in during Oct, 2010. It also appears that this patch is in gcc-4.6.*, but I have no idea of its status wrt gcc-4.5.*. _________________ .sigs waste space and bandwidth |
|
Back to top |
|
|
DirtyHairy l33t
Joined: 03 Jul 2006 Posts: 608 Location: Würzburg, Deutschland
|
Posted: Tue Sep 06, 2011 2:55 pm Post subject: |
|
|
From the gcc info page:
Code: | This selects the CPU to tune for at compilation time by
determining the processor type of the compiling machine.
Using `-mtune=native' will produce code optimized for the
local machine under the constraints of the selected
instruction set. Using `-march=native' will enable all
instruction subsets supported by the local machine (hence the
result might not run on different machines). |
To me, this means -march=native tries to detect the extensions supported by the processor and generate appropiate code. When spying on gcc what flags are actually activated by -march=native, I find on my machine Code: | -march=core2 -mcx16 -msahf -maes -mpclmul -mpopcnt -mavx --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=256 -mtune=core2 | which looks quite sensible to me |
|
Back to top |
|
|
depontius Advocate
Joined: 05 May 2004 Posts: 3509
|
Posted: Tue Sep 06, 2011 4:10 pm Post subject: |
|
|
My interpretation has always been that there's a lookup table inside gcc that maps the cpuid to its valid options. No cpuid, no options map.
However you bring up a good point wrt to checking. Going through your list "grep <item> /proc/cpuinfo" I find that on my Core-I7 I have cx16 and popcnt,
and am missing sahf, aes, pclmul, and avx. I remember that there's a flag to dump all of the settings being used, but don't remember what it is. _________________ .sigs waste space and bandwidth |
|
Back to top |
|
|
mike155 Advocate
Joined: 17 Sep 2010 Posts: 4438 Location: Frankfurt, Germany
|
Posted: Tue Sep 06, 2011 5:45 pm Post subject: |
|
|
DirtyHairy, it's a good idea to check how gcc interprets -march=native.
I have two Gentoo amd64 servers with gcc 4.5.3.
The first one has an Intel Core i5 CPU 660. Thunderbird and Firefox work perfectly fine
when emerged with CFLAGS="-march=native -O2 -pipe". -march=native results in:
Code: | -march=core2 -mcx16 -msahf -maes -mpclmul -mpopcnt -msse4.2
--param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=4096
-mtune=core2 |
The second one has an Intel Core i5-2410M CPU. Thunderbird and Firefox don't run
when emerged with CFLAGS="-march=native -O2 -pipe". -march=native results in:
Code: | -march=core2 -mcx16 -msahf -maes -mpclmul -mpopcnt -mavx
--param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=3072
-mtune=generic |
Maybe it's "-mavx" which causes trouble? I'll try to find out...
Last edited by mike155 on Tue Sep 06, 2011 10:19 pm; edited 1 time in total |
|
Back to top |
|
|
Aquous l33t
Joined: 08 Jan 2011 Posts: 700
|
Posted: Tue Sep 06, 2011 8:15 pm Post subject: |
|
|
Firefox and Thunderbird do not yet work with AVX - add -mno-avx to {C,XX}FLAGS |
|
Back to top |
|
|
mike155 Advocate
Joined: 17 Sep 2010 Posts: 4438 Location: Frankfurt, Germany
|
Posted: Tue Sep 06, 2011 10:10 pm Post subject: |
|
|
Aquous wrote: | Firefox and Thunderbird do not yet work with AVX - add -mno-avx to {C,XX}FLAGS |
I can confirm this. Firefox and Thunderbird work as expected on my Sandy Bridge CPU if emerged with
Code: | CFLAGS="-march=native -mno-avx -O2 -pipe" |
and they don't work if emerged with
Code: | CFLAGS="-march=native -O2 -pipe" |
This problem was also reported here: https://forums.gentoo.org/viewtopic-p-6659793.html#6659793 (item 3)
So the solution for my Sandy Bridge system (amd64, gcc 4.5.3) is:
1) Set CFLAGS in /etc/make.conf to
Code: | CFLAGS="-march=native -O2 -pipe" |
2) Write
Code: | CFLAGS="-march=native -mno-avx -O2 -pipe"
CXXFLAGS="${CFLAGS}" |
to the files
Code: | /etc/portage/env/net-libs/xulrunner
/etc/portage/env/www-client/firefox
/etc/portage/env/mail-client/thunderbird |
3) Re-emerge Firefox and Thunderbird:
Code: | emerge --oneshot xulrunner firefox thunderbird |
|
|
Back to top |
|
|
overkll Veteran
Joined: 21 Sep 2004 Posts: 1249 Location: Austin, Texas
|
Posted: Wed Sep 07, 2011 1:42 am Post subject: |
|
|
Funny, I was just testing yesterday what "native" would output for gcc on my Phenom II hex core. I didn't see the command on this post so here it is. Just run it from a terminal.
Code: | echo "" | gcc -march=native -v -E - 2>&1 | grep cc1 |
Cheers! |
|
Back to top |
|
|
depontius Advocate
Joined: 05 May 2004 Posts: 3509
|
Posted: Wed Sep 07, 2011 12:34 pm Post subject: |
|
|
Interesting... The machine I'm using now is multi-boot Core I7 quad ThinkPad, with RedHat 6.1, Gentoo, and Fedora Core 14 installed. In order to get the day job done, I'm generally booted to RedHat 6.1, and usually have Gentoo running in a chroot.
So for RedHat 6.1
Code: | /usr/libexec/gcc/x86_64-redhat-linux/4.4.5/cc1 -E -quiet -v -
-march=core2 -mcx16 -msahf -mpopcnt -msse4.2
--param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=6144
-mtune=core2 |
And for Fedora Core 14
Code: | /usr/libexec/gcc/x86_64-redhat-linux/4.5.1/cc1 -E -quiet -v -
-march=core2 -mcx16 -msahf -mpopcnt -msse4.2
--param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=6144
-mtune=core2 |
And for Gentoo
Code: | /usr/libexec/gcc/x86_64-pc-linux-gnu/4.4.5/cc1 -E -quiet -v -
-D_FORTIFY_SOURCE=2
-march=core2 -mcx16 -msahf -mpopcnt -msse4.2
--param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=256
-mtune=core2 |
It looks as if Gentoo stable and RH6.1 are both at the same level of gcc, but Gentoo has the extra "D_FORTIFY_SOURCE=2" flag. The other significant difference is that the RedHat products have set the L2 cache size differently from Gentoo. Neither gcc-4.4.5 nor gcc-4.5.1 recognizes the Core-I7, both choosing to recognize it as a Core2. _________________ .sigs waste space and bandwidth |
|
Back to top |
|
|
mike155 Advocate
Joined: 17 Sep 2010 Posts: 4438 Location: Frankfurt, Germany
|
|
Back to top |
|
|
wcg Guru
Joined: 06 Jan 2009 Posts: 588
|
Posted: Fri Sep 09, 2011 5:53 am Post subject: |
|
|
Just to clear up a minor confusion:
Quote: |
So the solution for my Sandy Bridge system (amd64, gcc 4.5.3) is:
|
Sandy Bridge is an Intel motherboard chipset. I would not expect it
to support AMD cpus. So that would be "x86_64" rather than
"amd64", right?
(In /etc/make.conf, CHOST would still be x86_64-pc-linux-gnu for
either 64-bit Intel Core* or Amd64 cpus.) _________________ TIA |
|
Back to top |
|
|
Aquous l33t
Joined: 08 Jan 2011 Posts: 700
|
Posted: Fri Sep 09, 2011 12:22 pm Post subject: |
|
|
wcg wrote: | Just to clear up a minor confusion:
Quote: |
So the solution for my Sandy Bridge system (amd64, gcc 4.5.3) is:
|
Sandy Bridge is an Intel motherboard chipset. I would not expect it
to support AMD cpus. So that would be "x86_64" rather than
"amd64", right?
(In /etc/make.conf, CHOST would still be x86_64-pc-linux-gnu for
either 64-bit Intel Core* or Amd64 cpus.) |
amd64 == x86_64 |
|
Back to top |
|
|
golagoda Tux's lil' helper
Joined: 18 Jun 2011 Posts: 105 Location: Australia
|
Posted: Fri Sep 09, 2011 12:29 pm Post subject: |
|
|
wcg wrote: | Just to clear up a minor confusion:
Quote: |
So the solution for my Sandy Bridge system (amd64, gcc 4.5.3) is:
|
Sandy Bridge is an Intel motherboard chipset. I would not expect it
to support AMD cpus. So that would be "x86_64" rather than
"amd64", right?
(In /etc/make.conf, CHOST would still be x86_64-pc-linux-gnu for
either 64-bit Intel Core* or Amd64 cpus.) |
http://en.wikipedia.org/wiki/X86-64 |
|
Back to top |
|
|
mike155 Advocate
Joined: 17 Sep 2010 Posts: 4438 Location: Frankfurt, Germany
|
Posted: Fri Sep 09, 2011 2:42 pm Post subject: |
|
|
Quote: | Sandy Bridge is an Intel motherboard chipset. I would not expect it
to support AMD cpus. So that would be "x86_64" rather than "amd64", right? |
Well, look here: http://packages.gentoo.org. We have Gentoo "amd64" and Gentoo "x86".
I was referring to the 64-bit OS Gentoo "amd64" - which runs on an Intel Sandy Bridge
processor. |
|
Back to top |
|
|
|