sully68 / iphone-dev

Automatically exported from code.google.com/p/iphone-dev
0 stars 0 forks source link

Cannot compile, cannot find -lLVMSupport #192

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
After much wrestling to get this to compile on gcc-4.4, I finally got an
error I can't get around. I configured and compiled llvm just as the guide
suggests. Here is the error I am getting:

/usr/bin/ld: skipping incompatible
/host/iphone/llvm-svn/Release/lib/libLLVMSupport.a when searching for
-lLLVMSupport
/usr/bin/ld: cannot find -lLLVMSupport
collect2: ld returned 1 exit status
make[2]: *** [/host/iphone/llvm-svn/Release/bin/tblgen] Error 1
make[2]: Leaving directory `/host/iphone/llvm-svn/utils/TableGen'
make[1]: *** [TableGen/.makeall] Error 2
make[1]: Leaving directory `/host/iphone/llvm-svn/utils'
make: *** [all] Error 1

I have attached a patch file with all the changes I made to get it to
compile. I am on Ubuntu Karmic (9.10) x86_64 running gcc v 4.4.1.

What can I do to get around this error? Thanks!

Original issue reported on code.google.com by jfanaian on 21 Oct 2009 at 7:04

Attachments:

GoogleCodeExporter commented 8 years ago
I am on Ubuntu Karmic (9.10) x86_64 running gcc v 4.2.4.  I had this same 
problem,
fixed by:

sudo apt-get install gfortran-4.2 gfortran-4.2-multilib fort77

I don't know if fort77 matters, but I installed it anyway.  
Good luck; I am having many problems compiling, due to the system being 64-bit. 
 Make
sure you install the g++ and gcc multilibs too, you are going to need them.

Original comment by Batman...@gmail.com on 7 Jan 2010 at 3:56

GoogleCodeExporter commented 8 years ago
Also seeing this:

make[3]: Leaving directory `/home/chris/llvm/utils/unittest/UnitTestMain'
make[2]: Leaving directory `/home/chris/llvm/utils/unittest'
llvm[2]: Linking Debug executable tblgen
/usr/bin/ld: skipping incompatible /home/chris/llvm/Debug/lib/libLLVMSupport.a 
when 
searching for -lLLVMSupport
/usr/bin/ld: skipping incompatible /home/chris/llvm/Debug/lib/libLLVMSupport.a 
when 
searching for -lLLVMSupport
/usr/bin/ld: cannot find -lLLVMSupport
collect2: ld returned 1 exit status

Original comment by cms...@gmail.com on 19 Feb 2010 at 1:03

GoogleCodeExporter commented 8 years ago
I don't think the issue was specific to gfortran-4.2. I presume its just that 
that package is dependent on some g++ packages that are relevant to the compile 
process.

I just got this to compile on Ubuntu 10.04 with g++ 4.1, but I had to have 
g++4.4 installed. I am probably not understanding something here, but it need 
both packages present to compile...

Original comment by ashr...@gmail.com on 4 Jul 2010 at 6:25

GoogleCodeExporter commented 8 years ago
ok, the real reason was the fact that I had LDFLAGS=-m32 flag set. I don't know 
if its ok to use this flag in some cases and not in others... for LLVM it is 
not set, but for the odcctools it is not.

Original comment by ashr...@gmail.com on 4 Jul 2010 at 6:45

GoogleCodeExporter commented 8 years ago
OK, I needed to add

export CXXFLAGS=-m32

How I found out:
- The linker error "skipping incompatible" means most likley 32/64 bit mismatch
- print out the actual commands from make "make -n" and saw no -m32
- Then I looked at the rules for the Makefile.rules and noticed the CXXFLAGS...

Original comment by ashr...@gmail.com on 4 Jul 2010 at 7:16