[LLVMdev] -fPIC warning on every compile on Cygwin

Nick Lewycky nicholas at mxc.ca
Mon Mar 2 19:38:05 PST 2009


Aaron Gray wrote:
> On Sun, Mar 1, 2009 at 4:24 AM, Nick Lewycky <nicholas at mxc.ca 
> <mailto:nicholas at mxc.ca>> wrote:
> 
>     Please try this patch. I tried to copy exactly what libtool would do
>     on Cygwin by reading the libtool source.
> 
>  
> Hi Nick,
>  
> Working fine on Cygwin :)

Great to hear! I've committed the fix in r65922. Thanks for the testing 
and putting up with the breakage.

Nick

> Aaron
>  
>  
> 
> 
>     Nick
> 
>     Aaron Gray wrote:
> 
>         On Fri, Feb 27, 2009 at 4:50 PM, Aaron Gray
>         <aaronngray.lists at googlemail.com
>         <mailto:aaronngray.lists at googlemail.com>
>         <mailto:aaronngray.lists at googlemail.com
>         <mailto:aaronngray.lists at googlemail.com>>> wrote:
> 
>            On Fri, Feb 27, 2009 at 4:32 PM, Jay Foad <jay.foad at gmail.com
>         <mailto:jay.foad at gmail.com>
>            <mailto:jay.foad at gmail.com <mailto:jay.foad at gmail.com>>> wrote:
> 
>                 >> Could you please rig Makefile.rules or something to print
>                out the value
>                 >> of $(LLVM_ON_WIN32) ? The only way I can think of this
>                happening is if
>                 >> that's erroneously false.
> 
>                This works for me:
> 
>                Index: Makefile.rules
>              
>          ===================================================================
>                --- Makefile.rules      (revision 65633)
>                +++ Makefile.rules      (working copy)
>                @@ -298,6 +298,8 @@
>                      # Common symbols not allowed in dylib files
>                      CXX.Flags += -fno-common
>                      C.Flags   += -fno-common
>                +    else ifeq ($(OS),Cygwin)
>                +      # Nothing. Cygwin defaults to PIC and warns when
>         given -fPIC
>                    else
>                      # Linux and others; pass -fPIC
>                      CXX.Flags += -fPIC
> 
>                Jay, thanks I will try this.
> 
>          I had to hand modify the code as it did not seem to want to
>         work as a patch.
>          However, it does not deal with the LLVMHello.dll problem.
>         Here's what I am getting :-
>          ~~~
>         llvm[3]: Linking Debug Loadable Module LLVMHello.dll
>         /usr/build/llvm-65633/lib/Transforms/Hello/Debug/Hello.o: In
>         function `_ZN79_GLO
>         BAL__N__usr_src_llvm_65633_lib_Transforms_Hello_Hello.cpp_00000000_965F4EBD6Hell
>         o213runOnFunctionERN4llvm8FunctionE':
>         /usr/src/llvm-65633/lib/Transforms/Hello/Hello.cpp:53: undefined
>         reference to `l
>         lvm::EscapeString(std::basic_string<char,
>         std::char_traits<char>, std::allocator
>         <char> >&)'
>         /usr/src/llvm-65633/lib/Transforms/Hello/Hello.cpp:54: undefined
>         reference to `l
>         lvm::cerr'
>         /usr/build/llvm-65633/lib/Transforms/Hello/Debug/Hello.o: In
>         function `_ZN79_GLO
>         BAL__N__usr_src_llvm_65633_lib_Transforms_Hello_Hello.cpp_00000000_965F4EBD5Hell
>         o13runOnFunctionERN4llvm8FunctionE':
>         /usr/src/llvm-65633/lib/Transforms/Hello/Hello.cpp:34: undefined
>         reference to `l
>         lvm::EscapeString(std::basic_string<char,
>         std::char_traits<char>, std::allocator
>         <char> >&)'
>         /usr/src/llvm-65633/lib/Transforms/Hello/Hello.cpp:35: undefined
>         reference to `l
>         lvm::cerr'
>         /usr/build/llvm-65633/lib/Transforms/Hello/Debug/Hello.o: In
>         function `_ZSt17__v
>         erify_groupingPKcjRKSs':
>         /usr/gcc-4.2.2/lib/gcc/i686-pc-cygwin/4.2.2/../../../../include/c++/4.2.2/bits/l
>         ocale_facets.tcc:2569: undefined reference to
>         `llvm::PassInfo::registerPass()'
>         /usr/gcc-4.2.2/lib/gcc/i686-pc-cygwin/4.2.2/../../../../include/c++/4.2.2/bits/l
>         ocale_facets.tcc:2571: undefined reference to
>         `llvm::Pass::getPassName() const'
>         /usr/gcc-4.2.2/lib/gcc/i686-pc-cygwin/4.2.2/../../../../include/c++/4.2.2/bits/l
>         ocale_facets.tcc:2571: undefined reference to
>         `llvm::Pass::print(std::basic_ostr
>         eam<char, std::char_traits<char> >&, llvm::Module const*) const'
>         /usr/gcc-4.2.2/lib/gcc/i686-pc-cygwin/4.2.2/../../../../include/c++/4.2.2/bits/l
>         ocale_facets.tcc:2571: undefined reference to
>         `llvm::FunctionPass::assignPassMan
>         ager(llvm::PMStack&, llvm::PassManagerType)'
>         /usr/gcc-4.2.2/lib/gcc/i686-pc-cygwin/4.2.2/../../../../include/c++/4.2.2/bits/l
>         ocale_facets.tcc:2570: undefined reference to
>         `llvm::Pass::dumpPassStructure(uns
>         igned int)'
>         /usr/gcc-4.2.2/lib/gcc/i686-pc-cygwin/4.2.2/../../../../include/c++/4.2.2/bits/l
>         ocale_facets.tcc:2576: undefined reference to
>         `llvm::FunctionPass::runOnModule(l
>         lvm::Module&)'
>         /usr/build/llvm-65633/lib/Transforms/Hello/Debug/Hello.o: In
>         function `_ZN4llvm1
>         2RegisterPassIN79_GLOBAL__N__usr_src_llvm_65633_lib_Transforms_Hello_Hello.cpp_0
>         0000000_965F4EBD5HelloEEC1EPKcS5_bb':
>         /usr/src/llvm-65633/include/llvm/PassSupport.h:172: undefined
>         reference to `llvm
>         ::Pass::getPassName() const'
>         /usr/src/llvm-65633/include/llvm/PassSupport.h:172: undefined
>         reference to `llvm
>         ::Pass::print(std::basic_ostream<char, std::char_traits<char>
>          >&, llvm::Module c
>         onst*) const'
>         /usr/src/llvm-65633/include/llvm/PassSupport.h:172: undefined
>         reference to `llvm
>         ::FunctionPass::assignPassManager(llvm::PMStack&,
>         llvm::PassManagerType)'
>         /usr/src/llvm-65633/include/llvm/PassSupport.h:175: undefined
>         reference to `llvm
>         ::Pass::dumpPassStructure(unsigned int)'
>         /usr/src/llvm-65633/include/llvm/PassSupport.h:175: undefined
>         reference to `llvm
>         ::FunctionPass::runOnModule(llvm::Module&)'
>         /usr/build/llvm-65633/lib/Transforms/Hello/Debug/Hello.o: In
>         function `_ZSt17__v
>         erify_groupingPKcjRKSs':
>         /usr/gcc-4.2.2/lib/gcc/i686-pc-cygwin/4.2.2/../../../../include/c++/4.2.2/bits/l
>         ocale_facets.tcc:2560: undefined reference to
>         `llvm::Statistic::RegisterStatisti
>         c()'
>         /usr/gcc-4.2.2/lib/gcc/i686-pc-cygwin/4.2.2/../../../../include/c++/4.2.2/bits/l
>         ocale_facets.tcc:2558: undefined reference to
>         `llvm::Value::getNameStr() const'
>         /usr/build/llvm-65633/lib/Transforms/Hello/Debug/Hello.o: In
>         function `_ZNSt12_V
>         ector_baseISt4pairIPKN4llvm8PassInfoEPNS1_4PassEESaIS7_EEC2ERKS8_':
>         /usr/gcc-4.2.2/lib/gcc/i686-pc-cygwin/4.2.2/../../../../include/c++/4.2.2/bits/s
>         tl_vector.h:(.text$_ZN4llvm12FunctionPassD2Ev[llvm::FunctionPass::~FunctionPass(
>         )]+0x7): undefined reference to `vtable for llvm::FunctionPass'
>         /usr/build/llvm-65633/lib/Transforms/Hello/Debug/Hello.o: In
>         function `_ZSt17__v
>         erify_groupingPKcjRKSs':
>         /usr/gcc-4.2.2/lib/gcc/i686-pc-cygwin/4.2.2/../../../../include/c++/4.2.2/bits/l
>         ocale_facets.tcc:2558: undefined reference to `llvm::Pass::~Pass()'
>         /usr/build/llvm-65633/lib/Transforms/Hello/Debug/Hello.o: In
>         function `_ZNSt12_V
>         ector_baseISt4pairIPKN4llvm8PassInfoEPNS1_4PassEESaIS7_EEC2ERKS8_':
>         /usr/gcc-4.2.2/lib/gcc/i686-pc-cygwin/4.2.2/../../../../include/c++/4.2.2/bits/s
>         tl_vector.h:(.text$_ZN4llvm4PassC2EPKv[llvm::Pass::Pass(void
>         const*)]+0x7): unde
>         fined reference to `vtable for llvm::Pass'
>         /usr/build/llvm-65633/lib/Transforms/Hello/Debug/Hello.o: In
>         function `_ZSt17__v
>         erify_groupingPKcjRKSs':
>         /usr/gcc-4.2.2/lib/gcc/i686-pc-cygwin/4.2.2/../../../../include/c++/4.2.2/bits/l
>         ocale_facets.tcc:2558: undefined reference to `vtable for
>         llvm::FunctionPass'
>         collect2: ld returned 1 exit status
>         make[3]: *** [/usr/build/llvm-65633/Debug/lib/LLVMHello.dll] Error 1
>         make[3]: Leaving directory
>         `/usr/build/llvm-65633/lib/Transforms/Hello'
>         make[2]: *** [Hello/.makeall] Error 2
>         make[2]: Leaving directory `/usr/build/llvm-65633/lib/Transforms'
>         make[1]: *** [Transforms/.makeall] Error 2
>         make[1]: Leaving directory `/usr/build/llvm-65633/lib'
>         make: *** [all] Error 1
>          Aaron Gray at AMD2500-PC <mailto:Gray at AMD2500-PC
>         <mailto:Gray at AMD2500-PC>> /usr/build/llvm-65633 $
>          Aaron
>          
> 
> 
> 




More information about the llvm-dev mailing list