Comparing Bill and Karim's cross-compile scripts. Updating Bill's to gcc 3.2.3.

Bill Gatliff bgat@billgatliff.com
Sat May 17 01:45:00 GMT 2003


Dan:


I appreciate your going over my script in such detail!  Comments below...

Dan Kegel wrote:

> I sat down and compared Bill Gatliff's script to the commands Karim
> gives in his book for building cross toolchains.
> The two are near-twins, although Karim doesn't present them as
> a script per se.
> Here are a few notes, with line numbers in Bill's script:
>
> 214-216, 239-241: repeated code in Bill's, maybe nicer to hoist
> it out of the case.  Also, Bill doesn't copy asm-generic, but Karim does.
> (Is that important?  Possibly, if some arches use the generic include 
> files
> instead of providing their own?  Which arches do that?) 


Wanna know what's awful?  I had forgotten that build-crossgcc.sh even 
*did* linux targets!  No wonder it's so broken!

> 301-304, 328-331: repeated code in Bill's, maybe nicer to hoist
> it out of the case.
> Also, Bill passes --with-local-prefix=$(PREFIX)/$(TARGET) to gcc's
> configure, Karim doesn't.  Presumably that prevents searching
> /usr/local/include, which sounds important.
> http://www.ugcs.caltech.edu/info/gcc/install_3.html says
> "The default value for @option{--with-local-prefix} is `/usr/local' 
> regardless of the value of @option{--prefix}."
> (But see also http://gcc.gnu.org/ml/gcc-bugs/2000-06/msg00197.html) 

I found that if I left --with-local-prefix out, the toolchain couldn't 
find libraries and header files reliably.

> 367: Karim doesn't override AR or RANLIB.  That might be a problem on
> some architectures, causing bad manifests in .a files?


Perhaps my approach is just belt-plus-suspenders?  :^)

> 387: Karim overrides install_root=${TARGET_PEFIX},
> but Bill uses the default.  This is understandable given the
> difference in --prefix.  Karim's right, I think.
> Also, Karim gives prefix="", which I think is just his personal
> bias; I think it causes libraries to end up in /lib instead of
> /usr/lib on the target. 


Yes, I think Karim is right here.

> 388: Karim fixes up paths in ld.so, but Bill doesn't.
> Need to remove absolute paths from the ld.so in ${TARGET_PREFIX)/lib;
> maybe Bill just forgot to mention that? 


Indeed.  My BSPs that I put together here using scripts that forked from 
build-crossgcc.sh a looooooong time ago *do* rewrite ld.so.

> Smash the two together and we have our holy grail of a Bill script 
> updated to 3.2.3 :-)
>
> Bill, do you agree about the absolute path problem in --prefix and in 
> ld.so? 


Yes, and yes.  I'm traveling next week, and will have my evenings mostly 
free.  Sounds like a good time to update build-crossgcc.sh!  (i.e., test 
your changes and post them).  I've been putting it off for far too long.



b.g.



------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com



More information about the crossgcc mailing list