From 7572e66bc7498f7ec78dbdc504578c79fad49399 Mon Sep 17 00:00:00 2001 From: Paul Kocialkowski Date: Mon, 3 Aug 2015 14:08:40 +0200 Subject: libpayload: lpgcc: CFLAGS and CMDLINE order inversion When building an external payload with lpgcc, the provided cmdline needs to be included before libpayload-specific CFLAGS so that the include priority is the payload first. This way, a payload using e.g. Kconfig that declares a config.h will have its config.h included first, instead of libpayload's config.h. Change-Id: I19b8012623e04c92a427d74904aed7f3bf5f0996 Signed-off-by: Paul Kocialkowski Reviewed-on: http://review.coreboot.org/11113 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi --- payloads/libpayload/bin/lpgcc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'payloads') diff --git a/payloads/libpayload/bin/lpgcc b/payloads/libpayload/bin/lpgcc index 1dbd716b12..93466395e8 100755 --- a/payloads/libpayload/bin/lpgcc +++ b/payloads/libpayload/bin/lpgcc @@ -165,10 +165,10 @@ _LDFLAGS="-L$BASE/../lib -L$_LIBDIR $_LDSCRIPT -static" if [ $DOLINK -eq 0 ]; then if [ $DEBUGME -eq 1 ]; then - echo "$DEFAULT_CC $_CFLAGS $CMDLINE" + echo "$DEFAULT_CC $CMDLINE $_CFLAGS" fi - $DEFAULT_CC $_CFLAGS $CMDLINE + $DEFAULT_CC $CMDLINE $_CFLAGS else if [ -z "${CONFIG_LP_ARCH_MIPS}" ]; then _LIBGCC=`$DEFAULT_CC $_ARCHEXTRA -print-libgcc-file-name` @@ -182,7 +182,7 @@ else exit 1 fi if [ $DEBUGME -eq 1 ]; then - echo "$DEFAULT_CC $_CFLAGS $_LDFLAGS $HEAD_O $CMDLINE -lpayload $_LIBGCC" + echo "$DEFAULT_CC $_LDFLAGS $HEAD_O $CMDLINE $_CFLAGS -lpayload $_LIBGCC" fi # Note: $_ARCHLIBDIR/head.o must be the first object being linked, because it @@ -190,5 +190,5 @@ else # header to be placed below 0x2000 in the resulting image. See: # http://www.gnu.org/software/grub/manual/multiboot/html_node/OS-image-format.html - $DEFAULT_CC $_CFLAGS $_LDFLAGS $HEAD_O $CMDLINE -lpayload $_LIBGCC + $DEFAULT_CC $_LDFLAGS $HEAD_O $CMDLINE $_CFLAGS -lpayload $_LIBGCC fi -- cgit v1.2.3