linux-um archives
 help / color / mirror / Atom feed
From: BlaisorBlade <blaisorblade_spam@yahoo.it>
To: user-mode-linux-devel@lists.sourceforge.net
Subject: Re: [uml-devel] Re: [patch] module symbol fix
Date: Sat, 28 Feb 2004 17:32:12 +0100	[thread overview]
Message-ID: <200402281732.13103.blaisorblade_spam@yahoo.it> (raw)
In-Reply-To: <20040227092656.GA12168@bytesex.org>

Alle 10:26, venerdì 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= 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 - 
and this means using __attribute__(__unused__) if needed - i.e. using 
__attribute__used as in the first patch (using more than one attribute works, 
as in include/linux/init.h).

The problem is that init.h is included even in userspace modules so it cannot 
include kernel headers - also, it seems that user_syms.c does not include 
<linux/compiler.h> and so __attribute_used cannot be expanded simply. If it 
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 to 
avoid the problems you pointed out and possibly others, but not being able to 
include linux/* in user-objs is increasingly sucking. Sadly there are reasons 
for this and they are good (I discovered this while trying to remove this 
limitation):

- user space headers include /usr/include/linux/*, so if you add -I<source 
tree root>/include, those headers will include _other_ linux headers and 
things will not work - especially, they will include <source tree 
root>/include/asm-um/* instead of /usr/include/asm/*.

- definitions depending on CONFIG_* would be messed up; in fact, uml-config.h 
is a translation of config.h which defines UML_CONFIG_* instead of CONFIG_*, 
because CONFIG_* macros are defined by /usr/include/linux/autoconf.h. So if 
an "user-objs" file includes linux/mm.h, that header could even think that 
CONFIG_HIGHMEM is defined because the distro said so!
-- 
Paolo Giarrusso, aka Blaisorblade
Linux registered user n. 292729



-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id\x1356&alloc_id438&opÌk
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

      reply	other threads:[~2004-02-28 19:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-26 21:26 [uml-devel] [patch] module symbol fix Gerd Knorr
2004-02-27  9:26 ` [uml-devel] " Gerd Knorr
2004-02-28 16:32   ` BlaisorBlade [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200402281732.13103.blaisorblade_spam@yahoo.it \
    --to=blaisorblade_spam@yahoo.it \
    --cc=user-mode-linux-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox