Optimization level per-compiler?

  • Hello all,

    I'm building a Universal binary successfully by setting

    GCC_VERSION_i386 4.0
    GCC_VERSION_ppc 3.3
    MACOSX_DEPLOYMENT_TARGET 10.2
    MACOSX_DEPLOYMENT_TARGET_i386 10.4
    MACOSX_DEPLOYMENT_TARGET_ppc 10.2
    SDKROOT_i386 /Developer/SDKs/MacOSX10.4u.sdk
    SDKROOT_ppc /Developer/SDKs/MacOSX10.2.8.sdk

    Unfortunately I'm encountering crashes in the ppc version when
    optimization level is set to "Fastest, Smallest [-Os]" (using GCC
    3.3). The crashes vanish when I lower the optimization level to
    "Fast" (-O2).

    Until the sources are fixed (which will take a while), I'm
    comfortable to stick to the lower optimization level.

    On the other hand, the i386 binaries are working fine (compiled using
    GCC 4.0). Testing has made good progress so far and I'd like to avoid
    having the i386 binary re-compiled (and thus re-tested) just to make
    the ppc binary work.

    So, I'd like to adjust the optimization level per-compiler.
    Something like
    "GCC_OPTIMIZATION_LEVEL_i386" / "GCC_OPTIMIZATION_LEVEL_ppc"
    or
    "GCC_OPTIMIZATION_LEVEL_40 / "GCC_OPTIMIZATION_LEVEL_33"

    would be great.

    Does anybody know of such settings?

    Otherwise, I'd have to clone my Universal target, set those targets
    to build ppc and i386 binaries, respectively, and then create a third
    target which somehow creates the Universal binary out of the build
    results of the ppc/i386 targets, right?

    Any advice would be appreciated!

    Regards,
    Dirk Stegemann
  • Have you tried:

    PER_ARCH_CFLAGS_ppc = -Os
    PER_ARCH_CFLAGS_i386 = -O2

    On 1/30/06, Dirk Stegemann <Dirk.Stegemann.Lists...> wrote:
    > Hello all,
    >
    > I'm building a Universal binary successfully by setting
    >
    > GCC_VERSION_i386 4.0
    > GCC_VERSION_ppc 3.3
    > MACOSX_DEPLOYMENT_TARGET 10.2
    > MACOSX_DEPLOYMENT_TARGET_i386 10.4
    > MACOSX_DEPLOYMENT_TARGET_ppc 10.2
    > SDKROOT_i386 /Developer/SDKs/MacOSX10.4u.sdk
    > SDKROOT_ppc /Developer/SDKs/MacOSX10.2.8.sdk
    >
    >
    > Unfortunately I'm encountering crashes in the ppc version when
    > optimization level is set to "Fastest, Smallest [-Os]" (using GCC
    > 3.3). The crashes vanish when I lower the optimization level to
    > "Fast" (-O2).
    >
    > Until the sources are fixed (which will take a while), I'm
    > comfortable to stick to the lower optimization level.
    >
    > On the other hand, the i386 binaries are working fine (compiled using
    > GCC 4.0). Testing has made good progress so far and I'd like to avoid
    > having the i386 binary re-compiled (and thus re-tested) just to make
    > the ppc binary work.
    >
    > So, I'd like to adjust the optimization level per-compiler.
    > Something like
    > "GCC_OPTIMIZATION_LEVEL_i386" / "GCC_OPTIMIZATION_LEVEL_ppc"
    > or
    > "GCC_OPTIMIZATION_LEVEL_40 / "GCC_OPTIMIZATION_LEVEL_33"
    >
    > would be great.
    >
    > Does anybody know of such settings?
    >
    > Otherwise, I'd have to clone my Universal target, set those targets
    > to build ppc and i386 binaries, respectively, and then create a third
    > target which somehow creates the Universal binary out of the build
    > results of the ppc/i386 targets, right?
    >
    > Any advice would be appreciated!
    >
    > Regards,
    > Dirk Stegemann
    >
    >
    >
    > _______________________________________________
    > Do not post admin requests to the list. They will be ignored.
    > Xcode-users mailing list      (<Xcode-users...>)
    > Help/Unsubscribe/Update your Subscription:
    > http://lists.apple.com/mailman/options/xcode-users/<clarkcox3...>
    >
    > This email sent to <clarkcox3...>
    >

    --
    Clark S. Cox III
    <clarkcox3...>
    My CV/Resume:
    http://homepage.mac.com/clarkcox3/files/Resume.pdf
    http://homepage.mac.com/clarkcox3/files/Resume.html
  • However,

    GCC_MODEL_TUNING_ppc = G5
    GCC_MODEL_TUNING_i386 = prescott

    does not seem to have any effect. Any ideas there?

    Alex

    On 30.01.2006, at 17:50, Clark Cox wrote:

    > Have you tried:
    >
    > PER_ARCH_CFLAGS_ppc = -Os
    > PER_ARCH_CFLAGS_i386 = -O2
    >
    >
    > On 1/30/06, Dirk Stegemann <Dirk.Stegemann.Lists...> wrote:
    >> Hello all,
    >>
    >> I'm building a Universal binary successfully by setting
    >>
    >> GCC_VERSION_i386 4.0
    >> GCC_VERSION_ppc 3.3
    >> MACOSX_DEPLOYMENT_TARGET 10.2
    >> MACOSX_DEPLOYMENT_TARGET_i386 10.4
    >> MACOSX_DEPLOYMENT_TARGET_ppc 10.2
    >> SDKROOT_i386 /Developer/SDKs/MacOSX10.4u.sdk
    >> SDKROOT_ppc /Developer/SDKs/MacOSX10.2.8.sdk
    >>
    >>
    >> Unfortunately I'm encountering crashes in the ppc version when
    >> optimization level is set to "Fastest, Smallest [-Os]" (using GCC
    >> 3.3). The crashes vanish when I lower the optimization level to
    >> "Fast" (-O2).
    >>
    >> Until the sources are fixed (which will take a while), I'm
    >> comfortable to stick to the lower optimization level.
    >>
    >> On the other hand, the i386 binaries are working fine (compiled using
    >> GCC 4.0). Testing has made good progress so far and I'd like to avoid
    >> having the i386 binary re-compiled (and thus re-tested) just to make
    >> the ppc binary work.
    >>
    >> So, I'd like to adjust the optimization level per-compiler.
    >> Something like
    >> "GCC_OPTIMIZATION_LEVEL_i386" / "GCC_OPTIMIZATION_LEVEL_ppc"
    >> or
    >> "GCC_OPTIMIZATION_LEVEL_40 / "GCC_OPTIMIZATION_LEVEL_33"
    >>
    >> would be great.
    >>
    >> Does anybody know of such settings?
    >>
    >> Otherwise, I'd have to clone my Universal target, set those targets
    >> to build ppc and i386 binaries, respectively, and then create a third
    >> target which somehow creates the Universal binary out of the build
    >> results of the ppc/i386 targets, right?
    >>
    >> Any advice would be appreciated!
    >>
    >> Regards,
    >> Dirk Stegemann
    >>
    >>
    >>
    >> _______________________________________________
    >> Do not post admin requests to the list. They will be ignored.
    >> Xcode-users mailing list      (<Xcode-users...>)
    >> Help/Unsubscribe/Update your Subscription:
    >> http://lists.apple.com/mailman/options/xcode-users/clarkcox3%
    >> 40gmail.com
    >>
    >> This email sent to <clarkcox3...>
    >>
    >
    >
    > --
    > Clark S. Cox III
    > <clarkcox3...>
    > My CV/Resume:
    > http://homepage.mac.com/clarkcox3/files/Resume.pdf
    > http://homepage.mac.com/clarkcox3/files/Resume.html
    > _______________________________________________
    > Do not post admin requests to the list. They will be ignored.
    > Xcode-users mailing list      (<Xcode-users...>)
    > Help/Unsubscribe/Update your Subscription:
    > http://lists.apple.com/mailman/options/xcode-users/<below...>
    >
    > This email sent to <below...>
  • GCC_MODEL_TUNING isn't supported as an architecture-specific flag.

    However, there's no point in doing that.  We've set the Intel tuning to
    the one that gets the best performance for the Core Duo processor, so
    just set the Instruction Scheduing popup menu to PowerPC G5 and you'll
    get your G5 tuning for PowerPC plus the optimal tuning for Intel.

    -Eric

    On Jan 30, 2006, at 8:56 AM, Alexander von Below wrote:

    > However,
    >
    > GCC_MODEL_TUNING_ppc = G5
    > GCC_MODEL_TUNING_i386 = prescott
    >
    > does not seem to have any effect. Any ideas there?
    >
    > Alex
    >
    > On 30.01.2006, at 17:50, Clark Cox wrote:
    >
    >> Have you tried:
    >>
    >> PER_ARCH_CFLAGS_ppc = -Os
    >> PER_ARCH_CFLAGS_i386 = -O2
    >>
    >>
    >> On 1/30/06, Dirk Stegemann <Dirk.Stegemann.Lists...> wrote:
    >>> Hello all,
    >>>
    >>> I'm building a Universal binary successfully by setting
    >>>
    >>> GCC_VERSION_i386 4.0
    >>> GCC_VERSION_ppc 3.3
    >>> MACOSX_DEPLOYMENT_TARGET 10.2
    >>> MACOSX_DEPLOYMENT_TARGET_i386 10.4
    >>> MACOSX_DEPLOYMENT_TARGET_ppc 10.2
    >>> SDKROOT_i386 /Developer/SDKs/MacOSX10.4u.sdk
    >>> SDKROOT_ppc /Developer/SDKs/MacOSX10.2.8.sdk
    >>>
    >>>
    >>> Unfortunately I'm encountering crashes in the ppc version when
    >>> optimization level is set to "Fastest, Smallest [-Os]" (using GCC
    >>> 3.3). The crashes vanish when I lower the optimization level to
    >>> "Fast" (-O2).
    >>>
    >>> Until the sources are fixed (which will take a while), I'm
    >>> comfortable to stick to the lower optimization level.
    >>>
    >>> On the other hand, the i386 binaries are working fine (compiled using
    >>> GCC 4.0). Testing has made good progress so far and I'd like to avoid
    >>> having the i386 binary re-compiled (and thus re-tested) just to make
    >>> the ppc binary work.
    >>>
    >>> So, I'd like to adjust the optimization level per-compiler.
    >>> Something like
    >>> "GCC_OPTIMIZATION_LEVEL_i386" / "GCC_OPTIMIZATION_LEVEL_ppc"
    >>> or
    >>> "GCC_OPTIMIZATION_LEVEL_40 / "GCC_OPTIMIZATION_LEVEL_33"
    >>>
    >>> would be great.
    >>>
    >>> Does anybody know of such settings?
    >>>
    >>> Otherwise, I'd have to clone my Universal target, set those targets
    >>> to build ppc and i386 binaries, respectively, and then create a third
    >>> target which somehow creates the Universal binary out of the build
    >>> results of the ppc/i386 targets, right?
    >>>
    >>> Any advice would be appreciated!
    >>>
    >>> Regards,
    >>> Dirk Stegemann
  • Hi,

    Am 30.01.2006 um 18:50 schrieb Clark Cox:

    > Have you tried:
    >
    > PER_ARCH_CFLAGS_ppc = -Os
    > PER_ARCH_CFLAGS_i386 = -O2

    Cool, I'll check them out tomorrow!

    The build transcript should reveal whether those settings overwrite
    the build-in "GCC_OPTIMIZATION_LEVEL" setting...

    Regards,
    Dirk Stegemann
  • Hi,

    Am 30.01.2006 um 18:50 schrieb Clark Cox:

    > Have you tried:
    >
    > PER_ARCH_CFLAGS_ppc = -Os
    > PER_ARCH_CFLAGS_i386 = -O2

    The build transcript shows that both settings are passed to the CL,
    first the "Optimization Level" setting to be chosen from the popup
    menu, than after some warning flags and the map file path, the value
    defined by 'PER_ARCH_CFLAGS_xxx'.

    Something like /usr/bin/gcc-3.3 -bla -bla -Ox -bla -bla -Oy -bla

    The latter argument (-Oy) overwrites the former (-Ox)...?

    Thanks,
    Dirk Stegemann
previous month january 2006 next month
MTWTFSS
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31          
Go to today