public inbox for crossgcc@sourceware.org
 help / color / mirror / Atom feed
* Cross compiler (i386 target on x86_64 machine)
@ 2009-07-24 14:08 Mark Ryden
  2009-07-24 20:25 ` Khem Raj
  0 siblings, 1 reply; 4+ messages in thread
From: Mark Ryden @ 2009-07-24 14:08 UTC (permalink / raw)
  To: crossgcc

Hello,

 I am trying to use a cross compiler tool in order to build a 386
gcc compiler on an x86_64 machine (both Intel).

I found this project: git://git.infradead.org/users/segher/buildall.git

I git clone the sources from this URL,
and configured it according to the source I need:
binutils-2.18.50.0.6, gcc-4.3.0-20080428 and linux-2.6.25. (these are
the versions
for Fedora 9, where I want to insmod my module).

My aim is to be able to build a module with the cross compiler in x86_64
so that I can insmod it on a 32 bit Intel machine.

So I configured the config file and ran:

./build i386
And it was ok:

Building i386... (target i386-linux)
 binutils: configure [00:03] build [00:51] install [00:04]
 gcc: configure [00:07] build [01:36] install [00:04]
 kernel: configure [00:01] build [03[15:54]  26 warnings  OK



 Now I tried to build a simple HelloWorld file. I got this error message:

make  -C /work/rpmbuild/BUILD/kernel-2.6.25/linux-2.6.25.i686
SUBDIRS=/work/dev/tests/kernel/helloWorld modules
make[1]: Entering directory
`/work/rpmbuild/BUILD/kernel-2.6.25/linux-2.6.25.i686'

 ERROR: Kernel configuration is invalid.
        include/linux/autoconf.h or include/config/auto.conf are missing.
        Run 'make oldconfig && make prepare' on kernel src to fix it.


 WARNING: Symbol version dump
/work/rpmbuild/BUILD/kernel-2.6.25/linux-2.6.25.i686/Module.symvers
          is missing; modules will have no dependencies and modversions.

 CC [M]  /work/dev/tests/kernel/helloWorld/helloWorld.o
gcc: error trying to exec 'cc1': execvp: No such file or directory
make[2]: *** [/work/dev/tests/kernel/helloWorld/helloWorld.o] Error 1
make[1]: *** [_module_/work/dev/tests/kernel/helloWorld] Error 2
make[1]: Leaving directory
`/work/rpmbuild/BUILD/kernel-2.6.25/linux-2.6.25.i686'
make: *** [default] Error 2


I beleieve that it can be that some little thing should be
added/changed in the makefile,
or something to the PATH. I really don't know what is the 'cc1' error.

I would appreciate if you can advise.

following is the config and the HellWorld Makefile I am using.

config:
=========
BINUTILS_SRC=/work/rpmbuild/BUILD/binutils-2.18.50.0.6
GCC_SRC=/work/rpmbuild/BUILD/gcc-4.3.0-20080428
KERNEL_SRC=/work/rpmbuild/BUILD/kernel-2.6.25/linux-2.6.25.i686
PREFIX=/work/buildTest
CHECKING=release

Makefile:
==========
obj-m    := helloWorld.o

CC:=/work/buildTest/i386-linux/bin/gcc
KDIR:=/work/rpmbuild/BUILD/kernel-2.6.25/linux-2.6.25.i686

PWD    := $(shell pwd)

default:
       $(MAKE)  -C $(KDIR) SUBDIRS=$(PWD) modules



Rgs,
Mark Ryden

--
For unsubscribe information see http://sourceware.org/lists.html#faq

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

* Re: Cross compiler (i386 target on x86_64 machine)
  2009-07-24 14:08 Cross compiler (i386 target on x86_64 machine) Mark Ryden
@ 2009-07-24 20:25 ` Khem Raj
  2009-07-25  9:23   ` Mark Ryden
  0 siblings, 1 reply; 4+ messages in thread
From: Khem Raj @ 2009-07-24 20:25 UTC (permalink / raw)
  To: Mark Ryden; +Cc: crossgcc

On Fri, Jul 24, 2009 at 7:08 AM, Mark Ryden<markryde@gmail.com> wrote:
> Hello,
>
>  I am trying to use a cross compiler tool in order to build a 386
> gcc compiler on an x86_64 machine (both Intel).

You can use crosstool-ng http://ymorin.is-a-geek.org/dokuwiki/projects/crosstool
its well supported.
-Khem

--
For unsubscribe information see http://sourceware.org/lists.html#faq

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

* Re: Cross compiler (i386 target on x86_64 machine)
  2009-07-24 20:25 ` Khem Raj
@ 2009-07-25  9:23   ` Mark Ryden
  2009-07-25 11:50     ` Thomas Petazzoni
  0 siblings, 1 reply; 4+ messages in thread
From: Mark Ryden @ 2009-07-25  9:23 UTC (permalink / raw)
  To: Khem Raj; +Cc: crossgcc

Hello,
Thanks, Khem Raj!

Yes, I knew crosstool-ng tool before; it seems to me much more
sophisticated tool than needed for this job.
I would appreciate if anybody can try to guess what is the reason for this error
I am getting (it might be a simple issue with setting a path, etc):
gcc: error trying to exec 'cc1': execvp: No such file or directory

Rgs,
Mark


On Fri, Jul 24, 2009 at 11:25 PM, Khem Raj<raj.khem@gmail.com> wrote:
> On Fri, Jul 24, 2009 at 7:08 AM, Mark Ryden<markryde@gmail.com> wrote:
>> Hello,
>>
>>  I am trying to use a cross compiler tool in order to build a 386
>> gcc compiler on an x86_64 machine (both Intel).
>
> You can use crosstool-ng http://ymorin.is-a-geek.org/dokuwiki/projects/crosstool
> its well supported.
> -Khem
>

--
For unsubscribe information see http://sourceware.org/lists.html#faq

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

* Re: Cross compiler (i386 target on x86_64 machine)
  2009-07-25  9:23   ` Mark Ryden
@ 2009-07-25 11:50     ` Thomas Petazzoni
  0 siblings, 0 replies; 4+ messages in thread
From: Thomas Petazzoni @ 2009-07-25 11:50 UTC (permalink / raw)
  To: crossgcc

Le Sat, 25 Jul 2009 12:23:15 +0300,
Mark Ryden <markryde@gmail.com> a écrit :

> Yes, I knew crosstool-ng tool before; it seems to me much more
> sophisticated tool than needed for this job.

It is just as sophisticated as the job of properly building a toolchain
is. If Crosstool-ng looks complicated, it's because the process of
building a toolchain is complicated. And the goal of Crosstool-ng is
precisely to make it easy to build toolchains, and to factorize all the
known-good recipes and patches to do that.

Really, really, really, you should spend 30 minutes figuring out how
Crosstool-ng works. It's going to save you dozens of hours of useless
work.

Sincerly,

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers and embedded Linux development,
consulting, training and support.
http://free-electrons.com

--
For unsubscribe information see http://sourceware.org/lists.html#faq

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

end of thread, other threads:[~2009-07-25 11:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-24 14:08 Cross compiler (i386 target on x86_64 machine) Mark Ryden
2009-07-24 20:25 ` Khem Raj
2009-07-25  9:23   ` Mark Ryden
2009-07-25 11:50     ` Thomas Petazzoni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).