Patchwork cross compiler

login
register
about
Submitter Myles Watson
Date 2009-10-30 18:15:36
Message ID <2831fecf0910301115h33bcf534j18bb91e1b9589a4b@mail.gmail.com>
Download mbox | patch
Permalink /patch/519/
State Accepted
Headers show

Comments

Myles Watson - 2009-10-30 18:15:36
On Fri, Oct 30, 2009 at 9:29 AM, Peter Stuge <peter@stuge.se> wrote:

> Myles Watson wrote:
> > >> That functionality is already there... see util/xcompile.
> > >
> > > So what's the preferred way to invoke it?
>
> I think Makefile picks it up automatically if there is an .xcompile
> file in the right spot.<http://www.coreboot.org/mailman/listinfo/coreboot>
>

Thanks.  My problems getting it to work were:

I hadn't realized that the path to crossgcc was hard coded in xcompile, so
xcompile has to be invoked from the right spot:

for gccprefixes in `pwd`/../crossgcc/xgcc/bin/i386-elf- i386-elf- ""; do

I had expected to be able to run xcompile from the top like this:
. ./util/xcompile/xcompile > .xcompile
the way it works is:
cd util/xcompile
. ./xcompile > ../../.xcompile

The other problem I had was that the Makefile removes .xcompile on make
clean, which is not what I wanted.  I'd just generated the .xcompile file,
so I did a make clean to make sure the whole thing was compiled with the
same compiler.

I think it would be better to remove .xcompile with make distclean.  Patch
attached.

Signed-off-by: Myles Watson <mylesgw@gmail.com>

Thanks,
Myles
Patrick Georgi - 2009-10-30 19:02:25
Am Freitag, den 30.10.2009, 12:15 -0600 schrieb Myles Watson:
> for gccprefixes in `pwd`/../crossgcc/xgcc/bin/i386-elf- i386-elf- "";
> do
Maybe add $PWD/util/crossgcc/xgcc/bin/i386-elf- to the list, too - it
can't hurt.

> I think it would be better to remove .xcompile with make distclean.
> Patch attached.
> 
> Signed-off-by: Myles Watson <mylesgw@gmail.com>
Acked-by: Patrick Georgi <patrick.georgi@coresystems.de>
(also applies to the change proposed above)


Patrick
Myles Watson - 2009-10-30 19:12:42
On Fri, Oct 30, 2009 at 1:02 PM, Patrick Georgi <patrick@georgi-clan.de>wrote:

> Am Freitag, den 30.10.2009, 12:15 -0600 schrieb Myles Watson:
> > for gccprefixes in `pwd`/../crossgcc/xgcc/bin/i386-elf- i386-elf- "";
> > do
> Maybe add $PWD/util/crossgcc/xgcc/bin/i386-elf- to the list, too - it
> can't hurt.
>
The only problem with that is then if you have built crosgcc, but you don't
want to use it, how do you specify that?  The Makefile will generate
.xcompile automatically with it included.

Is that the desired behavior?


>
> > I think it would be better to remove .xcompile with make distclean.
> > Patch attached.
> >
> > Signed-off-by: Myles Watson <mylesgw@gmail.com>
> Acked-by: Patrick Georgi <patrick.georgi@coresystems.de>
> (also applies to the change proposed above)
>
I would have committed, but:

myles@orangutan:svn$ svn ci -F commit.txt
svn: Commit failed (details follow):
svn: Authorization failed

So I guess we can figure out whether we should add the other path to the
list first.

Thanks,
Myles
Patrick Georgi - 2009-10-30 19:46:11
Am Freitag, den 30.10.2009, 13:12 -0600 schrieb Myles Watson:
> 
> 
> On Fri, Oct 30, 2009 at 1:02 PM, Patrick Georgi
> <patrick@georgi-clan.de> wrote:
>         Am Freitag, den 30.10.2009, 12:15 -0600 schrieb Myles Watson:
>         > for gccprefixes in `pwd`/../crossgcc/xgcc/bin/i386-elf-
>         i386-elf- "";
>         > do
>         
>         Maybe add $PWD/util/crossgcc/xgcc/bin/i386-elf- to the list,
>         too - it
>         can't hurt.
> The only problem with that is then if you have built crosgcc, but you
> don't want to use it, how do you specify that?  The Makefile will
> generate .xcompile automatically with it included.
> 
> Is that the desired behavior?
crossgcc is under our control, stupid distribution compilers are not, so
in my opinion, crossgcc should be preferred over alternatives.

Esp. as there's a simple workaround: move xgcc away.


Patrick
Stefan Reinauer - 2009-10-30 20:45:43
Patrick Georgi wrote:
> Am Freitag, den 30.10.2009, 12:15 -0600 schrieb Myles Watson:
>   
>> for gccprefixes in `pwd`/../crossgcc/xgcc/bin/i386-elf- i386-elf- "";
>> do
>>     
> Maybe add $PWD/util/crossgcc/xgcc/bin/i386-elf- to the list, too - it
> can't hurt.
>   
Yes, I think the `pwd`/../crossgcc/xgcc/ came from those times when
crossgcc was not checked into the coreboot repo...

>   
>> I think it would be better to remove .xcompile with make distclean.
>> Patch attached.
>>
>> Signed-off-by: Myles Watson <mylesgw@gmail.com>
>>     
> Acked-by: Patrick Georgi <patrick.georgi@coresystems.de>
> (also applies to the change proposed above)
>
>
> Patrick
>
>
>
Myles Watson - 2009-10-31 20:50:17
>
> > I think it would be better to remove .xcompile with make distclean.
>


> > Signed-off-by: Myles Watson <mylesgw@gmail.com>
> Acked-by: Patrick Georgi <patrick.georgi@coresystems.de>
>
Rev 4902.

Thanks,
Myles

Patch

Index: svn/Makefile
===================================================================
--- svn.orig/Makefile
+++ svn/Makefile
@@ -289,7 +289,7 @@  doxygen-clean:
 	rm -rf $(DOXYGEN_OUTPUT_DIR)
 
 clean: doxygen-clean
-	rm -f $(allobjs) $(obj)/coreboot* .xcompile
+	rm -f $(allobjs) $(obj)/coreboot*
 	rm -f $(obj)/option_table.* $(obj)/crt0_includes.h $(obj)/ldscript
 	rm -f $(obj)/mainboard/$(MAINBOARDDIR)/static.c $(obj)/mainboard/$(MAINBOARDDIR)/config.py $(obj)/mainboard/$(MAINBOARDDIR)/static.dot
 	rm -f $(obj)/mainboard/$(MAINBOARDDIR)/auto.inc $(obj)/mainboard/$(MAINBOARDDIR)/crt0.s $(obj)/mainboard/$(MAINBOARDDIR)/crt0.disasm
@@ -297,7 +297,7 @@  clean: doxygen-clean
 	$(MAKE) -C util/sconfig clean
 
 distclean: clean
-	rm -rf $(obj)
+	rm -rf $(obj) .xcompile
 	rm -f .config .config.old ..config.tmp .kconfig.d .tmpconfig*
 
 update: