FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo User

 
 
LinkBack Thread Tools
 
Old 03-12-2012, 10:32 AM
Alex Schuster
 
Default CFLAGS problem

Hi there!

Recently, my sister could not log in to KDE after I had done some
updates. X crashed when loggin into KDE. It turned out that
x11-libs/qt-gui-4.7.4-r1 was the problem when compiled with explict
CFLAGS, instead of just using -march=native.

Her CPU is an AMD A6-3500 with three cores. As I have a PC that is a
little faster, I thought I'd use my four cores in addition via distcc. My
CPU is different, so using -march=native would be bad. I visited[*], and
used this command to find out what -march=native does:

leela # cc -march=native -E -v - </dev/null 2>&1 | grep cc1
/usr/libexec/gcc/x86_64-pc-linux-gnu/4.5.3/cc1 -E -quiet -v -
-D_FORTIFY_SOURCE=2 -march=amdfam10 -mcx16 -msahf -mpopcnt -mabm --param
l1-cache-size=64 --param l1-cache-line-size=64 --param
l2-cache-size=1024 -mtune=amdfam10

So I defined these CFLAGS:
CFLAGS="-pipe -march=amdfam10 -O2 -mcx16 -msahf -mpopcnt -mabm
--param l1-cache-size=64 --param l1-cache-line-size=64
--param l2-cache-size=1024"

The command above does not tell about SSE stuff, so I used this one to
find out about that:

leela # echo | gcc -dME - -march=native | grep -Ei 'SSE|3DNOW|MMX' | sort
#define __3dNOW_A__ 1
#define __3dNOW__ 1
#define __MMX__ 1
#define __SSE2_MATH__ 1
#define __SSE2__ 1
#define __SSE3__ 1
#define __SSE4A__ 1
#define __SSE_MATH__ 1
#define __SSE__ 1

And I added "-msse -msse2 -msse3 -msse4 -m3dnow -mmmx" to CFLAGS.

Anything wrong with that? Because when I compile
x11-libs/qt-gui-4.7.4-r1, using distcc with local and remote clients,
X will crash when logging into KDE. gcc is at version 4.5.3 on both PCs.
Distcc worked fine in the past, but those were other clients.

Wonko
[*] http://en.gentoo-wiki.com/wiki/Safe_Cflags#-march.3Dnative
 
Old 03-12-2012, 11:15 AM
Helmut Jarausch
 
Default CFLAGS problem

On 03/12/2012 12:32:01 PM, Alex Schuster wrote:

Hi there!

Recently, my sister could not log in to KDE after I had done some
updates. X crashed when loggin into KDE. It turned out that
x11-libs/qt-gui-4.7.4-r1 was the problem when compiled with explict
CFLAGS, instead of just using -march=native.

Her CPU is an AMD A6-3500 with three cores. As I have a PC that is a
little faster, I thought I'd use my four cores in addition via
distcc. My
CPU is different, so using -march=native would be bad. I visited[*],
and

used this command to find out what -march=native does:

leela # cc -march=native -E -v - </dev/null 2>&1 | grep cc1
/usr/libexec/gcc/x86_64-pc-linux-gnu/4.5.3/cc1 -E -quiet -v -
-D_FORTIFY_SOURCE=2 -march=amdfam10 -mcx16 -msahf -mpopcnt -mabm
--param

l1-cache-size=64 --param l1-cache-line-size=64 --param
l2-cache-size=1024 -mtune=amdfam10

So I defined these CFLAGS:
CFLAGS="-pipe -march=amdfam10 -O2 -mcx16 -msahf -mpopcnt -mabm
--param l1-cache-size=64 --param l1-cache-line-size=64
--param l2-cache-size=1024"

The command above does not tell about SSE stuff, so I used this one to
find out about that:

leela # echo | gcc -dME - -march=native | grep -Ei 'SSE|3DNOW|MMX' |
sort

#define __3dNOW_A__ 1
#define __3dNOW__ 1
#define __MMX__ 1
#define __SSE2_MATH__ 1
#define __SSE2__ 1
#define __SSE3__ 1
#define __SSE4A__ 1
#define __SSE_MATH__ 1
#define __SSE__ 1

And I added "-msse -msse2 -msse3 -msse4 -m3dnow -mmmx" to CFLAGS.

Anything wrong with that? Because when I compile
x11-libs/qt-gui-4.7.4-r1, using distcc with local and remote clients,
X will crash when logging into KDE. gcc is at version 4.5.3 on both
PCs.

Distcc worked fine in the past, but those were other clients.

Wonko
[*] http://en.gentoo-wiki.com/wiki/Safe_Cflags#-march.3Dnative



I normally check the flags entry in cat /proc/cpuinfo to decide
what's supported on a given CPU.


Helmut.
 
Old 03-12-2012, 05:36 PM
Alex Schuster
 
Default CFLAGS problem

Helmut Jarausch writes:

> On 03/12/2012 12:32:01 PM, Alex Schuster wrote:

> > The command above does not tell about SSE stuff, so I used this one to
> > find out about that:
> >
> > leela # echo | gcc -dME - -march=native | grep -Ei 'SSE|3DNOW|MMX' |

Typo: The -E must be separate: gcc -dM -E - -march=native

> > sort
> > #define __3dNOW_A__ 1
> > #define __3dNOW__ 1
> > #define __MMX__ 1
> > #define __SSE2_MATH__ 1
> > #define __SSE2__ 1
> > #define __SSE3__ 1
> > #define __SSE4A__ 1
> > #define __SSE_MATH__ 1
> > #define __SSE__ 1
> >
> > And I added "-msse -msse2 -msse3 -msse4 -m3dnow -mmmx" to CFLAGS.

> I normally check the flags entry in cat /proc/cpuinfo to decide
> what's supported on a given CPU.

This gives: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge
mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext
fxsr_opt pdpe1gb rdtscp lm 3dnowext 3dnow constant_tsc rep_good nopl
nonstop_tsc extd_apicid aperfmperf pni monitor cx16 popcnt lahf_lm
cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch
osvw ibs skinit wdt arat cpb npt lbrv svm_lock nrip_save pausefilter

I see sse, sse2, pni (which means sse3 I think) and sse4a. Like what the
gcc output gives.

But then I looked in the gcc man page, and the relevant switches are:
-msse -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -msse4 ... -msse4a
With the -msse4a switch being a little separated from the others, maybe I
overlooked it when I looked the last time. So, the CPU knows about SSE4a,
but not about SSE4. Argh. I somehow thought that this would be the same
as SSE4, according to wikipedia this is not true. Problem found, I guess.

Wonko
 
Old 03-12-2012, 09:07 PM
Volker Armin Hemmann
 
Default CFLAGS problem

Am Montag, 12. März 2012, 12:32:01 schrieb Alex Schuster:
> Hi there!
>
> Recently, my sister could not log in to KDE after I had done some
> updates. X crashed when loggin into KDE. It turned out that
> x11-libs/qt-gui-4.7.4-r1 was the problem when compiled with explict
> CFLAGS, instead of just using -march=native.
>
> Her CPU is an AMD A6-3500 with three cores. As I have a PC that is a
> little faster, I thought I'd use my four cores in addition via distcc. My
> CPU is different, so using -march=native would be bad. I visited[*], and
> used this command to find out what -march=native does:
>
> leela # cc -march=native -E -v - </dev/null 2>&1 | grep cc1
> /usr/libexec/gcc/x86_64-pc-linux-gnu/4.5.3/cc1 -E -quiet -v -
> -D_FORTIFY_SOURCE=2 -march=amdfam10 -mcx16 -msahf -mpopcnt -mabm --param
> l1-cache-size=64 --param l1-cache-line-size=64 --param
> l2-cache-size=1024 -mtune=amdfam10
>
> So I defined these CFLAGS:
> CFLAGS="-pipe -march=amdfam10 -O2 -mcx16 -msahf -mpopcnt -mabm
> --param l1-cache-size=64 --param l1-cache-line-size=64
> --param l2-cache-size=1024"
>
> The command above does not tell about SSE stuff, so I used this one to
> find out about that:
>
> leela # echo | gcc -dME - -march=native | grep -Ei 'SSE|3DNOW|MMX' | sort
> #define __3dNOW_A__ 1
> #define __3dNOW__ 1
> #define __MMX__ 1
> #define __SSE2_MATH__ 1
> #define __SSE2__ 1
> #define __SSE3__ 1
> #define __SSE4A__ 1
> #define __SSE_MATH__ 1
> #define __SSE__ 1
>
> And I added "-msse -msse2 -msse3 -msse4 -m3dnow -mmmx" to CFLAGS.
>
> Anything wrong with that? Because when I compile
> x11-libs/qt-gui-4.7.4-r1, using distcc with local and remote clients,
> X will crash when logging into KDE. gcc is at version 4.5.3 on both PCs.
> Distcc worked fine in the past, but those were other clients.
>
> Wonko
>
>[*] http://en.gentoo-wiki.com/wiki/Safe_Cflags#-march.3Dnative

and of course we all just use our crystal balls because it is so easy without
the error message.

--
#163933
 
Old 03-12-2012, 10:42 PM
Alex Schuster
 
Default CFLAGS problem

Volker Armin Hemmann writes:

> and of course we all just use our crystal balls because it is so easy
> without the error message.

Hmm, something about X shutting down in kdm.log. Can't check now because
the system is down. But anyway, I don't think it matters, the problem is
that the crash happened only when the package was compiled with distcc
and explicit CFLAGS.

But now I think the problem was that I enabled support for SSE4, instead
of SSE4a. I'll change the CFLAGS and just try again.

Wonko
 

Thread Tools




All times are GMT. The time now is 12:28 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org