[llvm-commits] [Review request] Tweak section names of linkonce on PECOFF

NAKAMURA Takumi geek4civic at gmail.com
Mon Oct 11 04:45:52 PDT 2010


Good evening, Anton!

I have checked llvm-gcc42-2.8/mingw.
It seems llvm-g++/mingw has its own libstdc++ itself.
It has sections named ".text$linkonce_{mangled}" and marked as
LINK_ONCE_SAME_CONTENTS.

libstdc++, in My distro, msysgit, has sections " .text${mangled}" and
maked as LINK_ONCE_DISCARD.
(FYI, also in Cygwin)

It would be not a matter as far as we provide and ship libstdc++
compiled by llvm-gcc.

I don't know which would be *the right way*, but we should provide our
libstdc++ with clang++ in future ;)
(it should be "llvm-libcxx!")

..Takumi


2010/10/11 Anton Korobeynikov <anton at korobeynikov.info>:
> Hello Takumi,
>
>> W/O this, linking against gcc/libstdc++ must fail.
> It doesn't seem for me. E.g. llvm-gcc-built Qt linked w/o any problems.
> Could you please indicate the version of binutils you're using? And
> the error message you're seeing?
>
> --
> With best regards, Anton Korobeynikov
> Faculty of Mathematics and Mechanics, Saint Petersburg State University
>
-------------- next part --------------
msysgit $ gcc -v
Using built-in specs.
Target: mingw32
Configured with: ../gcc-4.4.0/configure --prefix=/mingw --build=mingw32 --enable-languages=c,ada,c++,fortran,objc,obj-c++ --disable-nls --disable-win32-registry --disable-werror --enable-threads --disable-ymvers --enable-cxx-flags='-fno-function-sections -fno-data-sections' --enable-fully-dynamic-string --enable-libgomp --enable-version-specific-runtime-libs --enable-sjlj-exceptions --with-pkgversion='TDM-1 mingw32' --with-bugurl=http://www.tdragon.net/recentgcc/bugs.php
Thread model: win32
gcc version 4.4.0 (TDM-1 mingw32)

msysgit $ ld --version
GNU ld (GNU Binutils) 2.19.1

cygwin-1.7 $ ld --version
GNU ld (GNU Binutils) 2.20.51.20100410



$(STAGE1)/Release+Asserts/bin/clang++.exe -I$(STAGE2)/include -I$(STAGE2)/utils/FileCheck -I$(LLVM)/include -I$(LLVM)/utils/FileCheck -DNDEBUG -D__NO_CTYPE_INLINE -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -O2 -fomit-frame-pointer -fno-exceptions -fno-rtti -Woverloaded-virtual -Wcast-qual -pedantic -Wno-long-long -Wall -W -Wno-unused-parameter -Wwrite-strings -O2 -L$(STAGE2)/Release/lib -L$(STAGE2)/Release/lib -o $(STAGE2)/Release/bin/FileCheck.exe $(STAGE2)/utils/FileCheck/Release/FileCheck.o -lLLVMSupport -lLLVMSystem -lpthread -lpsapi -limagehlp -lm
c:/msysgit/mingw/bin/../lib/gcc/mingw32/4.4.0/libstdc++.a(string-inst.o):string-inst.cc:(.text$_ZStplIcSt11char_traitsIcESaIcEESbIT_T0_T1_ERKS6_S8_[std::basic_string<char, std::char_traits<char>, std::allocator<char> > std::operator+<char, std::char_traits<char>, std::allocator<char> >(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)]+0x0): multiple definition of `std::basic_string<char, std::char_traits<char>, std::allocator<char> > std::operator+<char, std::char_traits<char>, std::allocator<char> >(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
$(STAGE2)/Release/lib/libLLVMSystem.a(Program.o):fake:(.text$linkonce__ZStplIcSt11char_traitsIcESaIcEESbIT_T0_T1_ERKS6_S8_+0x0): first defined here
c:/msysgit/mingw/bin/../lib/gcc/mingw32/4.4.0/libstdc++.a(string-inst.o):string-inst.cc:(.text$_ZStplIcSt11char_traitsIcESaIcEESbIT_T0_T1_EPKS3_RKS6_[std::basic_string<char, std::char_traits<char>, std::allocator<char> > std::operator+<char, std::char_traits<char>, std::allocator<char> >(char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)]+0x0): multiple definition of `std::basic_string<char, std::char_traits<char>, std::allocator<char> > std::operator+<char, std::char_traits<char>, std::allocator<char> >(char const*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
$(STAGE2)/Release/lib/libLLVMSystem.a(Path.o):fake:(.text$linkonce__ZStplIcSt11char_traitsIcESaIcEESbIT_T0_T1_EPKS3_RKS6_+0x0): first defined here
collect2: ld returned 1 exit status
clang++: error: linker (via gcc) command failed with exit code 1 (use -v to see invocation)
make[2]: *** [$(STAGE2)/Release/bin/FileCheck.exe] Error 1
make[2]: Leaving directory `$(STAGE2)/utils/FileCheck'
make[1]: *** [FileCheck/.makeall] Error 2
make[1]: Leaving directory `$(STAGE2)/utils'


More information about the llvm-commits mailing list