Gentoo Archives: gentoo-user

From: Volker Armin Hemmann <volkerarmin@××××××××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] CFLAGS problem
Date: Mon, 12 Mar 2012 22:09:22
Message-Id: 19317860.pGOyG9LUOh@localhost
In Reply to: [gentoo-user] CFLAGS problem by Alex Schuster
1 Am Montag, 12. März 2012, 12:32:01 schrieb Alex Schuster:
2 > Hi there!
3 >
4 > Recently, my sister could not log in to KDE after I had done some
5 > updates. X crashed when loggin into KDE. It turned out that
6 > x11-libs/qt-gui-4.7.4-r1 was the problem when compiled with explict
7 > CFLAGS, instead of just using -march=native.
8 >
9 > Her CPU is an AMD A6-3500 with three cores. As I have a PC that is a
10 > little faster, I thought I'd use my four cores in addition via distcc. My
11 > CPU is different, so using -march=native would be bad. I visited [*], and
12 > used this command to find out what -march=native does:
13 >
14 > leela # cc -march=native -E -v - </dev/null 2>&1 | grep cc1
15 > /usr/libexec/gcc/x86_64-pc-linux-gnu/4.5.3/cc1 -E -quiet -v -
16 > -D_FORTIFY_SOURCE=2 -march=amdfam10 -mcx16 -msahf -mpopcnt -mabm --param
17 > l1-cache-size=64 --param l1-cache-line-size=64 --param
18 > l2-cache-size=1024 -mtune=amdfam10
19 >
20 > So I defined these CFLAGS:
21 > CFLAGS="-pipe -march=amdfam10 -O2 -mcx16 -msahf -mpopcnt -mabm \
22 > --param l1-cache-size=64 --param l1-cache-line-size=64 \
23 > --param l2-cache-size=1024"
24 >
25 > The command above does not tell about SSE stuff, so I used this one to
26 > find out about that:
27 >
28 > leela # echo | gcc -dME - -march=native | grep -Ei 'SSE|3DNOW|MMX' | sort
29 > #define __3dNOW_A__ 1
30 > #define __3dNOW__ 1
31 > #define __MMX__ 1
32 > #define __SSE2_MATH__ 1
33 > #define __SSE2__ 1
34 > #define __SSE3__ 1
35 > #define __SSE4A__ 1
36 > #define __SSE_MATH__ 1
37 > #define __SSE__ 1
38 >
39 > And I added "-msse -msse2 -msse3 -msse4 -m3dnow -mmmx" to CFLAGS.
40 >
41 > Anything wrong with that? Because when I compile
42 > x11-libs/qt-gui-4.7.4-r1, using distcc with local and remote clients,
43 > X will crash when logging into KDE. gcc is at version 4.5.3 on both PCs.
44 > Distcc worked fine in the past, but those were other clients.
45 >
46 > Wonko
47 >
48 > [*] http://en.gentoo-wiki.com/wiki/Safe_Cflags#-march.3Dnative
49
50 and of course we all just use our crystal balls because it is so easy without
51 the error message.
52
53 --
54 #163933

Replies

Subject Author
Re: [gentoo-user] CFLAGS problem Alex Schuster <wonko@×××××××××.org>