CTSRD-CHERI / cheribuild

Easily build and run CHERI related projects
http://www.chericpu.com
Other
66 stars 45 forks source link

Build error - cheribuild.py cheribsd-aarch64 -d #354

Open harsha0229 opened 1 year ago

harsha0229 commented 1 year ago

Hello,

When I try to build for aarch64, using the command 'cheribuild.py cheribsd-aarch64 -d', I get the following error in between and the build fails resulting in a fatal error as shown below:

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx [733/1686] Building CXX object tools/clang/lib/ASTMatchers/Dynamic/CMakeFiles/obj.clangDynamicASTMatchers.dir/Registry.cpp.o FAILED: tools/clang/lib/ASTMatchers/Dynamic/CMakeFiles/obj.clangDynamicASTMatchers.dir/Registry.cpp.o /usr/bin/clang++ -DGTEST_HAS_RTTI=0 -DLLVM_NO_DEFAULT_ADDRESS_SPACE -D_DEBUG -D_GNU_SOURCE -DSTDC_CONSTANT_MACROS -DSTDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Itools/clang/lib/ASTMatchers/Dynamic -I/home/duser/cheri/llvm-project/clang/lib/ASTMatchers/Dynamic -I/home/duser/cheri/llvm-project/clang/include -Itools/clang/include -Iinclude -I/home/duser/cheri/llvm-project/llvm/include -fPIC -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wstring-conversion -Wmisleading-indentation -fdiagnostics-color -ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual -Wno-nested-anon-types -O3 -DNDEBUG -fno-exceptions -fno-rtti -UNDEBUG -std=c++14 -MD -MT tools/clang/lib/ASTMatchers/Dynamic/CMakeFiles/obj.clangDynamicASTMatchers.dir/Registry.cpp.o -MF tools/clang/lib/ASTMatchers/Dynamic/CMakeFiles/obj.clangDynamicASTMatchers.dir/Registry.cpp.o.d -o tools/clang/lib/ASTMatchers/Dynamic/CMakeFiles/obj.clangDynamicASTMatchers.dir/Registry.cpp.o -c /home/duser/cheri/llvm-project/clang/lib/ASTMatchers/Dynamic/Registry.cpp [736/1686] Building CXX object tools/clang/lib/Sema/CMakeFiles/obj.clangSema.dir/AnalysisBasedWarnings.cpp.o ninja: build stopped: subcommand failed. Fatal error (in target llvm-native): Command nice cmake --build . --target all -- -j4 failed with non-zero exit code 1

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx I'm using VMware WorkStation 16.1.2 build-17966106, Ubuntu 20.04.5 LTS, and the latest build on Github(of cheribuild as on today)

Also, when I try "./cheribuild.py llvm-aarch64", I get the following error: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx duser@172.16.0.157:~/Documents/Beam-connectivity/Project1/cheribuild$ ./cheribuild.py llvm-aarch64 Checking /home/duser/.config/cheribuild.json since /home/duser/Documents/Beam-connectivity/Project1/cheribuild/cheribuild.json doesn't exist Note: Configuration file /home/duser/.config/cheribuild.json does not exist, using only command line arguments. Sources will be stored in /home/duser/cheri Build artifacts will be stored in /home/duser/cheri/output cd /home/duser/Documents/Beam-connectivity/Project1/cheribuild && git fetch Fatal error: Dependency for llvm-aarch64 missing: /home/duser/cheri/output/sdk/bin/clang version 0.0.0 is not supported. Clang version 3.8 or newer is required. Possible solution: Run apt install clang Alternatively if the repository version is too old, try running: sudo apt install software-properties-common sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)"

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Can you please help me resolve this?

Thank you very much, Harsha

harsha0229 commented 1 year ago

Hello,

I could resolve the issue. I updated the OS to Ubuntu 22.04 and retried from scratch. It worked.

Thank you, Harsha

jrtc27 commented 1 year ago

For the first error I don’t know what the issue is, the log excerpt you posted doesn’t contain an actual error, just the build tool reporting that there was an error when running the compiler (which itself should have reported the actual error).

For the second error you didn’t have a working CHERI LLVM built yet and didn’t pass -d, so LLVM could not be cross-compiled for aarch64 using it.