Dibyendu Majumdar via llvm-dev
2017-Sep-25 21:47 UTC
[llvm-dev] Errors linking with LLVM 5.0 - dump() missing
Hi Matthias, On 25 September 2017 at 22:43, Matthias Braun <mbraun at apple.com> wrote:> The dump() methods are only meant to be used in debuggers and are only available in debug builds of LLVM. There are often similar print() methods available though. >I am not sure how this is the case seeing that the dump() function has been working in release builds in all the LLVM releases I have used (from 3.5 to 4.0).> >> On Sep 25, 2017, at 11:40 AM, Dibyendu Majumdar via llvm-dev <llvm-dev at lists.llvm.org> wrote:>> I am finding that my project that previously successfully built with >> versions 3.5 to 4.0 is now failing to link because of missing >> implementation for dump(). Errors I get are: >> >> Undefined symbols for architecture x86_64: >> >> "llvm::Type::dump() const", referenced from: >> ravi::LuaLLVMTypes::dump() in ravi_llvmtypes.cpp.o >> dump_content(lua_State*) in ravi_llvmluaapi.cpp.o >> "llvm::Value::dump() const", referenced from: >> dump_content(lua_State*) in ravi_llvmluaapi.cpp.o >> "llvm::Module::dump() const", referenced from: >> >> This appears to be a change that is not documented in the release >> notes of 5.0. Please can someone describe what the change is and how I >> can detect whether the dump() implementation is available or not? >> >> It also seems strange that dump() implementation was removed - surely >> it would have been better ti stub it so that client code does not >> break? >> >> Regards >> Dibyendu >> _______________________________________________ >> LLVM Developers mailing list >> llvm-dev at lists.llvm.org >> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >
Matthias Braun via llvm-dev
2017-Sep-25 21:53 UTC
[llvm-dev] Errors linking with LLVM 5.0 - dump() missing
> On Sep 25, 2017, at 2:47 PM, Dibyendu Majumdar <mobile at majumdar.org.uk> wrote: > > Hi Matthias, > > On 25 September 2017 at 22:43, Matthias Braun <mbraun at apple.com> wrote: >> The dump() methods are only meant to be used in debuggers and are only available in debug builds of LLVM. There are often similar print() methods available though. >> > > I am not sure how this is the case seeing that the dump() function has > been working in release builds in all the LLVM releases I have used > (from 3.5 to 4.0).The idea behind r198456 and the whole discussion in http://lists.llvm.org/pipermail/cfe-dev/2014-January/034323.html <http://lists.llvm.org/pipermail/cfe-dev/2014-January/034323.html> was that the dump() method are not available in release builds to safe code size. The dump methods can be included in the release builds anyway by enabling LLVM_ENABLE_DUMP. The actual implementation of this policy however lacked and depending on which dump() method you looked you would find a different pattern of when it is disable/enabled; I cleaned this up in r293359 <https://llvm.org/svn/llvm-project/llvm/trunk at 293359> so all dump methods are enabled/disabled consistenly. In any case if your client code uses dump() methods then I'd recommend to change it. - Matthias> >> >>> On Sep 25, 2017, at 11:40 AM, Dibyendu Majumdar via llvm-dev <llvm-dev at lists.llvm.org> wrote: > >>> I am finding that my project that previously successfully built with >>> versions 3.5 to 4.0 is now failing to link because of missing >>> implementation for dump(). Errors I get are: >>> >>> Undefined symbols for architecture x86_64: >>> >>> "llvm::Type::dump() const", referenced from: >>> ravi::LuaLLVMTypes::dump() in ravi_llvmtypes.cpp.o >>> dump_content(lua_State*) in ravi_llvmluaapi.cpp.o >>> "llvm::Value::dump() const", referenced from: >>> dump_content(lua_State*) in ravi_llvmluaapi.cpp.o >>> "llvm::Module::dump() const", referenced from: >>> >>> This appears to be a change that is not documented in the release >>> notes of 5.0. Please can someone describe what the change is and how I >>> can detect whether the dump() implementation is available or not? >>> >>> It also seems strange that dump() implementation was removed - surely >>> it would have been better ti stub it so that client code does not >>> break? >>> >>> Regards >>> Dibyendu >>> _______________________________________________ >>> LLVM Developers mailing list >>> llvm-dev at lists.llvm.org >>> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >>-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170925/5e15454e/attachment.html>
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