Patchwork uClibc: install libc.so even if BR2_PREFER_STATIC_LIB is enabled

login
register
mail settings
Submitter Arnout Vandecappelle
Date Nov. 1, 2012, 10:15 a.m.
Message ID <1351764953-24251-1-git-send-email-arnout@mind.be>
Download mbox | patch
Permalink /patch/196141/
State Rejected
Headers show

Comments

Arnout Vandecappelle - Nov. 1, 2012, 10:15 a.m.
BR2_PREFER_STATIC_LIB _prefers_ static linking, but doesn't force it for
all packages.  So some binaries may still be built without -static, and
they will need libc.so on the target.

Therefore, put libc.so.0 in the target unconditionally.

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
---
Untested!

 toolchain/uClibc/uclibc.mk |    2 --
 1 file changed, 2 deletions(-)
Eial Czerwacki - Nov. 1, 2012, 11:28 a.m.
On 11/01/2012 12:15 PM, Arnout Vandecappelle (Essensium/Mind) wrote:
> BR2_PREFER_STATIC_LIB _prefers_ static linking, but doesn't force it for
> all packages.  So some binaries may still be built without -static, and
> they will need libc.so on the target.
>
> Therefore, put libc.so.0 in the target unconditionally.
>
> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
> ---
> Untested!
>
>  toolchain/uClibc/uclibc.mk |    2 --
>  1 file changed, 2 deletions(-)
>
> diff --git a/toolchain/uClibc/uclibc.mk b/toolchain/uClibc/uclibc.mk
> index 397cdd4..65ff90b 100644
> --- a/toolchain/uClibc/uclibc.mk
> +++ b/toolchain/uClibc/uclibc.mk
> @@ -486,9 +486,7 @@ $(TARGET_DIR)/usr/bin/ldd: $(cross_compiler)
>  		PREFIX=$(TARGET_DIR) utils install_utils
>  	touch -c $@
>  
> -ifneq ($(BR2_PREFER_STATIC_LIB),y)
>  UCLIBC_TARGETS=$(TARGET_DIR)/lib/libc.so.0
> -endif
>  
>  ifeq ($(BR2_UCLIBC_INSTALL_TEST_SUITE),y)
>  UCLIBC_TARGETS+=uclibc-test
I can confirm it works:
# find / -name "libc*"
/lib/libcrypt.so.0
/lib/libc.so.0
/lib/libcrypt-0.9.32.1.so
/usr/include/bits/libc-lock.h
/usr/lib/libc.a
/usr/lib/libcrypt_pic.a
/usr/lib/libc_pic.a
/usr/lib/libcurses.a
/usr/lib/libcrypt.a
Thomas Petazzoni - Nov. 2, 2012, 10:17 p.m.
Dear Arnout Vandecappelle (Essensium/Mind),

On Thu,  1 Nov 2012 11:15:53 +0100, Arnout Vandecappelle
(Essensium/Mind) wrote:
> BR2_PREFER_STATIC_LIB _prefers_ static linking, but doesn't force it
> for all packages.  So some binaries may still be built without
> -static, and they will need libc.so on the target.
> 
> Therefore, put libc.so.0 in the target unconditionally.
> 
> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
> ---
> Untested!

This is an exact revert of c95174a8dfb6f72b80768b73b8f04448f846c122. Do
we really want to make circles and redo/undo our changes? :-)

Thomas
Arnout Vandecappelle - Nov. 3, 2012, 11:28 p.m.
On 11/02/12 23:17, Thomas Petazzoni wrote:
> Dear Arnout Vandecappelle (Essensium/Mind),
>
> On Thu,  1 Nov 2012 11:15:53 +0100, Arnout Vandecappelle
> (Essensium/Mind) wrote:
>> >  BR2_PREFER_STATIC_LIB_prefers_  static linking, but doesn't force it
>> >  for all packages.  So some binaries may still be built without
>> >  -static, and they will need libc.so on the target.
>> >
>> >  Therefore, put libc.so.0 in the target unconditionally.
>> >
>> >  Signed-off-by: Arnout Vandecappelle (Essensium/Mind)<arnout@mind.be>
>> >  ---
>> >  Untested!
> This is an exact revert of c95174a8dfb6f72b80768b73b8f04448f846c122. Do
> we really want to make circles and redo/undo our changes?:-)

  If they break things, yes.  The alternative is to disable all packages that
don't support static linking of executables if BR2_PREFER_STATIC_LIB is
selected.

  Regards,
  Arnout

Patch

diff --git a/toolchain/uClibc/uclibc.mk b/toolchain/uClibc/uclibc.mk
index 397cdd4..65ff90b 100644
--- a/toolchain/uClibc/uclibc.mk
+++ b/toolchain/uClibc/uclibc.mk
@@ -486,9 +486,7 @@  $(TARGET_DIR)/usr/bin/ldd: $(cross_compiler)
 		PREFIX=$(TARGET_DIR) utils install_utils
 	touch -c $@
 
-ifneq ($(BR2_PREFER_STATIC_LIB),y)
 UCLIBC_TARGETS=$(TARGET_DIR)/lib/libc.so.0
-endif
 
 ifeq ($(BR2_UCLIBC_INSTALL_TEST_SUITE),y)
 UCLIBC_TARGETS+=uclibc-test