ensuring CXXFLAGS usage and non-strip during

sunset
2010-01-03
2013-05-28
  • sunset
    sunset
    2010-01-03

    I maintain the the rpm package for fedora. I'm having trouble getting usable debuginfo from the rpmbuild. Attempting to solve this I notice that our build system required flags are being ignored or overwritten during the build -
    `CXXFFLAGS='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2
        -fexceptions -fstack-protector -param=ssp-buffer-size=4 -m64
        -mtune=generic'`
    , then make, log shows eg:
    `g++  -O2 -Wall -msse2 -fno-rtti -pipe -ffunction-sections
    -fomit-frame-pointer -Wno-format-y2k -fPIC -fno-exceptions -fno-strict-aliasing -I/usr/include/freetype2 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_THREAD_SAFE -D_REENTRANT     -o rakarrack  main.o jack.o rakarrack.o process.o fileio.o varios.o Reverb.o Chorus.o EffectLFO.o Echo.o Phaser.o Distorsion.o EQ.o Compressor.o AnalogFilter.o Alienwah.o Filter.o DynamicFilter.o SVFilter.o FormantFilter.o FilterParams.o Pan.o Harmonizer.o smbPitchShift.o Tuner.o MusicDelay.o Gate.o RecognizeNote.o RecChord.o rkrMIDI.o MIDIConverter.o  -lfltk_images -lpng -lz -ljpeg -lfltk -lasound -ljack -lpthread -lrt    -lXpm`
    It seems that while configure suggests that the environment will be used, something is going wrong.

     
  • Josep Andreu
    Josep Andreu
    2010-01-03

    I will check that thanks.

    Josep

     
  • sunset
    sunset
    2010-01-03

    Oops, forgot to mention that I'm working with 0.3.0 currently. Is the next release just around the corner ?

     
  • Josep Andreu
    Josep Andreu
    2010-01-03

    Yes … hope we will release at the end of this month

     
  • Josep Andreu
    Josep Andreu
    2010-01-03

    Please can you check if the configure.in located in the CVS tree is  enough? I'm not a Auto Tools guru and maybe I need some help :-)

     
  • sunset
    sunset
    2010-01-07

    Hi Joseph, I created a patch of configure.in.1.14 against the one in 0.3.0, and this successfully passes our build system CXXFLAGS into the compile stages, and also generates good -debuginfo packages.

    For others, note the additional BR requirement of fftw-devel .

    Also, once built I found that the fedora flags invoke the buffer overflow checks, and they capture a buffer overflow in RecChord.h/.c:

    rakarrack 
    *** buffer overflow detected ***: rakarrack terminated
    ======= Backtrace: =========
    /lib64/libc.so.6(__fortify_fail+0x37)[0x3e060f6ea7]
    /lib64/libc.so.6[0x3e060f4ec0]
    rakarrack[0x43efa1]
    rakarrack[0x4400dd]
    rakarrack[0x42c1b7]
    rakarrack[0x40bed0]
    rakarrack[0x4424e6]
    ======= Memory map: ========
    00400000-00460000 r-xp 00000000 08:12 10066                              /usr/bin/rakarrack
    00660000-00670000 rw-p 00060000 08:12 10066                              /usr/bin/rakarrack
    00670000-006a4000 rw-p 00000000 00:00 0 
    01434000-0152f000 rw-p 00000000 00:00 0                                  [heap]
    3097400000-30974f8000 r-xp 00000000 08:12 55335                          /usr/lib64/libfftw3.so.3.2.3
    30974f8000-30976f7000 ---p 000f8000 08:12 55335                          /usr/lib64/libfftw3.so.3.2.3
    30976f7000-30976fe000 rw-p 000f7000 08:12 55335                          /usr/lib64/libfftw3.so.3.2.3
    3097800000-3097814000 r-xp 00000000 08:12 14783                          /usr/lib64/libXft.so.2.1.13
    3097814000-3097a14000 ---p 00014000 08:12 14783                          /usr/lib64/libXft.so.2.1.13
    3097a14000-3097a15000 rw-p 00014000 08:12 14783                          /usr/lib64/libXft.so.2.1.13
    3098800000-3098811000 r-xp 00000000 08:12 15678                          /usr/lib64/libXpm.so.4.11.0
    3098811000-3098a10000 ---p 00011000 08:12 15678                          /usr/lib64/libXpm.so.4.11.0
    3098a10000-3098a11000 rw-p 00010000 08:12 15678                          /usr/lib64/libXpm.so.4.11.0
    3099400000-3099411000 r-xp 00000000 08:12 55334                          /usr/lib64/libjack.so.0.0.28
    3099411000-3099611000 ---p 00011000 08:12 55334                          /usr/lib64/libjack.so.0.0.28
    3099611000-3099613000 rw-p 00011000 08:12 55334                          /usr/lib64/libjack.so.0.0.28
    3099613000-309961b000 rw-p 00000000 00:00 0 
    34d8800000-34d88e3000 r-xp 00000000 08:12 17140                          /lib64/libasound.so.2.0.0
    34d88e3000-34d8ae2000 ---p 000e3000 08:12 17140                          /lib64/libasound.so.2.0.0
    34d8ae2000-34d8aea000 rw-p 000e2000 08:12 17140                          /lib64/libasound.so.2.0.0
    3b24600000-3b24616000 r-xp 00000000 08:12 8748                           /lib64/libgcc_s-4.4.2-20091222.so.1
    3b24616000-3b24815000 ---p 00016000 08:12 8748                           /lib64/libgcc_s-4.4.2-20091222.so.1
    3b24815000-3b24816000 rw-p 00015000 08:12 8748                           /lib64/libgcc_s-4.4.2-20091222.so.1
    3b24a00000-3b24ae4000 r-xp 00000000 08:12 8753                           /usr/lib64/libstdc++.so.6.0.13
    3b24ae4000-3b24ce4000 ---p 000e4000 08:12 8753                           /usr/lib64/libstdc++.so.6.0.13
    3b24ce4000-3b24ceb000 r--p 000e4000 08:12 8753                           /usr/lib64/libstdc++.so.6.0.13
    3b24ceb000-3b24ced000 rw-p 000eb000 08:12 8753                           /usr/lib64/libstdc++.so.6.0.13
    3b24ced000-3b24d02000 rw-p 00000000 00:00 0 
    3b24e00000-3b24ea4000 r-xp 00000000 08:12 34597                          /usr/lib64/libfltk.so.1.1
    3b24ea4000-3b250a3000 ---p 000a4000 08:12 34597                          /usr/lib64/libfltk.so.1.1
    3b250a3000-3b250ab000 rw-p 000a3000 08:12 34597                          /usr/lib64/libfltk.so.1.1
    3b250ab000-3b250b0000 rw-p 00000000 00:00 0 
    3b25200000-3b2520f000 r-xp 00000000 08:12 55321                          /usr/lib64/libfltk_images.so.1.1
    3b2520f000-3b2540e000 ---p 0000f000 08:12 55321                          /usr/lib64/libfltk_images.so.1.1
    3b2540e000-3b2540f000 rw-p 0000e000 08:12 55321                          /usr/lib64/libfltk_images.so.1.1
    3e05c00000-3e05c1e000 r-xp 00000000 08:12 30817                          /lib64/ld-2.11.so
    3e05e1d000-3e05e1e000 r--p 0001d000 08:12 30817                          /lib64/ld-2.11.so
    3e05e1e000-3e05e1f000 rw-p 0001e000 08:12 30817                          /lib64/ld-2.11.so
    3e05e1f000-3e05e20000 rw-p 00000000 00:00 0 
    3e06000000-3e0616f000 r-xp 00000000 08:12 31667                          /lib64/libc-2.11.so
    3e0616f000-3e0636e000 ---p 0016f000 08:12 31667                          /lib64/libc-2.11.so
    3e0636e000-3e06372000 r--p 0016e000 08:12 31667                          /lib64/libc-2.11.so
    3e06372000-3e06373000 rw-p 00172000 08:12 31667                          /lib64/libc-2.11.so
    3e06373000-3e06378000 rw-p 00000000 00:00 0 
    3e06400000-3e06402000 r-xp 00000000 08:12 49674                          /lib64/libdl-2.11.so
    3e06402000-3e06602000 ---p 00002000 08:12 49674                          /lib64/libdl-2.11.so
    3e06602000-3e06603000 r--p 00002000 08:12 49674                          /lib64/libdl-2.11.so
    3e06603000-3e06604000 rw-p 00003000 08:12 49674                          /lib64/libdl-2.11.so
    3e06800000-3e06817000 r-xp 00000000 08:12 67851                          /lib64/libpthread-2.11.so
    3e06817000-3e06a16000 ---p 00017000 08:12 67851                          /lib64/libpthread-2.11.so
    3e06a16000-3e06a17000 r--p 00016000 08:12 67851                          /lib64/libpthread-2.11.so
    3e06a17000-3e06a18000 rw-p 00017000 08:12 67851                          /lib64/libpthread-2.11.so
    3e06a18000-3e06a1c000 rw-p 00000000 00:00 0 
    3e06c00000-3e06c83000 r-xp 00000000 08:12 35848                          /lib64/libm-2.11.so
    3e06c83000-3e06e82000 ---p 00083000 08:12 35848                          /lib64/libm-2.11.so
    3e06e82000-3e06e83000 r--p 00082000 08:12 35848                          /lib64/libm-2.11.so
    3e06e83000-3e06e84000 rw-p 00083000 08:12 35848                          /lib64/libm-2.11.so
    3e07000000-3e07007000 r-xp 00000000 08:12 67882                          /lib64/librt-2.11.so
    3e07007000-3e07206000 ---p 00007000 08:12 67882                          /lib64/librt-2.11.so
    3e07206000-3e07207000 r--p 00006000 08:12 67882                          /lib64/librt-2.11.so
    3e07207000-3e07208000 rw-p 00007000 08:12 67882                          /lib64/librt-2.11.so
    3e07400000-3e07415000 r-xp 00000000 08:12 37042                          /lib64/libz.so.1.2.3
    3e07415000-3e07614000 ---p 00015000 08:12 37042                          /lib64/libz.so.1.2.3
    3e07614000-3e07615000 rw-p 00014000 08:12 37042                          /lib64/libz.so.1.2.3
    3e09c00000-3e09c02000 r-xp 00000000 08:12 49465                          /usr/lib64/libXau.so.6.0.0
    3e09c02000-3e09e02000 ---p 00002000 08:12 49465                          /usr/lib64/libXau.so.6.0.0
    3e09e02000-3e09e03000 rw-p 00002000 08:12 49465                          /usr/lib64/libXau.so.6.0.0
    3e0a000000-3e0a01b000 r-xp 00000000 08:12 49664                          /usr/lib64/libxcb.so.1.1.0
    3e0a01b000-3e0a21a000 ---p 0001b000 08:12 49664                          /usr/lib64/libxcb.so.1.1.0
    3e0a21a000-3e0a21b000 rw-p 0001a000 08:12 49664                          /usr/lib64/libxcb.so.1.1.0
    3e0a400000-3e0a539000 r-xp 00000000 08:12 50318                          /usr/lib64/libX11.so.6.3.0
    3e0a539000-3e0a739000 ---p 00139000 08:12 50318                          /usr/lib64/libX11.so.6.3.0
    3e0a739000-3e0a73f000 rw-p 00139000 08:12 50318                          /usr/lib64/libX11.so.6.3.0
    3e0ac00000-3e0ac26000 r-xp 00000000 08:12 37058                          /usr/lib64/libpng12.so.0.39.0
    3e0ac26000-3e0ae25000 ---p 00026000 08:12 37058                          /usr/lib64/libpng12.so.0.39.0
    3e0ae25000-3e0ae26000 rw-p 00025000 08:12 37058                          /usr/lib64/libpng12.so.0.39.0
    3e0b000000-3e0b026000 r-xp 00000000 08:12 36782                          /lib64/libexpat.so.1.5.2
    3e0b026000-3e0b225000 ---p 00026000 08:12 36782                          /lib64/libexpat.so.1.5.2
    3e0b225000-3e0b228000 rw-p 00025000 08:12 36782                          /lib64/libexpat.so.1.5.2
    3e0b400000-3e0b411000 r-xp 00000000 08:12 50326                          /usr/lib64/libXext.so.6.4.0
    3e0b411000-3e0b611000 ---p 00011000 08:12 50326                          /usr/lib64/libXext.so.6.4.0
    3e0b611000-3e0b612000 rw-p 00011000 08:12 50326                          /usr/lib64/libXext.so.6.4.0
    3e0bc00000-3e0bc34000 r-xp 00000000 08:12 37039                          /usr/lib64/libfontconfig.so.1.4.4
    3e0bc34000-3e0be34000 ---p 00034000 08:12 37039                          /usr/lib64/libfontconfig.so.1.4.4
    3e0be34000-3e0be36000 rw-p 00034000 08:12 37039                          /usr/lib64/libfontconfig.so.1.4.4
    3e0c000000-3e0c097000 r-xp 00000000 08:12 36777                          /usr/lib64/libfreetype.so.6.3.22
    3e0c097000-3e0c296000 ---p 00097000 08:12 36777                          /usr/lib64/libfreetype.so.6.3.22
    3e0c296000-3e0c29c000 rw-p 00096000 08:12 36777                          /usr/lib64/libfreetype.so.6.3.22
    3e0d000000-3e0d002000 r-xp 00000000 08:12 50327                          /usr/lib64/libXinerama.so.1.0.0
    3e0d002000-3e0d201000 ---p 00002000 08:12 50327                          /usr/lib64/libXinerama.so.1.0.0Aborted (core dumped)
    bash-4.0$
    

    thread apply bt  showed error at line 404 of .c
    case 5:
      strcpy (Chord5.Nom, ChN_.Nom);

    It seems width of .Nom=11, while ChN.Nom can be 16, and/or some of those chord text names must be wider than 11 bytes.
    It might make sense to use constants for the differing widths ?

    Anyway, basic patch, probably better ways to resolve it:
    _

    diff -ur rakarrack-0.3.0.orig/src/RecChord.h rakarrack-0.3.0/src/RecChord.h
    --- rakarrack-0.3.0.orig/src/RecChord.h 2008-11-06 00:45:14.000000000 +1100
    +++ rakarrack-0.3.0/src/RecChord.h  2010-01-08 00:41:01.000000000 +1100
    @@ -101,7 +101,7 @@
         int di2;
         int di3;
         int di4;
    -    char Nom[10];
    +    char Nom[16];
       } Chord5[67];
    
       int Ch[34][13];
    
     
  • Josep Andreu
    Josep Andreu
    2010-01-08

    Hi

    Thanks .. for your help, I will change this line right now, I'm only a entusiast amateur programmer, and seeing that now I know that I use jurassic methods to debug the program.

    Please can you send me the configure.in and some info of how can I do things like that?  or just a url where to find the info.
    Please send to my personal email  holborn@telefonica.net

    Thanks again.

    Josep