mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sam Ravnborg <sam@ravnborg.org>
To: Rusty Russell <rusty@au1.ibm.com>
Cc: Brian King <brking@us.ibm.com>,
	sam@ravnborg.org, akpm@osdl.org, linux-kernel@vger.kernel.org
Subject: Re: Question on MODULE_VERSION macro
Date: Mon, 23 Feb 2004 00:23:17 +0100	[thread overview]
Message-ID: <20040222232317.GA20083@mars.ravnborg.org> (raw)
In-Reply-To: <20040222044826.A94DA17DE9@ozlabs.au.ibm.com>

> > Any update on the MODULE_VERSION macro getting into mainline?
> 
> Sam need to ack the build system changes.

I have taken a look at it now.

As you mention yourself this assume all input files for a module
is .c files. Which is almost always the case.
But I do not like the fact that we warn in cases where .s files is
actually used.

Current implementation will also fail when using O= syntax.

The more correct approach is to list the .o files in the
.mod file. Then in sumversion find the corresponding .file.o.cmd, and parse
up the name of the corresponding source file (listed as the first filename
in the deps_ assignment, and pass this filename to grab_file.

Example .file.o.cmd file:
sam@mars:~/bk/v2.6> head -10 ~/b/drivers/scsi/aic7xxx/.aic7xxx_osm.o.cmd
cmd_drivers/scsi/aic7xxx/aic7xxx_osm.o := gcc -Wp,-MD,drivers/scsi/aic7xxx/.aic7xxx_osm.o.d -nostdinc -iwithprefix include -D__KERNEL__ -Iinclude -Iinclude2 -I/home/sam/bk/v2.6/include -I/home/sam/bk/v2.6/drivers/scsi/aic7xxx -Idrivers/scsi/aic7xxx -D__KERNEL__ -I/home/sam/bk/v2.6/include -Iinclude -I/home/sam/bk/v2.6/include2 -Iinclude2  -I/home/sam/bk/v2.6/include -Wall -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -pipe -mpreferred-stack-boundary=2 -march=i686 -I/home/sam/bk/v2.6/include/asm-i386/mach-default -Iinclude/asm-i386/mach-default -O2 -fomit-frame-pointer -I/home/sam/bk/v2.6/drivers/scsi -Idrivers/scsi -DMODULE -DKBUILD_BASENAME=aic7xxx_osm -DKBUILD_MODNAME=aic7xxx -c -o drivers/scsi/aic7xxx/aic7xxx_osm.o /home/sam/bk/v2.6/drivers/scsi/aic7xxx/aic7xxx_osm.c

deps_drivers/scsi/aic7xxx/aic7xxx_osm.o := \
  /home/sam/bk/v2.6/drivers/scsi/aic7xxx/aic7xxx_osm.c \
    $(wildcard include/config/aic7xxx/reset/delay/ms.h) \
    $(wildcard include/config/aic7xxx/proc/stats.h) \


Here the source file is listed with absolute path.
It must be as simple as searching through the file for a line starting with deps_,
and then read the following line.

The .mod file will specify the path to the .file.o.cmd file, since this
is an output file, there is no need to use $(srctree).

I hope I made the approach clear enough?

	Sam


  reply	other threads:[~2004-02-22 22:22 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20040119214233.GF967@beaverton.ibm.com>
2004-01-20  0:57 ` Rusty Russell
2004-01-20  1:17   ` Greg KH
2004-01-20  7:47     ` Rusty Russell
2004-02-20 21:44       ` Brian King
2004-02-21  1:07         ` Rusty Russell
2004-02-22 23:23           ` Sam Ravnborg [this message]
2004-02-23  3:51             ` Rusty Russell
2004-02-23 21:17               ` Sam Ravnborg
2004-02-24  6:13                 ` Rusty Russell
2004-02-25 21:36                   ` Sam Ravnborg
2004-02-26  1:50                     ` Rusty Russell
2004-02-26  7:12                       ` Sam Ravnborg
2004-03-10 20:49     ` Brian King
2004-03-10 21:08       ` Greg KH

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=20040222232317.GA20083@mars.ravnborg.org \
    --to=sam@ravnborg.org \
    --cc=akpm@osdl.org \
    --cc=brking@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rusty@au1.ibm.com \
    /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®