From: BlaisorBlade <bla...@ya...> - 2004-02-28 19:59:25
|
Alle 10:26, venerd=EC 27 febbraio 2004, Gerd Knorr ha scritto: > On Thu, Feb 26, 2004 at 10:26:55PM +0100, Gerd Knorr wrote: > > Hi, > > > > recent gcc versions need this one ... > > Another one of this kind (without this gcc may optimizes away the static > declared but unreferenced stuff, resulting in initrd=3D and --help options > not working any more for example ...). Yes, but it needs to be made work with older gcc, even 2.95.3 but also 3.2 = =2D=20 and this means using __attribute__(__unused__) if needed - i.e. using=20 __attribute__used as in the first patch (using more than one attribute work= s,=20 as in include/linux/init.h). The problem is that init.h is included even in userspace modules so it cann= ot=20 include kernel headers - also, it seems that user_syms.c does not include=20 <linux/compiler.h> and so __attribute_used cannot be expanded simply. If it= =20 works on you, check if the define comes from /usr/include/linux/compiler.h. Duplicating the version check from include/linux/compiler* will be needed t= o=20 avoid the problems you pointed out and possibly others, but not being able = to=20 include linux/* in user-objs is increasingly sucking. Sadly there are reaso= ns=20 for this and they are good (I discovered this while trying to remove this=20 limitation): =2D user space headers include /usr/include/linux/*, so if you add -I<sourc= e=20 tree root>/include, those headers will include _other_ linux headers and=20 things will not work - especially, they will include <source tree=20 root>/include/asm-um/* instead of /usr/include/asm/*. =2D definitions depending on CONFIG_* would be messed up; in fact, uml-conf= ig.h=20 is a translation of config.h which defines UML_CONFIG_* instead of CONFIG_*= ,=20 because CONFIG_* macros are defined by /usr/include/linux/autoconf.h. So if= =20 an "user-objs" file includes linux/mm.h, that header could even think that= =20 CONFIG_HIGHMEM is defined because the distro said so! =2D-=20 Paolo Giarrusso, aka Blaisorblade Linux registered user n. 292729 |