Skip to Content.
Sympa Menu

sm-sorcery-bugs - [SM-Sorcery-Bugs] [Bug 10198] New: Some CFLAGS suggestions

sm-sorcery-bugs AT lists.ibiblio.org

Subject: Bugs for Sorcery are reported here

List archive

Chronological Thread  
  • From: bugzilla-daemon AT bugs.sourcemage.org
  • To: sm-sorcery-bugs AT lists.ibiblio.org
  • Subject: [SM-Sorcery-Bugs] [Bug 10198] New: Some CFLAGS suggestions
  • Date: 13 Dec 2005 15:51:42 -0000

http://bugs.sourcemage.org/show_bug.cgi?id=10198

Summary: Some CFLAGS suggestions
Product: Sorcery
Version: Untargetted future release
Platform: Other
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P2
Component: Unknown
AssignedTo: sm-sorcery-bugs AT lists.ibiblio.org
ReportedBy: nxsty AT linux.nu


Hello

I haven't used SourceMage myself for some time but I recently downloaded a
sorcery tarball to see how it has progressed. I found a couple of problems.
First the file var/lib/sorcery/archspecs/amd64/x86_64 contains this:

CPUNAME="AMD Athlon 64, Athlon 64 FX and Opteron"

if use_gcc 3.3. ; then
CFLAGS="-march=athlon-xp -mmmx -mfpmath=sse -msse -msse2 -m3dnow -m64"
elif use_gcc2 ; then
CFLAGS="-march=i686"
else
CFLAGS="-march=k8 -mmmx -mfpmath=sse -msse -msse2 -m3dnow -m64"
fi

HOST="x86_64-unknown-linux-gnu"
FAST="-O3"
SMALL="-Os"

1. That first CFLAGS line wont work. -march=athlon-xp is a 32 bit only flag so
it can't be combined with -m64. If gcc is run with those options it will just
exit with a error. Gcc 3.3 shouldn't be run with any arch/cpu flag on x86_64
unless you are compiling 32 bit code.

2. Gcc2 doesn't support x86_64 so that could just be removed.

3. -mfpmath=sse -msse -msse2 -mmmx are on by default on x86_64 and -m3dnow is
implied by -march=athlon64 so there is no reason to specify them.

4. You shouldn't force 64 bit with the cflag -m64. A x86_64 compiler will
default to 64 bit anyway and forcing it on with the CFLAGS like that will
break
apps that need to build parts 32 bit, like grub.

And for the rest of the archspecs files:

5. The correct -m* switches are turned on by the -march switches so these
could
be removed all over the tree except in special cases.

6. -mfpmath=sse will in most cases create slower code than without it
(apparently because if limitations in the glibc headers) except on x86_64
where
it's on by default. So this flag should be removed everywhere because it's
just
bad for performance and it's on by default where it's not.

7. The combreloc option can be removed completely. This has been the default
behaviour for binutils for a long time anyway. -Wl,-O1 and -Bdirect are some
linker optimizations you could add instead (the second needs a patch).

--
Configure bugmail: http://bugs.sourcemage.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



  • [SM-Sorcery-Bugs] [Bug 10198] New: Some CFLAGS suggestions, bugzilla-daemon, 12/13/2005

Archive powered by MHonArc 2.6.24.

Top of Page