[uClibc-cvs] CVS update of uClibc/utils (Makefile)

Joakim Tjernlund jocke at codepoet.org
Tue Aug 10 08:58:13 UTC 2004


    Date: Tuesday, August 10, 2004 @ 02:58:13
  Author: jocke
    Path: /var/cvs/uClibc/utils

Modified: Makefile (1.12 -> 1.13)

Mike Frysinger writes:
while playing around with Gentoo on uClibc, i hit some troubles with ldconfig

first, i found that it kept trying to read 'etc/ld.so.conf' ... it didnt want 
to read '/etc/ld.so.conf' ... looking at the source, the default conf file is 
defined as UCLIBC_RUNTIME_PREFIX "etc/ld.so.conf" ... all fine and dandy, but 
the utils/Makefile builds the .c files with this:
-DUCLIBC_RUNTIME_PREFIX=$(R_PREFIX)
i couldnt find where R_PREFIX was defined/used anywhere else, but i did find 
that every other time UCLIBC_RUNTIME_PREFIX was defined, it was set like:
-DUCLIBC_RUNTIME_PREFIX=\"$(RUNTIME_PREFIX)\"
changing the utils/Makefile to be like this fixed things for me

next up, i found that i wasnt getting an /etc/ld.so.cache file when i ran 
`ldconfig` ... looking at the code, USE_CACHE needs to be defined ... 
Rules.mak has a line that reads LIBRARY_CACHE:=#-DUSE_CACHE by default, but 
then LIBRARY_CACHE is never used anywhere :)
so the fix here is to add $(LIBRARY_CACHE) to the lines in utils/Makefile 
where the .c files are compiled

perhaps a suggestion then ?  in my mind it makes sense to utilize a cache file 
when running uclibc native but perhaps not while cross compiling ... so 
perhaps add LIBRARY_CACHE:=-DUSE_CACHE to the section in Rules.mak where LDSO 
is set to the uclibc linker (i.e. native) but set LIBRARY_CACHE:=#-DUSE_CACHE 
where LDSO is the $(SYSTEM_LDSO) (i.e. cross compiling)

Applied with minor fixes.


Index: uClibc/utils/Makefile
diff -u uClibc/utils/Makefile:1.12 uClibc/utils/Makefile:1.13
--- uClibc/utils/Makefile:1.12	Tue Jan 20 14:36:23 2004
+++ uClibc/utils/Makefile	Tue Aug 10 02:58:12 2004
@@ -29,11 +29,9 @@
 TARGET_ICONV =
 endif
 
-XXFLAGS=
+XXFLAGS=$(LIBRARY_CACHE)
 ifeq ($(strip $(LDSO_LDD_SUPPORT)),y)
-XXFLAGS= -D__LDSO_LDD_SUPPORT
-else
-XXFLAGS=
+XXFLAGS+= -D__LDSO_LDD_SUPPORT
 endif
 
 ifeq ($(strip $(HAVE_SHARED)),y)
@@ -51,14 +49,14 @@
 
 ldconfig:	ldconfig.c readsoname.c
 	$(CC) $(CFLAGS) $(XXFLAGS) -Wl,-s -static \
-		-DUCLIBC_RUNTIME_PREFIX=$(R_PREFIX) \
+		-DUCLIBC_RUNTIME_PREFIX=\"$(RUNTIME_PREFIX)\" \
 		-DUCLIBC_LDSO=$(UCLIBC_LDSO) -I. -I../ldso/include \
 		$^ -o $@ $(LDADD_LIBFLOAT) -L../lib
 	$(STRIPTOOL) -x -R .note -R .comment $@
 
 ldd:	ldd.c
 	$(CC) $(CFLAGS) $(XXFLAGS) -Wl,-s \
-		-DUCLIBC_RUNTIME_PREFIX=$(R_PREFIX) \
+		-DUCLIBC_RUNTIME_PREFIX=\"$(RUNTIME_PREFIX)\" \
 		-DUCLIBC_LDSO=$(UCLIBC_LDSO) \
 		$^ -o $@ $(LDADD_LIBFLOAT) -L../lib
 	$(STRIPTOOL) -x -R .note -R .comment $@
@@ -72,13 +70,13 @@
 
 ldd.host:	ldd.c
 	$(HOSTCC) $(HOSTCFLAGS) -Wl,-s \
-		-DUCLIBC_RUNTIME_PREFIX=$(R_PREFIX) \
+		-DUCLIBC_RUNTIME_PREFIX=\"$(RUNTIME_PREFIX)\" \
 		-DUCLIBC_LDSO=$(UCLIBC_LDSO) \
 		$^ -o $@
 
 ldconfig.host:	ldconfig.c readsoname.c
 	$(HOSTCC) $(HOSTCFLAGS) -Wl,-s \
-		-DUCLIBC_RUNTIME_PREFIX=$(R_PREFIX) \
+		-DUCLIBC_RUNTIME_PREFIX=\"$(RUNTIME_PREFIX)\" \
 		-DUCLIBC_LDSO=$(UCLIBC_LDSO) -I. -I../ldso/include \
 		$^ -o $@
 



More information about the uClibc-cvs mailing list