Bao, Zheng found a bug which killed SATA booting on my board.
This happened because we do not error out on implicit function declarations. The linker has no way of checking whether the implicitly assumed function signature is identical to the real signature, so mismatches can occur and these mismatches are practically impossible to debug because the code looks completely correct.
Adding -Werror-implicit-function-declaration to our CFLAGS would solve this problem nicely, but a lot of files in the tree need to be fixed.
Example set of errors for the AMD DBM690T target: src/cpu/amd/model_fxx/../../../northbridge/amd/amdk8/amdk8_f.h:586: warning: implicit declaration of function ‘hard_reset’ src/mainboard/amd/dbm690t/fadt.c:71: warning: implicit declaration of function ‘pm_iowrite’ src/mainboard/amd/dbm690t/mainboard.c:145: warning: implicit declaration of function ‘pm2_ioread’ src/mainboard/amd/dbm690t/mainboard.c:147: warning: implicit declaration of function ‘pm2_iowrite’ src/mainboard/amd/dbm690t/mainboard.c:164: warning: implicit declaration of function ‘pm_ioread’ src/mainboard/amd/dbm690t/mainboard.c:166: warning: implicit declaration of function ‘pm_iowrite’ src/mainboard/amd/dbm690t/mainboard.c:255: warning: implicit declaration of function ‘lb_add_memory_range’ src/northbridge/amd/amdk8/amdk8_f.h:586: warning: implicit declaration of function ‘hard_reset’ src/southbridge/amd/sb600/../../../northbridge/amd/amdk8/reset_test.c:16: warning: implicit declaration of function ‘pci_read_config32’ src/southbridge/amd/sb600/../../../northbridge/amd/amdk8/reset_test.c:44: warning: implicit declaration of function ‘pci_write_config32’ src/superio/ite/it8712f/superio.c:80: warning: implicit declaration of function ‘set_kbc_ps2_mode’
Signed-off-by: Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net
Index: LinuxBIOSv2-asus_m2a-vm/src/config/Config.lb =================================================================== --- LinuxBIOSv2-asus_m2a-vm/src/config/Config.lb (Revision 3816) +++ LinuxBIOSv2-asus_m2a-vm/src/config/Config.lb (Arbeitskopie) @@ -8,7 +8,7 @@ makedefine GCC_INC_DIR := $(shell LC_ALL=C $(CC) -print-search-dirs | sed -ne "s/install: (.*)/\1include/gp")
makedefine CPPFLAGS := -I$(TOP)/src/include -I$(TOP)/src/arch/$(ARCH)/include -I$(GCC_INC_DIR) $(CPUFLAGS) -makedefine CFLAGS := $(CPU_OPT) $(DISTRO_CFLAGS) $(CPPFLAGS) -Os -nostdinc -nostdlib -fno-builtin -Wall +makedefine CFLAGS := $(CPU_OPT) $(DISTRO_CFLAGS) $(CPPFLAGS) -Os -nostdinc -nostdlib -fno-builtin -Wall -Werror-implicit-function-declaration
makedefine HOSTCFLAGS:= -Os -Wall