Error when installing
when installing using cmake on arch linux, i get this error
`[sypherrd@inferno binaryen]$ cmake . && make
-- No build type selected, default to Release
-- Building with -fno-omit-frame-pointer
-- Building with -fno-rtti
-- Building with -fPIC
-- Building with -UNDEBUG
-- Building with -DBUILD_LLVM_DWARF
-- Building with -Wall
-- Building with -Werror
-- Building with -Wextra
-- Building with -Wno-unused-parameter
-- Building with -Wno-dangling-pointer
-- Building with -Wno-implicit-int-float-conversion
-- Building with -Wno-unknown-warning-option
-- Building with -Wswitch
-- Building with -Wimplicit-fallthrough
-- Building with -Wnon-virtual-dtor
-- Building libbinaryen as shared library.
-- Linking with -Bsymbolic
-- Configuring done (0.1s)
-- Generating done (0.0s)
-- Build files have been written to: /home/sypherrd/binaryen
[ 18%] Built target llvm_dwarf
[ 19%] Building CXX object CMakeFiles/binaryen.dir/src/passes/Strip.cpp.o
In file included from /usr/include/c++/15.2.1/functional:61,
from /home/sypherrd/binaryen/src/passes/Strip.cpp:22:
In copy constructor ‘std::function<_Res(_ArgTypes ...)>::function(const std::function<_Res(_ArgTypes ...)>&) [with _Res = bool; _ArgTypes = {wasm::CustomSection&}]’,
inlined from ‘wasm::Strip::Strip(Decider)’ at /home/sypherrd/binaryen/src/passes/Strip.cpp:37:28,
inlined from ‘wasm::Pass* wasm::createStripDebugPass()’ at /home/sypherrd/binaryen/src/passes/Strip.cpp:62:4:
/usr/include/c++/15.2.1/bits/std_function.h:393:17: error: ‘
In copy constructor ‘std::function<_Res(_ArgTypes ...)>::function(const std::function<_Res(_ArgTypes ...)>&) [with _Res = bool; _ArgTypes = {wasm::CustomSection&}]’,
inlined from ‘wasm::Strip::Strip(Decider)’ at /home/sypherrd/binaryen/src/passes/Strip.cpp:37:28,
inlined from ‘wasm::Pass* wasm::createStripDWARFPass()’ at /home/sypherrd/binaryen/src/passes/Strip.cpp:68:4:
/usr/include/c++/15.2.1/bits/std_function.h:393:17: error: ‘
In copy constructor ‘std::function<_Res(_ArgTypes ...)>::function(const std::function<_Res(_ArgTypes ...)>&) [with _Res = bool; _ArgTypes = {wasm::CustomSection&}]’,
inlined from ‘wasm::Strip::Strip(Decider)’ at /home/sypherrd/binaryen/src/passes/Strip.cpp:37:28,
inlined from ‘wasm::Pass* wasm::createStripProducersPass()’ at /home/sypherrd/binaryen/src/passes/Strip.cpp:74:4:
/usr/include/c++/15.2.1/bits/std_function.h:393:17: error: ‘
At global scope:
cc1plus: note: unrecognized command-line option ‘-Wno-unknown-warning-option’ may have been intended to silence earlier diagnostics
cc1plus: note: unrecognized command-line option ‘-Wno-implicit-int-float-conversion’ may have been intended to silence earlier diagnostics
cc1plus: all warnings being treated as errors
make[2]: *** [CMakeFiles/binaryen.dir/build.make:1745: CMakeFiles/binaryen.dir/src/passes/Strip.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:508: CMakeFiles/binaryen.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
[sypherrd@inferno binaryen]$
`
any help would be appreciated, thanks!
We have a few places already where we need to disable that gcc warning, and I guess we might need another place here.
Here is an example:
https://github.com/WebAssembly/binaryen/blob/07e02d283ebe7b1a68f11d4b6030665e33ebbb32/src/ir/metadata.cpp#L80
A PR would be welcome as a workaround.
(meanwhile, you can disable warnings-as-errors and/or use an older gcc, to avoid this locally)
In case someone else finds this thread while dealing with the error above, here is how to disable "warnings-as-errors": in the cmake invocation, pass the arg -DENABLE_WERROR=OFF.