[U-Boot] [PATCH] Switch from library archives to partial linking

Peter Tyser ptyser at xes-inc.com
Sun Nov 7 15:16:19 CET 2010


On Sat, 2010-11-06 at 18:21 +0100, Albert ARIBAUD wrote:
> Le 06/11/2010 15:28, Sebastien Carlier a écrit :
> > Hello all,
> >
> > My previous patch missed some places that create library archives.  A
> > new 100% $(AR)-free version is available here:
> >
> >       http://io.oiioiio.com/~sebc/0001-Use-partial-linking-v2.patch
> >
> > I have tested this patch with MAKEALL -A arm and checked that it does
> > not break any build on this architecture.  I have not yet tested the
> > resulting binaries, but in theory they should work.  :-)  Feedback on
> > other architectures is also welcome.
> >
> > For a few boards (balloon3, palmld, palmtc, pleb2, zipitz2) that disable
> > CONFIG_CMD_NET, this patch also disables CONFIG_CMD_NFS to prevent
> > net/nfs.o from being compiled and causing undefined symbols.
> 
> I guess if this patch is ready to be pulled in a git repo, you should 
> submit it using git format-patch / git send-email, ideally as a patchset 
> with each patch dealing with one lib, because clearly each ex-library 
> will require its own set of custodian ack(s), thus require its own patch 
> in the set.

You shouldn't need to send the patch using "git send-email".  The patch
is greater than U-Boot's mailing list limit (100k) and posting the patch
on a website is perfectly acceptable.  Also, it shouldn't be necessary
to split the patch into each separate patch's to address each lib.  It'd
be a lot of work on Sebastien's part to do this and not break bisection,
and most maintainers can either ack this patch, or probably don't need
to since its more of a build change, not low-level change that a
maintainer has insight into.

I had a couple of comments though:
- You need to add your "Signed-of-by: " line to the patch.
- A patch description illustrating why this approach is better than the
current approach would be appreciated.
- You shouldn't be making changes to stuff like CONFIG_CMD_NFS in this
patch.  Its unrelated, and should be dealt with in another patch.  eg
your patches could be:
1/2: Fix boards with CONFIG_CMD_NFS but !CONFIG_CMD_NET
2/2: Switch from library archives to partial linking

I just tried compiling for PowerPC and ran into this:
Configuring for cmi_mpc5xx board...
net/libnet.o: In function `rpc_req':
/home/ptyser/u-boot/u-boot/net/nfs.c:193: undefined reference to `NetEthHdrSize'
/home/ptyser/u-boot/u-boot/net/nfs.c:202: undefined reference to `NetSendUDPPacket'
net/libnet.o: In function `NfsStart':
/home/ptyser/u-boot/u-boot/net/nfs.c:741: undefined reference to `NetSetTimeout'
/home/ptyser/u-boot/u-boot/net/nfs.c:742: undefined reference to `NetSetHandler'
net/libnet.o: In function `NfsHandler':
/home/ptyser/u-boot/u-boot/net/nfs.c:656: undefined reference to `NetSetTimeout'
net/libnet.o: In function `NfsTimeout':
/home/ptyser/u-boot/u-boot/net/nfs.c:574: undefined reference to `NetStartAgain'
/home/ptyser/u-boot/u-boot/net/nfs.c:577: undefined reference to `NetSetTimeout'
net/libnet.o:(.got2+0x8): undefined reference to `NetTxPacket'
net/libnet.o:(.got2+0xc): undefined reference to `NetServerEther'
net/libnet.o:(.got2+0x18): undefined reference to `NetServerIP'
net/libnet.o:(.got2+0x1c): undefined reference to `BootFile'
net/libnet.o:(.got2+0x20): undefined reference to `NetOurIP'
net/libnet.o:(.got2+0x30): undefined reference to `NetOurGatewayIP'
net/libnet.o:(.got2+0x34): undefined reference to `NetOurSubnetMask'
net/libnet.o:(.got2+0x40): undefined reference to `NetBootFileSize'
net/libnet.o:(.got2+0x64): undefined reference to `NetState'
net/libnet.o:(.got2+0x7c): undefined reference to `NetBootFileXferSize'
make: *** [u-boot] Error 1
powerpc-linux-size: './u-boot': No such file

I'm guessing lots of boards will have this same issue.  I imagine its
due to include/config_cmd_defaults.h, so maybe if you fix the issue in
that one place all the compile issues will go away.

Best,
Peter



More information about the U-Boot mailing list