-
Notifications
You must be signed in to change notification settings - Fork 13
Build hexagon-builtins for baremetal #53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -147,7 +147,43 @@ build_clang_rt_builtins() { | |
| cmake --build ./obj_clang_rt -- -v install-builtins | ||
| } | ||
|
|
||
| build_clang_rt_builtins_baremetal() { | ||
| cd ${BASE}/llvm-project/ | ||
|
|
||
| PATH=${TOOLCHAIN_BIN}:${PATH} \ | ||
| cmake -G Ninja \ | ||
| -DCMAKE_C_COMPILER:STRING=`which clang` \ | ||
| -DCMAKE_CXX_COMPILER:STRING=`which clang++` \ | ||
| -DCMAKE_BUILD_TYPE=Release \ | ||
| -DLLVM_CMAKE_DIR:PATH=$TOOLCHAIN_INSTALL \ | ||
| -DCMAKE_INSTALL_PREFIX:PATH=$($TOOLCHAIN_INSTALL/bin/clang -print-resource-dir) \ | ||
| -DCMAKE_ASM_FLAGS="-G0 -mlong-calls -fno-pic" \ | ||
| -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON \ | ||
| -DLLVM_TARGET_TRIPLE=hexagon-unknown-unknown-elf \ | ||
| -DCOMPILER_RT_DEFAULT_TARGET_TRIPLE=hexagon-unknown-unknown-elf \ | ||
| -DCOMPILER_RT_BUILD_BUILTINS=ON \ | ||
| -DCOMPILER_RT_BUILD_SANITIZERS=OFF \ | ||
| -DCOMPILER_RT_BUILD_XRAY=OFF \ | ||
| -DCOMPILER_RT_BUILD_LIBFUZZER=OFF \ | ||
| -DCOMPILER_RT_BUILD_PROFILE=OFF \ | ||
| -DCOMPILER_RT_BUILD_MEMPROF=OFF \ | ||
| -DCOMPILER_RT_BUILD_ORC=OFF \ | ||
| -DCOMPILER_RT_BUILD_GWP_ASAN=OFF \ | ||
| -DCOMPILER_RT_BUILTINS_ENABLE_PIC=OFF \ | ||
| -DCOMPILER_RT_SUPPORTED_ARCH=hexagon \ | ||
| -DCOMPILER_RT_BAREMETAL_BUILD=ON \ | ||
|
Comment on lines
+165
to
+174
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Most of these belong in a cmake cache file. Can you contribute them -- ideally to the llvm-project monorepo? Adding cmake cache files like this is noncontroversial and is just a mechanism to publicize our build configuration for other developers. This makes use cases for LLVM toolchain builds clear to people who want to understand how the toolchain is used -- for example, when making changes to cmake functions/modules. |
||
| -DCMAKE_C_FLAGS="-ffreestanding" \ | ||
| -DCMAKE_CXX_FLAGS="-ffreestanding" \ | ||
| -DCMAKE_CROSSCOMPILING=ON \ | ||
| -DCAN_TARGET_hexagon=1 \ | ||
| -DCMAKE_C_COMPILER_FORCED=ON \ | ||
| -DCMAKE_CXX_COMPILER_FORCED=ON \ | ||
| -DCMAKE_C_COMPILER_TARGET=hexagon-unknown-unknown-elf \ | ||
| -DCMAKE_CXX_COMPILER_TARGET=hexagon-unknown-unknown-elf \ | ||
| -B hexagon-builtins/ \ | ||
| -S compiler-rt/ | ||
| cmake --build ./hexagon-builtins -- -v install-builtins | ||
| } | ||
|
|
||
| config_kernel() { | ||
| cd ${BASE} | ||
|
|
@@ -385,6 +421,7 @@ config_kernel | |
| build_kernel_headers | ||
| build_musl_headers | ||
| build_clang_rt_builtins | ||
| build_clang_rt_builtins_baremetal | ||
| build_musl | ||
|
|
||
| build_libs | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah - my mistake -- I said elsewhere that the triple is used, but that's not quite right. The C library gets installed to
target/${normalized-triple}/but you're right that the builtins get installed here. Hmm -- will this one conflict with the builtins for linux?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@quic-k or @quic-akaryaki are you planning to make changes to the compiler driver to support this?