Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 Reviewed-on: http://gerrit.cloudera.org:8080/4540 Tested-by: Kudu Jenkins Reviewed-by: Alexey Serbin <[email protected]>
- Loading branch information