Menu

#23 Attempt to fix the build on higher GCC versions (4.6+)

None
closed-fixed
nobody
None
5
2017-03-18
2013-12-25
No

GCC 4.6+ forbids explicit template specialization to have storage class. Specializations of templates cannot explicitly specify a storage class, and have the same storage as the primary template. This is a change from previous behavior, based on the feedback and commentary as part of the ISO C++ Core Defect Report 605. (http://gcc.gnu.org/gcc-4.3/porting_to.html)

Quick sed(1) expression to fix:

sed -E 's,(template<> )(inline )?static ,\1\2,' \
    src/misc/CNestedDataFile/anytype.h \
    src/misc/endian_util.h \
    src/backend/CGraphParamValueNode.h \
    src/backend/CPluginMapping.h \
    src/backend/ALFO.h \
    src/backend/CSound_defs.h

Unfortunately, ReZound would then compile, but fail to link...

Discussion

  • Davy Durham

    Davy Durham - 2013-12-27

    These issues have previously been fixed in svn trunk/

    Have you tried trunk? Please close this ticket if you find the problems already fixed.

     

    Last edit: Davy Durham 2013-12-27
  • Alexey Dokuchaev

    Unfortunately, ReZound (version 0.13.1beta) still does not build (fails to link) with GCC 4.7:

    libtool: link: g++47 -I/usr/local/include/fox-1.6 -g -Wall -std=c++0x -Wno-unused-function -Wno-unused-variable -Wno-unused -fexceptions 
    -Wl,-rpath=/usr/local/lib/gcc47 -Wl,-lpthread -Wl,--allow-multiple-definition -o rezound main.o  -L/usr/local/lib -L/usr/local/lib/gcc47 
    ./.libs/libfrontend.a ../../src/backend/.libs/libbackend.a -laudiofile /usr/local/lib/libjack.so /usr/local/lib/libogg.so /usr/local/lib/
    libvorbisfile.so /usr/local/lib/libvorbisenc.so /usr/local/lib/libvorbis.so /usr/local/lib/libFLAC++.so /usr/local/lib/libFLAC.so -lfftw3
     ../../src/backend/File/.libs/libFile.a ../../src/backend/Edits/.libs/libEdits.a ../../src/backend/Effects/.libs/libEffects.a ../../src/b
    ackend/Filters/.libs/libFilters.a ../../src/backend/Looping/.libs/libLooping.a ../../src/backend/Remaster/.libs/libRemaster.a -lSoundTouc
    h ../../src/backend/Generate/.libs/libGenerate.a ../../src/backend/LADSPA/.libs/libLADSPA.a ../../src/misc/CNestedDataFile/.libs/libmiscC
    N.a ../../src/PoolFile/.libs/libPoolFile.a ../../src/misc/.libs/libmisc.a -lFOX-1.6 /usr/local/lib/libX11.so /usr/local/lib/libXext.so /u
    sr/local/lib/libfreetype.so /usr/local/lib/libXft.so /usr/local/lib/libXcursor.so /usr/local/lib/libXrender.so /usr/local/lib/libXrandr.s
    o /usr/local/lib/libXfixes.so /usr/local/lib/libXi.so -lrt /usr/local/lib/libjpeg.so -lpng /usr/local/lib/libtiff.so -lz -lbz2 -lGLU -lGL -lportaudio -lpthread -lm -pthread -Wl,-rpath -Wl,/usr/local/lib -Wl,-rpath -Wl,/usr/local/lib
    ../../src/backend/.libs/libbackend.a(CFLACSoundTranslator.o):(.rodata._ZTV17MyFLACEncoderFile[_ZTV17MyFLACEncoderFile]+0xe8): undefined reference to `FLAC::Encoder::File::init(std::string const&)'
    ../../src/backend/.libs/libbackend.a(CFLACSoundTranslator.o):(.rodata._ZTV17MyFLACEncoderFile[_ZTV17MyFLACEncoderFile]+0xf4): undefined reference to `FLAC::Encoder::File::init_ogg(std::string const&)'
    ../../src/backend/.libs/libbackend.a(CFLACSoundTranslator.o):(.rodata._ZTV17MyFLACDecoderFile[_ZTV17MyFLACDecoderFile]+0xa4): undefined reference to `FLAC::Decoder::File::init(std::string const&)'
    ../../src/backend/.libs/libbackend.a(CFLACSoundTranslator.o):(.rodata._ZTV17MyFLACDecoderFile[_ZTV17MyFLACDecoderFile]+0xb0): undefined reference to `FLAC::Decoder::File::init_ogg(std::string const&)'
    collect2: error: ld returned 1 exit status
    *** Error code 1
    
    $ g++47 -v
    Using built-in specs.
    COLLECT_GCC=g++47
    COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc47/gcc/i386-portbld-freebsd11.0/4.7.4/lto-wrapper
    Target: i386-portbld-freebsd11.0
    Configured with: ./../gcc-4.7.4/configure --disable-bootstrap --disable-nls --enable-gnu-indirect-function --libdir=/usr/local/lib/gcc47 --libexecdir=/usr/local/libexec/gcc47 --program-suffix=47 --with-as=/usr/local/bin/as --with-gmp=/usr/local --with-gxx-include-dir=/usr/local/lib/gcc47/include/c++/ --with-ld=/usr/local/bin/ld --with-pkgversion='FreeBSD Ports Collection' --with-system-zlib --disable-libgcj --enable-languages=c,c++,objc,fortran --prefix=/usr/local --mandir=/usr/local/man --infodir=/usr/local/info/gcc47 --build=i386-portbld-freebsd11.0
    Thread model: posix
    gcc version 4.7.4 (FreeBSD Ports Collection) 
    
     
  • Davy Durham

    Davy Durham - 2017-03-04

    gcc-5 works for me. Though I haven't tested building 32bit. Still a problem on HEAD of trunk?

     
  • Alexey Dokuchaev

    I didnt' try the trunk, but with the latest patches 0.13.1beta builds fine with GCC 4.9 on FreeBSD (64-bit). It does not link though due to incompatible ABIs of std::string between GNU's libstd++ and FreeBSD's libc++, but that is unrelated (and expected).

    There are couple of remaining issues with 32-bit builds, but I guess we can take care of them separately. Since as you've said you've committed those patches, I believe this bug can be closed now.

     
  • Davy Durham

    Davy Durham - 2017-03-18

    Thanks. Open any other issues as needed.

     
  • Davy Durham

    Davy Durham - 2017-03-18
    • status: open --> closed-fixed
    • Group: -->
     

Log in to post a comment.