LadybirdBrowser / ancient-history

The Ladybird web browser
BSD 2-Clause "Simplified" License
1.62k stars 107 forks source link

[Build Error] Segmentation Fault #100

Closed warpdesign closed 1 year ago

warpdesign commented 1 year ago

When running cmake -GNinja -B Build I am getting this error on macOS:

[4/2218] Building CXX object _deps/lag...land/Libraries/LibGUI/GML/Parser.cpp.o FAILED: _deps/lagom-build/CMakeFiles/LibGUI.dir///Userland/Libraries/LibGUI/GML/Parser.cpp.o /Library/Developer/CommandLineTools/usr/bin/c++ -DLibGUI_EXPORTS -I/Users/nico/Documents/Dev/ladybird/Build/serenity -I/Users/nico/Documents/Dev/ladybird/Build/serenity/Userland/Libraries -I/Users/nico/Documents/Dev/ladybird/Build/_deps/lagom-build -I/Users/nico/Documents/Dev/ladybird/Build/_deps/lagom-build/Userland/Services -I/Users/nico/Documents/Dev/ladybird/Build/_deps/lagom-build/Userland/Libraries -I/Users/nico/Documents/Dev/ladybird/Build/serenity/Meta/Lagom/../.. -I/Users/nico/Documents/Dev/ladybird/Build/serenity/Meta/Lagom/../../Userland -I/Users/nico/Documents/Dev/ladybird/Build/serenity/Meta/Lagom/../../Userland/Libraries -I/Users/nico/Documents/Dev/ladybird/Build/serenity/Meta/Lagom/../../Userland/Services -I/Users/nico/Documents/Dev/ladybird/Build -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.3.sdk -fPIC -Wall -Wextra -Werror -Wno-implicit-const-int-float-conversion -Wno-literal-suffix -Wno-maybe-uninitialized -Wno-unknown-warning-option -Wno-unused-command-line-argument -fsigned-char -fno-exceptions -fdiagnostics-color=always -fPIC -g1 -O2 -Wno-overloaded-virtual -Wno-user-defined-literals -fconstexpr-steps=16777216 -Wno-unused-private-field -std=c++20 -MD -MT _deps/lagom-build/CMakeFiles/LibGUI.dir///Userland/Libraries/LibGUI/GML/Parser.cpp.o -MF _deps/lagom-build/CMakeFiles/LibGUI.dir///Userland/Libraries/LibGUI/GML/Parser.cpp.o.d -o _deps/lagom-build/CMakeFiles/LibGUI.dir///Userland/Libraries/LibGUI/GML/Parser.cpp.o -c /Users/nico/Documents/Dev/ladybird/Build/serenity/Userland/Libraries/LibGUI/GML/Parser.cpp clang: error: unable to execute command: Segmentation fault: 11 clang: error: clang frontend command failed due to signal (use -v to see invocation) Apple clang version 13.1.6 (clang-1316.0.21.2.5) Target: arm64-apple-darwin21.5.0 Thread model: posix InstalledDir: /Library/Developer/CommandLineTools/usr/bin clang: note: diagnostic msg:


PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT: Preprocessed source(s) and associated run script(s) are located at: clang: note: diagnostic msg: /var/folders/d0/3xyb4j252nxfphjnb7wd8sq00000gp/T/Parser-08fa67.cpp clang: note: diagnostic msg: /var/folders/d0/3xyb4j252nxfphjnb7wd8sq00000gp/T/Parser-08fa67.sh clang: note: diagnostic msg: Crash backtrace is located in clang: note: diagnostic msg: /Users/nico/Library/Logs/DiagnosticReports/clang.crash clang: note: diagnostic msg: (choose the .crash file that corresponds to your crash) clang: note: diagnostic msg:


Also, I am not sure what repo I should checkout/run the build commands in:

BertalanD commented 1 year ago

We have seen this compiler crash multiple times. Please ensure you have the latest version of Xcode installed OR specify a different compiler (e.g. Homebrew LLVM 15) by setting -DCMAKE_CXX_COMPILER.

warpdesign commented 1 year ago

After updating to latest macOS 12.6 (which updated build toolchain), I was able to compile and run ladybird successfully with the following command: cmake -GNinja -B Build -DCMAKE_CXX_COMPILER=clang++

Some notes: