Skip to content

Commit 8810a9f

Browse files
Tzvetan Mikovfacebook-github-bot
authored andcommitted
arm32 cross-compilation with LTO needs lld-16
Summary: . Reviewed By: avp Differential Revision: D79003256 fbshipit-source-id: 3f490b195acde29ef7690f70f5630e6b45c51bd9
1 parent 0ab4825 commit 8810a9f

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

armhf/arm-linux-gnueabihf.toolchain.cmake

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,7 @@ set(CMAKE_ASM_COMPILER_TARGET arm-linux-gnueabihf)
1818
# Ensure the correct architecture is used and enable Thumb-2
1919
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mthumb -march=armv7-a")
2020
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mthumb -march=armv7-a")
21+
# Use LLD for better LTO support
22+
set(CMAKE_EXE_LINKER_FLAGS "-fuse-ld=lld-16")
23+
set(CMAKE_SHARED_LINKER_FLAGS "-fuse-ld=lld-16")
24+
set(CMAKE_MODULE_LINKER_FLAGS "-fuse-ld=lld-16")

doc/CrossCompilation.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ For Emscripten, you can find an example from the `test-emscripten` job from `her
5757

5858
## Compiling and Running ARM32 Static Hermes from ARM64
5959

60+
On the ARM64 Linux machine you need clang-16 and lld-16.
61+
6062
On the ARM64 Linux machine on which you're compiling:
6163
```
6264
# Add architecture

0 commit comments

Comments
 (0)