This is an archive of the discontinued LLVM Phabricator instance.

Add missing header for InstructionCombining.cpp, in order to export LLVMInitializeInstCombine as extern "C"
ClosedPublic

Authored by brenton on Mar 6 2018, 3:20 AM.

Details

Summary

Getting this error:

"Undefined symbols for architecture x86_64:
  \"_LLVMInitializeInstCombine\", referenced from:
      _LLVMLink_LLVMInitializeInstCombine_Wrapper in llvmc60.cpp.o
     (maybe you meant: _LLVMLink_LLVMInitializeInstCombine_Wrapper)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see \
invocation)
make[2]: *** [LLVMLink.dylib] Error 1
make[1]: *** [CMakeFiles/LLVMLink.dir/all] Error 2
make: *** [all] Error 2
"

LLVMInitializeInstCombine is declared extern "C" in the LLVM-C header Initialization.h, but not declared extern "C" surrounding the definition for the function in lib/Transforms/InstCombine/InstructionCombining.cpp.

This fixes 35947
https://bugs.llvm.org/show_bug.cgi?id=35947

Diff Detail

Repository
rL LLVM

Event Timeline

brenton created this revision.Mar 6 2018, 3:20 AM
brenton edited the summary of this revision. (Show Details)Mar 6 2018, 3:21 AM

Please run Clang-fromat. If I'm not mistaken, llvm-c/Initialization.h should be after InstCombineInternal.h.

brenton updated this revision to Diff 137191.Mar 6 2018, 7:08 AM

You are correct. I ran clang-format on it.

clang-format also formatted the rest of the file and changed it, but I did not want to make those changes in this revision.

Eugene.Zelenko accepted this revision.Mar 6 2018, 8:08 AM
This revision is now accepted and ready to land.Mar 6 2018, 8:08 AM

I cannot commit this patch myself. I do not have permissions.

I was wondering about including this in the first bug release of 6.0. How would I ensure this?

I cannot commit this patch myself. I do not have permissions.

I'll try to do this later today.

I was wondering about including this in the first bug release of 6.0. How would I ensure this?

You'll need to create bug report in http://bugs.llvm.org, but I'm not sure was meta-report for 6.0.1 created or not.

This revision was automatically updated to reflect the committed changes.
nmgeek added a subscriber: nmgeek.Dec 23 2018, 10:17 AM

This bug seems to be in the mainstream, stable, LTS Ubuntu apt repository as version 1:6.0-1ubuntu2~16.04.1. It breaks the llvmlite python package and, by extension, the python numba package. Conda works around it by compiling llvm from source and repackaging. What is the recommended workaround for Ubuntu 16 when not using Conda?