diff options
author | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2017-10-27 13:49:38 +0000 |
---|---|---|
committer | Javier Jardón <jjardon@gnome.org> | 2017-11-05 12:14:48 +0000 |
commit | 4203865325c33d752f814850f43d2ecb16c8fa16 (patch) | |
tree | 8bf81042a356db74fad2905b46ea369a316e4309 /elements/gnu-toolchain/stage2-glibc.bst | |
parent | b917c363cc13b13ed553051844095469e1d6fc82 (diff) | |
download | definitions-4203865325c33d752f814850f43d2ecb16c8fa16.tar.gz |
Replace use of architecture conditionals with generic project conditions
The initial implementation of architecture conditionals has been
removed, as the same behaviours can be implemented using the more
generic mechanism for conditionals that is being introduced for
BuildStream 1.0.
We now have two architecture options: build_arch and arch. They are
documented in project.conf. The first one controls the build sandbox
while the second controls the host and target of the binaries we
produce.
Diffstat (limited to 'elements/gnu-toolchain/stage2-glibc.bst')
-rw-r--r-- | elements/gnu-toolchain/stage2-glibc.bst | 78 |
1 files changed, 39 insertions, 39 deletions
diff --git a/elements/gnu-toolchain/stage2-glibc.bst b/elements/gnu-toolchain/stage2-glibc.bst index e3f13c35..296fdcf6 100644 --- a/elements/gnu-toolchain/stage2-glibc.bst +++ b/elements/gnu-toolchain/stage2-glibc.bst @@ -16,6 +16,29 @@ depends: variables: prefix: /tools + glibc-arch-flags: '' + glibc-ld-so-name: 'autodetect' + glibc-ld-so-libdir: 'lib' + + (?): + - arch.startswith("armv7"): + glibc-arch-flags: --without-fp + + - arch in ["armv8b64", "armv8l64"]: + glibc-ld-so-name: ld-linux-aarch64.so.1 + + - arch == "ppc64b": + glibc-ld-so-name: ld64.so.1 + glibc-ld-so-libdir: lib64 + + - arch == "ppc64l": + glibc-ld-so-name: ld64.so.2 + glibc-ld-so-libdir: lib64 + + - arch == "x86_64": + glibc-ld-so-name: ld-linux-x86-64.so.2 + glibc-ld-so-libdir: lib64 + environment: PATH: /tools/bin:/usr/bin:/bin:/usr/sbin:/sbin @@ -33,14 +56,8 @@ config: # 5. Force configuration values of certain things that can't be detected # in a cross-compile. - | - case "%{bst-target-arch}" in - armv7*) - ARCH_FLAGS="--without-fp" ;; - esac - export CFLAGS="-O2 $CFLAGS"; export CXX=false; \ - cd o && ../configure \ - $ARCH_FLAGS \ + cd o && ../configure %{glibc-arch-flags} \ --build=$(../scripts/config.guess) --host=%{target-stage1} \ --prefix="%{prefix}" \ `# [1]` --libdir="%{prefix}/lib" \ @@ -104,42 +121,25 @@ config: # like all other bootstrap only components. ln -s specs-for-sysroot "$target_specs_dir/specs" - # Install a symlink for the program interpreter (ld.so) so that binaries - # built in stage 3 before the stage 3 glibc is built can use it. - # - # The name of the dynamic loader is hardcoded in GCC during its 'configure' - # stage, but the file is actually provided by the libc (usually GLIBC). It - # would be better if we could ask GCC or GLIBC what the expected name of the - # ld.so is for the given platform rather than figuring it out - - install -d %{install-root}/lib - | - case "%{bst-target-arch}" in - x86_64) - 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}/usr/lib64/ld-linux-x86-64.so.2" ;; - armv8*64) - install -d "%{install-root}/usr/lib" - ln -s "/usr/lib64" "%{install-root}/lib64" - ln -s "%{prefix}/lib/ld-linux-aarch64.so.1" \ - "%{install-root}/usr/lib/ld-linux-aarch64.so.1" ;; - ppc64l) - install -d "%{install-root}/usr/lib64" - ln -s "/usr/lib64" "%{install-root}/lib64" - ln -s "%{prefix}/lib/ld64.so.2" \ - "%{install-root}/usr/lib64/ld64.so.2" ;; - ppc64b) - install -d "%{install-root}/usr/lib64" - ln -s "/usr/lib64" "%{install-root}/lib64" - ln -s "%{prefix}/lib/ld64.so.1" \ - "%{install-root}/usr/lib64/ld64.so.1" ;; - *) + # Install a symlink for the program interpreter (ld.so) so that binaries + # built in stage 3 before the stage 3 glibc is built can use it. + # + # The name of the dynamic loader is hardcoded in GCC during its 'configure' + # stage, but the file is actually provided by the libc (usually GLIBC). It + # would be better if we could ask GCC or GLIBC what the expected name of the + # ld.so is for the given platform rather than hardcoding it again here. + loader="%{glibc-ld-so-name}" + + if [ "$loader" == "autodetect" ]; then loader=$(basename $(ls "%{install-root}%{prefix}"/lib/ld-linux*)) [ -z $loader ] && loader=$(basename $(ls "%{install-root}%{prefix}"/lib/ld.so*)) [ -z $loader ] && ( echo "Bug in stage2-glibc ld.so symlinks" ; exit 1 ) - ln -s "%{prefix}/lib/$loader" "%{install-root}/lib/$loader" - esac + fi + + install -d "%{install-root}/usr/%{glibc-ld-so-libdir}" + ln -s "/usr/%{glibc-ld-so-libdir}" "%{install-root}/%{glibc-ld-so-libdir}" + ln -s "%{prefix}/lib/$loader" "%{install-root}/usr/%{glibc-ld-so-libdir}/$loader" strip-commands: - | |