summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2022-02-08 08:58:44 +0100
committerWaldemar Brodkorb <wbx@openadk.org>2022-02-08 08:59:27 +0100
commit779e4681ef960f220bb54ad87bb3fc44a60af0e8 (patch)
tree2635fceb53780d500f32963ef9dd7bc5ae9e932a
parent6122629eeb3393ce87fbe10a70f43ae952a97ae4 (diff)
riscv: fix glibc bootup
-rw-r--r--package/glibc/Makefile12
-rw-r--r--target/config/Config.in.abi13
-rw-r--r--toolchain/glibc/Makefile7
3 files changed, 12 insertions, 20 deletions
diff --git a/package/glibc/Makefile b/package/glibc/Makefile
index eb0c64a3a..81331baa8 100644
--- a/package/glibc/Makefile
+++ b/package/glibc/Makefile
@@ -47,14 +47,12 @@ ifneq ($(ADK_TARGET_USE_STATIC_LIBS_ONLY),y)
${INSTALL_DIR} ${IDIR_GLIBC}/$(ADK_TARGET_LIBC_PATH)
$(CP) $(STAGING_TARGET_DIR)/lib/ld*.so* $(IDIR_GLIBC)/$(ADK_TARGET_LIBC_PATH)
for file in libc libpthread librt libcrypt libdl libm libanl libnsl libresolv libutil libnss_dns libnss_files; do \
- $(CP) $(STAGING_TARGET_DIR)/$(ADK_TARGET_LIBC_ABI_PATH)/$$file.so* $(IDIR_GLIBC)/$(ADK_TARGET_LIBC_PATH); \
- #$(CP) $(STAGING_TARGET_DIR)/$(ADK_TARGET_LIBC_ABI_PATH)/$$file-$(PKG_GLIBCVER).so $(IDIR_GLIBC)/$(ADK_TARGET_LIBC_PATH); \
+ $(CP) $(STAGING_TARGET_DIR)/lib/$$file.so* $(IDIR_GLIBC)/$(ADK_TARGET_LIBC_PATH); \
done
else
${INSTALL_DIR} ${IDIR_GLIBC}/$(ADK_TARGET_LIBC_PATH)
-for file in libnss_dns libnss_files; do \
- $(CP) $(STAGING_TARGET_DIR)/$(ADK_TARGET_LIBC_ABI_PATH)/$$file.so* $(IDIR_GLIBC)/$(ADK_TARGET_LIBC_PATH); \
- $(CP) $(STAGING_TARGET_DIR)/$(ADK_TARGET_LIBC_ABI_PATH)/$$file-$(PKG_GLIBCVER).so $(IDIR_GLIBC)/$(ADK_TARGET_LIBC_PATH); \
+ $(CP) $(STAGING_TARGET_DIR)/lib/$$file.so* $(IDIR_GLIBC)/$(ADK_TARGET_LIBC_PATH); \
done
endif
${INSTALL_DIR} $(IDIR_GLIBC)/usr/bin
@@ -72,11 +70,7 @@ glibc-gconv-install:
glibc-dev-install:
${INSTALL_DIR} $(IDIR_GLIBC_DEV)/$(ADK_TARGET_LIBC_PATH) $(IDIR_GLIBC_DEV)/usr/lib
-ifeq ($(ADK_TARGET_ARCH_RISCV64),y)
- ${CP} ${STAGING_TARGET_DIR}/usr/lib/*/libc.so ${IDIR_GLIBC_DEV}/usr/lib
-else
- ${CP} ${STAGING_TARGET_DIR}/usr/lib/*/libc.so ${IDIR_GLIBC_DEV}/usr/lib
-endif
+ ${CP} ${STAGING_TARGET_DIR}/usr/lib/libc.so ${IDIR_GLIBC_DEV}/usr/lib
ifeq ($(ADK_TARGET_ABI_O32),y)
ifeq ($(ADK_TARGET_BIG_ENDIAN),y)
$(SED) "s#@@ELFTARGET@@#elf32-tradbigmips#" $(IDIR_GLIBC_DEV)/usr/lib/libc.so
diff --git a/target/config/Config.in.abi b/target/config/Config.in.abi
index 14a2dcc63..9995ba51d 100644
--- a/target/config/Config.in.abi
+++ b/target/config/Config.in.abi
@@ -82,25 +82,16 @@ config ADK_TARGET_ABI_MIPS64
config ADK_TARGET_LIBC_PATH
string
- default "lib32" if ADK_TARGET_ABI_N32
+ default "lib32" if ADK_TARGET_ABI_N32 || ADK_TARGET_ARCH_RISC32
default "libx32" if ADK_TARGET_ABI_X32
default "lib64" if ADK_TARGET_ABI_64 || ADK_TARGET_ABI_N64 \
|| ADK_TARGET_ARCH_AARCH64 \
|| ADK_TARGET_ARCH_SPARC64 \
|| ADK_TARGET_ARCH_PPC64 \
+ || ADK_TARGET_ARCH_RISC64 \
|| ADK_TARGET_ARCH_X86_64
default "lib"
-config ADK_TARGET_LIBC_ABI_PATH
- string
- default "lib/lp64" if ADK_TARGET_ABI_LP64
- default "lib/lp64f" if ADK_TARGET_ABI_LP64F
- default "lib/lp64d" if ADK_TARGET_ABI_LP64D
- default "lib/ilp32" if ADK_TARGET_ABI_ILP32
- default "lib/ilp32f" if ADK_TARGET_ABI_ILP32F
- default "lib/ilp32d" if ADK_TARGET_ABI_ILP32D
- default "lib"
-
config ADK_TARGET_ABI_CFLAGS
string
default "-mabi=32" if ADK_TARGET_ABI_O32
diff --git a/toolchain/glibc/Makefile b/toolchain/glibc/Makefile
index 7ed06ddfb..ddc9d9f0a 100644
--- a/toolchain/glibc/Makefile
+++ b/toolchain/glibc/Makefile
@@ -40,6 +40,13 @@ GLIBC_ENV:= PATH='${HOST_PATH}:${TARGET_PATH}' \
libc_cv_gnu99_inline=yes \
libc_cv_initfini_array=yes
+ifeq ($(ADK_TARGET_ARCH_RISCV64),y)
+GLIBC_ENV+= libc_cv_slibdir=/lib libc_cv_rtlddir=/lib
+endif
+ifeq ($(ADK_TARGET_ARCH_RISCV32),y)
+GLIBC_ENV+= libc_cv_slibdir=/lib libc_cv_rtlddir=/lib
+endif
+
GLIBC_MAKEOPTS+= cross-compiling=yes
ifeq (${ADK_MAKE_PARALLEL},y)
GLIBC_MAKEOPTS+= PARALLELMFLAGS="-j$(ADK_MAKE_JOBS)"