summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2019-11-06 03:45:27 (GMT)
committerWaldemar Brodkorb <wbx@openadk.org>2019-11-06 03:45:33 (GMT)
commit42e913726d359db0d293b903bb7857912b49c15f (patch)
treea154bedd72e3ff4dfafe4b62248def1cd09a0972
parent64e87769cef8a887a66edd80eafae9999a616b8a (diff)
riscv64: allow shared library support for uClibc-ng
-rw-r--r--target/riscv64/Makefile20
-rw-r--r--target/riscv64/uclibc-ng.config24
2 files changed, 41 insertions, 3 deletions
diff --git a/target/riscv64/Makefile b/target/riscv64/Makefile
index d79d68a..8f396c3 100644
--- a/target/riscv64/Makefile
+++ b/target/riscv64/Makefile
@@ -8,8 +8,25 @@ include $(ADK_TOPDIR)/mk/image.mk
KERNEL:=$(LINUX_DIR)/vmlinux
OSTRIP:=-R .reginfo -R .notes -R .note -R .comment -R .mdebug -R .note.gnu.build-id
QEMU_ARGS:=-M virt -nographic
+ifeq ($(ADK_TARGET_QEMU_WITH_VIRTIO),y)
+QEMU_ARGS+=-netdev user,id=eth0 -device virtio-net-device,netdev=eth0
+endif
+ifeq ($(ADK_TARGET_FS),archive)
+QEMU_ARGS+=-device virtio-blk-device,drive=vda -drive file=qemu-${ADK_TARGET_CPU_ARCH}.img,if=none,id=vda,format=raw
+endif
# target helper text
+ifeq ($(ADK_TARGET_FS),archive)
+targethelp:
+ @echo "The RootFS tarball is: $(FW_DIR)/$(ROOTFSTARBALL)"
+ifeq ($(ADK_TARGET_QEMU),y)
+ @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
+ @echo "Use following command to create a QEMU Image:"
+ @echo "./scripts/create.sh qemu-${ADK_TARGET_CPU_ARCH}.img $(FW_DIR)/$(ROOTFSTARBALL)"
+ @echo "Start qemu with following options:"
+ @echo 'qemu-system-${ADK_TARGET_CPU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL)'
+endif
+endif
ifeq ($(ADK_TARGET_FS),initramfs)
targethelp:
@echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}'
@@ -50,6 +67,9 @@ bbl:
cp $(BUILD_DIR)/bbl/bbl $(FW_DIR)/$(TARGET_KERNEL)
# filesystem specific targets
+ifeq ($(ADK_TARGET_FS),archive)
+imageinstall: kernel-install bbl $(FW_DIR)/$(ROOTFSTARBALL) targethelp
+endif
ifeq ($(ADK_TARGET_FS),initramfs)
imageinstall: kernel-install bbl $(FW_DIR)/$(INITRAMFS) targethelp
endif
diff --git a/target/riscv64/uclibc-ng.config b/target/riscv64/uclibc-ng.config
index 3f75446..1931eee 100644
--- a/target/riscv64/uclibc-ng.config
+++ b/target/riscv64/uclibc-ng.config
@@ -62,9 +62,22 @@ HAVE_DOT_CONFIG=y
# General Library Settings
#
DOPIC=y
-ARCH_HAS_NO_SHARED=y
-ARCH_HAS_NO_LDSO=y
-UCLIBC_CTOR_DTOR=y
+HAVE_SHARED=y
+# FORCE_SHAREABLE_TEXT_SEGMENTS is not set
+LDSO_LDD_SUPPORT=y
+LDSO_CACHE_SUPPORT=y
+LDSO_PRELOAD_ENV_SUPPORT=y
+# LDSO_PRELOAD_FILE_SUPPORT is not set
+LDSO_BASE_FILENAME="ld.so"
+# LDSO_STANDALONE_SUPPORT is not set
+# LDSO_PRELINK_SUPPORT is not set
+UCLIBC_STATIC_LDCONFIG=y
+LDSO_RUNPATH=y
+# LDSO_RUNPATH_OF_EXECUTABLE is not set
+LDSO_SAFE_RUNPATH=y
+LDSO_SEARCH_INTERP_PATH=y
+LDSO_LD_LIBRARY_PATH=y
+# LDSO_GNU_HASH_SUPPORT is not set
HAS_NO_THREADS=y
# UCLIBC_HAS_LINUXTHREADS is not set
# UCLIBC_HAS_THREADS_NATIVE is not set
@@ -202,6 +215,8 @@ HARDWIRED_ABSPATH=y
# Security options
#
# UCLIBC_HAS_SSP is not set
+UCLIBC_BUILD_RELRO=y
+# UCLIBC_BUILD_NOW is not set
UCLIBC_BUILD_NOEXECSTACK=y
#
@@ -212,6 +227,9 @@ UCLIBC_EXTRA_CFLAGS=""
# DODEBUG is not set
# DOSTRIP is not set
# DOASSERTS is not set
+# SUPPORT_LD_DEBUG is not set
+# SUPPORT_LD_DEBUG_EARLY is not set
# UCLIBC_MALLOC_DEBUGGING is not set
+# UCLIBC_HAS_BACKTRACE is not set
WARNINGS="-Wall"
# EXTRA_WARNINGS is not set