[llvm-commits] [llvm] r66315 - /llvm/trunk/Makefile.rules

Evan Cheng echeng at apple.com
Sat Mar 7 22:53:54 PST 2009


On Mar 7, 2009, at 2:02 PM, Nick Lewycky wrote:

> Hi Evan. This breaks the build on my system and I'm about to revert  
> it.
>
> My system has an x86_64 kernel with a 32-bit userspace. It works  
> like this:
>
> $ g++ x.cpp -o x
> $ file x
> x: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV),  
> dynamically
> linked (uses shared libs), for GNU/Linux 2.6.18, not stripped
> $ g++ x.cpp -o x -m64
> /usr/bin/ld: skipping incompatible
> /usr/lib/gcc/i486-linux-gnu/4.3.3/libstdc++.so when searching for - 
> lstdc++
> /usr/bin/ld: skipping incompatible
> /usr/lib/gcc/i486-linux-gnu/4.3.3/libstdc++.a when searching for - 
> lstdc++
> /usr/bin/ld: skipping incompatible
> /usr/lib/gcc/i486-linux-gnu/4.3.3/libstdc++.so when searching for - 
> lstdc++
> /usr/bin/ld: skipping incompatible
> /usr/lib/gcc/i486-linux-gnu/4.3.3/libstdc++.a when searching for - 
> lstdc++
> /usr/local/lib64/libstdc++.a: could not read symbols: Archive has no
> index; run ranlib to add one
> collect2: ld returned 1 exit status
> $
>
> I'm not sure what that means for the ARCH variable. By way of example,
> to build llvm-gcc I force --host and --build=i686-pc-linux-gnu . If  
> you
> think the right fix here is to force ARCH=i386 on a system like mine,
> I'll be happy to investigate how to do that.

ARCH should be whatever the llvm tree is being built for. That is, if  
you do ./configure -target=x86_64-linux, it should be built with -m64,  
if target is i386-linux, then -m32.

I don't quite understand why it breaks your build. Does configure sets  
ARCH to x86_64 for your system? That seems wrong to me. I'd prefer to  
fix that instead.

The reason I made the change is to eliminate the need to pass  
EXTRA_OPTIONS=-m64 that make JIT work.

Evan

>
> Nick
>
> Evan Cheng wrote:
>> Author: evancheng
>> Date: Fri Mar  6 19:40:17 2009
>> New Revision: 66315
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=66315&view=rev
>> Log:
>> If ARCH is x86_64, pass -m64 to the host compiler. -m32 for i386.  
>> This makes sure the JIT work correctly.
>>
>> Modified:
>>    llvm/trunk/Makefile.rules
>>
>> Modified: llvm/trunk/Makefile.rules
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/Makefile.rules?rev=66315&r1=66314&r2=66315&view=diff
>>
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> = 
>> =====================================================================
>> --- llvm/trunk/Makefile.rules (original)
>> +++ llvm/trunk/Makefile.rules Fri Mar  6 19:40:17 2009
>> @@ -516,6 +516,14 @@
>>
>>   # Building universal cannot compute dependencies automatically.
>>   DISABLE_AUTO_DEPENDENCIES=1
>> +else
>> +  ifeq ($(ARCH),x86_64)
>> +    CompileCommonOpts += -m64
>> +  else
>> +    ifeq ($(ARCH),i386)
>> +      CompileCommonOpts += -m32
>> +    endif
>> +  endif
>> endif
>>
>> ifeq ($(OS),SunOS)
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list