[U-Boot] [PATCH] Switch from archive libraries to partial linking

Mike Frysinger vapier at gentoo.org
Wed Nov 10 07:57:30 CET 2010


On Monday, November 08, 2010 17:04:32 Sebastien Carlier wrote:
> This commit changes all Makefiles to use partial linking (ld -r) instead of
> creating library archives, which forces all symbols to participate in
> linking, allowing non-weak symbols to override weak symbols as intended. 
> This approach is also used by Linux, from which the gmake function
> cmd_link_o_target (added at the end of config.mk and used in all
> Makefiles) is inspired.

wish we could integrate this into one place already.  all these Makefile's 
duplicating targets sucks a lot.  but guess that could be a future change.

the config.mk looks weird:
+cmd_link_o_target = $(if $(strip $1),\
+                      $(LD) -r -o $@ $1 ,\
+                      rm -f $@; $(AR) rcs $@ )

why do you need the rm/ar ?

>  post/board/lwmon/Makefile                 |    2 +-
>  post/board/lwmon5/Makefile                |    2 +-
>  post/board/netta/Makefile                 |    2 +-
>  post/board/pdm360ng/Makefile              |    2 +-
>  post/cpu/mpc83xx/Makefile                 |    2 +-
>  post/cpu/mpc8xx/Makefile                  |    2 +-
>  post/cpu/ppc4xx/Makefile                  |    2 +-
>  post/drivers/Makefile                     |    2 +-
>  post/lib_powerpc/Makefile                 |    2 +-
>  post/lib_powerpc/fpu/Makefile             |    2 +-
>  post/rules.mk                             |    2 +-

these look like useless whitespace changes.  a lot of the LIB= changes have 
similar useless changes.  looks like your sed needs a little more smarts to 
retain whitespace:
	-e '/^LIB/s:[.]a$:.o:'
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20101110/3804df2b/attachment.pgp 


More information about the U-Boot mailing list