David Keaton via llvm-dev
2017-Sep-26 01:03 UTC
[llvm-dev] Errors linking with LLVM 5.0 - dump() missing
On 09/25/2017 02:53 PM, Matthias Braun via llvm-dev wrote:> The dump methods can be included in the release builds anyway by > enabling LLVM_ENABLE_DUMP.Is there a way to pass LLVM_ENABLE_DUMP into cmake from outside without changing any of the configuration files? With Chapel's use of LLVM, we try to avoid modifying any of the source files that come from the LLVM distribution. Our own Makefile that builds Chapel also invokes cmake to build LLVM. I have tried setting environment variables and passing command-line arguments, and nothing seems to work. I hope I've just done it wrong and there is a way to make this work without modifying files from the distribution. A debug build of LLVM is too slow for our purposes, but we need the dump() methods for debugging Chapel. David
Matthias Braun via llvm-dev
2017-Sep-26 01:19 UTC
[llvm-dev] Errors linking with LLVM 5.0 - dump() missing
> On Sep 25, 2017, at 6:03 PM, David Keaton via llvm-dev <llvm-dev at lists.llvm.org> wrote: > > On 09/25/2017 02:53 PM, Matthias Braun via llvm-dev wrote: >> The dump methods can be included in the release builds anyway by enabling LLVM_ENABLE_DUMP. > > Is there a way to pass LLVM_ENABLE_DUMP into cmake from outside without changing any of the configuration files? With Chapel's use of LLVM, we try to avoid modifying any of the source files that come from the LLVM distribution. Our own Makefile that builds Chapel also invokes cmake to build LLVM. I have tried setting environment variables and passing command-line arguments, and nothing seems to work.Looks like nobody got around adding a flag. (this really should be fixed). In the meantime `cmake -DCMAKE_CXX_FLAGS="-DLLVM_ENABLE_DUMP"` should do the trick. - Matthias
David Keaton via llvm-dev
2017-Sep-26 01:47 UTC
[llvm-dev] Errors linking with LLVM 5.0 - dump() missing
On 09/25/2017 06:19 PM, Matthias Braun wrote:> >> On Sep 25, 2017, at 6:03 PM, David Keaton via llvm-dev <llvm-dev at lists.llvm.org> wrote: >> >> On 09/25/2017 02:53 PM, Matthias Braun via llvm-dev wrote: >>> The dump methods can be included in the release builds anyway by enabling LLVM_ENABLE_DUMP. >> >> Is there a way to pass LLVM_ENABLE_DUMP into cmake from outside without changing any of the configuration files? With Chapel's use of LLVM, we try to avoid modifying any of the source files that come from the LLVM distribution. Our own Makefile that builds Chapel also invokes cmake to build LLVM. I have tried setting environment variables and passing command-line arguments, and nothing seems to work. > Looks like nobody got around adding a flag. (this really should be fixed). > > In the meantime `cmake -DCMAKE_CXX_FLAGS="-DLLVM_ENABLE_DUMP"` should do the trick.Thank you. That was the flag we needed. Unfortunately, when I tried this just now, I found that the declaration of llvm::MachineRegisterInfo::dumpUses() in include/llvm/CodeGen/MachineRegisterInfo.h is missing the check against LLVM_ENABLE_DUMP. It has only #ifndef NDEBUG which causes the build to fail because the definition in lib/CodeGen/MachineRegisterInfo.cpp is guarded by this. #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) David
Apparently Analagous Threads
- Errors linking with LLVM 5.0 - dump() missing
- Errors linking with LLVM 5.0 - dump() missing
- Errors linking with LLVM 5.0 - dump() missing
- Question about LLVM Building Error with "-DLLVM_ENABLE_DUMP" and "RelWithDebInfo"
- Errors linking with LLVM 5.0 - dump() missing