[coreboot] libpayload: gcc wrappers

Uwe Hermann uwe at hermann-uwe.de
Tue Apr 8 01:08:37 CEST 2008


On Fri, Apr 04, 2008 at 04:11:00PM -0600, Jordan Crouse wrote:
> Index: libpayload/Makefile
> ===================================================================
> --- libpayload.orig/Makefile	2008-04-04 15:52:25.000000000 -0600
> +++ libpayload/Makefile	2008-04-04 16:00:47.000000000 -0600
> @@ -29,6 +29,7 @@
>  
>  BASE_DIR=$(shell pwd)
>  KCONFIG_DIR=util/kconfig
> +DESTDIR=/opt
>  
>  ifeq (.config, $(wildcard .config))
>  dot-config := 1
> @@ -51,12 +52,15 @@
>  -include .config
>  endif
>  
> -PLATFORM-$(CONFIG_TARGET_I386) += i386/Makefile.inc
> +ARCHDIR-$(CONFIG_TARGET_I386) = i386

Please check if this works correctly. The patch doesn't apply cleanly
anymore and when I tried to fix this manually I got:

Makefile:63: /Makefile.inc: No such file or directory
make: *** No rule to make target `/Makefile.inc'.  Stop.

Obviously the 'ARCHDIR-$(CONFIG_TARGET_I386) = i386' causes
problems, maybe because $(CONFIG_TARGET_I386) is not available
early enough?


> +PLATFORM-y += $(ARCHDIR-y)/Makefile.inc
>  TARGETS-y :=


> +install: lib
> +	install -m 755 -d $(DESTDIR)/libpayload/lib
> +	cp -r lib/* $(DESTDIR)/libpayload/lib/
> +	install -m 755 -d $(DESTDIR)/libpayload/include
> +	cp -r include/* $(DESTDIR)/libpayload/include/
> +	install -m 755 -d $(DESTDIR)/libpayload/bin
> +	install -m 755 scripts/lpgcc $(DESTDIR)/libpayload/bin
> +	install -m 755 scripts/lpas $(DESTDIR)/libpayload/bin
> +	install -m 644 scripts/lp.functions $(DESTDIR)/libpayload/bin

Can we rename scripts/ to bin/ for consistency?


>  clean:
>  	@ rm -f $(TARGETS-y)
> -	@ rm -f libpayload.a
> +	@ rm -f lib/libpayload.a lib/$(ARCHDIR-y)/head.o
>  
>  distclean: clean
>  	@ make -C $(KCONFIG_DIR) clean
> Index: libpayload/lib/libpayload.ldscript
> ===================================================================
> --- /dev/null	1970-01-01 00:00:00.000000000 +0000
> +++ libpayload/lib/libpayload.ldscript	2008-04-04 16:00:47.000000000 -0600

This part of the patch might need an update, libpayload.ldscript changed
in a recent commit.


[sample/*]
> -LIBPAYLOAD = ../libpayload.a
> -LIBGCC := $(shell $(CC) $(CROSS_CFLAGS) -print-libgcc-file-name)
> -CFLAGS := -Wall -Werror -Os -fno-stack-protector -nostdinc $(INCLUDES)
> +CFLAGS := -debug-wrapper -Wall -Werror -Os -fno-stack-protector

I think -debug-wrapper should be removed before comitting.

  
>  all: hello.elf
>  
>  hello.elf: hello.o
> -	ld -T ../libpayload.ldscript -o $@ hello.o ../i386/head.o $(LIBPAYLOAD) $(LIBGCC)
> +	$(CC) -debug-wrapper -o $@ hello.o

Ditto.


Other than that this is
Acked-by: Uwe Hermann <uwe at hermann-uwe.de>


Uwe.
-- 
http://www.hermann-uwe.de  | http://www.holsham-traders.de
http://www.crazy-hacks.org | http://www.unmaintained-free-software.org




More information about the coreboot mailing list