[OpenBIOS] [PATCH] Add non-standard compiler prefix support

Lennart Sorensen lsorense at csclub.uwaterloo.ca
Thu Apr 30 14:22:46 CEST 2015


On Thu, Apr 30, 2015 at 12:14:10PM +0100, Mark Cave-Ayland wrote:
> On 29/04/15 14:57, Programmingkid wrote:
> 
> > This patch gives OpenBIOS users the ability to specify
> > their own compiler prefix. It can be used by just adding
> > PREFIX=<your prefix> right before the switch-arch command.
> > Example: PREFIX=ppc-elf- ./switch-arch ppc
> > 
> > Signed-off-by: John Arbuckle <programmingkidx at gmail.com
> > <mailto:programmingkidx at gmail.com>>
> > 
> > Index: config/scripts/switch-arch
> > ===================================================================
> > --- config/scripts/switch-arch(revision 1335)
> > +++ config/scripts/switch-arch(working copy)
> > @@ -99,6 +99,13 @@
> > 
> >  
> > 
> >  select_prefix()
> >  {
> > +    # if the user specified the prefix like this: PREFIX=ppc-elf-
> > ./switch-arch ppc
> > +    if [ $PREFIX ]
> > +    then
> > +        TARGET=$PREFIX
> > +        return
> > +    fi
> > +    
> >      for TARGET in ${1}-unknown-linux-gnu- ${1}-linux-gnu- ${1}-linux-
> > ${1}-elf- ${1}-eabi-
> >      do
> >          if type ${TARGET}gcc > /dev/null 2>&1
> 
> Any reason why you couldn't simply just add $PREFIX to the end of the
> "for TARGET in ...." line? And thinking about it further, the name
> PREFIX itself could be a bit vague so maybe CCPREFIX is a better name?

PREFIX sure could be confused with the installation path prefix.

I like the CROSS_COMPILER variable that the linux kernel and some other
projects use.

I do find it inconvinient that it always seems that whatever prefix
you specify has gcc appended to it given all my cross compilers have
gcc-version at the end of their name.  That's just how Debian has
generated them for years.

-- 
Len Sorensen



More information about the OpenBIOS mailing list