-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Better Clang LTO: install LLVMgold to bfd-plugins.
ar will automatically load any plugins that are installed to ../lib/bfd-plugins. Rather than needing to fix all of our build systems, we can make LTO Just Work if we copy the gold plugin (and its dependencies) into the binutils directory. I've also added a test for cmake LTO. Test: ./validate.py --filter flto Bug: android/ndk#108 Change-Id: I1db61b8ef3405474c64ff20478daa86ca41ab3b3
- Loading branch information
Showing
4 changed files
with
32 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
cmake_minimum_required(VERSION 3.6.0) | ||
|
||
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -flto") | ||
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -flto") | ||
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold") | ||
|
||
add_library(bar STATIC jni/bar.c) | ||
|
||
add_executable(flto jni/flto.c) | ||
target_link_libraries(flto bar) |