OSDN Git Service

Fix SwiftShader's libEGL build under ThinLTO.
authorIvan Krasin <krasin@chromium.org>
Mon, 17 Apr 2017 21:08:34 +0000 (14:08 -0700)
committerIvan Krasin <krasin@chromium.org>
Tue, 18 Apr 2017 20:38:37 +0000 (20:38 +0000)
commit628a8496e44ec8a096125cb0cdc3e63bb7dd8380
treeefa4dbb4cf0b1afcaed803a14def2a33bc8bc1ae
parent30385f0f418b2c366acd7ef9bf6024b41bd4a1e1
Fix SwiftShader's libEGL build under ThinLTO.

Linking libEGL.so of the SwiftShader's flavor requires
the linker to be too smart (there's a heavy reliance on
garbage collecting unused symbols, for which there is
no guarantees in the general case). In ThinLTO case,
garbage collection is still not as sofisticated, as in
other cases, so it fails to link the target complaining
about undefined symbols.

The workaround is to prevent Clang from splitting the
bitcode files in the question into two, and making the
GC problem a bit easier.

Eventually, ThinLTO might get a better GC, but it might
be a good idea to not rely on this feature in the source
code. At least, no other targets in Chromium do.

BUG=chromium:686980

Change-Id: Ib44f65c4825cc3f6cd24695738a71ca4661f0bfb
Reviewed-on: https://swiftshader-review.googlesource.com/9308
Tested-by: Ivan Krasin <krasin@chromium.org>
Reviewed-by: Nicolas Capens <capn@google.com>
src/OpenGL/libEGL/BUILD.gn