All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] Building LTP in a 64-bit machine for 32-bit target
@ 2013-02-19 13:12 Pedro Fonseca
  2013-03-07  8:51 ` Shashi
  0 siblings, 1 reply; 5+ messages in thread
From: Pedro Fonseca @ 2013-02-19 13:12 UTC (permalink / raw)
  To: ltp-list

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
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [LTP] Building LTP in a 64-bit machine for 32-bit target
  2013-02-19 13:12 [LTP] Building LTP in a 64-bit machine for 32-bit target Pedro Fonseca
@ 2013-03-07  8:51 ` Shashi
  2013-03-07  9:26   ` Sedat Dilek
  0 siblings, 1 reply; 5+ messages in thread
From: Shashi @ 2013-03-07  8:51 UTC (permalink / raw)
  To: ltp-list

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
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [LTP] Building LTP in a 64-bit machine for 32-bit target
  2013-03-07  8:51 ` Shashi
@ 2013-03-07  9:26   ` Sedat Dilek
  2013-03-08 16:58     ` shashi kiran
  0 siblings, 1 reply; 5+ messages in thread
From: Sedat Dilek @ 2013-03-07  9:26 UTC (permalink / raw)
  To: Shashi; +Cc: ltp-list, Pedro Fonseca

On Thu, Mar 7, 2013 at 9:51 AM, Shashi <shashi859@gmail.com> wrote:
> 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
>

[ CC Pedro ]

AFAICS "-m32" is available on gcc, dunno if for example clang supports
that, too.

Can't say if "-m32" as LDFLAGS makes any sense or to say IOW "-m32"
for CC is sufficient.
Maybe you can explain that, Shashi?

To support "-m32" CFLAGS for gcc on Debian/Ubuntu you need to install
'gcc-multilib' (gcc with biarch-support) package.
This installs 'libc6-i386' and 'libc6-i386-dev' packages automatically.

     $ sudo apt-get update
     $ sudo apt-get install gcc-multilib

Another way could be to install multiarch-support if not available
(binutils-mutiarch and multiarch-support packages).
But I should check Debian's/Ubuntu's wiki pages, again... how to build
on amd64 for i386...

Hope this helps people reading this ML.

Regards,
- Sedat -

>
>
>
> ------------------------------------------------------------------------------
> 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
> Ltp-list@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ltp-list

------------------------------------------------------------------------------
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
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [LTP] Building LTP in a 64-bit machine for 32-bit target
  2013-03-07  9:26   ` Sedat Dilek
@ 2013-03-08 16:58     ` shashi kiran
  0 siblings, 0 replies; 5+ messages in thread
From: shashi kiran @ 2013-03-08 16:58 UTC (permalink / raw)
  To: sedat.dilek; +Cc: ltp-list, Pedro Fonseca

On Thu, Mar 7, 2013 at 2:56 PM, Sedat Dilek <sedat.dilek@gmail.com> wrote:
>
> On Thu, Mar 7, 2013 at 9:51 AM, Shashi <shashi859@gmail.com> wrote:
> > 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
> >
>
> [ CC Pedro ]
>
> AFAICS "-m32" is available on gcc, dunno if for example clang supports
> that, too.
>
> Can't say if "-m32" as LDFLAGS makes any sense or to say IOW "-m32"
> for CC is sufficient.
> Maybe you can explain that, Shashi?
>
> To support "-m32" CFLAGS for gcc on Debian/Ubuntu you need to install
> 'gcc-multilib' (gcc with biarch-support) package.
> This installs 'libc6-i386' and 'libc6-i386-dev' packages automatically.
>
>      $ sudo apt-get update
>      $ sudo apt-get install gcc-multilib
>
> Another way could be to install multiarch-support if not available
> (binutils-mutiarch and multiarch-support packages).
> But I should check Debian's/Ubuntu's wiki pages, again... how to build
> on amd64 for i386...
>
> Hope this helps people reading this ML.
>
> Regards,
> - Sedat -
>
> >
> >
> >
> > ------------------------------------------------------------------------------
> > 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
> > Ltp-list@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/ltp-list


Hi ,

If "LDFLAGS=-m32" is not set, then following errors is observed while
building ltp-pan,

      gcc -m32 -g -O2 -fno-strict-aliasing -pipe -Wall -m32 -Wno-error
-I/home/user/ltp/ltp-full-20120903/pan -I../include -I../include -c -o
ltp-bump.o ltp-bump.c
      gcc -m32 -g -O2 -fno-strict-aliasing -pipe -Wall -m32 -Wno-error
-I/home/user/ltp/ltp-full-20120903/pan -I../include -I../include  -c
-o zoolib.o zoolib.c
      gcc -L../lib  ltp-bump.o zoolib.o   -lm  -o ltp-bump

     /usr/bin/ld: i386 architecture of input file `ltp-bump.o' is
incompatible with i386:x86-64 output
     /usr/bin/ld: i386 architecture of input file `zoolib.o' is
incompatible with i386:x86-64 output
      collect2: ld returned 1 exit status
      make: *** [ltp-bump] Error 1

As per rules set by makefile, gcc trying to build 64bit binary using
32bit objects. So When LDFLAGS is set to "-m32", gcc will create
create 32bit binary by linking to 32bit object files.

      gcc -m32  -L../lib  ltp-bump.o zoolib.o   -lm  -o ltp-bump
      gcc -m32 -g -O2 -fno-strict-aliasing -pipe -Wall -m32 -Wno-error
-I/home/user/ltp/ltp-full-20120903/pan -I../include -I../include -c -o
ltp-pan.o ltp-pan.c
      gcc -m32 -g -O2 -fno-strict-aliasing -pipe -Wall -m32 -Wno-error
-I/home/user/ltp/ltp-full-20120903/pan -I../include -I../include -c -o
splitstr.o splitstr.c
      gcc -m32  -L../lib  ltp-pan.o zoolib.o splitstr.o   -lm  -o ltp-pan

------------------------------------------------------------------------------
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
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [LTP] Building LTP in a 64-bit machine for 32-bit target
@ 2013-03-08  6:07 shashi859
  0 siblings, 0 replies; 5+ messages in thread
From: shashi859 @ 2013-03-08  6:07 UTC (permalink / raw)
  To: ltp-list

[-- Attachment #1: Type: text/html, Size: 5291 bytes --]

[-- Attachment #2: Type: text/plain, Size: 397 bytes --]

------------------------------------------------------------------------------
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

[-- Attachment #3: Type: text/plain, Size: 155 bytes --]

_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-03-08 16:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-19 13:12 [LTP] Building LTP in a 64-bit machine for 32-bit target Pedro Fonseca
2013-03-07  8:51 ` Shashi
2013-03-07  9:26   ` Sedat Dilek
2013-03-08 16:58     ` shashi kiran
2013-03-08  6:07 shashi859

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.