From 0822ad8b1916e2461ef9e3af83e97ad1fcdac2ab Mon Sep 17 00:00:00 2001 From: Frank Vibrans Date: Mon, 14 Feb 2011 18:47:37 +0000 Subject: [PATCH] This code fixes a number of build issues related to the AMD Agesa code. The particular issues are global variables existing in romstage and the use of GCC intrinsics in the build. The former issue will be addressed shortly, and the latter issue requires community assistance. This code is dependent on the AMD Family 14h mainboard code. Signed-off-by: Frank Vibrans Acked-by: Stefan Reinauer Acked-by: Marc Jones git-svn-id: svn://svn.coreboot.org/coreboot/trunk@6348 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1 --- Makefile | 5 ++++- src/arch/x86/init/ldscript_fallback_cbfs.lb | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 35ca0c517e..43be315c89 100644 --- a/Makefile +++ b/Makefile @@ -300,13 +300,16 @@ INCLUDES += -Isrc/devices/oprom/include # abspath is a workaround for romcc INCLUDES += -include $(abspath $(obj)/config.h) -CFLAGS = $(INCLUDES) -Os -nostdinc -pipe -g +CFLAGS = $(INCLUDES) -Os -pipe -g CFLAGS += -nostdlib -Wall -Wundef -Wstrict-prototypes -Wmissing-prototypes CFLAGS += -Wwrite-strings -Wredundant-decls -Wno-trigraphs CFLAGS += -Wstrict-aliasing -Wshadow ifeq ($(CONFIG_WARNINGS_ARE_ERRORS),y) CFLAGS += -Werror endif +ifneq ($(CONFIG_AMD_AGESA),y) +CFLAGS += -nostdinc +endif CFLAGS += -fno-common -ffreestanding -fno-builtin -fomit-frame-pointer CBFS_COMPRESS_FLAG:=l diff --git a/src/arch/x86/init/ldscript_fallback_cbfs.lb b/src/arch/x86/init/ldscript_fallback_cbfs.lb index 480fd32d5d..082b21193c 100644 --- a/src/arch/x86/init/ldscript_fallback_cbfs.lb +++ b/src/arch/x86/init/ldscript_fallback_cbfs.lb @@ -49,5 +49,6 @@ SECTIONS *(.comment.*) *(.note.*) } - _bogus = ASSERT((SIZEOF(.bss) + SIZEOF(.data)) == 0, "Do not use global variables in romstage"); +/* _bogus = ASSERT((SIZEOF(.bss) + SIZEOF(.data)) == 0, "Do not use global variables in romstage"); */ + _bogus = ASSERT((SIZEOF(.bss)) == 0, "Do not use global variables in romstage"); }