Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 176240 - When "cross-compiling" to sparc64, CFLAGS="-O2 -pipe" is not sane at all
Summary: When "cross-compiling" to sparc64, CFLAGS="-O2 -pipe" is not sane at all
Status: RESOLVED LATER
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: Sparc64 Linux
: High normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: cflags
  Show dependency tree
 
Reported: 2007-04-27 12:57 UTC by Ferris McCormick (RETIRED)
Modified: 2007-05-03 05:39 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ferris McCormick (RETIRED) gentoo-dev 2007-04-27 12:57:27 UTC
When building kgcc64 (the kernel compiler) on sparc, toolchain.eclass decides that it is doing a cross-compile because (I suppose) the sparc64 userland is always 32 bits, but kgcc64 must build 64-bit kernel code.  It then sets CFLAGS="-O2 -pipe" with the comment:
# Set this to something sane for both native and target

However, when building for target=sparc64, CFLAGS="-O2 -pipe" is probably never sane, and results in just about the worst performance possible for the resulting program.  If the user gives you "-mcpu=ultrasparc", "-mcpu=ultrasparc3", or "-mcpu=v8" you probably must use that unless the application is known not to build for that -mcpu= flag (and this is should have been handled by the ebuild for the package itself.)

Please see Bug 59506 for a discussion of why you shouldn't filter out -mcpu= flags.
Comment 1 SpanKY gentoo-dev 2007-05-03 05:39:16 UTC
you skipped the important comments in the eclass:
    # CFLAGS:
    #   This conflicts when creating a crosscompiler, so set to a sane
    #     default in this case:
    #   used in ./configure and elsewhere for the native compiler
    #   used by gcc when creating libiberty.a
    #   used by xgcc when creating libstdc++ (and probably others)!
    #     this behavior should be removed...