Commit b934b572 authored by Lai Wei-Chih's avatar Lai Wei-Chih Committed by Andrew Hsieh
Browse files

[ndk][pndk] Fix le32 linking issue by treating ".bc" as ".o".

This issue occurs only when bitcode filename ends with .bc,
filename ends with ".o" or ".so" doesn't have such problem.

Issue description:

Assume libc.bc is already linked by le32-none-ndk-link, and it
contains the bitcode wrapper we needed.

clang -shared -emit-llvm -target le32-none-ndk a.bc libc.bc -o b.bc

It takes 3 phases to complete the linking,

(1) clang -cc1 a.bc -emit-llvm-bc -target le32-none-ndk -o /tmp/a.bc
(2) clang -cc1 libc.bc -emit-llvm-bc -target le32-none-ndk -o /tmp/libc.bc
(3) le32-none-ndk-link -shared /tmp/a.bc /tmp/libc.bc -o b.bc

In the second phase, /tmp/libc.bc is generated without bitcode wrapper.
This makes the final linking phase incorrectly.

The solution here is treating ".bc" as ".o", then phase 1 and 2 could be
skipped.
parent bd2a7ffc
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment