[OE-core] [PATCH 04/25] gcc-4.9: redefine default library install directory

Kai Kang kai.kang at windriver.com
Thu Nov 6 15:34:07 UTC 2014


Packages use 'aarch64-poky-linux-gcc -print-multi-os-directory' to get
the value of install directory. The value is set by MULTILIB_OSDIRNAMES
and default is '/lib64'. And the dynamic linker ld-linux-aarch64.so.1
from package eglibc is installed to /lib64.

But the default dynamic linker defined in gcc/config/aarch64/aarch64-linux.h
is:

MULTILIB_OSDIRNAMES = .=../lib64$(call if_multiarch,:aarch64$(AARCH_BE)-linux-gnu)

Then cause all the ELF files fail to launch because fail to find the
linker and libraries.

Redefine default library install directory to /lib to fix this issue.

Signed-off-by: Kai Kang <kai.kang at windriver.com>
---
 meta/recipes-devtools/gcc/gcc-4.9.inc              |  1 +
 ...0099-gcc-redefine-library-dir-for-aarch64.patch | 29 ++++++++++++++++++++++
 2 files changed, 30 insertions(+)
 create mode 100644 meta/recipes-devtools/gcc/gcc-4.9/0099-gcc-redefine-library-dir-for-aarch64.patch

diff --git a/meta/recipes-devtools/gcc/gcc-4.9.inc b/meta/recipes-devtools/gcc/gcc-4.9.inc
index 9a66cd2..8ed2e8a 100644
--- a/meta/recipes-devtools/gcc/gcc-4.9.inc
+++ b/meta/recipes-devtools/gcc/gcc-4.9.inc
@@ -71,6 +71,7 @@ SRC_URI = "\
     file://0054-gcc-Makefile.in-fix-parallel-building-failure.patch \
     file://0055-PR-rtl-optimization-61801.patch \
     file://0056-top-level-reorder_gcc-bug-61144.patch \
+    file://0099-gcc-redefine-library-dir-for-aarch64.patch \
 "
 SRC_URI[md5sum] = "fddf71348546af523353bd43d34919c1"
 SRC_URI[sha256sum] = "d334781a124ada6f38e63b545e2a3b8c2183049515a1abab6d513f109f1d717e"
diff --git a/meta/recipes-devtools/gcc/gcc-4.9/0099-gcc-redefine-library-dir-for-aarch64.patch b/meta/recipes-devtools/gcc/gcc-4.9/0099-gcc-redefine-library-dir-for-aarch64.patch
new file mode 100644
index 0000000..23cdb95
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.9/0099-gcc-redefine-library-dir-for-aarch64.patch
@@ -0,0 +1,29 @@
+Redefine default library directory for aarch64.
+
+Packages use 'aarch64-poky-linux-gcc -print-multi-os-directory' to get the
+value of install directory. The value is set by MULTILIB_OSDIRNAMES and default
+is '/lib64'. Add the dynamic linker ld-linux-aarch64.so.1 from package eglibc
+is installed to /lib64.
+
+But the default dynamic linker defined in gcc/config/aarch64/aarch64-linux.h
+is:
+
+#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux-aarch64%{mbig-endian:_be}.so.1"
+
+Then cause all the ELF files fail to launch because fail to find the linker.
+
+Upstream-Status: Pending
+
+Signed-off-by: Kai Kang <kai.kang at windriver.com>
+---
+--- gcc-4.9.1/gcc/config/aarch64/t-aarch64-linux.orig	2014-09-19 14:38:47.550669143 +0800
++++ gcc-4.9.1/gcc/config/aarch64/t-aarch64-linux	2014-09-19 14:39:01.234669516 +0800
+@@ -22,7 +22,7 @@
+ LIB1ASMFUNCS = _aarch64_sync_cache_range
+ 
+ AARCH_BE = $(if $(findstring TARGET_BIG_ENDIAN_DEFAULT=1, $(tm_defines)),_be)
+-MULTILIB_OSDIRNAMES = .=../lib64$(call if_multiarch,:aarch64$(AARCH_BE)-linux-gnu)
++MULTILIB_OSDIRNAMES = .=../lib$(call if_multiarch,:aarch64$(AARCH_BE)-linux-gnu)
+ MULTIARCH_DIRNAME = $(call if_multiarch,aarch64$(AARCH_BE)-linux-gnu)
+ 
+ # Disable the multilib for linux-gnu targets for the time being; focus
-- 
1.9.1




More information about the Openembedded-core mailing list