Skip to content

NDK link-time optimization fails missing llvmgold.so, but contains llvmgold.dylib #108

@JakeWharton

Description

@JakeWharton

I'm attempting to add -flto for link-time optimization to my cFlags and ldFlags (using the new Gradle experimental plugin) but receiving a failure to load LLVMgold.so at link time:

/Users/jw/android-sdk/ndk-bundle/toolchains/aarch64-linux-android-4.9/prebuilt/darwin-x86_64/lib/gcc/aarch64-linux-android/4.9.x/../../../../aarch64-linux-android/bin/ld: /Users/jw/android-sdk/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/bin/../lib64/LLVMgold.so: error loading plugin: dlopen(/Users/jw/android-sdk/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/bin/../lib64/LLVMgold.so, 2): image not found

A quick look into the NDK reveals that the lib64/ folder contains an LLVMgold.dylib file, but not the .so:

$ find ~/android-sdk/ndk-bundle -name 'LLVMgold*'
/Users/jw/android-sdk/ndk-bundle/toolchains/llvm/prebuilt/darwin-x86_64/lib64/LLVMgold.dylib

Is the .so missing, or is there a different way to enable LTO that uses this dynamic lib instead?

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions