Browse Source

Per http://bugs.uclibc.org/view.php?id=15, patch from kergoth:
Sometimes it is desirable to build ldconfig non-static.

Eric Andersen 21 years ago
parent
commit
b872898162
2 changed files with 36 additions and 25 deletions
  1. 35 24
      extra/Configs/Config.in
  2. 1 1
      utils/Makefile

+ 35 - 24
extra/Configs/Config.in

@@ -200,7 +200,7 @@ config FORCE_SHAREABLE_TEXT_SEGMENTS
 	  segments. These libraries haven't set the DT_TEXTREL tag in the dynamic
 	  segments. These libraries haven't set the DT_TEXTREL tag in the dynamic
 	  section (==> objdump). So all your libraries must be compiled with
 	  section (==> objdump). So all your libraries must be compiled with
 	  -fPIC or -fpic, and all assembler function must be written as position
 	  -fPIC or -fpic, and all assembler function must be written as position
-	  independent code (PIC). 
+	  independent code (PIC).
 	  Enabling this option will makes uClibc's shared library loader a
 	  Enabling this option will makes uClibc's shared library loader a
 	  little bit smaller and guarantee that no memory will be wasted by badly
 	  little bit smaller and guarantee that no memory will be wasted by badly
 	  coded shared libraries.
 	  coded shared libraries.
@@ -278,7 +278,7 @@ config UCLIBC_HAS_THREADS
 	depends on !HAS_NO_THREADS
 	depends on !HAS_NO_THREADS
 	default y
 	default y
 	help
 	help
-	  If you want to compile uClibc with pthread support, then answer Y.  
+	  If you want to compile uClibc with pthread support, then answer Y.
 	  This will increase the size of uClibc by adding a bunch of locking
 	  This will increase the size of uClibc by adding a bunch of locking
 	  to critical data structures, and adding extra code to ensure that
 	  to critical data structures, and adding extra code to ensure that
 	  functions are properly reentrant.
 	  functions are properly reentrant.
@@ -291,7 +291,7 @@ config PTHREADS_DEBUG_SUPPORT
 	depends on UCLIBC_HAS_THREADS
 	depends on UCLIBC_HAS_THREADS
 	help
 	help
 	  Say Y here if you wish to be able to debug applications that use
 	  Say Y here if you wish to be able to debug applications that use
-	  uClibc's pthreads library.  By enabling this option, a library 
+	  uClibc's pthreads library.  By enabling this option, a library
 	  named libthread_db will be built.  This library will be dlopen()'d
 	  named libthread_db will be built.  This library will be dlopen()'d
 	  by gdb and will allow gdb to debug the threads in your application.
 	  by gdb and will allow gdb to debug the threads in your application.
 
 
@@ -306,11 +306,22 @@ config UCLIBC_HAS_LFS
 	bool "Large File Support"
 	bool "Large File Support"
 	default y
 	default y
 	help
 	help
-	  If you wish to build uClibc with support for accessing large files 
-	  (i.e. files greater then 2 GiB) then answer Y.  Do not enable this 
-	  if you are using an older Linux kernel (2.0.x) that lacks large file 
+	  If you wish to build uClibc with support for accessing large files
+	  (i.e. files greater then 2 GiB) then answer Y.  Do not enable this
+	  if you are using an older Linux kernel (2.0.x) that lacks large file
 	  support.  Enabling this option will increase the size of uClibc.
 	  support.  Enabling this option will increase the size of uClibc.
 
 
+config UCLIBC_STATIC_LDCONFIG
+	bool "Link ldconfig statically"
+	default y
+	help
+	  Enable this option to statically link the ldconfig binary.
+
+	  Making ldconfig static can be beneficial if you have a library
+	  problem and need to used ldconfig to recover.  Sometimes, it is
+	  preferable to instead keep the size of the system down, in which
+	  case you should disable this option.
+
 choice
 choice
 	prompt "Malloc Implementation"
 	prompt "Malloc Implementation"
 	default MALLOC if ! ARCH_HAS_MMU
 	default MALLOC if ! ARCH_HAS_MMU
@@ -378,7 +389,7 @@ config UCLIBC_DYNAMIC_ATEXIT
 	  global destructors are implemented via atexit(), and it is quite
 	  global destructors are implemented via atexit(), and it is quite
 	  possible to exceed the default number when this option is disabled.
 	  possible to exceed the default number when this option is disabled.
 	  Enabling this option adds a few bytes, and more significantly makes
 	  Enabling this option adds a few bytes, and more significantly makes
-	  atexit and on_exit depend on malloc, which can be bad when compiling 
+	  atexit and on_exit depend on malloc, which can be bad when compiling
 	  static executables.
 	  static executables.
 
 
 	  Unless you use uClibc with C++, you should probably answer N.
 	  Unless you use uClibc with C++, you should probably answer N.
@@ -388,7 +399,7 @@ config HAS_SHADOW
 	bool "Shadow Password Support"
 	bool "Shadow Password Support"
 	default y
 	default y
 	help
 	help
-	  Answer N if you do not need shadow password support.  
+	  Answer N if you do not need shadow password support.
 	  Most people will answer Y.
 	  Most people will answer Y.
 
 
 config UNIX98PTY_ONLY
 config UNIX98PTY_ONLY
@@ -396,7 +407,7 @@ config UNIX98PTY_ONLY
 	default y
 	default y
 	help
 	help
 	  If you want to support only Unix 98 PTYs enable this.  Some older
 	  If you want to support only Unix 98 PTYs enable this.  Some older
-	  applications may need this disabled.  For most current programs, 
+	  applications may need this disabled.  For most current programs,
 	  you can generally answer Y.
 	  you can generally answer Y.
 
 
 config ASSUME_DEVPTS
 config ASSUME_DEVPTS
@@ -404,7 +415,7 @@ config ASSUME_DEVPTS
 	default y
 	default y
 	help
 	help
 	  Enable this if /dev/pts is on a devpts or devfs filesystem.  Both
 	  Enable this if /dev/pts is on a devpts or devfs filesystem.  Both
-	  these filesystems automatically manage permissions on the /dev/pts 
+	  these filesystems automatically manage permissions on the /dev/pts
 	  devices.  You may need to mount your devpts or devfs filesystem on
 	  devices.  You may need to mount your devpts or devfs filesystem on
 	  /dev/pts for this to work.
 	  /dev/pts for this to work.
 
 
@@ -488,15 +499,15 @@ config UCLIBC_HAS_IPV6
 	help
 	help
 	  If you want to include support for the next version of the Internet
 	  If you want to include support for the next version of the Internet
 	  Protocol (IP version 6) then answer Y.
 	  Protocol (IP version 6) then answer Y.
-	  
+
 	  Most people should answer N.
 	  Most people should answer N.
 
 
 config UCLIBC_HAS_RPC
 config UCLIBC_HAS_RPC
 	bool "Remote Procedure Call (RPC) support"
 	bool "Remote Procedure Call (RPC) support"
 	default n
 	default n
 	help
 	help
-	  If you want to include RPC support, enable this.  RPC is rarely used 
-	  for anything except for the NFS filesystem.  Unless you plan to use NFS, 
+	  If you want to include RPC support, enable this.  RPC is rarely used
+	  for anything except for the NFS filesystem.  Unless you plan to use NFS,
 	  you can probably leave this set to N and save some space.  If you need
 	  you can probably leave this set to N and save some space.  If you need
 	  to use NFS then you should answer Y.
 	  to use NFS then you should answer Y.
 
 
@@ -506,7 +517,7 @@ config UCLIBC_HAS_FULL_RPC
 	default y if !HAVE_SHARED
 	default y if !HAVE_SHARED
 	help
 	help
 	  Normally we enable just enough RPC support for things like rshd and
 	  Normally we enable just enough RPC support for things like rshd and
-	  nfs mounts to work.  If you find you need the rest of the RPC stuff, 
+	  nfs mounts to work.  If you find you need the rest of the RPC stuff,
 	  then enable this option.  Most people can safely answer N.
 	  then enable this option.  Most people can safely answer N.
 
 
 endmenu
 endmenu
@@ -522,7 +533,7 @@ config UCLIBC_HAS_STRING_GENERIC_OPT
 	  In general, they are faster (but 3-5K larger) than the base
 	  In general, they are faster (but 3-5K larger) than the base
 	  uClibc string functions which are optimized solely for size.
 	  uClibc string functions which are optimized solely for size.
 
 
-	  Many people will answer Y.  
+	  Many people will answer Y.
 
 
 config UCLIBC_HAS_STRING_ARCH_OPT
 config UCLIBC_HAS_STRING_ARCH_OPT
 	bool "Use arch-specific string functions"
 	bool "Use arch-specific string functions"
@@ -541,7 +552,7 @@ config UCLIBC_HAS_CTYPE_TABLES
 	  Answer Y to use table versions of the 'ctype.h' functions.
 	  Answer Y to use table versions of the 'ctype.h' functions.
 	  While the non-table versions are often smaller when building
 	  While the non-table versions are often smaller when building
 	  staticly linked apps, they work only in stub locale mode.
 	  staticly linked apps, they work only in stub locale mode.
-	  
+
 	  Most people will answer Y.
 	  Most people will answer Y.
 
 
 config UCLIBC_HAS_CTYPE_SIGNED
 config UCLIBC_HAS_CTYPE_SIGNED
@@ -587,7 +598,7 @@ config UCLIBC_HAS_WCHAR
 	bool "Wide Character Support"
 	bool "Wide Character Support"
 	default n
 	default n
 	help
 	help
-	  Answer Y to enable wide character support.  This will make uClibc 
+	  Answer Y to enable wide character support.  This will make uClibc
 	  much larger.  It is also currently required for locale support.
 	  much larger.  It is also currently required for locale support.
 
 
 	  Most people will answer N.
 	  Most people will answer N.
@@ -600,8 +611,8 @@ config UCLIBC_HAS_LOCALE
 	help
 	help
 	  uClibc now has full ANSI/ISO C99 locale support (except for
 	  uClibc now has full ANSI/ISO C99 locale support (except for
 	  wcsftime() and collating items in regex).  Be aware that enabling
 	  wcsftime() and collating items in regex).  Be aware that enabling
-	  this option will make uClibc much larger.  
-	  
+	  this option will make uClibc much larger.
+
 	  Enabling UCLIBC_HAS_LOCALE with the default set of supported locales
 	  Enabling UCLIBC_HAS_LOCALE with the default set of supported locales
 	  (169 UTF-8 locales, and 144 locales for other codesets) will enlarge
 	  (169 UTF-8 locales, and 144 locales for other codesets) will enlarge
 	  uClibc by around 300k.  You can reduce this size by building your own
 	  uClibc by around 300k.  You can reduce this size by building your own
@@ -985,7 +996,7 @@ config UCLIBC_HAS_FTW
 	bool "Support the ftw() and nftw() interfaces"
 	bool "Support the ftw() and nftw() interfaces"
 	default n
 	default n
 	help
 	help
-	  The SuSv3 ftw() and nftw() interfaces are used to recursively descend 
+	  The SuSv3 ftw() and nftw() interfaces are used to recursively descend
 	  directory paths while repeatedly calling a function.
 	  directory paths while repeatedly calling a function.
 
 
 	  This interface is rarely used, and adds around 4.5k.  Unless you have
 	  This interface is rarely used, and adds around 4.5k.  Unless you have
@@ -998,7 +1009,7 @@ config UCLIBC_HAS_GLOB
 
 
 	  The glob interface is somewhat large (weighing in at about 4k).  It
 	  The glob interface is somewhat large (weighing in at about 4k).  It
 	  is used fairly often, but is an option since people wanting to go for
 	  is used fairly often, but is an option since people wanting to go for
-	  absolute minimum size may wish to omit it. 
+	  absolute minimum size may wish to omit it.
 
 
 	  Most people will answer Y.
 	  Most people will answer Y.
 
 
@@ -1023,7 +1034,7 @@ config SHARED_LIB_LOADER_PREFIX
 
 
 	  BIG FAT WARNING:
 	  BIG FAT WARNING:
 	  If you do not have a shared library loader with the correct name
 	  If you do not have a shared library loader with the correct name
-	  sitting in the directory this points to, your binaries will not 
+	  sitting in the directory this points to, your binaries will not
 	  run.
 	  run.
 
 
 config SYSTEM_LDSO
 config SYSTEM_LDSO
@@ -1037,7 +1048,7 @@ config SYSTEM_LDSO
 
 
 	  BIG FAT WARNING:
 	  BIG FAT WARNING:
 	  If you do not have a shared library loader with the correct name
 	  If you do not have a shared library loader with the correct name
-	  sitting in the directory this points to, your binaries will not 
+	  sitting in the directory this points to, your binaries will not
 	  run.
 	  run.
 
 
 config RUNTIME_PREFIX
 config RUNTIME_PREFIX
@@ -1268,7 +1279,7 @@ config UCLIBC_MALLOC_DEBUGGING
 		  2   -  output messages for malloc/free calls and OS allocation calls
 		  2   -  output messages for malloc/free calls and OS allocation calls
 		  4   -  output messages for the `MMB' layer
 		  4   -  output messages for the `MMB' layer
 		  8   -  output messages for internal malloc heap manipulation calls
 		  8   -  output messages for internal malloc heap manipulation calls
-	  
+
 	  Because this increases the size of malloc appreciably (due to strings
 	  Because this increases the size of malloc appreciably (due to strings
 	  etc), you should say N unless you need to debug a malloc problem.
 	  etc), you should say N unless you need to debug a malloc problem.
 
 

+ 1 - 1
utils/Makefile

@@ -45,7 +45,7 @@ readelf: readelf.c
 	$(STRIPTOOL) -x -R .note -R .comment $@
 	$(STRIPTOOL) -x -R .note -R .comment $@
 
 
 ldconfig:	ldconfig.c
 ldconfig:	ldconfig.c
-	$(CC) $(CFLAGS) -Wl,-s -static \
+	$(CC) $(CFLAGS) -Wl,-s $(if $(filter $(UCLIBC_STATIC_LDCONFIG),y),-static) \
 		-DUCLIBC_RUNTIME_PREFIX=\"$(RUNTIME_PREFIX)\" \
 		-DUCLIBC_RUNTIME_PREFIX=\"$(RUNTIME_PREFIX)\" \
 		-DUCLIBC_LDSO=$(UCLIBC_LDSO) -I. -I../ldso/include \
 		-DUCLIBC_LDSO=$(UCLIBC_LDSO) -I. -I../ldso/include \
 		$^ -o $@
 		$^ -o $@