summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Thursfield <sam.thursfield@codethink.co.uk>2017-07-05 16:39:37 (GMT)
committerSam Thursfield <sam.thursfield@codethink.co.uk>2017-08-24 17:36:56 (GMT)
commit698e4aed71d282e20cf54086034acbbdb2ad61d5 (patch)
tree7cdb1aa082e6f44d8f446a8517b353a23e71851e
parentba104e63f8a1f13b952e28198fcf1e3169420f25 (diff)
downloaddefinitions-698e4aed71d282e20cf54086034acbbdb2ad61d5.tar.gz
gnu-toolchain: Add /lib64 -> /usr/lib64 symlink on 64-bit arches
This is required at least for armv8l64, otherwise the glibc.bst element installs a symlink in /usr/lib/ld-linux-aarch64.so.2 that points to a missing file (it expects /usr/lib64/ld-linux-aarch64.so.2 to exist, but if /lib64 is a directory rather than a symlink then that file ends up only in the /lib64/ directory). This also makes our filesystem hierarchy more consistent with other GNU/Linux operating systems.
-rw-r--r--elements/gnu-toolchain/fhs-dirs.bst19
-rw-r--r--elements/gnu-toolchain/stage2-fhs-dirs.bst19
-rw-r--r--elements/gnu-toolchain/stage2-glibc.bst15
3 files changed, 47 insertions, 6 deletions
diff --git a/elements/gnu-toolchain/fhs-dirs.bst b/elements/gnu-toolchain/fhs-dirs.bst
index 28a5a53..7359e58 100644
--- a/elements/gnu-toolchain/fhs-dirs.bst
+++ b/elements/gnu-toolchain/fhs-dirs.bst
@@ -24,3 +24,22 @@ config:
- install -m 644 services "%{install-root}/etc/services"
- install -m 644 protocols "%{install-root}/etc/protocols"
- echo baserock > "%{install-root}/etc/hostname"
+
+arches:
+ # Most 64 bit architectures need a /lib64 symlink as well as /lib.
+ # FIXME: the create-fhs-dirs script should probably handle this...
+ armv8b64:
+ config:
+ install-commands:
+ - mkdir -p "%{install-root}/usr/lib64"
+ - ln -s "./usr/lib64" "%{install-root}/lib64"
+ armv8l64:
+ config:
+ install-commands:
+ - mkdir -p "%{install-root}/usr/lib64"
+ - ln -s "./usr/lib64" "%{install-root}/lib64"
+ x86_64:
+ config:
+ install-commands:
+ - mkdir -p "%{install-root}/usr/lib64"
+ - ln -s "./usr/lib64" "%{install-root}/lib64"
diff --git a/elements/gnu-toolchain/stage2-fhs-dirs.bst b/elements/gnu-toolchain/stage2-fhs-dirs.bst
index f91f2f1..1528172 100644
--- a/elements/gnu-toolchain/stage2-fhs-dirs.bst
+++ b/elements/gnu-toolchain/stage2-fhs-dirs.bst
@@ -29,3 +29,22 @@ config:
- install -m 644 services "%{install-root}/etc/services"
- install -m 644 protocols "%{install-root}/etc/protocols"
- echo baserock > "%{install-root}/etc/hostname"
+
+arches:
+ # Most 64 bit architectures need a /lib64 symlink as well as /lib.
+ # FIXME: the create-fhs-dirs script should probably handle this...
+ armv8b64:
+ config:
+ install-commands:
+ - mkdir -p "%{install-root}/usr/lib64"
+ - ln -s "./usr/lib64" "%{install-root}/lib64"
+ armv8l64:
+ config:
+ install-commands:
+ - mkdir -p "%{install-root}/usr/lib64"
+ - ln -s "./usr/lib64" "%{install-root}/lib64"
+ x86_64:
+ config:
+ install-commands:
+ - mkdir -p "%{install-root}/usr/lib64"
+ - ln -s "./usr/lib64" "%{install-root}/lib64"
diff --git a/elements/gnu-toolchain/stage2-glibc.bst b/elements/gnu-toolchain/stage2-glibc.bst
index 809803f..8c75e78 100644
--- a/elements/gnu-toolchain/stage2-glibc.bst
+++ b/elements/gnu-toolchain/stage2-glibc.bst
@@ -109,17 +109,20 @@ config:
- |
case "%{bst-target-arch}" in
x86_64)
- install -d "%{install-root}/lib64"
+ install -d "%{install-root}/usr/lib64"
+ ln -s "/usr/lib64" "%{install-root}/lib64"
ln -s "%{prefix}/lib/ld-linux-x86-64.so.2" \
- "%{install-root}/lib64/ld-linux-x86-64.so.2" ;;
+ "%{install-root}/usr/lib64/ld-linux-x86-64.so.2" ;;
ppc64l)
- install -d "%{install-root}/lib64"
+ install -d "%{install-root}/usr/lib64"
+ ln -s "/usr/lib64" "%{install-root}/lib64"
ln -s "%{prefix}/lib/ld64.so.2" \
- "%{install-root}/lib64/ld64.so.2" ;;
+ "%{install-root}/usr/lib64/ld64.so.2" ;;
ppc64b)
- install -d "%{install-root}/lib64"
+ install -d "%{install-root}/usr/lib64"
+ ln -s "/usr/lib64" "%{install-root}/lib64"
ln -s "%{prefix}/lib/ld64.so.1" \
- "%{install-root}/lib64/ld64.so.1" ;;
+ "%{install-root}/usr/lib64/ld64.so.1" ;;
*)
loader=$(basename $(ls "%{install-root}%{prefix}"/lib/ld-linux*))
[ -z $loader ] && loader=$(basename $(ls "%{install-root}%{prefix}"/lib/ld.so*))