[syslinux] host cross-compile patch

H. Peter Anvin hpa at zytor.com
Thu Apr 1 16:07:11 PDT 2010


On 03/15/2010 01:45 PM, Don Hiatt wrote:
> I tend to use the same tool-chain across various hosts so I made this
> very simple patch that allows you to pass the cross-compiler name to
> make ( e.g. make CROSS_COMPILE=i686-nptl-linux-gnu-).
> 
> I'm not sure if patches should be attached or just pasted inline so I
> did both this time. BTW, it's relative to syslinux 4 but the same
> changes work with syslinux 3 although the patch won't apply cleanly.
> 
> don
> 
> -------------
> diff --git a/MCONFIG b/MCONFIG
> index 87079a5..6c5a164 100644
> --- a/MCONFIG
> +++ b/MCONFIG
> @@ -39,19 +39,23 @@ UPX	 = upx
> 
>  CHMOD	 = chmod
> 
> -CC	 = gcc
> +# Pass cross-compiler tuple to make,
> +#  e.g. make CROSS_COMPILE=i686-nptl-linux-gnu-
> +CROSS_COMPILE	?=
> +CC		= $(CROSS_COMPILE)gcc
> +
>  gcc_ok   = $(shell tmpf=gcc_ok.$$$$.tmp; \
>  		   if $(CC) $(GCCOPT) $(1) -c $(topdir)/dummy.c \
>  			-o $$tmpf 2>/dev/null ; \
>  		   then echo '$(1)'; else echo '$(2)'; fi; \
>  		   rm -f $$tmpf)
> 
> -LD	 = ld
> -OBJDUMP	 = objdump
> -OBJCOPY  = objcopy
> -AR       = ar
> -NM       = nm
> -RANLIB   = ranlib
> +LD	 = $(CROSS_COMPILE)ld
> +OBJDUMP	 = $(CROSS_COMPILE)objdump
> +OBJCOPY  = $(CROSS_COMPILE)objcopy
> +AR       = $(CROSS_COMPILE)ar
> +NM       = $(CROSS_COMPILE)nm
> +RANLIB   = $(CROSS_COMPILE)ranlib
>  GZIPPROG = gzip
>  PNGTOPNM = pngtopnm
>  MCOPY    = mcopy
> 

I'm not sure this is really the right way to go about this -- there are
multiple sets of programs involved:

- programs to be run on the build host (e.g. prepcore);
- programs to be run on the "target" system (e.g. the extlinux program);
- code to be run in the embedded environment.

They might all need different prefixes...

	-hpa




More information about the Syslinux mailing list