Author: uwe Date: 2007-11-22 23:54:11 +0100 (Thu, 22 Nov 2007) New Revision: 516
Modified: LinuxBIOSv3/include/shared.h LinuxBIOSv3/mainboard/adl/msm800sev/Makefile LinuxBIOSv3/mainboard/amd/norwich/Makefile LinuxBIOSv3/mainboard/artecgroup/dbe61/Makefile LinuxBIOSv3/mainboard/emulation/qemu-x86/Makefile Log: The introduction of the _SHARED macros had one flaw: If multiple files had _SHARED defined during compilation, each of them would contain an assignment of stage0_printk to *printk. During linking, this caused errors as multiple definitions of printk existed. Make sure _SHARED alone gives you only the printk prototype, and iff _MAINOBJECT is defined as well, include the assignment.
Signed-off-by: Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net Acked-by: Uwe Hermann uwe@hermann-uwe.de
Modified: LinuxBIOSv3/include/shared.h =================================================================== --- LinuxBIOSv3/include/shared.h 2007-11-21 20:12:56 UTC (rev 515) +++ LinuxBIOSv3/include/shared.h 2007-11-22 22:54:11 UTC (rev 516) @@ -29,9 +29,24 @@ */ #define FUNC(func, ret, attr, args...) \ ret stage0_##func(args) attr + +/* + * The introduction of the _SHARED macros had one flaw: If multiple files + * had _SHARED defined during compilation, each of them would contain an + * assignment of stage0_printk to *printk. During linking, this caused + * errors as multiple definitions of printk existed. + * Make sure _SHARED alone gives you only the printk prototype, and iff + * _MAINOBJECT is defined as well, include the assignment. + */ +#ifdef _MAINOBJECT #define EXTERN(func, ret, attr, args...) \ ret (*func)(args) attr= stage0_##func #else +#define EXTERN(func, ret, attr, args...) \ + ret *func(args) attr +#endif + +#else #define FUNC(func, ret, attr, args...) \ ret func(args) attr #define EXTERN(func, ret, attr, args...)
Modified: LinuxBIOSv3/mainboard/adl/msm800sev/Makefile =================================================================== --- LinuxBIOSv3/mainboard/adl/msm800sev/Makefile 2007-11-21 20:12:56 UTC (rev 515) +++ LinuxBIOSv3/mainboard/adl/msm800sev/Makefile 2007-11-22 22:54:11 UTC (rev 516) @@ -34,7 +34,7 @@
# Next Quest: Make a single rule out of those: $(obj)/mainboard/$(MAINBOARDDIR)/initram.o: $(src)/mainboard/$(MAINBOARDDIR)/initram.c - $(Q)$(CC) $(INITCFLAGS) -D_SHARED -fPIE -c $< -o $@ + $(Q)$(CC) $(INITCFLAGS) -D_SHARED -D_MAINOBJECT -fPIE -c $< -o $@ $(obj)/northbridge/amd/geodelx/raminit.o: $(src)/northbridge/amd/geodelx/raminit.c $(Q)mkdir -p $(dir $@) $(Q)$(CC) $(INITCFLAGS) -D_SHARED -fPIE -c $< -o $@
Modified: LinuxBIOSv3/mainboard/amd/norwich/Makefile =================================================================== --- LinuxBIOSv3/mainboard/amd/norwich/Makefile 2007-11-21 20:12:56 UTC (rev 515) +++ LinuxBIOSv3/mainboard/amd/norwich/Makefile 2007-11-22 22:54:11 UTC (rev 516) @@ -28,7 +28,7 @@
# Next Quest: Make a single rule out of those: $(obj)/mainboard/$(MAINBOARDDIR)/initram.o: $(src)/mainboard/$(MAINBOARDDIR)/initram.c - $(Q)$(CC) $(INITCFLAGS) -D_SHARED -fPIE -c $< -o $@ + $(Q)$(CC) $(INITCFLAGS) -D_SHARED -D_MAINOBJECT -fPIE -c $< -o $@ $(obj)/northbridge/amd/geodelx/raminit.o: $(src)/northbridge/amd/geodelx/raminit.c $(Q)mkdir -p $(dir $@) $(Q)$(CC) $(INITCFLAGS) -D_SHARED -fPIE -c $< -o $@
Modified: LinuxBIOSv3/mainboard/artecgroup/dbe61/Makefile =================================================================== --- LinuxBIOSv3/mainboard/artecgroup/dbe61/Makefile 2007-11-21 20:12:56 UTC (rev 515) +++ LinuxBIOSv3/mainboard/artecgroup/dbe61/Makefile 2007-11-22 22:54:11 UTC (rev 516) @@ -32,7 +32,7 @@
# Next Quest: Make a single rule out of those: $(obj)/mainboard/$(MAINBOARDDIR)/initram.o: $(src)/mainboard/$(MAINBOARDDIR)/initram.c - $(Q)$(CC) $(INITCFLAGS) -D_SHARED -fPIE -c $< -o $@ + $(Q)$(CC) $(INITCFLAGS) -D_SHARED -D_MAINOBJECT -fPIE -c $< -o $@ $(obj)/northbridge/amd/geodelx/raminit.o: $(src)/northbridge/amd/geodelx/raminit.c $(Q)mkdir -p $(dir $@) $(Q)$(CC) $(INITCFLAGS) -D_SHARED -fPIE -c $< -o $@
Modified: LinuxBIOSv3/mainboard/emulation/qemu-x86/Makefile =================================================================== --- LinuxBIOSv3/mainboard/emulation/qemu-x86/Makefile 2007-11-21 20:12:56 UTC (rev 515) +++ LinuxBIOSv3/mainboard/emulation/qemu-x86/Makefile 2007-11-22 22:54:11 UTC (rev 516) @@ -43,7 +43,7 @@ INITRAM_OBJ = $(obj)/mainboard/$(MAINBOARDDIR)/initram.o
$(obj)/mainboard/$(MAINBOARDDIR)/initram.o: $(src)/mainboard/$(MAINBOARDDIR)/initram.c - $(Q)$(CC) $(INITCFLAGS) -D_SHARED -fPIE -c $< -o $@ + $(Q)$(CC) $(INITCFLAGS) -D_SHARED -D_MAINOBJECT -fPIE -c $< -o $@
$(obj)/linuxbios.initram $(obj)/linuxbios.initram.map: $(obj)/stage0.init $(obj)/stage0-prefixed.o $(INITRAM_OBJ) $(Q)# initram links against stage0