summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile18
-rw-r--r--extra/gcc-uClibc/gcc-uClibc.c4
-rw-r--r--ldso/Rules.mak1
-rw-r--r--ldso/config.h10
-rw-r--r--ldso/ldso/dl-elf.c42
-rw-r--r--ldso/ldso/readelflib1.c42
-rw-r--r--ldso/util/ldconfig.c5
7 files changed, 63 insertions, 59 deletions
diff --git a/Makefile b/Makefile
index d04e6572a..7894ca733 100644
--- a/Makefile
+++ b/Makefile
@@ -154,17 +154,17 @@ install_runtime:
# in $(INSTALL_DIR)/include. Probably true only if you're using
# a packaging system.
install_dev:
- install -d $(INSTALL_DIR)/include
- install -d $(INSTALL_DIR)/include/bits
- rm -f $(INSTALL_DIR)/include/asm
- rm -f $(INSTALL_DIR)/include/linux
- ln -s $(KERNEL_SOURCE)/include/asm $(INSTALL_DIR)/include/asm
- ln -s $(KERNEL_SOURCE)/include/linux $(INSTALL_DIR)/include/linux
+ install -d $(INSTALL_DIR)/usr/include
+ install -d $(INSTALL_DIR)/usr/include/bits
+ rm -f $(INSTALL_DIR)/usr/include/asm
+ rm -f $(INSTALL_DIR)/usr/include/linux
+ ln -s $(KERNEL_SOURCE)/include/asm $(INSTALL_DIR)/usr/include/asm
+ ln -s $(KERNEL_SOURCE)/include/linux $(INSTALL_DIR)/usr/include/linux
find include/ -type f -depth -not -path "*CVS*" -exec install \
- -D -m 644 {} $(INSTALL_DIR)/'{}' ';'
+ -D -m 644 {} $(INSTALL_DIR)/usr/'{}' ';'
find include/bits/ -type f -depth -not -path "*CVS*" -exec install \
- -D -m 644 {} $(INSTALL_DIR)/'{}' ';'
- install -m 644 include/bits/uClibc_config.h $(INSTALL_DIR)/include/bits/
+ -D -m 644 {} $(INSTALL_DIR)/usr/'{}' ';'
+ install -m 644 include/bits/uClibc_config.h $(INSTALL_DIR)/usr/include/bits/
$(MAKE) -C extra/gcc-uClibc install
clean:
diff --git a/extra/gcc-uClibc/gcc-uClibc.c b/extra/gcc-uClibc/gcc-uClibc.c
index f0c5fae1c..aa50f5dc8 100644
--- a/extra/gcc-uClibc/gcc-uClibc.c
+++ b/extra/gcc-uClibc/gcc-uClibc.c
@@ -63,7 +63,7 @@ static char *rpath[] = {
};
static char *uClibc_inc[] = {
- "-I"UCLIBC_INSTALL_DIR"include/",
+ "-I"UCLIBC_INSTALL_DIR"usr/include/",
"-I"UCLIBC_BUILD_DIR"include/"
};
@@ -74,7 +74,9 @@ static char *crt0_path[] = {
static char *lib_path[] = {
"-L"UCLIBC_INSTALL_DIR"lib",
+ "-L"UCLIBC_INSTALL_DIR"usr/lib",
"-L"UCLIBC_BUILD_DIR"lib"
+ "-L"UCLIBC_BUILD_DIR"usr/lib"
};
static char static_linking[] = "-static";
diff --git a/ldso/Rules.mak b/ldso/Rules.mak
index b853c1426..c0bd561bb 100644
--- a/ldso/Rules.mak
+++ b/ldso/Rules.mak
@@ -10,5 +10,4 @@ CFLAGS += -DVERSION=\"$(LDSO_VERSION)\"
CC = $(TOPDIR)extra/gcc-uClibc/$(NATIVE_ARCH)-uclibc-gcc
ifeq ($(DEVEL),true)
CFLAGS += -DUCLIBC_INSTALL_DIR=\"$(INSTALL_DIR)\"
- CFLAGS += -DUCLIBC_DEVEL
endif
diff --git a/ldso/config.h b/ldso/config.h
index 1d1429dc1..26171138d 100644
--- a/ldso/config.h
+++ b/ldso/config.h
@@ -4,18 +4,12 @@
# define LDSO_CACHE "../util/ld.so.cache"
# define LDSO_PRELOAD "../util/ld.so.preload"
# define LDDSTUB "../util/lddstub"
-#elif UCLIBC_DEVEL
+#else
# define LDSO_IMAGE UCLIBC_INSTALL_DIR"/lib/ld.so"
# define LDSO_CONF UCLIBC_INSTALL_DIR"/etc/ld.so.conf"
# define LDSO_CACHE UCLIBC_INSTALL_DIR"/etc/ld.so.cache"
# define LDSO_PRELOAD UCLIBC_INSTALL_DIR"/etc/ld.so.preload"
-# define LDDSTUB UCLIBC_INSTALL_DIR"/lib/lddstub"
-#else
-# define LDSO_IMAGE "/lib/ld.so"
-# define LDSO_CONF "/etc/ld.so.conf"
-# define LDSO_CACHE "/etc/ld.so.cache"
-# define LDSO_PRELOAD "/etc/ld.so.preload"
-# define LDDSTUB "/usr/lib/lddstub"
+# define LDDSTUB UCLIBC_INSTALL_DIR"/usr/lib/lddstub"
#endif
#define LDD_ARGV0 "__LDD_ARGV0"
diff --git a/ldso/ldso/dl-elf.c b/ldso/ldso/dl-elf.c
index 4689e51f2..78ba9d0d2 100644
--- a/ldso/ldso/dl-elf.c
+++ b/ldso/ldso/dl-elf.c
@@ -227,7 +227,7 @@ struct elf_resolve *_dl_load_shared_library(int secure,
/*
* Where should the cache be searched? There is no such concept in the
* ABI, so we have some flexibility here. For now, search it before
- * the default path of /usr/lib.
+ * the hard coded paths that follow (i.e before /lib and /usr/lib).
*/
#ifdef USE_CACHE
if (_dl_cache_addr != NULL && _dl_cache_addr != (caddr_t) - 1) {
@@ -247,51 +247,57 @@ struct elf_resolve *_dl_load_shared_library(int secure,
}
#endif
-
-#ifdef UCLIBC_DEVEL
-
- /* Check in /usr/<arch>-linux-uclibc/lib */
- pnt1 = UCLIBC_INSTALL_DIR "/lib";
+ /* Check in <install-dir>/usr/lib */
+ pnt1 = UCLIBC_INSTALL_DIR "/usr/lib/";
pnt = mylibname;
while (*pnt1)
- *pnt++ = *pnt1++;
+ *pnt++ = *pnt1++;
pnt1 = libname;
while (*pnt1)
- *pnt++ = *pnt1++;
+ *pnt++ = *pnt1++;
*pnt++ = 0;
tpnt1 = _dl_load_elf_shared_library(secure, mylibname, 0);
if (tpnt1)
- return tpnt1;
+ return tpnt1;
-#else /* UCLIBC_DEVEL */
+ /* Check in <install-dir>/lib */
+ pnt1 = UCLIBC_INSTALL_DIR "/lib/";
+ pnt = mylibname;
+ while (*pnt1)
+ *pnt++ = *pnt1++;
+ pnt1 = libname;
+ while (*pnt1)
+ *pnt++ = *pnt1++;
+ *pnt++ = 0;
+ tpnt1 = _dl_load_elf_shared_library(secure, mylibname, 0);
+ if (tpnt1)
+ return tpnt1;
/* Check in /usr/lib */
pnt1 = "/usr/lib/";
pnt = mylibname;
while (*pnt1)
- *pnt++ = *pnt1++;
+ *pnt++ = *pnt1++;
pnt1 = libname;
while (*pnt1)
- *pnt++ = *pnt1++;
+ *pnt++ = *pnt1++;
*pnt++ = 0;
tpnt1 = _dl_load_elf_shared_library(secure, mylibname, 0);
if (tpnt1)
- return tpnt1;
+ return tpnt1;
/* Check in /lib */
- /* try "/lib/". */
pnt1 = "/lib/";
pnt = mylibname;
while (*pnt1)
- *pnt++ = *pnt1++;
+ *pnt++ = *pnt1++;
pnt1 = libname;
while (*pnt1)
- *pnt++ = *pnt1++;
+ *pnt++ = *pnt1++;
*pnt++ = 0;
tpnt1 = _dl_load_elf_shared_library(secure, mylibname, 0);
if (tpnt1)
- return tpnt1;
-#endif /* UCLIBC_DEVEL */
+ return tpnt1;
goof:
/* Well, we shot our wad on that one. All we can do now is punt */
diff --git a/ldso/ldso/readelflib1.c b/ldso/ldso/readelflib1.c
index 4689e51f2..78ba9d0d2 100644
--- a/ldso/ldso/readelflib1.c
+++ b/ldso/ldso/readelflib1.c
@@ -227,7 +227,7 @@ struct elf_resolve *_dl_load_shared_library(int secure,
/*
* Where should the cache be searched? There is no such concept in the
* ABI, so we have some flexibility here. For now, search it before
- * the default path of /usr/lib.
+ * the hard coded paths that follow (i.e before /lib and /usr/lib).
*/
#ifdef USE_CACHE
if (_dl_cache_addr != NULL && _dl_cache_addr != (caddr_t) - 1) {
@@ -247,51 +247,57 @@ struct elf_resolve *_dl_load_shared_library(int secure,
}
#endif
-
-#ifdef UCLIBC_DEVEL
-
- /* Check in /usr/<arch>-linux-uclibc/lib */
- pnt1 = UCLIBC_INSTALL_DIR "/lib";
+ /* Check in <install-dir>/usr/lib */
+ pnt1 = UCLIBC_INSTALL_DIR "/usr/lib/";
pnt = mylibname;
while (*pnt1)
- *pnt++ = *pnt1++;
+ *pnt++ = *pnt1++;
pnt1 = libname;
while (*pnt1)
- *pnt++ = *pnt1++;
+ *pnt++ = *pnt1++;
*pnt++ = 0;
tpnt1 = _dl_load_elf_shared_library(secure, mylibname, 0);
if (tpnt1)
- return tpnt1;
+ return tpnt1;
-#else /* UCLIBC_DEVEL */
+ /* Check in <install-dir>/lib */
+ pnt1 = UCLIBC_INSTALL_DIR "/lib/";
+ pnt = mylibname;
+ while (*pnt1)
+ *pnt++ = *pnt1++;
+ pnt1 = libname;
+ while (*pnt1)
+ *pnt++ = *pnt1++;
+ *pnt++ = 0;
+ tpnt1 = _dl_load_elf_shared_library(secure, mylibname, 0);
+ if (tpnt1)
+ return tpnt1;
/* Check in /usr/lib */
pnt1 = "/usr/lib/";
pnt = mylibname;
while (*pnt1)
- *pnt++ = *pnt1++;
+ *pnt++ = *pnt1++;
pnt1 = libname;
while (*pnt1)
- *pnt++ = *pnt1++;
+ *pnt++ = *pnt1++;
*pnt++ = 0;
tpnt1 = _dl_load_elf_shared_library(secure, mylibname, 0);
if (tpnt1)
- return tpnt1;
+ return tpnt1;
/* Check in /lib */
- /* try "/lib/". */
pnt1 = "/lib/";
pnt = mylibname;
while (*pnt1)
- *pnt++ = *pnt1++;
+ *pnt++ = *pnt1++;
pnt1 = libname;
while (*pnt1)
- *pnt++ = *pnt1++;
+ *pnt++ = *pnt1++;
*pnt++ = 0;
tpnt1 = _dl_load_elf_shared_library(secure, mylibname, 0);
if (tpnt1)
- return tpnt1;
-#endif /* UCLIBC_DEVEL */
+ return tpnt1;
goof:
/* Well, we shot our wad on that one. All we can do now is punt */
diff --git a/ldso/util/ldconfig.c b/ldso/util/ldconfig.c
index b7f976890..5c041f8b8 100644
--- a/ldso/util/ldconfig.c
+++ b/ldso/util/ldconfig.c
@@ -684,13 +684,10 @@ int main(int argc, char **argv)
free(extpath);
}
-#ifdef UCLIBC_DEVEL
+ scan_dir(UCLIBC_INSTALL_DIR"/usr/lib");
scan_dir(UCLIBC_INSTALL_DIR"/lib");
-#else
- /* everybody needs these, don't they? */
scan_dir("/usr/lib");
scan_dir("/lib");
-#endif
}
if (!nocache)