kmatheussen / radium

A graphical music editor. A next generation tracker.
http://users.notam02.no/~kjetism/radium/
GNU General Public License v2.0
854 stars 37 forks source link

Faust does not compile with old ABI #1054

Closed Teteros closed 7 years ago

Teteros commented 7 years ago
g++ -mtune=generic -msse2 -mfpmath=sse -O0 -fsanitize=address -g -fPIC -D_GLIBCXX_USE_CXX11_ABI=0 -fno-strict-aliasing -Wno-parentheses -I. -Iboxes -Ierrors -Ievaluate -Inormalize -Iparser -Ipropagate -Iparallelize -Isignals -Itlib -Idraw -Idraw/device -Idraw/schema -Iextended -Ipatternmatcher -Idocumentator -Iutils -I../libraries -Igenerator -Igenerator/asmjs -Igenerator/c -Igenerator/cpp -Igenerator/java -Igenerator/js -Igenerator/llvm -Igenerator/fir -Igenerator/wasm -DINSTALL_PREFIX='"/usr/local"' -std=gnu++11 -O1 -fPIC -Wall -Wuninitialized -fvisibility=hidden -Wno-overloaded-virtual -Wno-parentheses -I. -Iboxes -Ierrors -Ievaluate -Inormalize -Iparser -Ipropagate -Iparallelize -Isignals -Itlib -Idraw -Idraw/device -Idraw/schema -Iextended -Ipatternmatcher -Idocumentator -Iutils -I../libraries -Igenerator -Igenerator/asmjs -Igenerator/c -Igenerator/cpp -Igenerator/java -Igenerator/js -Igenerator/llvm -Igenerator/fir -Igenerator/wasm -DINSTALL_PREFIX='"/usr/local"'  -I`/usr/bin/llvm-config --includedir` -I../architecture -DLLVM_40 -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS  -fsanitize=address patternmatcher/patternmatcher.o generator/uitree.o generator/fir_to_fir.o generator/Text.o generator/floats.o generator/omp_code_container.o generator/instructions.o generator/code_container.o generator/instructions_compiler.o generator/vec_code_container.o generator/description.o generator/occurences.o generator/wss_code_container.o generator/dag_instructions_compiler.o generator/contextor.o generator/dsp_aux.o generator/tools.o propagate/labels.o propagate/propagate.o boxes/boxcomplexity.o boxes/ppbox.o boxes/boxes.o boxes/boxtype.o evaluate/eval.o evaluate/environment.o evaluate/loopDetector.o parallelize/colorize.o parallelize/code_loop.o draw/drawschema.o draw/sigToGraph.o parser/sourcefetcher.o parser/faustparser.o parser/enrobage.o parser/sourcereader.o parser/faustlexer.o documentator/doc_notice.o documentator/doc_metadatas.o documentator/doc_autodoc.o documentator/lateq.o documentator/doc_sharing.o documentator/doc.o documentator/doc_Text.o documentator/doc_compile.o documentator/doc_lang.o normalize/simplify.o normalize/aterm.o normalize/privatise.o normalize/mterm.o normalize/normalize.o signals/sigorderrules.o signals/subsignals.o signals/recursivness.o signals/sigtyperules.o signals/sigvisitor.o signals/binop.o signals/sigprint.o signals/prim2.o signals/ppsig.o signals/signals.o signals/sigtype.o utils/files.o utils/names.o errors/timing.o errors/errormsg.o extended/xtended.o tlib/occurrences.o tlib/node.o tlib/shlysis.o tlib/symbol.o tlib/recursive-tree.o tlib/compatibility.o tlib/list.o tlib/tree.o draw/schema/blockSchema.o draw/schema/cutSchema.o draw/schema/mergeSchema.o draw/schema/seqSchema.o draw/schema/enlargedSchema.o draw/schema/splitSchema.o draw/schema/collector.o draw/schema/inverterSchema.o draw/schema/decorateSchema.o draw/schema/parSchema.o draw/schema/cableSchema.o draw/schema/topSchema.o draw/schema/recSchema.o draw/schema/connectorSchema.o draw/device/SVGDev.o draw/device/PSDev.o generator/wasm/wasm_code_container.o generator/js/js_code_container.o generator/llvm/llvm_code_container.o generator/llvm/llvm_dsp_aux.o generator/llvm/clang_code_container.o generator/cpp/cpp_gpu_code_container.o generator/cpp/cpp_code_container.o generator/asmjs/asmjs_dsp_aux.o generator/asmjs/asmjs_code_container.o generator/c/c_code_container.o generator/java/java_code_container.o generator/fir/fir_code_container.o ../libraries/loki/SafeFormat.o main.o libcode.o global.o `/usr/bin/llvm-config --ldflags` -lLLVM-4.0.1  -ldl -lcrypto -lz -lncurses -lpthread -o faust
rm -f libfaust.a
ar cq libfaust.a patternmatcher/patternmatcher.o generator/uitree.o generator/fir_to_fir.o generator/Text.o generator/floats.o generator/omp_code_container.o generator/instructions.o generator/code_container.o generator/instructions_compiler.o generator/vec_code_container.o generator/description.o generator/occurences.o generator/wss_code_container.o generator/dag_instructions_compiler.o generator/contextor.o generator/dsp_aux.o generator/tools.o propagate/labels.o propagate/propagate.o boxes/boxcomplexity.o boxes/ppbox.o boxes/boxes.o boxes/boxtype.o evaluate/eval.o evaluate/environment.o evaluate/loopDetector.o parallelize/colorize.o parallelize/code_loop.o draw/drawschema.o draw/sigToGraph.o parser/sourcefetcher.o parser/faustparser.o parser/enrobage.o parser/sourcereader.o parser/faustlexer.o documentator/doc_notice.o documentator/doc_metadatas.o documentator/doc_autodoc.o documentator/lateq.o documentator/doc_sharing.o documentator/doc.o documentator/doc_Text.o documentator/doc_compile.o documentator/doc_lang.o normalize/simplify.o normalize/aterm.o normalize/privatise.o normalize/mterm.o normalize/normalize.o signals/sigorderrules.o signals/subsignals.o signals/recursivness.o signals/sigtyperules.o signals/sigvisitor.o signals/binop.o signals/sigprint.o signals/prim2.o signals/ppsig.o signals/signals.o signals/sigtype.o utils/files.o utils/names.o errors/timing.o errors/errormsg.o extended/xtended.o tlib/occurrences.o tlib/node.o tlib/shlysis.o tlib/symbol.o tlib/recursive-tree.o tlib/compatibility.o tlib/list.o tlib/tree.o draw/schema/blockSchema.o draw/schema/cutSchema.o draw/schema/mergeSchema.o draw/schema/seqSchema.o draw/schema/enlargedSchema.o draw/schema/splitSchema.o draw/schema/collector.o draw/schema/inverterSchema.o draw/schema/decorateSchema.o draw/schema/parSchema.o draw/schema/cableSchema.o draw/schema/topSchema.o draw/schema/recSchema.o draw/schema/connectorSchema.o draw/device/SVGDev.o draw/device/PSDev.o generator/wasm/wasm_code_container.o generator/js/js_code_container.o generator/llvm/llvm_code_container.o generator/llvm/llvm_dsp_aux.o generator/llvm/clang_code_container.o generator/cpp/cpp_gpu_code_container.o generator/cpp/cpp_code_container.o generator/asmjs/asmjs_dsp_aux.o generator/asmjs/asmjs_code_container.o generator/c/c_code_container.o generator/java/java_code_container.o generator/fir/fir_code_container.o ../libraries/loki/SafeFormat.o libcode.o libmain.o global.o
ranlib libfaust.a
generator/llvm/llvm_code_container.o: In function `LLVMCodeContainer::LLVMCodeContainer(std::string const&, int, int)':
/home/tete/.cache/pacaur/radium-git/src/radium/bin/packages/faust2/compiler/generator/llvm/llvm_code_container.cpp:64: undefined reference to `llvm::sys::getDefaultTargetTriple()'
generator/llvm/llvm_code_container.o: In function `LLVMCodeContainer::LLVMCodeContainer(std::string const&, int, int)':
/home/tete/.cache/pacaur/radium-git/src/radium/bin/packages/faust2/compiler/generator/llvm/llvm_code_container.cpp:64: undefined reference to `llvm::sys::getDefaultTargetTriple()'
generator/llvm/llvm_dsp_aux.o: In function `llvm_dsp_factory::writeDSPFactoryToIR()':
/home/tete/.cache/pacaur/radium-git/src/radium/bin/packages/faust2/compiler/generator/llvm/llvm_dsp_aux.cpp:426: undefined reference to `llvm::createPrintModulePass(llvm::raw_ostream&, std::string const&, bool)'
generator/llvm/llvm_dsp_aux.o: In function `llvm_dsp_factory::writeDSPFactoryToIRFile(std::string const&)':
/home/tete/.cache/pacaur/radium-git/src/radium/bin/packages/faust2/compiler/generator/llvm/llvm_dsp_aux.cpp:437: undefined reference to `llvm::createPrintModulePass(llvm::raw_ostream&, std::string const&, bool)'
generator/llvm/llvm_dsp_aux.o: In function `llvm_dsp_factory::llvm_dsp_factory(std::string const&, std::string const&, std::string const&)':
/home/tete/.cache/pacaur/radium-git/src/radium/bin/packages/faust2/compiler/generator/llvm/llvm_dsp_aux.cpp:493: undefined reference to `llvm::sys::getDefaultTargetTriple()'
generator/llvm/llvm_dsp_aux.o: In function `llvm_dsp_factory::llvm_dsp_factory(std::string const&, llvm::Module*, llvm::LLVMContext*, std::string const&, int)':
/home/tete/.cache/pacaur/radium-git/src/radium/bin/packages/faust2/compiler/generator/llvm/llvm_dsp_aux.cpp:510: undefined reference to `llvm::sys::getDefaultTargetTriple()'
generator/llvm/llvm_dsp_aux.o: In function `llvm_dsp_factory::llvm_dsp_factory(std::string const&, int, char const**, std::string const&, std::string const&, std::string const&, std::string const&, std::string&, int)':
/home/tete/.cache/pacaur/radium-git/src/radium/bin/packages/faust2/compiler/generator/llvm/llvm_dsp_aux.cpp:554: undefined reference to `llvm::sys::getDefaultTargetTriple()'
generator/llvm/llvm_dsp_aux.o: In function `getDSPMachineTarget()':
/home/tete/.cache/pacaur/radium-git/src/radium/bin/packages/faust2/compiler/generator/llvm/llvm_dsp_aux.cpp:1377: undefined reference to `llvm::sys::getDefaultTargetTriple()'
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile.unix:223: faust] Error 1
make[2]: Leaving directory '/home/tete/.cache/pacaur/radium-git/src/radium/bin/packages/faust2/compiler'
make[1]: *** [Makefile:44: all] Error 2
make[1]: Leaving directory '/home/tete/.cache/pacaur/radium-git/src/radium/bin/packages/faust2'
make: *** [Makefile:519: bin/packages/deletemetorebuild] Error 2

1. Steps to reproduce the problem.

Compile faust with -D_GLIBCXX_USE_CXX11_ABI=0 flag as in:

https://github.com/kmatheussen/radium/blob/master/bin/packages/build.sh#L198

The bug does not seem to happen when -D_GLIBCXX_USE_CXX11_ABI=1 is used

2. Which version of Radium are you using? Do you know if an earlier version has worked?

Current git (fa9608b) Latest release (4.9.12) has the same results.

3. If relevant, which operating system did you run Radium on?

Arch Linux

└> gcc --version gcc (GCC) 7.1.1 20170630

└> llvm-config --version 4.0.1

└> llvm-config --cxxflags -I/usr/include -march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong -fno-plt -fPIC -fvisibility-inlines-hidden -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wno-maybe-uninitialized -Wdelete-non-virtual-dtor -Wno-comment -Werror=date-time -std=c++11 -ffunction-sections -fdata-sections -O3 -DNDEBUG -fno-exceptions -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS

└> llvm-config --libs --system-libs -lLLVM-4.0

4. When D_GLIBCXX_USE_CXX11_ABI=1 is used:

make packages completes but RADIUM_QT_VERSION=5 BUILDTYPE=RELEASE ./build_linux.sh errors:

RADIUM_QT_VERSION=5
BUILDTYPE=RELEASE
INCLUDE_FAUSTDEV=jadda
INCLUDE_PDDEV=jadda
INCLUDE_FAUSTDEV=jadda
INCLUDE_PDDEV=jadda
  Non-linux build detected. Deleting binaries.
echo linux
linux
if [ RELEASE = DEBUG ] ; then \
        echo "-Werror -Wall -g -fno-optimize-sibling-calls -fsanitize=undefined -fno-sanitize-recover  -fsanitize=address -fno-common" >buildtype.opt ; \
else \
        echo "-DRELEASE -Wall -g -O2 -mfpmath=sse -msse2  -DNDEBUG" >buildtype.opt ; \
fi
if [ RELEASE = DEBUG ] ; then \
        echo "-DNOPAUSEPLAY -DCOMPILING_RADIUM -DGUIISQT -DUSE_GFX_OP_QUEUE -DFULL_VERSION=1 -DIS_LITTLE_ENDIAN=1 -DUSE_OPENGL=1 -DUSE_QT_VISUAL=1 -DUSE_GTK_VISUAL=0 -DUSE_QT_REQTYPE=1 -DUSE_GTK_REQTYPE=0 -DUSE_QT_MENU=1 -DUSE_GTK_MENU=0" >flagopts.opt ; \
else \
        echo "-DNOPAUSEPLAY -DCOMPILING_RADIUM -DGUIISQT -DUSE_GFX_OP_QUEUE -DFULL_VERSION=1 -DIS_LITTLE_ENDIAN=1 -DUSE_OPENGL=1 -DUSE_QT_VISUAL=1 -DUSE_GTK_VISUAL=0 -DUSE_QT_REQTYPE=1 -DUSE_GTK_REQTYPE=0 -DUSE_QT_MENU=1 -DUSE_GTK_MENU=0 -DRELEASE" >flagopts.opt ; \
fi
cd bin && /usr/bin/python2 generate_keyboard_sub_ids.py >../common/keyboard_sub_ids.h
bash check_dependencies.sh `./find_python_path.sh` "`/home/tete/.cache/pacaur/radium-git/src/radium/find_moc_and_uic_paths.sh moc`" "`/home/tete/.cache/pacaur/radium-git/src/radium/find_moc_and_uic_paths.sh uic`" test_build
/usr/bin/python2 ../bin/protoconfparser.py radium_proc.h
cd api/ ; /usr/bin/python2 ../bin/protoconfparser.py radium_proc.h ; cd ..
cd Qt/ && "`/home/tete/.cache/pacaur/radium-git/src/radium/find_moc_and_uic_paths.sh moc`" Qt_PluginWidget.h >mQt_PluginWidget.cpp
make: *** No rule to make target 'Qt/Qt_bottom_bar_widget.h', needed by 'Qt_MainWindow.o'.  Stop.
make: *** Waiting for unfinished jobs....

Above is more for debugging, faust with newer ABI might not link with older ABI packages.

kmatheussen commented 7 years ago

I don't remember exactly why I added ...CXX11_AB=1, but I think it was only necessary on windows or osx.

make: *** No rule to make target 'Qt/Qt_bottom_bar_widget.h', needed by 'Qt_MainWindow.o'. Stop.

This seems to be a bug in the makefile. Just remove that "$(P)Qt_bottom_bar_widget.h" occurence from the Makefile.

Teteros commented 7 years ago

Thanks for your makefile fix. I think LLVM in my repos is compiled with new ABI (gcc5+ default) so I just patched out D_GLIBCXX_USE_CXX11_ABI flags =1 locally to work with Arch's env.

Radium compiles now, would be handy if you could make it a compile option, This can be closed.