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> git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@516 f3766cd6-281f-0410-b1cd-43a5c92072e9
This commit is contained in:
parent
7ffd614f3f
commit
daea2e08b0
5 changed files with 19 additions and 4 deletions
|
|
@ -29,8 +29,23 @@
|
|||
*/
|
||||
#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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue