aboutsummaryrefslogtreecommitdiffstats
path: root/.github/workflows
diff options
context:
space:
mode:
authorChristian Marangi <ansuelsmth@gmail.com>2022-12-05 23:23:04 +0100
committerChristian Marangi <ansuelsmth@gmail.com>2022-12-06 23:46:13 +0100
commit42f0ab028e2eae0d4e7acf9db7fd68b256f23503 (patch)
treebf6d97dc870ee8e46aa579fc1104cbbe8b34c263 /.github/workflows
parent6cee46def01a0d51d1fb003d92e0840f87aa8822 (diff)
downloadupstream-42f0ab028e2eae0d4e7acf9db7fd68b256f23503.tar.gz
upstream-42f0ab028e2eae0d4e7acf9db7fd68b256f23503.tar.bz2
upstream-42f0ab028e2eae0d4e7acf9db7fd68b256f23503.zip
CI: build: fix use of sdk as toolchain
The toolchain included in a sdk have a different format than an external toolchain tar. Since sdk is a more integrated setup doesn't use and include wrapper bin that use the external toolchain config and use an alternative and more standard way to include all the toolchain headers. External toolchain use wrapper.sh to append the configured include header when each tool is called. Fix the sdk toolchain by reverting their own sdk wrapper scripts and to simulate an external toolchain build copying what is done in the toolchain target makefile. This handle compilation error and warning caused by not using fortify header on building packages. Fixes: 006e52545d14 ("CI: build: add support to fallback to sdk for external toolchain") Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Diffstat (limited to '.github/workflows')
-rw-r--r--.github/workflows/build.yml28
1 files changed, 28 insertions, 0 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 115bf2c654..43f30617d8 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -266,6 +266,34 @@ jobs:
--overwrite-config \
--config ${{ env.TARGET }}/${{ env.SUBTARGET }}
+ - name: Adapt external sdk to external toolchain format
+ if: inputs.build_toolchain == false && steps.parse-toolchain.outputs.toolchain-type == 'external_sdk'
+ shell: su buildbot -c "sh -e {0}"
+ working-directory: openwrt
+ run: |
+ TOOLCHAIN_DIR=${{ env.TOOLCHAIN_FILE }}/staging_dir/$(ls ${{ env.TOOLCHAIN_FILE }}/staging_dir | grep toolchain)
+ TOOLCHAIN_BIN=$TOOLCHAIN_DIR/bin
+ OPENWRT_DIR=$(pwd)
+
+ # Find target name from toolchain info.mk
+ GNU_TARGET_NAME=$(cat $TOOLCHAIN_DIR/info.mk | grep TARGET_CROSS | sed 's/^TARGET_CROSS=\(.*\)-$/\1/')
+
+ cd $TOOLCHAIN_BIN
+
+ # Revert sdk wrapper scripts applied to all the bins
+ for app in $(find . -name "*.bin"); do
+ TARGET_APP=$(echo $app | sed 's/\.\/\.\(.*\)\.bin/\1/')
+ rm $TARGET_APP
+ mv .$TARGET_APP.bin $TARGET_APP
+ done
+
+ # Setup the wrapper script in the sdk toolchain dir simulating an external toolchain build
+ cp $OPENWRT_DIR/target/toolchain/files/wrapper.sh $GNU_TARGET_NAME-wrapper.sh
+ for app in cc gcc g++ c++ cpp ld as ; do
+ [ -f $GNU_TARGET_NAME-$app ] && mv $GNU_TARGET_NAME-$app $GNU_TARGET_NAME-$app.bin
+ ln -sf $GNU_TARGET_NAME-wrapper.sh $GNU_TARGET_NAME-$app
+ done
+
- name: Configure external toolchain with sdk
if: inputs.build_toolchain == false && steps.parse-toolchain.outputs.toolchain-type == 'external_sdk'
shell: su buildbot -c "sh -e {0}"