Hello Todd Lipcon,
I'd like you to do a code review. Please visit
http://gerrit.cloudera.org:8080/4540
to review the following change.
Change subject: build: fix codegen errors when using static linkage
......................................................................
build: fix codegen errors when using static linkage
Commit 1670a89 upgraded cmake from 3.2 to 3.6, and in the process, broke all
statically linked codegen-dependent Kudu executables. When run, they
produced errors like the following:
LLVM ERROR: Program used external function
'_ZN4kudu9ArenaBaseILb0EE21AllocateBytesFallbackEmm' which could not be
resolved!
The release notes revealed the culprit: CMP0065[1]. This policy change
removed -rdynamic from every Kudu executable's link line, which had the side
effect of breaking codegen. I don't know why we need -rdynamic, but I
verified that restoring it manually (and using this patch to restore it) fix
the tests. I went digging for better solutions and saw that maybe we should
call ExecutionEngine::addGlobalMapping() on our created functions[2][3], but
after looking at the hairy mess that is JITWrapper, I decided to punt.
This wasn't caught in precommit tests because gerrit uses distributed
testing, which means release builds are dynamically linked to reduce
executable disk space consumption.
1. https://cmake.org/cmake/help/v3.4/policy/CMP0065.html
2.
http://stackoverflow.com/questions/4425797/linking-llvm-jit-code-to-external-c-functions
3. https://llvm.org/bugs/show_bug.cgi?id=20656
Change-Id: Ie803b93cfd9b5bed56ece5f24b769850b7b55b74
---
M CMakeLists.txt
1 file changed, 8 insertions(+), 0 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/40/4540/1
--
To view, visit http://gerrit.cloudera.org:8080/4540
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie803b93cfd9b5bed56ece5f24b769850b7b55b74
Gerrit-PatchSet: 1
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Adar Dembo <[email protected]>
Gerrit-Reviewer: Todd Lipcon <[email protected]>