Alexey Serbin has submitted this change and it was merged.

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 

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.


Change-Id: Ie803b93cfd9b5bed56ece5f24b769850b7b55b74
Tested-by: Kudu Jenkins
Reviewed-by: Alexey Serbin <>
M CMakeLists.txt
1 file changed, 8 insertions(+), 0 deletions(-)

  Alexey Serbin: Looks good to me, approved
  Kudu Jenkins: Verified

To view, visit
To unsubscribe, visit

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie803b93cfd9b5bed56ece5f24b769850b7b55b74
Gerrit-PatchSet: 2
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: Adar Dembo <>
Gerrit-Reviewer: Adar Dembo <>
Gerrit-Reviewer: Alexey Serbin <>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Todd Lipcon <>

Reply via email to