Pedro Fonseca <pfonseca@...> writes:

> 
> Hi,
> 
> I've been trying to cross compile LTP on a 64-bit x86 machine to produce 
> tests for a 32-bit x86 machines. Unfortunately, so far I haven't found a 
> clean way of achieving this.
> 
> I've tried configuring with "./configure --host=i386" but this still 
> produces x86-64 binaries.
> 
> I've also tried configuring with "CFLAGS=-m32 ./configure CFLAGS=-m32" 
> but it gives compilation errors on some tests (e.g. 
> testcases/kernel/syscalls/chown01_16). I can get past some of the errors 
> by disabling the "/../utils/compat_16.mk" lines in the individual test 
> Makefiles. But is there a better way to compile LTP for 32-bit on a 64-bit?
> 
> Thanks,
> Pedro
> 
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_d2d_feb
> 

Hello Pedra Fonseca,

./configure --build=i686-pc-linux-gnu --target=i686-pc-linux-gnu "CFLAGS=-m32"
"CPPFLAGS=-m32" "LDFLAGS=-m32"

I use the above command to build ltp for 32-bit architecture on 64-bit machine.
Once you do run this, you can check the CFLAGS, CPPFLAGS, LDFALGS being set in 
config.status file. --target flag is to set target environment if it is
different from build environment.
http://stackoverflow.com/questions/5139403/whats-the-difference-of-configure-option-build-host-and-target

In fedora-64 bit, to build a 32-bit binary you need following packages
sudo yum install glibc-devel.i686 libgcc.i686

May be in Ubuntu, you may need these packages or similar kind. If not installed
gcc will throw some error. Let me know if you still find problem.

Regards,
ShashiKiran




------------------------------------------------------------------------------
Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester  
Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the  
endpoint security space. For insight on selecting the right partner to 
tackle endpoint security challenges, access the full report. 
http://p.sf.net/sfu/symantec-dev2dev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to