LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Adrian Bunk <bunk@stusta.de>
To: Tilman Schmidt <tilman@imap.cc>
Cc: Hansjoerg Lipp <hjlipp@web.de>,
	gigaset307x-common@lists.sourceforge.net, kkeil@suse.de,
	kai.germaschewski@gmx.de, isdn4linux@listserv.isdn4linux.de,
	linux-kernel@vger.kernel.org
Subject: Re: Kbuild problem (was: [2.6 patch] drivers/isdn/gigaset/: build asyncdata.o into the gigaset module)
Date: Sat, 17 Feb 2007 11:52:03 +0100	[thread overview]
Message-ID: <20070217105203.GR13958@stusta.de> (raw)
In-Reply-To: <45D64691.8070901@imap.cc>

On Sat, Feb 17, 2007 at 01:04:33AM +0100, Tilman Schmidt wrote:
> Am 16.02.2007 09:33 schrieb Adrian Bunk:
> >>> ...
> >>>   LD      drivers/isdn/gigaset/built-in.o
> >>> drivers/isdn/gigaset/ser_gigaset.o: In function `gigaset_m10x_send_skb':
> >>> (.text+0xe50): multiple definition of `gigaset_m10x_send_skb'
> >>> drivers/isdn/gigaset/usb_gigaset.o:(.text+0x0): first defined here
> >>> drivers/isdn/gigaset/ser_gigaset.o: In function `gigaset_m10x_input':
> >>> (.text+0x1121): multiple definition of `gigaset_m10x_input'
> >>> drivers/isdn/gigaset/usb_gigaset.o:(.text+0x2d1): first defined here
> >>> make[4]: *** [drivers/isdn/gigaset/built-in.o] Error 1
> 
> > CONFIG_ISDN_DRV_GIGASET=y
> > CONFIG_GIGASET_BASE=y
> > CONFIG_GIGASET_M105=y
> > CONFIG_GIGASET_M101=y
> 
> Ah, thanks, I can see what's happening now. When both the M101 and M105
> drivers are built into the kernel, asyncdata.o gets linked in twice, via
> 
> 	usb_gigaset-y := usb-gigaset.o asyncdata.o
> 	obj-$(CONFIG_GIGASET_M105) += usb_gigaset.o gigaset.o
> 
> and
> 
> 	ser_gigaset-y := ser-gigaset.o asyncdata.o
> 	obj-$(CONFIG_GIGASET_M101) += ser_gigaset.o gigaset.o
> 
> The assertion in Documentation/kbuild/makefiles.txt:
> 
>         The order of files in $(obj-y) is significant.  Duplicates in
>         the lists are allowed: the first instance will be linked into
>         built-in.o and succeeding instances will be ignored.
> 
> doesn't work out in this case because asyncdata.o isn't added directly
> to $(obj-y), but as part of usb_gigaset.o and ser_gigaset.o.
> 
> I'm not quite happy with your solution, though. I'd prefer a
> Makefile which builds modular usb_gigaset.ko and/or ser_gigaset.ko
> like the present one (including asyncdata.o), but when linking
> usb-gigaset.o and ser-gigaset.o into the kernel includes asyncdata.o
> only once. Trouble is, I don't know how to express that in Kbuild.
> 
> Any ideas?

CONFIG_GIGASET_M105=y, CONFIG_GIGASET_M101=m and similar problems might 
make this quite tricky.

Shared functionality simply doesn't belong into any of the affected 
modules, but to a different place where all users can access it.

> Thanks,
> Tilman

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


  reply	other threads:[~2007-02-17 10:51 UTC|newest]

Thread overview: 12+ 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 [this message]
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
2007-02-20 14:12                 ` Joerg Dorchain
2007-02-20 14:59                 ` Adrian Bunk
2007-02-20 21:55                   ` Tilman Schmidt

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=20070217105203.GR13958@stusta.de \
    --to=bunk@stusta.de \
    --cc=gigaset307x-common@lists.sourceforge.net \
    --cc=hjlipp@web.de \
    --cc=isdn4linux@listserv.isdn4linux.de \
    --cc=kai.germaschewski@gmx.de \
    --cc=kkeil@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tilman@imap.cc \
    --subject='Re: Kbuild problem (was: [2.6 patch] drivers/isdn/gigaset/: build asyncdata.o into the gigaset module)' \
    /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).