Menu

#558 gcc strict-aliasing and build system

2.0 Series
closed-fixed
5
2007-01-23
2007-01-15
No

Hello,

Some code fails with strict aliasing, attached compiler output.
You can add -fno-strict-aliasing or better fix the problems.

Strange enough... I tried to use CFLAGS and CPPFLAGS at environment and as command-line to sccons without any success... So I had to patch nsis-2.23-src/SCons/Config/gnu. Can you please allow modifying these variables from external (Maybe I just don't know how to do that...)

Another issue... Can you please add another way to tell configuration not to strip the binaries? Currently you don't strip only if debug... We (Gentoo) patch in order to allow stripping by user request at package manager. Best way is to add STRIP=0 or something at scons.

Thanks!

Discussion

  • Alon Bar-Lev

    Alon Bar-Lev - 2007-01-15

    Compiler output

     
  • Alon Bar-Lev

    Alon Bar-Lev - 2007-01-15

    nsis-2.23-config.patch

     
  • Alon Bar-Lev

    Alon Bar-Lev - 2007-01-15

    Logged In: YES
    user_id=1157530
    Originator: YES

    Gentoo current patches.
    File Added: nsis-2.23-config.patch

     
  • Amir Szekely

    Amir Szekely - 2007-01-23

    Logged In: YES
    user_id=584402
    Originator: NO

    SCons doesn't support CFLAGS and CPPFLAGS by default. It's a bit hairy to add. For now, I've added APPEND_CCFLAGS and APPEND_LINKFLAGS command line options instead. STRIP is now also available.

    I've also added -fno-strict-aliasing to avoid all the warnings as it's too much to change. Thanks.

    So, you're left with:

    scons STRIP=no

    BTW, it's highly recommended that you do strip the resulting Windows binaries. A big feature of NSIS is the installer size and you lose a lot of that if you skip stripping. Just using MinGW already almost doubles the size... The best option here is to use the VC6 built binaries distributed with each Windows version. There's a ZIP file available for download that contains everything so you don't have to handle executable installers.

     
  • Amir Szekely

    Amir Szekely - 2007-01-23
    • status: open --> closed-fixed
     
  • Alon Bar-Lev

    Alon Bar-Lev - 2007-01-23

    Logged In: YES
    user_id=1157530
    Originator: YES

    Thanks!
    We are stripping the executables... But by user request from package management... So thanks for the addition.

     
  • Alin Nastac

    Alin Nastac - 2007-03-11

    Logged In: YES
    user_id=887028
    Originator: NO

    nsis-2.24 still has issues in this regard.
    This is the patch that fix it:
    diff -Nru nsis-2.24-src.orig/SCons/Config/gnu nsis-2.24-src/SCons/Config/gnu
    --- nsis-2.24-src.orig/SCons/Config/gnu 2007-03-11 10:52:57.000000000 +0200
    +++ nsis-2.24-src/SCons/Config/gnu 2007-03-11 10:54:11.000000000 +0200
    @@ -113,6 +113,7 @@
    if not defenv['DEBUG']:
    cp_util_env.Append(CCFLAGS = '-O2') # optimize
    cp_util_env.Append(CCFLAGS = '-Wall') # all warnings
    +cp_util_env.Append(CCFLAGS = '-fno-strict-aliasing') # not safe for strict aliasing

    conf = FlagsConfigure(cp_util_env)
    conf.CheckLinkFlag('$MAP_FLAG') # generate map file

     
  • Amir Szekely

    Amir Szekely - 2007-03-18

    Logged In: YES
    user_id=584402
    Originator: NO

    Thanks, fixed.

     

Log in to post a comment.