LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Tilman Schmidt <tilman@imap.cc>
To: Adrian Bunk <bunk@stusta.de>
Cc: Kai Germaschewski <kai.germaschewski@unh.edu>,
	Hansjoerg Lipp <hjlipp@web.de>,
	kkeil@suse.de, isdn4linux@listserv.isdn4linux.de,
	linux-kernel@vger.kernel.org
Subject: Re: Kbuild problem
Date: Tue, 20 Feb 2007 14:56:27 +0100	[thread overview]
Message-ID: <45DAFE0B.1070305@imap.cc> (raw)
In-Reply-To: <20070218104028.GU13958@stusta.de>

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

Adrian Bunk schrieb:
> On Sun, Feb 18, 2007 at 12:22:10AM -0500, Kai Germaschewski wrote:
>> On Sat, 17 Feb 2007, Tilman Schmidt wrote:
>> 
>> > asyncdata.o is only needed for M105 and M101, not for the base
>> > driver. How do I express in Kbuild that asyncdata.o is to be added
>> > to gigaset-y only if CONFIG_GIGASET_M105 and CONFIG_GIGASET_M101
>> > are not both 'n'?
>> 
>> The way this is typically done is via Kconfig. Add a config option 
>> ASYNCDATA (actually something more descriptive/specific would be better), 
>> add a "select ASYNCDATA" to the config options for m101 and m105, and then 
>> you can use CONFIG_ASYNCDATA to decide whether to add asyncdata.o in the 
>> Makefile.
> 
> One disadvantage of this approach is that in a kernel with 
> CONFIG_GIGASET_BASE=y, you can't later compile and load the usb_gigaset 
> or ser_gigaset modules without rebooting since they require a change to 
> the kernel image.

You've got a point there. So linking asyncdata.o into the modules that
need it, as it is currently done, would perhaps be better after all?
The original problem (asyncdata.o linked in twice, causing duplicate
symbol definitions) could be fixed with this (admittedly somewhat
awkward) change to the Makefile (build tested):

--- linux-2.6.20-mm1-work/drivers/isdn/gigaset/Makefile 2007-02-20 13:39:44.000000000 +0100
+++ u/drivers/isdn/gigaset/Makefile     2007-02-20 13:38:58.000000000 +0100
@@ -1,7 +1,10 @@
 gigaset-y := common.o interface.o proc.o ev-layer.o i4l.o
 usb_gigaset-y := usb-gigaset.o asyncdata.o
 bas_gigaset-y := bas-gigaset.o isocdata.o
-ser_gigaset-y := ser-gigaset.o asyncdata.o
+ser_gigaset-y := ser-gigaset.o
+ifneq ($(CONFIG_GIGASET_M101)$(CONFIG_GIGASET_M105),yy)
+ser_gigaset-y += asyncdata.o
+endif

 obj-$(CONFIG_GIGASET_M105) += usb_gigaset.o gigaset.o
 obj-$(CONFIG_GIGASET_BASE) += bas_gigaset.o gigaset.o

The alternative would be to always link asyncdata.o into the gigaset
module whether it's needed or not. "size asyncdata.o" says:
   text    data     bss     dec     hex filename
   4200       0       0    4200    1068 asyncdata.o
which appears tolerable.

Opinions?

-- 
Tilman Schmidt                    E-Mail: tilman@imap.cc
Bonn, Germany
Diese Nachricht besteht zu 100% aus wiederverwerteten Bits.
Ungeöffnet mindestens haltbar bis: (siehe Rückseite)


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 250 bytes --]

  reply	other threads:[~2007-02-20 13:58 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-15 21:56 [2.6 patch] drivers/isdn/gigaset/: build asyncdata.o into the gigaset module Adrian Bunk
2007-02-16  0:17 ` Tilman Schmidt
2007-02-16  8:33   ` Adrian Bunk
2007-02-17  0:04     ` Kbuild problem (was: [2.6 patch] drivers/isdn/gigaset/: build asyncdata.o into the gigaset module) Tilman Schmidt
2007-02-17 10:52       ` Adrian Bunk
2007-02-17 18:36         ` Kbuild problem Tilman Schmidt
2007-02-18  5:22           ` Kai Germaschewski
2007-02-18 10:40             ` Adrian Bunk
2007-02-20 13:56               ` Tilman Schmidt [this message]
2007-02-20 14:12                 ` Joerg Dorchain
2007-02-20 14:59                 ` Adrian Bunk
2007-02-20 21:55                   ` Tilman Schmidt
2007-11-01  1:39 kbuild problem Randy Dunlap
2007-11-01  5:21 ` Sam Ravnborg
2007-11-01 17:11   ` Randy Dunlap
2007-11-01 17:59     ` Sam Ravnborg

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=45DAFE0B.1070305@imap.cc \
    --to=tilman@imap.cc \
    --cc=bunk@stusta.de \
    --cc=hjlipp@web.de \
    --cc=isdn4linux@listserv.isdn4linux.de \
    --cc=kai.germaschewski@unh.edu \
    --cc=kkeil@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --subject='Re: Kbuild problem' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).