Closed dslm4515 closed 3 years ago
Tried to use Clang/Clang++ from LLVM.
Set these variables:
CC=clang
CXX=clang++
CXFLAGS="-D__WORDSIZE=32 -g1"
CXXFLAGS="-D__WORDSIZE=32 -g1"
LDFLAGS=" -Wl,--no-keep-memory"
Build fails after compiling many but not all targets:
/usr/bin/ld: /src-bmlfs/webkitgtk-2.30.2/build/../Source/WTF/wtf/CheckedArithmetic.h:
365: undefined reference to '__mulodi4'
clang-11: error linker command failed with exit code 1
``
Or build freezes (had to use CTRL+C):
[1714/4497] Generating ../../inspector-resource.stamp^C ninja: build interrupted by user.
real 657m33.482s user 711m7.829s sys 5m38.116s
Build succeeded! __mulodi4
Symbol is not provided by GCC...but provided by compiler-rt of the LLVM toolset!
Not sure if this matters, but I built ccache and libunwind just before this build.
Flags set:
CC=clang
CXX=clang++
CFLAGS=" -D__WORDSIZE=32 -g1 -march=native -O2"
CXXFLAGS=" -D__WORDSIZE=32 -g1 -march=native -O2"
LDFLAGS=" -Wl,--no-keep-memory -fuse-ld=lld -rtlib=compiler-rt"
Then configure source to use those flags:
cmake -GNinja \
-DPORT=GTK \
-DCMAKE_BUILD_TYPE=MinSizeRel \
-DCMAKE_SKIP_RPATH=ON \
-DCMAKE_INSTALL_PREFIX=/usr \
-DLIB_INSTALL_DIR=/usr/lib \
-DENABLE_GTKDOC=OFF \
-DENABLE_GEOLOCATION=ON \
-DENABLE_SAMPLING_PROFILER=OFF \
-DENABLE_MINIBROWSER=ON \
-DUSE_WPE_RENDERER=ON \
-DUSE_WOFF2=ON \
-DCMAKE_CXX_FLAGS="$CXXFLAGS" \
-DUSE_LD_GOLD=OFF \
-DUSE_SYSTEMD=OFF \
-DUSE_LIBHYPHEN=OFF \
-DENABLE_GLES2=ON
Machine:
Tried to build webkitgtk 2.30.4 on same machine:
[896/4497] Building CXX object Source/JavaScriptCore/CMakeFiles/JavaScriptCore...._/DerivedSources/JavaScriptCore/unified-sources/UnifiedSource-f2e18ffc-10.cpp.o
FAILED: Source/JavaScriptCore/CMakeFiles/JavaScriptCore.dir/__/__/DerivedSources/JavaScriptCore/unified-sources/UnifiedSource-f2e18ffc-10.cpp.o
/usr/bin/ccache /usr/bin/clang++ -DBUILDING_GTK__=1 -DBUILDING_JavaScriptCore -DBUILDING_WITH_CMAKE=1 -DBWRAP_EXECUTABLE=\"/usr/bin/bwrap\" -DDBUS_PROXY_EXECUTABL
E=\"/usr/bin/xdg-dbus-proxy\" -DGETTEXT_PACKAGE=\"WebKit2GTK-4.0\" -DHAVE_CONFIG_H=1 -DJSC_COMPILATION -DJSC_GLIB_API_ENABLED -DJavaScriptCore_EXPORTS -DSTATICALL
Y_LINKED_WITH_WTF -DSVN_REVISION=\"tarball\" -DWEBKITGTK_API_VERSION_STRING=\"4.0\" -IDerivedSources/ForwardingHeaders -I. -I../Source/JavaScriptCore -I../Source/
JavaScriptCore/API -I../Source/JavaScriptCore/assembler -I../Source/JavaScriptCore/b3 -I../Source/JavaScriptCore/b3/air -I../Source/JavaScriptCore/bindings -I../S
ource/JavaScriptCore/builtins -I../Source/JavaScriptCore/bytecode -I../Source/JavaScriptCore/bytecompiler -I../Source/JavaScriptCore/dfg -I../Source/JavaScriptCor
e/disassembler -I../Source/JavaScriptCore/disassembler/ARM64 -I../Source/JavaScriptCore/disassembler/udis86 -I../Source/JavaScriptCore/domjit -I../Source/JavaScri
ptCore/ftl -I../Source/JavaScriptCore/heap -I../Source/JavaScriptCore/debugger -I../Source/JavaScriptCore/inspector -I../Source/JavaScriptCore/inspector/agents -I
../Source/JavaScriptCore/inspector/augmentable -I../Source/JavaScriptCore/inspector/remote -I../Source/JavaScriptCore/interpreter -I../Source/JavaScriptCore/jit -
I../Source/JavaScriptCore/llint -I../Source/JavaScriptCore/parser -I../Source/JavaScriptCore/profiler -I../Source/JavaScriptCore/runtime -I../Source/JavaScriptCor
e/tools -I../Source/JavaScriptCore/wasm -I../Source/JavaScriptCore/wasm/js -I../Source/JavaScriptCore/yarr -IDerivedSources/JavaScriptCore -IDerivedSources/JavaSc
riptCore/inspector -IDerivedSources/JavaScriptCore/runtime -IDerivedSources/JavaScriptCore/yarr -IDerivedSources/ForwardingHeaders/JavaScriptCore/glib -IDerivedSo
urces/JavaScriptCore/javascriptcoregtk/jsc -I../Source/JavaScriptCore/API/glib -IDerivedSources/JavaScriptCore/javascriptcoregtk -I../Source/JavaScriptCore/inspec
tor/remote/glib -isystem /usr/include/glib-2.0 -isystem /usr/lib/glib-2.0/include -fdiagnostics-color=always -fcolor-diagnostics -Wextra -Wall -mfpmath=sse -msse2
-Wno-noexcept-type -Wno-psabi -Wno-parentheses-equality -Qunused-arguments -Wwrite-strings -Wundef -Wpointer-arith -Wmissing-format-attribute -Wformat-security -
Wcast-align -D__WORDSIZE=32 -g1 -O2 -fno-strict-aliasing -fno-exceptions -fno-rtti -Os -DNDEBUG -fPIC -ffp-contract=off -fno-slp-vectorize -std=c++17 -MD -MT S
ource/JavaScriptCore/CMakeFiles/JavaScriptCore.dir/__/__/DerivedSources/JavaScriptCore/unified-sources/UnifiedSource-f2e18ffc-10.cpp.o -MF Source/JavaScriptCore/C
MakeFiles/JavaScriptCore.dir/__/__/DerivedSources/JavaScriptCore/unified-sources/UnifiedSource-f2e18ffc-10.cpp.o.d -o Source/JavaScriptCore/CMakeFiles/JavaScriptC
ore.dir/__/__/DerivedSources/JavaScriptCore/unified-sources/UnifiedSource-f2e18ffc-10.cpp.o -c DerivedSources/JavaScriptCore/unified-sources/UnifiedSource-f2e18ff
c-10.cpp
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0. Program arguments: /usr/bin/clang++ -Wextra -Wall -mfpmath=sse -msse2 -Wno-noexcept-type -Wno-psabi -Wno-parentheses-equality -Qunused-arguments -Wwrite-s
trings -Wundef -Wpointer-arith -Wmissing-format-attribute -Wformat-security -Wcast-align -g1 -O2 -fno-strict-aliasing -fno-exceptions -fno-rtti -Os -fPIC -ffp-con
tract=off -fno-slp-vectorize -std=c++17 -fdiagnostics-color=always -fcolor-diagnostics -DBUILDING_GTK__=1 -DBUILDING_JavaScriptCore -DBUILDING_WITH_CMAKE=1 -DBWRA
P_EXECUTABLE="/usr/bin/bwrap" -DDBUS_PROXY_EXECUTABLE="/usr/bin/xdg-dbus-proxy" -DGETTEXT_PACKAGE="WebKit2GTK-4.0" -DHAVE_CONFIG_H=1 -DJSC_COMPILATION -DJSC_GLIB_
API_ENABLED -DJavaScriptCore_EXPORTS -DSTATICALLY_LINKED_WITH_WTF -DSVN_REVISION="tarball" -DWEBKITGTK_API_VERSION_STRING="4.0" -IDerivedSources/ForwardingHeaders
-I. -I../Source/JavaScriptCore -I../Source/JavaScriptCore/API -I../Source/JavaScriptCore/assembler -I../Source/JavaScriptCore/b3 -I../Source/JavaScriptCore/b3/ai
r -I../Source/JavaScriptCore/bindings -I../Source/JavaScriptCore/builtins -I../Source/JavaScriptCore/bytecode -I../Source/JavaScriptCore/bytecompiler -I../Source/
JavaScriptCore/dfg -I../Source/JavaScriptCore/disassembler -I../Source/JavaScriptCore/disassembler/ARM64 -I../Source/JavaScriptCore/disassembler/udis86 -I../Sourc
e/JavaScriptCore/domjit -I../Source/JavaScriptCore/ftl -I../Source/JavaScriptCore/heap -I../Source/JavaScriptCore/debugger -I../Source/JavaScriptCore/inspector -I
../Source/JavaScriptCore/inspector/agents -I../Source/JavaScriptCore/inspector/augmentable -I../Source/JavaScriptCore/inspector/remote -I../Source/JavaScriptCore/
interpreter -I../Source/JavaScriptCore/jit -I../Source/JavaScriptCore/llint -I../Source/JavaScriptCore/parser -I../Source/JavaScriptCore/profiler -I../Source/Java
ScriptCore/runtime -I../Source/JavaScriptCore/tools -I../Source/JavaScriptCore/wasm -I../Source/JavaScriptCore/wasm/js -I../Source/JavaScriptCore/yarr -IDerivedSo
urces/JavaScriptCore -IDerivedSources/JavaScriptCore/inspector -IDerivedSources/JavaScriptCore/runtime -IDerivedSources/JavaScriptCore/yarr -IDerivedSources/Forwa
rdingHeaders/JavaScriptCore/glib -IDerivedSources/JavaScriptCore/javascriptcoregtk/jsc -I../Source/JavaScriptCore/API/glib -IDerivedSources/JavaScriptCore/javascr
iptcoregtk -I../Source/JavaScriptCore/inspector/remote/glib -isystem /usr/include/glib-2.0 -isystem /usr/lib/glib-2.0/include -D__WORDSIZE=32 -DNDEBUG -c -MD -MT
Source/JavaScriptCore/CMakeFiles/JavaScriptCore.dir/__/__/DerivedSources/JavaScriptCore/unified-sources/UnifiedSource-f2e18ffc-10.cpp.o -MF Source/JavaScriptCore/
CMakeFiles/JavaScriptCore.dir/__/__/DerivedSources/JavaScriptCore/unified-sources/UnifiedSource-f2e18ffc-10.cpp.o.d -fcolor-diagnostics -o Source/JavaScriptCore/C
MakeFiles/JavaScriptCore.dir/__/__/DerivedSources/JavaScriptCore/unified-sources/UnifiedSource-f2e18ffc-10.cpp.o DerivedSources/JavaScriptCore/unified-sources/Uni
fiedSource-f2e18ffc-10.cpp
1. ../Source/JavaScriptCore/bytecode/Opcode.h:260:1: current parser token 'namespace'
2. ../Source/JavaScriptCore/bytecode/Opcode.h:41:1: parsing namespace 'JSC'
clang-11: error: clang frontend command failed due to signal (use -v to see invocation)
clang version 11.0.0
Target: i686-unknown-linux-musl
Thread model: posix
InstalledDir: /usr/bin
clang-11: note: diagnostic msg:
********************
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-11: note: diagnostic msg: /tmp/UnifiedSource-f2e18ffc-10-56b164.cpp
clang-11: note: diagnostic msg: /tmp/UnifiedSource-f2e18ffc-10-56b164.sh
clang-11: note: diagnostic msg:
********************
[898/4497] Building CXX object Source/JavaScriptCore/CMakeFiles/JavaScriptCore....__/DerivedSources/JavaScriptCore/unified-sources/UnifiedSource-f2e18ffc-8.cpp.o
ninja: build stopped: subcommand failed.
Tried GCC with these flags:
CXX= [unset]
CC= [unset]
CFLAGS =-D__WORDSIZE=32 -g1 -O2
CXXFLAGS=-D__WORDSIZE=32 -g1 -O2
LDFLAGS=-Wl,--no-keep-memory
but build failed:
[938/4497] Building CXX object Source/JavaScriptCore/CMakeFiles/JavaScriptCore...._/DerivedSources/JavaScriptCore/unified-sources/UnifiedSource-f2e18ffc-36.cpp.o
FAILED: Source/JavaScriptCore/CMakeFiles/JavaScriptCore.dir/__/__/DerivedSources/JavaScriptCore/unified-sources/UnifiedSource-f2e18ffc-36.cpp.o
/usr/bin/ccache /usr/bin/c++ -DBUILDING_GTK__=1 -DBUILDING_JavaScriptCore -DBUILDING_WITH_CMAKE=1 -DBWRAP_EXECUTABLE=\"/usr/bin/bwrap\" -DDBUS_PROXY_EXECUTABLE=\"/usr/bin/xdg-dbus-proxy\" -DGETTEXT_PACKAGE=\"WebKit2GTK-4.0\" -DHAVE_CONFIG_H=1 -DJSC_COMPILATION -DJSC_GLIB_API_ENABLED -DJavaScriptCore_EXPORTS -DSTATICALLY_LINKED_WITH_WTF -DSVN_REVISION=\"tarball\" -DWEBKITGTK_API_VERSION_STRING=\"4.0\" -IDerivedSources/ForwardingHeaders -I. -I../Source/JavaScriptCore -I../Source/JavaScriptCore/API -I../Source/JavaScriptCore/assembler -I../Source/JavaScriptCore/b3 -I../Source/JavaScriptCore/b3/air -I../Source/JavaScriptCore/bindings -I../Source/JavaScriptCore/builtins -I../Source/JavaScriptCore/bytecode -I../Source/JavaScriptCore/bytecompiler -I../Source/JavaScriptCore/dfg -I../Source/JavaScriptCore/disassembler -I../Source/JavaScriptCore/disassembler/ARM64 -I../Source/JavaScriptCore/disassembler/udis86 -I../Source/JavaScriptCore/domjit -I../Source/JavaScriptCore/ftl -I../Source/JavaScriptCore/heap -I../Source/JavaScriptCore/debugger -I../Source/JavaScriptCore/inspector -I../Source/JavaScriptCore/inspector/agents -I../Source/JavaScriptCore/inspector/augmentable -I../Source/JavaScriptCore/inspector/remote -I../Source/JavaScriptCore/interpreter -I../Source/JavaScriptCore/jit -I../Source/JavaScriptCore/llint -I../Source/JavaScriptCore/parser -I../Source/JavaScriptCore/profiler -I../Source/JavaScriptCore/runtime -I../Source/JavaScriptCore/tools -I../Source/JavaScriptCore/wasm -I../Source/JavaScriptCore/wasm/js -I../Source/JavaScriptCore/yarr -IDerivedSources/JavaScriptCore -IDerivedSources/JavaScriptCore/inspector -IDerivedSources/JavaScriptCore/runtime -IDerivedSources/JavaScriptCore/yarr -IDerivedSources/ForwardingHeaders/JavaScriptCore/glib -IDerivedSources/JavaScriptCore/javascriptcoregtk/jsc -I../Source/JavaScriptCore/API/glib -IDerivedSources/JavaScriptCore/javascriptcoregtk -I../Source/JavaScriptCore/inspector/remote/glib -isystem /usr/include/glib-2.0 -isystem /usr/lib/glib-2.0/include -fdiagnostics-color=always -Wextra -Wall -mfpmath=sse -msse2 -Wno-expansion-to-defined -Wno-noexcept-type -Wno-psabi -Wno-maybe-uninitialized -Wwrite-strings -Wundef -Wpointer-arith -Wmissing-format-attribute -Wformat-security -Wcast-align -D__WORDSIZE=32 -g1 -O2 -fno-strict-aliasing -fno-exceptions -fno-rtti -Os -DNDEBUG -fPIC -ffp-contract=off -std=c++17 -MD -MT Source/JavaScriptCore/CMakeFiles/JavaScriptCore.dir/__/__/DerivedSources/JavaScriptCore/unified-sources/UnifiedSource-f2e18ffc-36.cpp.o -MF Source/JavaScriptCore/CMakeFiles/JavaScriptCore.dir/__/__/DerivedSources/JavaScriptCore/unified-sources/UnifiedSource-f2e18ffc-36.cpp.o.d -o Source/JavaScriptCore/CMakeFiles/JavaScriptCore.dir/__/__/DerivedSources/JavaScriptCore/unified-sources/UnifiedSource-f2e18ffc-36.cpp.o -c DerivedSources/JavaScriptCore/unified-sources/UnifiedSource-f2e18ffc-36.cpp
In file included from ../Source/JavaScriptCore/runtime/CodeCache.h:31,
from ../Source/JavaScriptCore/runtime/VM.cpp:41,
from DerivedSources/JavaScriptCore/unified-sources/UnifiedSource-f2e18ffc-36.cpp:8:
../Source/JavaScriptCore/parser/Parser.h:2238:1: internal compiler error: Segmentation fault
2238 | }
| ^
0x8898d2a crash_signal
../../gcc/toplev.c:328
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
[940/4497] Building CXX object Source/JavaScriptCore/CMakeFiles/JavaScriptCore...._/DerivedSources/JavaScriptCore/unified-sources/UnifiedSource-f2e18ffc-32.cpp.o
ninja: build stopped: subcommand failed.
Previous builds were on a 32-bit chroot ( linux32 chroot ${CHROOT_ARGS}
) on a 64-bit machine with 64-bit kernel and 32-bit userland. Also tried building without chroot on a 64-bit machine with 64-bit kernel and 32-bit userland, but build failed too.
This time, build was successful using clang/clang++ on 64-bit machine with 32-bit kernel and 32-bit userland. Also, LDFLAGS were set to:
-Wl,-z,stack-size=2097152 -Wl,--no-keep-memory -fuse-ld=lld -rtlib=compiler-rt
Webkit2GTK fails to compile with GCC or Clang.
For Clang:
Similar errors come up with either webkitgtk 2.30.2 or 2.30.4.
Some flags were set but no help: