-
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?
Conversation
Signed-off-by: Kushal Pal <[email protected]>
|
If the builtins library we're building is the same one that we've already built for linux, we can just add a symlink instead of building it again. We can add a symlink to this library for each hexagon triple we want to support. |
While we're doing this change -- why not build the picolibc fork too? That way we can have a release that works for experimenting w/picolibc. |
|
@androm3da we don't know if the builtins will be always built in the same way for linux and baremetal. For example, baremetal builtins may not need PIC. |
that would be nice, but currently the PR to upstream Hexagon patches in Picolibc is open |
It is this way now, so whatever the normalized baremetal triple is, that's the path that we should be installing into. |
If you think it "works" (for some definition of "works") then IMO it's good to include it. We don't know how long the upstreaming will take and this toolchain repo has routinely used downstream forks while we're working on upstreaming. I mean, if you can run programs built against your picolibc fork in both hexagon-sim and QEMU, with semihosting, then we should include it here because that's a significant step forward. Whatever changes upstream picolibc demands will only make things better but in the meantime people can experiment with this new functionality. |
| -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 \ |
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.
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_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) \ |
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?
yes, we can run programs built against Picolibc fork with both hexagon-sim and QEMU with semihosting |
Adding a function to build hexagon builtins for baremetal target
we might have to decide on a common location for the install path of archive
or we can keep it separate for different target triples
This seems like a common path to install compiler-rt bits :
<install_path>/lib/clang/<version>/lib/<target-triple>/