-
Notifications
You must be signed in to change notification settings - Fork 4
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
Xtensa lld update #1
base: xtensa-lld
Are you sure you want to change the base?
Conversation
Use GCCInstallationDetector in Xtensa toolchain instead of XtensaGCCToolchainDetector for initialization of the gcc environment. Add xtensa toolchain test tree with multilib subdirectories.
cc @andreisfr @igrr |
Sorry for the delay! Unfortunately I still can't get it working. I've done the following:
Unfortunately it doesn't quite work yet. This is the error I'm getting:
To be absolutely sure I used the correct Clang version I ran the following command:
The git hash matches. This is the patch I've been using for esp-idf: diff --git a/tools/cmake/toolchain-clang-esp32.cmake b/tools/cmake/toolchain-clang-esp32.cmake
index bb25f98298..3b84307f06 100644
--- a/tools/cmake/toolchain-clang-esp32.cmake
+++ b/tools/cmake/toolchain-clang-esp32.cmake
@@ -11,6 +11,6 @@ set(CMAKE_OBJDUMP xtensa-esp32-elf-objdump)
# -freestanding is a hack to force Clang to use its own stdatomic.h,
# without falling back to the (incompatible) GCC stdatomic.h
# https://github.com/espressif/llvm-project/blob/d9341b81/clang/lib/Headers/stdatomic.h#L13-L18
-set(CMAKE_C_FLAGS "--target=xtensa -mcpu=esp32 -ffreestanding" CACHE STRING "C Compiler Base Flags")
-set(CMAKE_CXX_FLAGS "--target=xtensa -mcpu=esp32 -ffreestanding" CACHE STRING "C++ Compiler Base Flags")
+set(CMAKE_C_FLAGS "--target=xtensa -mcpu=esp32 -ffreestanding -fuse-ld=lld" CACHE STRING "C Compiler Base Flags")
+set(CMAKE_CXX_FLAGS "--target=xtensa -mcpu=esp32 -ffreestanding -fuse-ld=lld" CACHE STRING "C++ Compiler Base Flags")
set(CMAKE_ASM_FLAGS "--target=xtensa -mcpu=esp32" CACHE STRING "Assembler Base Flags") |
I think I got it working! I had to create an |
Hi @aykevl!
If you have time and want to test your LLD port with our LLVM toolchain release (partially based on GCC currently). Here are commits to help testing your Xtensa LLD with IDF. After building clang and LLD you can replace binaries in our latest release distro and use it to build IDF hello-world.
To build IDF example you need to add
-fuse-ld=lld
option to clang in IDF cmake file. Below is the example patch.Command to build IDF example should look like
PATH=/tmp/xtensa-esp32-elf-clang/bin:$PATH IDF_TOOLCHAIN=clang idf.py build