From e15291333b18017e62a22127aa4195d1b7af5522 Mon Sep 17 00:00:00 2001 From: Martin Haase Date: Mon, 1 Mar 2021 20:30:29 +0100 Subject: [PATCH 01/26] prototype: aarch64 sandbox (configurable sandbox+toolchain) --- recipes/devel/git.yaml | 10 +++++++--- recipes/devel/host-compat-toolchain.yaml | 2 +- recipes/devel/sandbox-toolchain.yaml | 4 ++-- recipes/devel/sandbox.yaml | 6 ++++-- recipes/libs/expat.yaml | 1 + recipes/libs/libcap.yaml | 3 ++- tests/cross-platform/recipes/cmake/greeter.yaml | 6 ++++++ 7 files changed, 23 insertions(+), 9 deletions(-) diff --git a/recipes/devel/git.yaml b/recipes/devel/git.yaml index 18219490..22bac512 100644 --- a/recipes/devel/git.yaml +++ b/recipes/devel/git.yaml @@ -21,18 +21,22 @@ checkoutSCM: digestSHA1: "851537fc03f5a99419ef20e9b836de965c7928bd" extract: False -buildTools: [target-toolchain, curl] -buildVars: [PKG_VERSION, AUTOCONF_HOST, - CPPFLAGS, CFLAGS, LDFLAGS] +buildTools: [target-toolchain, host-toolchain] +buildVars: [PKG_VERSION, AUTOCONF_HOST, AUTOCONF_BUILD, + CC, CPPFLAGS, CFLAGS, LDFLAGS] buildScript: | export CFLAGS="-I${BOB_DEP_PATHS[libs::zlib-dev]}/usr/include -I${BOB_DEP_PATHS[libs::openssl-dev]}/usr/include" export LDFLAGS="-L${BOB_DEP_PATHS[libs::zlib-dev]}/usr/lib -L${BOB_DEP_PATHS[libs::openssl-dev]}/usr/lib -Wl,-rpath-link=${BOB_DEP_PATHS[libs::zlib-dev]}/usr/lib -Wl,-rpath-link=${BOB_DEP_PATHS[libs::openssl-dev]}/usr/lib" + export ac_cv_fread_reads_directories=yes + export ac_cv_snprintf_returns_bogus=no + mkdir -p install tar -xf $1/git-${PKG_VERSION}.tar.xz pushd git-${PKG_VERSION} ./configure --host=${AUTOCONF_HOST} \ + --build=${AUTOCONF_BUILD} \ --prefix=/usr \ --with-curl=${BOB_DEP_PATHS[net::curl-dev]}/usr \ --without-python \ diff --git a/recipes/devel/host-compat-toolchain.yaml b/recipes/devel/host-compat-toolchain.yaml index 2e1f3ec3..321b7458 100644 --- a/recipes/devel/host-compat-toolchain.yaml +++ b/recipes/devel/host-compat-toolchain.yaml @@ -6,7 +6,7 @@ shared: True environment: - AUTOCONF_TARGET: "$(gen-autoconf,bob_compat)" + AUTOCONF_TARGET: "${SANDBOX_AUTOCONF_TARGET:-$(gen-autoconf,bob_compat)}" depends: # The following tools are needed by the cross-toolchain build process. diff --git a/recipes/devel/sandbox-toolchain.yaml b/recipes/devel/sandbox-toolchain.yaml index 1241553a..7c2083f8 100644 --- a/recipes/devel/sandbox-toolchain.yaml +++ b/recipes/devel/sandbox-toolchain.yaml @@ -1,5 +1,5 @@ inherit: [sandbox-toolchain] privateEnvironment: - SANDBOX_AUTOCONF_BUILD: "$(gen-autoconf,bob)" - SANDBOX_AUTOCONF_HOST: "$(gen-autoconf,bob)" + SANDBOX_AUTOCONF_BUILD: "${SANDBOX_AUTOCONF_BUILD:-$(gen-autoconf,bob)}" + SANDBOX_AUTOCONF_HOST: "${SANDBOX_AUTOCONF_HOST:-$(gen-autoconf,bob)}" diff --git a/recipes/devel/sandbox.yaml b/recipes/devel/sandbox.yaml index 01faee04..bad6fbc2 100644 --- a/recipes/devel/sandbox.yaml +++ b/recipes/devel/sandbox.yaml @@ -47,8 +47,10 @@ depends: - name: devel::cross-toolchain environment: - AUTOCONF_TARGET: "x86_64-bob-linux-gnu" - ARCH: x86_64 + # TODO AUTOCONF_TARGET: "${SANDBOX_AUTOCONF_TARGET:-x86_64-bob-linux-gnu}" + AUTOCONF_TARGET: "aarch64-bob-linux-gnu" + # TODO ARCH: "${SANDBOX_ARCH:-x86_64}" + ARCH: "arm64" GCC_LIBC: glibc BASEMENT_OPTIMIZE: "s" BASEMENT_DEBUG: "0" diff --git a/recipes/libs/expat.yaml b/recipes/libs/expat.yaml index c6d59c1a..0a62bca6 100644 --- a/recipes/libs/expat.yaml +++ b/recipes/libs/expat.yaml @@ -9,6 +9,7 @@ checkoutSCM: digestSHA256: a00ae8a6b96b63a3910ddc1100b1a7ef50dc26dceb65ced18ded31ab392f132b stripComponents: 1 +buildTools: [host-toolchain] buildScript: | autotoolsBuild $1 diff --git a/recipes/libs/libcap.yaml b/recipes/libs/libcap.yaml index e297edb0..0ed48b8e 100644 --- a/recipes/libs/libcap.yaml +++ b/recipes/libs/libcap.yaml @@ -10,7 +10,7 @@ checkoutSCM: extract: False buildTools: [host-toolchain, target-toolchain] -buildVars: [AR, CC, OBJCOPY, RANLIB, PKG_VERSION] +buildVars: [AR, CC, OBJCOPY, RANLIB, PKG_VERSION, CROSS_COMPILE] buildScript: | tar -xf $1/libcap-${PKG_VERSION}.tar.xz mkdir -p install @@ -21,6 +21,7 @@ buildScript: | AR=$AR \ CC=$CC \ OBJCOPY=$OBJCOPY \ + ${CROSS_COMPILE:+BUILD_CC=gcc} \ RANLIB=$RANLIB \ RAISE_SETFCAP=no \ DESTDIR="$PWD/install" \ diff --git a/tests/cross-platform/recipes/cmake/greeter.yaml b/tests/cross-platform/recipes/cmake/greeter.yaml index 2bf40866..4c36c1c4 100644 --- a/tests/cross-platform/recipes/cmake/greeter.yaml +++ b/tests/cross-platform/recipes/cmake/greeter.yaml @@ -1,5 +1,11 @@ inherit: [ "basement::rootrecipe", cmake ] +environment: + SANDBOX_AUTOCONF_HOST: "aarch64-bob-linux-gnu" + SANDBOX_AUTOCONF_BUILD: "aarch64-bob-linux-gnu" + SANDBOX_AUTOCONF_TARGET: "aarch64-bob-linux-gnu" + SANDBOX_ARCH: "arm64" + checkoutSCM: scm: import url: src/greeter/ From ab5e9e1cea7550b8450751f13705b32d0bf8b27b Mon Sep 17 00:00:00 2001 From: Martin Haase Date: Mon, 1 Mar 2021 21:50:14 +0100 Subject: [PATCH 02/26] classes/sandbox-toolchain: added ARCH if SANDBOX_ARCH is set --- classes/sandbox-toolchain.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/classes/sandbox-toolchain.yaml b/classes/sandbox-toolchain.yaml index 429c2475..edd706b6 100644 --- a/classes/sandbox-toolchain.yaml +++ b/classes/sandbox-toolchain.yaml @@ -62,3 +62,4 @@ provideVars: # architecture is the same. AUTOCONF_BUILD: "${SANDBOX_AUTOCONF_BUILD}" AUTOCONF_HOST: "${SANDBOX_AUTOCONF_HOST}" + ARCH: "${SANDBOX_ARCH:-$ARCH}" From eef93396fe6da79b03498e22f07814786b9b15be Mon Sep 17 00:00:00 2001 From: Martin Haase Date: Mon, 1 Mar 2021 22:45:57 +0100 Subject: [PATCH 03/26] libs/compat/glibc: disabled werror --- recipes/libs/compat/glibc.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/recipes/libs/compat/glibc.yaml b/recipes/libs/compat/glibc.yaml index f60fd112..465a67df 100644 --- a/recipes/libs/compat/glibc.yaml +++ b/recipes/libs/compat/glibc.yaml @@ -36,6 +36,7 @@ buildScript: | --with-headers=$2/usr/include \ --enable-obsolete-rpc \ --libdir=/usr/lib \ + --disable-werror \ $EXTRA touch .configure.stamp fi From 66d53b06f0331d7ccde07631fd5dcef0014a4e17 Mon Sep 17 00:00:00 2001 From: Martin Haase Date: Tue, 2 Mar 2021 16:22:02 +0100 Subject: [PATCH 04/26] libs/compat/glibc: fixes for aarch64, maybe included in 2.27, if update is an option --- .../0003-improve-ifunc-check-BZ-25506.diff | 27 ++++++++++++++ ...4-aarch64-rewrite-emla-dynamic-symbol.diff | 35 +++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 recipes/libs/compat/glibc/0003-improve-ifunc-check-BZ-25506.diff create mode 100644 recipes/libs/compat/glibc/0004-aarch64-rewrite-emla-dynamic-symbol.diff diff --git a/recipes/libs/compat/glibc/0003-improve-ifunc-check-BZ-25506.diff b/recipes/libs/compat/glibc/0003-improve-ifunc-check-BZ-25506.diff new file mode 100644 index 00000000..6525064e --- /dev/null +++ b/recipes/libs/compat/glibc/0003-improve-ifunc-check-BZ-25506.diff @@ -0,0 +1,27 @@ +diff --git a/workspace/configure.ac b/workspace/configure.ac +index 49b900c1ed..e20034f301 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -649,7 +649,7 @@ if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS \ + -o conftest conftest.S 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then + # Do a link to see if the backend supports IFUNC relocs. + $READELF -r conftest 1>&AS_MESSAGE_LOG_FD +- LC_ALL=C $READELF -r conftest | grep 'no relocations' >/dev/null || { ++ LC_ALL=C $READELF -Wr conftest | grep -q 'IRELATIVE\|R_SPARC_JMP_IREL' && { + libc_cv_ld_gnu_indirect_function=yes + } + fi + +diff --git a/workspace/configure b/workspace/configure +index b959d2d988..3b98ec312f 100755 +--- a/configure ++++ b/configure +@@ -4035,7 +4035,7 @@ if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS \ + -o conftest conftest.S 1>&5 2>&5; then + # Do a link to see if the backend supports IFUNC relocs. + $READELF -r conftest 1>&5 +- LC_ALL=C $READELF -r conftest | grep 'no relocations' >/dev/null || { ++ LC_ALL=C $READELF -Wr conftest | grep -q 'IRELATIVE\|R_SPARC_JMP_IREL' && { + libc_cv_ld_gnu_indirect_function=yes + } + fi diff --git a/recipes/libs/compat/glibc/0004-aarch64-rewrite-emla-dynamic-symbol.diff b/recipes/libs/compat/glibc/0004-aarch64-rewrite-emla-dynamic-symbol.diff new file mode 100644 index 00000000..68209d0f --- /dev/null +++ b/recipes/libs/compat/glibc/0004-aarch64-rewrite-emla-dynamic-symbol.diff @@ -0,0 +1,35 @@ +--- workspace/x/glibc-2.23/sysdeps/aarch64/dl-machine.h 2016-02-18 18:54:00.000000000 +0100 ++++ workspace/sysdeps/aarch64/dl-machine.h 2021-03-02 15:43:54.678003584 +0100 +@@ -56,19 +56,8 @@ + This depends on 32bit relocations being resolved at link time + and that the static address fits in the 32bits. */ + +- ElfW(Addr) static_addr; +- ElfW(Addr) dynamic_addr; +- +- asm (" \n" +-" adrp %1, _dl_start; \n" +-" add %1, %1, #:lo12:_dl_start \n" +-" ldr %w0, 1f \n" +-" b 2f \n" +-"1: \n" +-" .word _dl_start \n" +-"2: \n" +- : "=r" (static_addr), "=r" (dynamic_addr)); +- return dynamic_addr - static_addr; ++ extern ElfW(Dyn) _DYNAMIC[] attribute_hidden; ++ return (ElfW(Addr)) &_DYNAMIC - elf_machine_dynamic (); + } + + /* Set up the loaded object described by L so its unrelocated PLT +@@ -172,8 +161,8 @@ + cmp x0, #0 \n\ + bne 1b \n\ + // Update _dl_argv \n\ +- adrp x3, _dl_argv \n\ +- str x2, [x3, #:lo12:_dl_argv] \n\ ++ adrp x3, __GI__dl_argv \n\ ++ str x2, [x3, #:lo12:__GI__dl_argv] \n\ + .L_done_stack_adjust: \n\ + // compute envp \n\ + add x3, x2, x1, lsl #3 \n\ From 5ff111357c3a47fc393abc0a6e46fffc68981546 Mon Sep 17 00:00:00 2001 From: Martin Haase Date: Tue, 2 Mar 2021 16:18:42 +0100 Subject: [PATCH 05/26] fixed the usage of a cross-built sandbox --- tests/cross-platform/recipes/cmake/greeter.yaml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/cross-platform/recipes/cmake/greeter.yaml b/tests/cross-platform/recipes/cmake/greeter.yaml index 4c36c1c4..2f1b01c4 100644 --- a/tests/cross-platform/recipes/cmake/greeter.yaml +++ b/tests/cross-platform/recipes/cmake/greeter.yaml @@ -1,10 +1,11 @@ inherit: [ "basement::rootrecipe", cmake ] environment: - SANDBOX_AUTOCONF_HOST: "aarch64-bob-linux-gnu" - SANDBOX_AUTOCONF_BUILD: "aarch64-bob-linux-gnu" - SANDBOX_AUTOCONF_TARGET: "aarch64-bob-linux-gnu" - SANDBOX_ARCH: "arm64" + # this is just an example how to use this sandbox inside a recipe + SANDBOX_AUTOCONF_HOST: "$(if-then-else,$(is-sandbox-enabled),aarch64-bob-linux-gnu,)" + SANDBOX_AUTOCONF_BUILD: "$(if-then-else,$(is-sandbox-enabled),aarch64-bob-linux-gnu,)" + SANDBOX_AUTOCONF_TARGET: "$(if-then-else,$(is-sandbox-enabled),aarch64-bob-linux-gnu,)" + SANDBOX_ARCH: "$(if-then-else,$(is-sandbox-enabled),arm64,)" checkoutSCM: scm: import From 438ce99f2a1abedb04603929f2d8c1e83311b27f Mon Sep 17 00:00:00 2001 From: Martin Haase Date: Fri, 5 Mar 2021 08:38:52 +0100 Subject: [PATCH 06/26] sandbox: provides AUTOCONF vars of itself --- classes/basement/rootrecipe.yaml | 2 +- recipes/devel/sandbox.yaml | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/classes/basement/rootrecipe.yaml b/classes/basement/rootrecipe.yaml index 695247e5..5ee590a5 100644 --- a/classes/basement/rootrecipe.yaml +++ b/classes/basement/rootrecipe.yaml @@ -6,7 +6,7 @@ depends: depends: # Setup sandbox with corresponding toolchain - name: devel::sandbox - use: [sandbox] + use: [sandbox, environment] forward: True - name: devel::sandbox-toolchain use: [environment, tools] diff --git a/recipes/devel/sandbox.yaml b/recipes/devel/sandbox.yaml index bad6fbc2..94b88fbf 100644 --- a/recipes/devel/sandbox.yaml +++ b/recipes/devel/sandbox.yaml @@ -93,3 +93,6 @@ depends: - devel::binutils - devel::gcc-native +provideVars: + AUTOCONF_HOST: "${SANDBOX_AUTOCONF_HOST:-}" + AUTOCONF_BUILD: "${SANDBOX_AUTOCONF_BUILD:-}" From f406f7a12e5c87a5aa17ddd222bbc9b7413fbfe0 Mon Sep 17 00:00:00 2001 From: Martin Haase Date: Fri, 5 Mar 2021 08:39:35 +0100 Subject: [PATCH 07/26] test: added a specific test-target for aarch64 --- tests/cross-platform/recipes/cmake/greeter.yaml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/tests/cross-platform/recipes/cmake/greeter.yaml b/tests/cross-platform/recipes/cmake/greeter.yaml index 2f1b01c4..b8aaafe6 100644 --- a/tests/cross-platform/recipes/cmake/greeter.yaml +++ b/tests/cross-platform/recipes/cmake/greeter.yaml @@ -1,12 +1,5 @@ inherit: [ "basement::rootrecipe", cmake ] -environment: - # this is just an example how to use this sandbox inside a recipe - SANDBOX_AUTOCONF_HOST: "$(if-then-else,$(is-sandbox-enabled),aarch64-bob-linux-gnu,)" - SANDBOX_AUTOCONF_BUILD: "$(if-then-else,$(is-sandbox-enabled),aarch64-bob-linux-gnu,)" - SANDBOX_AUTOCONF_TARGET: "$(if-then-else,$(is-sandbox-enabled),aarch64-bob-linux-gnu,)" - SANDBOX_ARCH: "$(if-then-else,$(is-sandbox-enabled),arm64,)" - checkoutSCM: scm: import url: src/greeter/ @@ -29,7 +22,7 @@ multiPackage: - cmake::libgreet-dev - cmake::libgreet-tgt cross: - depends: + depends: &cross - if: !expr | "${BOB_HOST_PLATFORM}" == "msys" || "${BOB_HOST_PLATFORM}" == "win32" name: devel::win::vs2019-toolchain-vc142-amd64 @@ -41,3 +34,11 @@ multiPackage: use: [tools] forward: True - depends: *deps + cross-aarch64: + environment: + # this is just an example how to use this sandbox inside a recipe + SANDBOX_AUTOCONF_HOST: "aarch64-bob-linux-gnu" + SANDBOX_AUTOCONF_BUILD: "aarch64-bob-linux-gnu" + SANDBOX_AUTOCONF_TARGET: "aarch64-bob-linux-gnu" + SANDBOX_ARCH: "arm64" + depends: *cross From 49f84e7ef15f9544e938915ea45b25c6505ccff7 Mon Sep 17 00:00:00 2001 From: Martin Haase Date: Fri, 5 Mar 2021 08:40:33 +0100 Subject: [PATCH 08/26] libs/glibc: added another patch for aarch64 support --- ...003-improve-ifunc-check-BZ-25506.diff.save | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 recipes/libs/compat/glibc/0003-improve-ifunc-check-BZ-25506.diff.save diff --git a/recipes/libs/compat/glibc/0003-improve-ifunc-check-BZ-25506.diff.save b/recipes/libs/compat/glibc/0003-improve-ifunc-check-BZ-25506.diff.save new file mode 100644 index 00000000..02b585f0 --- /dev/null +++ b/recipes/libs/compat/glibc/0003-improve-ifunc-check-BZ-25506.diff.save @@ -0,0 +1,27 @@ +diff --git a/configure.ac b/configure.ac +index 49b900c1ed..e20034f301 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -649,7 +649,7 @@ if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS \ + -o conftest conftest.S 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then + # Do a link to see if the backend supports IFUNC relocs. + $READELF -r conftest 1>&AS_MESSAGE_LOG_FD +- LC_ALL=C $READELF -r conftest | grep 'no relocations' >/dev/null || { ++ LC_ALL=C $READELF -Wr conftest | grep -q 'IRELATIVE\|R_SPARC_JMP_IREL' && { + libc_cv_ld_gnu_indirect_function=yes + } + fi + +diff --git a/configure.ac b/configure.ac +index 49b900c1ed..e20034f301 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -649,7 +649,7 @@ if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS \ + -o conftest conftest.S 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then + # Do a link to see if the backend supports IFUNC relocs. + $READELF -r conftest 1>&AS_MESSAGE_LOG_FD +- LC_ALL=C $READELF -r conftest | grep 'no relocations' >/dev/null || { ++ LC_ALL=C $READELF -Wr conftest | grep -q 'IRELATIVE\|R_SPARC_JMP_IREL' && { + libc_cv_ld_gnu_indirect_function=yes + } + fi From 50be7acf4319dd40644e32d8d4ac2128617122ff Mon Sep 17 00:00:00 2001 From: Martin Haase Date: Mon, 8 Mar 2021 11:09:21 +0100 Subject: [PATCH 09/26] devel/sandbox: adapt after environment var fix of bob --- recipes/devel/sandbox.yaml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/recipes/devel/sandbox.yaml b/recipes/devel/sandbox.yaml index 94b88fbf..9c7df113 100644 --- a/recipes/devel/sandbox.yaml +++ b/recipes/devel/sandbox.yaml @@ -47,10 +47,8 @@ depends: - name: devel::cross-toolchain environment: - # TODO AUTOCONF_TARGET: "${SANDBOX_AUTOCONF_TARGET:-x86_64-bob-linux-gnu}" - AUTOCONF_TARGET: "aarch64-bob-linux-gnu" - # TODO ARCH: "${SANDBOX_ARCH:-x86_64}" - ARCH: "arm64" + AUTOCONF_TARGET: "${SANDBOX_AUTOCONF_TARGET:-x86_64-bob-linux-gnu}" + ARCH: "${SANDBOX_ARCH:-x86_64}" GCC_LIBC: glibc BASEMENT_OPTIMIZE: "s" BASEMENT_DEBUG: "0" From c532c9c47ffd6945a40a6d9fc4ef1096aaee6590 Mon Sep 17 00:00:00 2001 From: Martin Haase Date: Mon, 8 Mar 2021 11:10:08 +0100 Subject: [PATCH 10/26] libs/compat/glibc: removed unnecessary patch --- .../0003-improve-ifunc-check-BZ-25506.diff | 27 ------------------- ...003-improve-ifunc-check-BZ-25506.diff.save | 27 ------------------- 2 files changed, 54 deletions(-) delete mode 100644 recipes/libs/compat/glibc/0003-improve-ifunc-check-BZ-25506.diff delete mode 100644 recipes/libs/compat/glibc/0003-improve-ifunc-check-BZ-25506.diff.save diff --git a/recipes/libs/compat/glibc/0003-improve-ifunc-check-BZ-25506.diff b/recipes/libs/compat/glibc/0003-improve-ifunc-check-BZ-25506.diff deleted file mode 100644 index 6525064e..00000000 --- a/recipes/libs/compat/glibc/0003-improve-ifunc-check-BZ-25506.diff +++ /dev/null @@ -1,27 +0,0 @@ -diff --git a/workspace/configure.ac b/workspace/configure.ac -index 49b900c1ed..e20034f301 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -649,7 +649,7 @@ if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS \ - -o conftest conftest.S 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then - # Do a link to see if the backend supports IFUNC relocs. - $READELF -r conftest 1>&AS_MESSAGE_LOG_FD -- LC_ALL=C $READELF -r conftest | grep 'no relocations' >/dev/null || { -+ LC_ALL=C $READELF -Wr conftest | grep -q 'IRELATIVE\|R_SPARC_JMP_IREL' && { - libc_cv_ld_gnu_indirect_function=yes - } - fi - -diff --git a/workspace/configure b/workspace/configure -index b959d2d988..3b98ec312f 100755 ---- a/configure -+++ b/configure -@@ -4035,7 +4035,7 @@ if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS \ - -o conftest conftest.S 1>&5 2>&5; then - # Do a link to see if the backend supports IFUNC relocs. - $READELF -r conftest 1>&5 -- LC_ALL=C $READELF -r conftest | grep 'no relocations' >/dev/null || { -+ LC_ALL=C $READELF -Wr conftest | grep -q 'IRELATIVE\|R_SPARC_JMP_IREL' && { - libc_cv_ld_gnu_indirect_function=yes - } - fi diff --git a/recipes/libs/compat/glibc/0003-improve-ifunc-check-BZ-25506.diff.save b/recipes/libs/compat/glibc/0003-improve-ifunc-check-BZ-25506.diff.save deleted file mode 100644 index 02b585f0..00000000 --- a/recipes/libs/compat/glibc/0003-improve-ifunc-check-BZ-25506.diff.save +++ /dev/null @@ -1,27 +0,0 @@ -diff --git a/configure.ac b/configure.ac -index 49b900c1ed..e20034f301 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -649,7 +649,7 @@ if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS \ - -o conftest conftest.S 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then - # Do a link to see if the backend supports IFUNC relocs. - $READELF -r conftest 1>&AS_MESSAGE_LOG_FD -- LC_ALL=C $READELF -r conftest | grep 'no relocations' >/dev/null || { -+ LC_ALL=C $READELF -Wr conftest | grep -q 'IRELATIVE\|R_SPARC_JMP_IREL' && { - libc_cv_ld_gnu_indirect_function=yes - } - fi - -diff --git a/configure.ac b/configure.ac -index 49b900c1ed..e20034f301 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -649,7 +649,7 @@ if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS \ - -o conftest conftest.S 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then - # Do a link to see if the backend supports IFUNC relocs. - $READELF -r conftest 1>&AS_MESSAGE_LOG_FD -- LC_ALL=C $READELF -r conftest | grep 'no relocations' >/dev/null || { -+ LC_ALL=C $READELF -Wr conftest | grep -q 'IRELATIVE\|R_SPARC_JMP_IREL' && { - libc_cv_ld_gnu_indirect_function=yes - } - fi From 3ec2468544efc8f126033241da20b78f0d0d5ef1 Mon Sep 17 00:00:00 2001 From: Martin Haase Date: Mon, 10 May 2021 08:08:26 +0200 Subject: [PATCH 11/26] recipes/devel/gcc: added --with-linker-hash-style=gnu to gcc build parameters --- recipes/devel/gcc.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/recipes/devel/gcc.yaml b/recipes/devel/gcc.yaml index 5f063e17..401ac22e 100644 --- a/recipes/devel/gcc.yaml +++ b/recipes/devel/gcc.yaml @@ -47,6 +47,7 @@ buildScript: | ${GCC_TARGET_FPU:+--with-fpu=$GCC_TARGET_FPU} \ ${GCC_TARGET_FLOAT_ABI:+--with-float=$GCC_TARGET_FLOAT_ABI} \ --enable-initfini-array \ + --with-linker-hash-style=gnu \ "${@}" \ --disable-gtk-doc \ --disable-gtk-doc-html \ From 0c2744c6015bce9aff6f934a79ec392e97e0c85e Mon Sep 17 00:00:00 2001 From: "Martin Haase (FDTech)" Date: Wed, 19 May 2021 16:01:14 +0200 Subject: [PATCH 12/26] devel/sandbox: small fix, set default values --- recipes/devel/sandbox.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/devel/sandbox.yaml b/recipes/devel/sandbox.yaml index 9c7df113..16cc774a 100644 --- a/recipes/devel/sandbox.yaml +++ b/recipes/devel/sandbox.yaml @@ -92,5 +92,5 @@ depends: - devel::gcc-native provideVars: - AUTOCONF_HOST: "${SANDBOX_AUTOCONF_HOST:-}" - AUTOCONF_BUILD: "${SANDBOX_AUTOCONF_BUILD:-}" + AUTOCONF_HOST: "${SANDBOX_AUTOCONF_HOST:-${AUTOCONF_HOST}}" + AUTOCONF_BUILD: "${SANDBOX_AUTOCONF_BUILD:-${AUTOCONF_BUILD}}" From 16bde15d0d6dc03ce63eeac8052af9b73fc41a89 Mon Sep 17 00:00:00 2001 From: Martin Haase Date: Mon, 1 Mar 2021 20:30:29 +0100 Subject: [PATCH 13/26] prototype: aarch64 sandbox (configurable sandbox+toolchain) --- tests/cross-platform/recipes/cmake/greeter.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/cross-platform/recipes/cmake/greeter.yaml b/tests/cross-platform/recipes/cmake/greeter.yaml index b8aaafe6..f0654267 100644 --- a/tests/cross-platform/recipes/cmake/greeter.yaml +++ b/tests/cross-platform/recipes/cmake/greeter.yaml @@ -1,5 +1,11 @@ inherit: [ "basement::rootrecipe", cmake ] +environment: + SANDBOX_AUTOCONF_HOST: "aarch64-bob-linux-gnu" + SANDBOX_AUTOCONF_BUILD: "aarch64-bob-linux-gnu" + SANDBOX_AUTOCONF_TARGET: "aarch64-bob-linux-gnu" + SANDBOX_ARCH: "arm64" + checkoutSCM: scm: import url: src/greeter/ From ac84124ab32232c3806f670741948a5d7cebaf0e Mon Sep 17 00:00:00 2001 From: Martin Haase Date: Tue, 2 Mar 2021 16:22:02 +0100 Subject: [PATCH 14/26] libs/compat/glibc: fixes for aarch64, maybe included in 2.27, if update is an option --- .../0003-improve-ifunc-check-BZ-25506.diff | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 recipes/libs/compat/glibc/0003-improve-ifunc-check-BZ-25506.diff diff --git a/recipes/libs/compat/glibc/0003-improve-ifunc-check-BZ-25506.diff b/recipes/libs/compat/glibc/0003-improve-ifunc-check-BZ-25506.diff new file mode 100644 index 00000000..6525064e --- /dev/null +++ b/recipes/libs/compat/glibc/0003-improve-ifunc-check-BZ-25506.diff @@ -0,0 +1,27 @@ +diff --git a/workspace/configure.ac b/workspace/configure.ac +index 49b900c1ed..e20034f301 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -649,7 +649,7 @@ if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS \ + -o conftest conftest.S 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then + # Do a link to see if the backend supports IFUNC relocs. + $READELF -r conftest 1>&AS_MESSAGE_LOG_FD +- LC_ALL=C $READELF -r conftest | grep 'no relocations' >/dev/null || { ++ LC_ALL=C $READELF -Wr conftest | grep -q 'IRELATIVE\|R_SPARC_JMP_IREL' && { + libc_cv_ld_gnu_indirect_function=yes + } + fi + +diff --git a/workspace/configure b/workspace/configure +index b959d2d988..3b98ec312f 100755 +--- a/configure ++++ b/configure +@@ -4035,7 +4035,7 @@ if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS \ + -o conftest conftest.S 1>&5 2>&5; then + # Do a link to see if the backend supports IFUNC relocs. + $READELF -r conftest 1>&5 +- LC_ALL=C $READELF -r conftest | grep 'no relocations' >/dev/null || { ++ LC_ALL=C $READELF -Wr conftest | grep -q 'IRELATIVE\|R_SPARC_JMP_IREL' && { + libc_cv_ld_gnu_indirect_function=yes + } + fi From 41e4dd0bf622c94e34cda073a6e1d3d047bea695 Mon Sep 17 00:00:00 2001 From: Martin Haase Date: Tue, 2 Mar 2021 16:18:42 +0100 Subject: [PATCH 15/26] fixed the usage of a cross-built sandbox --- tests/cross-platform/recipes/cmake/greeter.yaml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/cross-platform/recipes/cmake/greeter.yaml b/tests/cross-platform/recipes/cmake/greeter.yaml index f0654267..2a50b2fa 100644 --- a/tests/cross-platform/recipes/cmake/greeter.yaml +++ b/tests/cross-platform/recipes/cmake/greeter.yaml @@ -1,10 +1,11 @@ inherit: [ "basement::rootrecipe", cmake ] environment: - SANDBOX_AUTOCONF_HOST: "aarch64-bob-linux-gnu" - SANDBOX_AUTOCONF_BUILD: "aarch64-bob-linux-gnu" - SANDBOX_AUTOCONF_TARGET: "aarch64-bob-linux-gnu" - SANDBOX_ARCH: "arm64" + # this is just an example how to use this sandbox inside a recipe + SANDBOX_AUTOCONF_HOST: "$(if-then-else,$(is-sandbox-enabled),aarch64-bob-linux-gnu,)" + SANDBOX_AUTOCONF_BUILD: "$(if-then-else,$(is-sandbox-enabled),aarch64-bob-linux-gnu,)" + SANDBOX_AUTOCONF_TARGET: "$(if-then-else,$(is-sandbox-enabled),aarch64-bob-linux-gnu,)" + SANDBOX_ARCH: "$(if-then-else,$(is-sandbox-enabled),arm64,)" checkoutSCM: scm: import From 1b8a41a5e8b3f1558a8cc8cafc01602332fb3713 Mon Sep 17 00:00:00 2001 From: Martin Haase Date: Fri, 5 Mar 2021 08:39:35 +0100 Subject: [PATCH 16/26] test: added a specific test-target for aarch64 --- tests/cross-platform/recipes/cmake/greeter.yaml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/tests/cross-platform/recipes/cmake/greeter.yaml b/tests/cross-platform/recipes/cmake/greeter.yaml index 2a50b2fa..b8aaafe6 100644 --- a/tests/cross-platform/recipes/cmake/greeter.yaml +++ b/tests/cross-platform/recipes/cmake/greeter.yaml @@ -1,12 +1,5 @@ inherit: [ "basement::rootrecipe", cmake ] -environment: - # this is just an example how to use this sandbox inside a recipe - SANDBOX_AUTOCONF_HOST: "$(if-then-else,$(is-sandbox-enabled),aarch64-bob-linux-gnu,)" - SANDBOX_AUTOCONF_BUILD: "$(if-then-else,$(is-sandbox-enabled),aarch64-bob-linux-gnu,)" - SANDBOX_AUTOCONF_TARGET: "$(if-then-else,$(is-sandbox-enabled),aarch64-bob-linux-gnu,)" - SANDBOX_ARCH: "$(if-then-else,$(is-sandbox-enabled),arm64,)" - checkoutSCM: scm: import url: src/greeter/ From 5378e6eaac4fb887199d88cca9a94b82b6315f3b Mon Sep 17 00:00:00 2001 From: Martin Haase Date: Fri, 5 Mar 2021 08:40:33 +0100 Subject: [PATCH 17/26] libs/glibc: added another patch for aarch64 support --- ...003-improve-ifunc-check-BZ-25506.diff.save | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 recipes/libs/compat/glibc/0003-improve-ifunc-check-BZ-25506.diff.save diff --git a/recipes/libs/compat/glibc/0003-improve-ifunc-check-BZ-25506.diff.save b/recipes/libs/compat/glibc/0003-improve-ifunc-check-BZ-25506.diff.save new file mode 100644 index 00000000..02b585f0 --- /dev/null +++ b/recipes/libs/compat/glibc/0003-improve-ifunc-check-BZ-25506.diff.save @@ -0,0 +1,27 @@ +diff --git a/configure.ac b/configure.ac +index 49b900c1ed..e20034f301 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -649,7 +649,7 @@ if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS \ + -o conftest conftest.S 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then + # Do a link to see if the backend supports IFUNC relocs. + $READELF -r conftest 1>&AS_MESSAGE_LOG_FD +- LC_ALL=C $READELF -r conftest | grep 'no relocations' >/dev/null || { ++ LC_ALL=C $READELF -Wr conftest | grep -q 'IRELATIVE\|R_SPARC_JMP_IREL' && { + libc_cv_ld_gnu_indirect_function=yes + } + fi + +diff --git a/configure.ac b/configure.ac +index 49b900c1ed..e20034f301 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -649,7 +649,7 @@ if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS \ + -o conftest conftest.S 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then + # Do a link to see if the backend supports IFUNC relocs. + $READELF -r conftest 1>&AS_MESSAGE_LOG_FD +- LC_ALL=C $READELF -r conftest | grep 'no relocations' >/dev/null || { ++ LC_ALL=C $READELF -Wr conftest | grep -q 'IRELATIVE\|R_SPARC_JMP_IREL' && { + libc_cv_ld_gnu_indirect_function=yes + } + fi From 51cbbff7f1f29d002b03395bf587af1b9e7ab684 Mon Sep 17 00:00:00 2001 From: Martin Haase Date: Mon, 8 Mar 2021 11:10:08 +0100 Subject: [PATCH 18/26] libs/compat/glibc: removed unnecessary patch --- .../0003-improve-ifunc-check-BZ-25506.diff | 27 ------------------- ...003-improve-ifunc-check-BZ-25506.diff.save | 27 ------------------- 2 files changed, 54 deletions(-) delete mode 100644 recipes/libs/compat/glibc/0003-improve-ifunc-check-BZ-25506.diff delete mode 100644 recipes/libs/compat/glibc/0003-improve-ifunc-check-BZ-25506.diff.save diff --git a/recipes/libs/compat/glibc/0003-improve-ifunc-check-BZ-25506.diff b/recipes/libs/compat/glibc/0003-improve-ifunc-check-BZ-25506.diff deleted file mode 100644 index 6525064e..00000000 --- a/recipes/libs/compat/glibc/0003-improve-ifunc-check-BZ-25506.diff +++ /dev/null @@ -1,27 +0,0 @@ -diff --git a/workspace/configure.ac b/workspace/configure.ac -index 49b900c1ed..e20034f301 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -649,7 +649,7 @@ if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS \ - -o conftest conftest.S 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then - # Do a link to see if the backend supports IFUNC relocs. - $READELF -r conftest 1>&AS_MESSAGE_LOG_FD -- LC_ALL=C $READELF -r conftest | grep 'no relocations' >/dev/null || { -+ LC_ALL=C $READELF -Wr conftest | grep -q 'IRELATIVE\|R_SPARC_JMP_IREL' && { - libc_cv_ld_gnu_indirect_function=yes - } - fi - -diff --git a/workspace/configure b/workspace/configure -index b959d2d988..3b98ec312f 100755 ---- a/configure -+++ b/configure -@@ -4035,7 +4035,7 @@ if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS \ - -o conftest conftest.S 1>&5 2>&5; then - # Do a link to see if the backend supports IFUNC relocs. - $READELF -r conftest 1>&5 -- LC_ALL=C $READELF -r conftest | grep 'no relocations' >/dev/null || { -+ LC_ALL=C $READELF -Wr conftest | grep -q 'IRELATIVE\|R_SPARC_JMP_IREL' && { - libc_cv_ld_gnu_indirect_function=yes - } - fi diff --git a/recipes/libs/compat/glibc/0003-improve-ifunc-check-BZ-25506.diff.save b/recipes/libs/compat/glibc/0003-improve-ifunc-check-BZ-25506.diff.save deleted file mode 100644 index 02b585f0..00000000 --- a/recipes/libs/compat/glibc/0003-improve-ifunc-check-BZ-25506.diff.save +++ /dev/null @@ -1,27 +0,0 @@ -diff --git a/configure.ac b/configure.ac -index 49b900c1ed..e20034f301 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -649,7 +649,7 @@ if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS \ - -o conftest conftest.S 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then - # Do a link to see if the backend supports IFUNC relocs. - $READELF -r conftest 1>&AS_MESSAGE_LOG_FD -- LC_ALL=C $READELF -r conftest | grep 'no relocations' >/dev/null || { -+ LC_ALL=C $READELF -Wr conftest | grep -q 'IRELATIVE\|R_SPARC_JMP_IREL' && { - libc_cv_ld_gnu_indirect_function=yes - } - fi - -diff --git a/configure.ac b/configure.ac -index 49b900c1ed..e20034f301 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -649,7 +649,7 @@ if ${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS \ - -o conftest conftest.S 1>&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD; then - # Do a link to see if the backend supports IFUNC relocs. - $READELF -r conftest 1>&AS_MESSAGE_LOG_FD -- LC_ALL=C $READELF -r conftest | grep 'no relocations' >/dev/null || { -+ LC_ALL=C $READELF -Wr conftest | grep -q 'IRELATIVE\|R_SPARC_JMP_IREL' && { - libc_cv_ld_gnu_indirect_function=yes - } - fi From 57858f375983b32fd3ef08ba3481125940a3b9fa Mon Sep 17 00:00:00 2001 From: Martin Haase Date: Mon, 1 Mar 2021 20:30:29 +0100 Subject: [PATCH 19/26] prototype: aarch64 sandbox (configurable sandbox+toolchain) --- tests/cross-platform/recipes/cmake/greeter.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/cross-platform/recipes/cmake/greeter.yaml b/tests/cross-platform/recipes/cmake/greeter.yaml index b8aaafe6..f0654267 100644 --- a/tests/cross-platform/recipes/cmake/greeter.yaml +++ b/tests/cross-platform/recipes/cmake/greeter.yaml @@ -1,5 +1,11 @@ inherit: [ "basement::rootrecipe", cmake ] +environment: + SANDBOX_AUTOCONF_HOST: "aarch64-bob-linux-gnu" + SANDBOX_AUTOCONF_BUILD: "aarch64-bob-linux-gnu" + SANDBOX_AUTOCONF_TARGET: "aarch64-bob-linux-gnu" + SANDBOX_ARCH: "arm64" + checkoutSCM: scm: import url: src/greeter/ From 6dbfbff1b18d5873891bd76c1e2734eb9d45a352 Mon Sep 17 00:00:00 2001 From: Martin Haase Date: Tue, 13 Jul 2021 23:08:27 +0200 Subject: [PATCH 20/26] devel/cross-toolchain: autoconf_target aarch64-cross-linux-gnu for aarch64 toolchain --- recipes/devel/bootstrap-sandbox.yaml | 2 +- recipes/devel/cross-toolchain.yaml | 2 +- recipes/devel/gcc.yaml | 1 - recipes/devel/sandbox.yaml | 4 ++-- tests/cross-platform/recipes/cmake/greeter.yaml | 8 +------- 5 files changed, 5 insertions(+), 12 deletions(-) diff --git a/recipes/devel/bootstrap-sandbox.yaml b/recipes/devel/bootstrap-sandbox.yaml index c93fe727..f78763c3 100644 --- a/recipes/devel/bootstrap-sandbox.yaml +++ b/recipes/devel/bootstrap-sandbox.yaml @@ -41,7 +41,7 @@ depends: - name: devel::cross-toolchain environment: - AUTOCONF_TARGET: "x86_64-wendy-linux-gnu" + AUTOCONF_TARGET: "$(gen-autoconf,wendy)" ARCH: x86_64 GCC_LIBC: glibc BASEMENT_OPTIMIZE: "s" diff --git a/recipes/devel/cross-toolchain.yaml b/recipes/devel/cross-toolchain.yaml index c30354c5..1cd1bab3 100644 --- a/recipes/devel/cross-toolchain.yaml +++ b/recipes/devel/cross-toolchain.yaml @@ -88,7 +88,7 @@ multiPackage: # ARMv8-A AArch64 Linux toolchain aarch64-linux-gnu: environment: - AUTOCONF_TARGET: "aarch64-linux-gnu" + AUTOCONF_TARGET: "aarch64-cross-linux-gnu" ARCH: "arm64" GCC_TARGET_ARCH: "armv8-a" GCC_LIBC: "glibc" diff --git a/recipes/devel/gcc.yaml b/recipes/devel/gcc.yaml index 401ac22e..5f063e17 100644 --- a/recipes/devel/gcc.yaml +++ b/recipes/devel/gcc.yaml @@ -47,7 +47,6 @@ buildScript: | ${GCC_TARGET_FPU:+--with-fpu=$GCC_TARGET_FPU} \ ${GCC_TARGET_FLOAT_ABI:+--with-float=$GCC_TARGET_FLOAT_ABI} \ --enable-initfini-array \ - --with-linker-hash-style=gnu \ "${@}" \ --disable-gtk-doc \ --disable-gtk-doc-html \ diff --git a/recipes/devel/sandbox.yaml b/recipes/devel/sandbox.yaml index 16cc774a..1e864c8c 100644 --- a/recipes/devel/sandbox.yaml +++ b/recipes/devel/sandbox.yaml @@ -47,8 +47,8 @@ depends: - name: devel::cross-toolchain environment: - AUTOCONF_TARGET: "${SANDBOX_AUTOCONF_TARGET:-x86_64-bob-linux-gnu}" - ARCH: "${SANDBOX_ARCH:-x86_64}" + AUTOCONF_TARGET: "${SANDBOX_AUTOCONF_HOST:-$(gen-autoconf,bob)}" + ARCH: "${SANDBOX_ARCH:-$(host-arch)}" GCC_LIBC: glibc BASEMENT_OPTIMIZE: "s" BASEMENT_DEBUG: "0" diff --git a/tests/cross-platform/recipes/cmake/greeter.yaml b/tests/cross-platform/recipes/cmake/greeter.yaml index f0654267..7c75264d 100644 --- a/tests/cross-platform/recipes/cmake/greeter.yaml +++ b/tests/cross-platform/recipes/cmake/greeter.yaml @@ -1,11 +1,5 @@ inherit: [ "basement::rootrecipe", cmake ] -environment: - SANDBOX_AUTOCONF_HOST: "aarch64-bob-linux-gnu" - SANDBOX_AUTOCONF_BUILD: "aarch64-bob-linux-gnu" - SANDBOX_AUTOCONF_TARGET: "aarch64-bob-linux-gnu" - SANDBOX_ARCH: "arm64" - checkoutSCM: scm: import url: src/greeter/ @@ -45,6 +39,6 @@ multiPackage: # this is just an example how to use this sandbox inside a recipe SANDBOX_AUTOCONF_HOST: "aarch64-bob-linux-gnu" SANDBOX_AUTOCONF_BUILD: "aarch64-bob-linux-gnu" - SANDBOX_AUTOCONF_TARGET: "aarch64-bob-linux-gnu" + SANDBOX_AUTOCONF_TARGET: "aarch64-bob_compat-linux-gnu" SANDBOX_ARCH: "arm64" depends: *cross From 83dcb5d702e0bb506a1576f2f4b42389611e7650 Mon Sep 17 00:00:00 2001 From: Martin Haase Date: Thu, 15 Jul 2021 08:34:08 +0200 Subject: [PATCH 21/26] classes/cmake added sysroot to find_root_paths --- classes/cmake.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/classes/cmake.yaml b/classes/cmake.yaml index 1020fc38..afe64ac0 100644 --- a/classes/cmake.yaml +++ b/classes/cmake.yaml @@ -11,6 +11,9 @@ buildSetup: | [[ "$AUTOCONF_BUILD" == *-msys ]] && i="$(cygpath -m $i)" CMAKE_FIND_ROOT_PATH+="${CMAKE_FIND_ROOT_PATH:+;}$i" done + # We should also add the sysroot path if available. + SYSROOT="$($CXX -print-sysroot)" + [ -z "${SYSROOT:+true}" ] || CMAKE_FIND_ROOT_PATH+=";${SYSROOT}" # It is necessary to add the sysroot path of gcc/g++ if available too # because our host-compat-toolchain has a non-standard sysroot @@ -146,6 +149,7 @@ buildSetup: | -DCMAKE_BUILD_TYPE=Bob \ -DCMAKE_INSTALL_PREFIX="$CMAKE_INSTALL_PREFIX" \ -DCMAKE_INSTALL_SYSCONFDIR="$CMAKE_INSTALL_SYSCONFDIR" \ + -DCMAKE_INSTALL_LIBDIR="lib" \ -DBUILD_SHARED_LIBS=$BUILD_SHARED_LIBS \ -DCMAKE_MSVC_RUNTIME_LIBRARY="" \ "${@:2}" From 8cd54bc0582c73ca18dea3eb4bd994e89d1a7808 Mon Sep 17 00:00:00 2001 From: "Martin Haase (FDTech)" Date: Mon, 26 Jul 2021 12:29:35 +0200 Subject: [PATCH 22/26] classes/cmake: add sysroot just for gcc/g++ --- classes/cmake.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/classes/cmake.yaml b/classes/cmake.yaml index afe64ac0..aafad287 100644 --- a/classes/cmake.yaml +++ b/classes/cmake.yaml @@ -11,8 +11,10 @@ buildSetup: | [[ "$AUTOCONF_BUILD" == *-msys ]] && i="$(cygpath -m $i)" CMAKE_FIND_ROOT_PATH+="${CMAKE_FIND_ROOT_PATH:+;}$i" done - # We should also add the sysroot path if available. - SYSROOT="$($CXX -print-sysroot)" + # We should also add the sysroot path of gcc/g++ if available. + if[[ "$CXX" == *"g++" ]] ; then + SYSROOT="$($CXX -print-sysroot)" + fi [ -z "${SYSROOT:+true}" ] || CMAKE_FIND_ROOT_PATH+=";${SYSROOT}" # It is necessary to add the sysroot path of gcc/g++ if available too From 671e671383aa9fba2da09d8410e281ebbfa7a4bb Mon Sep 17 00:00:00 2001 From: "Martin Haase (FDTech)" Date: Mon, 26 Jul 2021 14:02:37 +0200 Subject: [PATCH 23/26] classes/cmake: fixed bash if syntax --- classes/cmake.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/cmake.yaml b/classes/cmake.yaml index aafad287..a32a02f9 100644 --- a/classes/cmake.yaml +++ b/classes/cmake.yaml @@ -12,7 +12,7 @@ buildSetup: | CMAKE_FIND_ROOT_PATH+="${CMAKE_FIND_ROOT_PATH:+;}$i" done # We should also add the sysroot path of gcc/g++ if available. - if[[ "$CXX" == *"g++" ]] ; then + if [[ "$CXX" == *"g++" ]] ; then SYSROOT="$($CXX -print-sysroot)" fi [ -z "${SYSROOT:+true}" ] || CMAKE_FIND_ROOT_PATH+=";${SYSROOT}" From 213db2560a99400cf08c50a2abdefbe59fb96aa2 Mon Sep 17 00:00:00 2001 From: "Martin Haase (FDTech)" Date: Fri, 3 Jun 2022 09:00:33 +0200 Subject: [PATCH 24/26] cleanup and rebase with master --- classes/basement/rootrecipe.yaml | 2 +- classes/cmake.yaml | 5 ----- classes/sandbox.yaml | 3 +++ recipes/devel/sandbox.yaml | 4 ---- 4 files changed, 4 insertions(+), 10 deletions(-) diff --git a/classes/basement/rootrecipe.yaml b/classes/basement/rootrecipe.yaml index 5ee590a5..695247e5 100644 --- a/classes/basement/rootrecipe.yaml +++ b/classes/basement/rootrecipe.yaml @@ -6,7 +6,7 @@ depends: depends: # Setup sandbox with corresponding toolchain - name: devel::sandbox - use: [sandbox, environment] + use: [sandbox] forward: True - name: devel::sandbox-toolchain use: [environment, tools] diff --git a/classes/cmake.yaml b/classes/cmake.yaml index a32a02f9..babc502a 100644 --- a/classes/cmake.yaml +++ b/classes/cmake.yaml @@ -11,11 +11,6 @@ buildSetup: | [[ "$AUTOCONF_BUILD" == *-msys ]] && i="$(cygpath -m $i)" CMAKE_FIND_ROOT_PATH+="${CMAKE_FIND_ROOT_PATH:+;}$i" done - # We should also add the sysroot path of gcc/g++ if available. - if [[ "$CXX" == *"g++" ]] ; then - SYSROOT="$($CXX -print-sysroot)" - fi - [ -z "${SYSROOT:+true}" ] || CMAKE_FIND_ROOT_PATH+=";${SYSROOT}" # It is necessary to add the sysroot path of gcc/g++ if available too # because our host-compat-toolchain has a non-standard sysroot diff --git a/classes/sandbox.yaml b/classes/sandbox.yaml index 54667302..73c6afe1 100644 --- a/classes/sandbox.yaml +++ b/classes/sandbox.yaml @@ -71,4 +71,7 @@ provideSandbox: mount: - "/etc/resolv.conf" - "/dev/pts" + environment: + AUTOCONF_HOST: "${SANDBOX_AUTOCONF_HOST:-${AUTOCONF_HOST}}" + AUTOCONF_BUILD: "${SANDBOX_AUTOCONF_BUILD:-${AUTOCONF_BUILD}}" diff --git a/recipes/devel/sandbox.yaml b/recipes/devel/sandbox.yaml index 1e864c8c..ced3db45 100644 --- a/recipes/devel/sandbox.yaml +++ b/recipes/devel/sandbox.yaml @@ -90,7 +90,3 @@ depends: depends: - devel::binutils - devel::gcc-native - -provideVars: - AUTOCONF_HOST: "${SANDBOX_AUTOCONF_HOST:-${AUTOCONF_HOST}}" - AUTOCONF_BUILD: "${SANDBOX_AUTOCONF_BUILD:-${AUTOCONF_BUILD}}" From 549193b22108b00b422ddb0975fc7dd42a7295db Mon Sep 17 00:00:00 2001 From: "Martin Haase (FDTech)" Date: Fri, 3 Jun 2022 09:20:09 +0200 Subject: [PATCH 25/26] fixed wrong rebasement fixes --- recipes/devel/git.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/devel/git.yaml b/recipes/devel/git.yaml index 22bac512..24449e4c 100644 --- a/recipes/devel/git.yaml +++ b/recipes/devel/git.yaml @@ -21,7 +21,7 @@ checkoutSCM: digestSHA1: "851537fc03f5a99419ef20e9b836de965c7928bd" extract: False -buildTools: [target-toolchain, host-toolchain] +buildTools: [target-toolchain, curl, host-toolchain] buildVars: [PKG_VERSION, AUTOCONF_HOST, AUTOCONF_BUILD, CC, CPPFLAGS, CFLAGS, LDFLAGS] buildScript: | From 1b3f8b1c972353d55178197cf8042b82d18c6ccf Mon Sep 17 00:00:00 2001 From: "Martin Haase (FDTech)" Date: Fri, 3 Jun 2022 13:44:55 +0200 Subject: [PATCH 26/26] devel/git: add cross-compilation support .FIXES #142 --- recipes/devel/git.yaml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/recipes/devel/git.yaml b/recipes/devel/git.yaml index 18219490..cf7f4713 100644 --- a/recipes/devel/git.yaml +++ b/recipes/devel/git.yaml @@ -21,13 +21,20 @@ checkoutSCM: digestSHA1: "851537fc03f5a99419ef20e9b836de965c7928bd" extract: False -buildTools: [target-toolchain, curl] -buildVars: [PKG_VERSION, AUTOCONF_HOST, - CPPFLAGS, CFLAGS, LDFLAGS] +buildTools: [target-toolchain, curl, host-toolchain] +buildVars: [PKG_VERSION, AUTOCONF_HOST, AUTOCONF_BUILD, + CC, CPPFLAGS, CFLAGS, LDFLAGS] buildScript: | export CFLAGS="-I${BOB_DEP_PATHS[libs::zlib-dev]}/usr/include -I${BOB_DEP_PATHS[libs::openssl-dev]}/usr/include" export LDFLAGS="-L${BOB_DEP_PATHS[libs::zlib-dev]}/usr/lib -L${BOB_DEP_PATHS[libs::openssl-dev]}/usr/lib -Wl,-rpath-link=${BOB_DEP_PATHS[libs::zlib-dev]}/usr/lib -Wl,-rpath-link=${BOB_DEP_PATHS[libs::openssl-dev]}/usr/lib" + EXTRA=( ) + if [[ "${AUTOCONF_BUILD:-unknown}" != "${AUTOCONF_HOST:-${AUTOCONF_BUILD:-unknown}}" ]]; then + export ac_cv_fread_reads_directories=yes + export ac_cv_snprintf_returns_bogus=no + EXTRA+=( "--build=${AUTOCONF_BUILD}" ) + fi + mkdir -p install tar -xf $1/git-${PKG_VERSION}.tar.xz @@ -36,7 +43,8 @@ buildScript: | --prefix=/usr \ --with-curl=${BOB_DEP_PATHS[net::curl-dev]}/usr \ --without-python \ - --without-expat + --without-expat \ + ${EXTRA:+${EXTRA[@]}} makeParallel make DESTDIR=${PWD}/../install install popd