mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bob McElrath <mcelrath@draal.physics.wisc.edu>
To: Evgeny Polyakov <johnpol@2ka.mipt.ru>
Cc: linux-kernel@vger.kernel.org
Subject: Re: basic module bug
Date: Sat, 25 Aug 2001 10:56:45 -0500	[thread overview]
Message-ID: <20010825105645.T21497@draal.physics.wisc.edu> (raw)
In-Reply-To: <20010825005957.Q21497@draal.physics.wisc.edu> <200108251122.f7PBMvl17221@www.2ka.mipt.ru> <20010825102756.R21497@draal.physics.wisc.edu>
In-Reply-To: <20010825102756.R21497@draal.physics.wisc.edu>; from mcelrath@draal.physics.wisc.edu on Sat, Aug 25, 2001 at 10:27:56AM -0500

[-- Attachment #1: Type: text/plain, Size: 1809 bytes --]

Also I don't know if I mentioned this is on the alpha architecture.
I've tried egcs 2.91.66, gcc-2.96-85 (redhat), binutils-2.10.91.0.2-3.
All kernel versions I've tried (2.4.4, 2.4.5, 2.4.7, 2.4.9, 2.2.19)
generate the same message.  What am I doing wrong?

Where can I find a "skeleton" kernel module for comparison?

Bob McElrath [mcelrath@draal.physics.wisc.edu] wrote:
> Evgeny Polyakov [johnpol@2ka.mipt.ru] wrote:
> > How do you compile this module?
> > I've just trying to do this with the following command and all is OK:
> > gcc ./test.c -c -o ./test.o -D__KERNEL__ -DMODULE.
> 
> That's because if you -D__KERNEL__ the whole file is ifdef'ed out.  ;)
> 
> Remove the #ifdef __KERNEL__ stuff if you want to compile it that way.

Here's a simpler case more compatible with the options passed to gcc
when the kernel is compiled:

    /* test module.  Compile with: gcc -c -I/usr/src/linux/include
     * -D__KERNEL__ -DMODULE test.c  */
    #include <linux/module.h>
    #include <linux/kernel.h>
    #include <asm/current.h>
    #ifdef MODULE
     int init_module(void)
    #else
     int test_init(void)
    #endif
     {
             return 0;
     }
    #ifdef MODULE
     void cleanup_module(void)
     {
     }
    #endif

(0)<mcelrath@draal:/home/mcelrath> gcc -c -I/usr/src/linux/include -D__KERNEL__ -DMODULE test.c
In file included from test.c:5:
/usr/src/linux/include/asm/current.h:4: warning: call-clobbered register used for global register variable

Yet a simpler case:

    #include <asm/current.h>
    int main() {}

Generates the same warning message.  Why does this message not occur
when compiling the kernel?

Cheers,
-- Bob

Bob McElrath (rsmcelrath@students.wisc.edu) 
Univ. of Wisconsin at Madison, Department of Physics

[-- Attachment #2: Type: application/pgp-signature, Size: 240 bytes --]

  reply	other threads:[~2001-08-25 15:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-08-25  5:59 Bob McElrath
2001-08-25 11:21 ` Evgeny Polyakov
2001-08-25 15:27   ` Bob McElrath
2001-08-25 15:56     ` Bob McElrath [this message]
2001-08-25 19:04     ` Evgeny Polyakov
2001-08-25 21:03       ` Bob McElrath

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=20010825105645.T21497@draal.physics.wisc.edu \
    --to=mcelrath@draal.physics.wisc.edu \
    --cc=johnpol@2ka.mipt.ru \
    --cc=linux-kernel@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®