From 46f54789910cf5b79af0329f8102b70ac64eaf76 Mon Sep 17 00:00:00 2001 From: Geoff Levand Date: Wed, 1 Apr 2015 10:58:57 -0700 Subject: [PATCH 1/2] setup_board: Fix hard coded symbol path commit 03e8d451bf7d5dc66994ccdc90af39e6128689e5 (setup_board: setup gdb wrapper and debug symbol path) added hard coded paths for the symbol path. Change those to use the BOARD_ROOT variable. Signed-off-by: Geoff Levand --- setup_board | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup_board b/setup_board index 7f783b74f7..ad9d65a6be 100755 --- a/setup_board +++ b/setup_board @@ -265,7 +265,7 @@ sudo cp /etc/portage/repos.conf/* "${BOARD_ETC}"/portage/repos.conf/ # make it easy to find debug symbols sudo mkdir -p /usr/lib/debug/build -sudo ln -sfT /build/amd64-usr/usr/lib/debug /usr/lib/debug/build/amd64-usr +sudo ln -sfT ${BOARD_ROOT}/usr/lib/debug /usr/lib/debug/${BOARD_ROOT} generate_all_wrappers From ea6cf50b8df53c662018f5668073819475163623 Mon Sep 17 00:00:00 2001 From: Geoff Levand Date: Wed, 1 Apr 2015 10:58:57 -0700 Subject: [PATCH 2/2] toolchain_util.sh: Fix _configure_sysroot CBUILD The portage CBUILD and HOSTCC variables need to be set to the SDK host to get a proper cross build when building target binaries. Change _configure_sysroot to use the CBUILD environment variable to set the CBUILD and HOSTCC variables of ${ROOT}/etc/portage/make.conf. Also, fix up all calls to _configure_sysroot to set the CBUILD environment variable. Fixes setup_board failure when the host and target architectures differ. Signed-off-by: Geoff Levand [marineam: fixed a copy/paste error] --- build_library/catalyst_toolchains.sh | 3 ++- build_library/toolchain_util.sh | 8 ++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/build_library/catalyst_toolchains.sh b/build_library/catalyst_toolchains.sh index 32b16b48b7..4106b6af42 100644 --- a/build_library/catalyst_toolchains.sh +++ b/build_library/catalyst_toolchains.sh @@ -16,7 +16,8 @@ configure_target_root() { local cross_chost=$(get_board_chost "$1") local profile=$(get_board_profile "${board}") - CHOST="${cross_chost}" \ + CBUILD="$(portageq envvar CBUILD)" \ + CHOST="${cross_chost}" \ ROOT="/build/${board}" \ SYSROOT="/usr/${cross_chost}" \ _configure_sysroot "${profile}" diff --git a/build_library/toolchain_util.sh b/build_library/toolchain_util.sh index 87e5a25df4..388a7c58fa 100644 --- a/build_library/toolchain_util.sh +++ b/build_library/toolchain_util.sh @@ -187,7 +187,8 @@ _get_dependency_list() { # Configure a new ROOT # Values are copied from the environment or the current host configuration. -# Usage: ROOT=/foo/bar SYSROOT=/foo/bar configure_portage coreos:some/profile +# Usage: CBUILD=foo-bar-linux-gnu ROOT=/foo/bar SYSROOT=/foo/bar configure_portage coreos:some/profile +# Note: if using portageq to get CBUILD it must be called before CHOST is set. _configure_sysroot() { local profile="$1" @@ -279,7 +280,10 @@ install_cross_libs() { sudo="sudo -E" fi - CHOST="${cross_chost}" ROOT="$ROOT" SYSROOT="$ROOT" \ + CBUILD="$(portageq envvar CBUILD)" \ + CHOST="${cross_chost}" \ + ROOT="$ROOT" \ + SYSROOT="$ROOT" \ _configure_sysroot "${CROSS_PROFILES[${cross_chost}]}" # In order to get a dependency list we must calculate it before