[llvm-dev] [cfe-dev] How to debug if LTO generate wrong code?

Shi, Steven via llvm-dev llvm-dev at lists.llvm.org
Mon May 30 05:11:48 PDT 2016


Hi Mehdi,
Your patch cannot compile with gold-plugin.cpp in latest trunk either, the failure is same as llvm3.8 as below.


Steven Shi
Intel\SSG\STO\UEFI Firmware

Tel: +86 021-61166522
iNet: 821-6522

From: Shi, Steven
Sent: Monday, May 30, 2016 2:59 PM
To: mehdi.amini at apple.com
Cc: Umesh Kalappa <umesh.kalappa0 at gmail.com>; eliben at gmail.com; llvm-dev <llvm-dev at lists.llvm.org>; cfe-dev at lists.llvm.org; Rafael EspĂ­ndola <rafael.espindola at gmail.com>
Subject: RE: [cfe-dev] [llvm-dev] How to debug if LTO generate wrong code?

Hi Mehdi,
The llvm3.8 gold-plugin.cpp is very different from the latest one on trunk. Your patch has compiling failure on llvm3.8 as below. I will try it on latest trunk later. Thank you help anyway!

Building CXX object tools/gold/CMakeFiles/LLVMgold.dir/gold-plugin.cpp.o
cd /home/jshi19/llvm38releasebuild/tools/gold && /home/jshi19/clang38/bin/clang++   -DGTEST_HAS_RTTI=0 -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/jshi19/llvm38releasebuild/tools/gold -I/home/jshi19/llvm-3.8.0.src/tools/gold -I/home/jshi19/llvm38releasebuild/include -I/home/jshi19/llvm-3.8.0.src/include -I/home/jshi19/binutils-2.26/include  -fPIC -fvisibility-inlines-hidden -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wcovered-switch-default -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -std=c++11 -ffunction-sections -fdata-sections -O3 -DNDEBUG -fPIC    -fno-exceptions -fno-rtti -o CMakeFiles/LLVMgold.dir/gold-plugin.cpp.o -c /home/jshi19/llvm-3.8.0.src/tools/gold/gold-plugin.cpp
/home/jshi19/llvm-3.8.0.src/tools/gold/gold-plugin.cpp:60:16: error: unknown type name 'string'; did you mean 'std::string'?
static cl::opt<string> LTOCodeModel("lto-use-large-codemodel", cl::Hidden,
               ^~~~~~
               std::string
/usr/lib/gcc/x86_64-linux-gnu/5.3.1/../../../../include/c++/5.3.1/bits/stringfwd.h:74:33: note: 'std::string' declared here
  typedef basic_string<char>    string;
                                ^
/home/jshi19/llvm-3.8.0.src/tools/gold/gold-plugin.cpp:800:9: error: no template named 'StringSwitch' in namespace 'llvm'; did you mean 'StringSet'?
  llvm::StringSwitch<unsigned>(LTOCodeModel)
  ~~~~~~^~~~~~~~~~~~
        StringSet
/home/jshi19/llvm-3.8.0.src/include/llvm/ADT/StringSet.h:23:9: note: 'StringSet' declared here
  class StringSet : public llvm::StringMap<char, AllocatorTy> {
        ^
In file included from /home/jshi19/llvm-3.8.0.src/tools/gold/gold-plugin.cpp:16:
In file included from /home/jshi19/llvm-3.8.0.src/include/llvm/ADT/DenseSet.h:17:
In file included from /home/jshi19/llvm-3.8.0.src/include/llvm/ADT/DenseMap.h:17:
In file included from /home/jshi19/llvm-3.8.0.src/include/llvm/ADT/DenseMapInfo.h:17:
In file included from /home/jshi19/llvm-3.8.0.src/include/llvm/ADT/ArrayRef.h:13:
In file included from /home/jshi19/llvm-3.8.0.src/include/llvm/ADT/Hashing.h:49:
In file included from /home/jshi19/llvm-3.8.0.src/include/llvm/Support/Host.h:17:
/home/jshi19/llvm-3.8.0.src/include/llvm/ADT/StringMap.h:228:12: error: multiple overloads of 'StringMap' instantiate to the same signature 'void (unsigned int)'
  explicit StringMap(AllocatorTy A)
           ^
/home/jshi19/llvm-3.8.0.src/include/llvm/ADT/StringSet.h:23:28: note: in instantiation of template class 'llvm::StringMap<char, unsigned int>' requested here
  class StringSet : public llvm::StringMap<char, AllocatorTy> {
                           ^
/home/jshi19/llvm-3.8.0.src/tools/gold/gold-plugin.cpp:800:3: note: in instantiation of template class 'llvm::StringSet<unsigned int>' requested here
  llvm::StringSwitch<unsigned>(LTOCodeModel)
  ^
/home/jshi19/llvm-3.8.0.src/include/llvm/ADT/StringMap.h:225:12: note: previous declaration is here
  explicit StringMap(unsigned InitialSize)
           ^
3 errors generated.
tools/gold/CMakeFiles/LLVMgold.dir/build.make:65: recipe for target 'tools/gold/CMakeFiles/LLVMgold.dir/gold-plugin.cpp.o' failed
make[3]: *** [tools/gold/CMakeFiles/LLVMgold.dir/gold-plugin.cpp.o] Error 1
make[3]: Leaving directory '/home/jshi19/llvm38releasebuild'
CMakeFiles/Makefile2:17855: recipe for target 'tools/gold/CMakeFiles/LLVMgold.dir/all' failed
make[2]: *** [tools/gold/CMakeFiles/LLVMgold.dir/all] Error 2
make[2]: Leaving directory '/home/jshi19/llvm38releasebuild'
CMakeFiles/Makefile2:17867: recipe for target 'tools/gold/CMakeFiles/LLVMgold.dir/rule' failed
make[1]: *** [tools/gold/CMakeFiles/LLVMgold.dir/rule] Error 2
make[1]: Leaving directory '/home/jshi19/llvm38releasebuild'
Makefile:3944: recipe for target 'LLVMgold' failed
make: *** [LLVMgold] Error 2


Steven Shi
Intel\SSG\STO\UEFI Firmware

Tel: +86 021-61166522
iNet: 821-6522

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160530/579fc411/attachment.html>


More information about the llvm-dev mailing list