From 885534ec824a98b40ca75711a3083e5c307de0a7 Mon Sep 17 00:00:00 2001 From: takeshix Date: Mon, 19 Apr 2021 13:34:06 +0200 Subject: [PATCH] Updated GDB build script --- .github/workflows/build-gdb.yml | 57 ++++----------------------------- build/targets/build_gdb.sh | 12 ++++--- 2 files changed, 15 insertions(+), 54 deletions(-) diff --git a/.github/workflows/build-gdb.yml b/.github/workflows/build-gdb.yml index 44771b4..d6cc2c5 100644 --- a/.github/workflows/build-gdb.yml +++ b/.github/workflows/build-gdb.yml @@ -15,20 +15,10 @@ jobs: run: sudo apk update && sudo apk add bash && sudo bash build/install_deps_alpine.sh - name: Install build compiler - run: /bin/sh -c "cd / && curl -so ${ARCH}-cross.tgz ${HOST}/${ARCH}-cross.tgz && tar -xf ${ARCH}-cross.tgz && rm ${ARCH}-cross.tgz && cd ${ARCH}-cross" - env: - ARCH: x86_64-linux-musl - HOST: http://musl.cc/ - TEMP: /tmp - USER: 0 + run: $GITHUB_WORKSPACE/02_install_build_compiler.sh x86_64 - name: Install dependencies workaround - run: /bin/sh -c "cd / && curl -so ${ARCH}-cross.tgz ${HOST}/${ARCH}-cross.tgz && tar -xf ${ARCH}-cross.tgz && rm ${ARCH}-cross.tgz && cd ${ARCH}-cross" - env: - ARCH: i686-linux-musl - HOST: http://musl.cc/ - TEMP: /tmp - USER: 0 + run: $GITHUB_WORKSPACE/02_install_build_compiler.sh i686 - name: Build GDB id: build_gdb @@ -54,20 +44,7 @@ jobs: run: sudo apk update && sudo apk add bash && sudo bash build/install_deps_alpine.sh - name: Install build compiler - run: /bin/sh -c "cd / && curl -so ${ARCH}-cross.tgz ${HOST}/${ARCH}-cross.tgz && tar -xf ${ARCH}-cross.tgz && rm ${ARCH}-cross.tgz && cd ${ARCH}-cross" - env: - ARCH: x86_64-linux-musl - HOST: http://musl.cc/ - TEMP: /tmp - USER: 0 - - - name: Install dependencies workaround - run: /bin/sh -c "cd / && curl -so ${ARCH}-cross.tgz ${HOST}/${ARCH}-cross.tgz && tar -xf ${ARCH}-cross.tgz && rm ${ARCH}-cross.tgz && cd ${ARCH}-cross" - env: - ARCH: x86_64-linux-musl - HOST: http://musl.cc/ - TEMP: /tmp - USER: 0 + run: $GITHUB_WORKSPACE/02_install_build_compiler.sh x86_64 - name: Build GDB id: build_gdb @@ -94,20 +71,10 @@ jobs: run: sudo apk update && sudo apk add bash && sudo bash build/install_deps_alpine.sh - name: Install build compiler - run: /bin/sh -c "cd / && curl -so ${ARCH}-cross.tgz ${HOST}/${ARCH}-cross.tgz && tar -xf ${ARCH}-cross.tgz && rm ${ARCH}-cross.tgz && cd ${ARCH}-cross" - env: - ARCH: x86_64-linux-musl - HOST: http://musl.cc/ - TEMP: /tmp - USER: 0 + run: $GITHUB_WORKSPACE/02_install_build_compiler.sh x86_64 - name: Install dependencies workaround - run: /bin/sh -c "cd / && curl -so ${ARCH}-cross.tgz ${HOST}/${ARCH}-cross.tgz && tar -xf ${ARCH}-cross.tgz && rm ${ARCH}-cross.tgz && cd ${ARCH}-cross" - env: - ARCH: arm-linux-musleabihf - HOST: http://musl.cc/ - TEMP: /tmp - USER: 0 + run: $GITHUB_WORKSPACE/02_install_build_compiler.sh arm - name: Build gdb id: build_gdb @@ -134,20 +101,10 @@ jobs: run: sudo apk update && sudo apk add bash && sudo bash build/install_deps_alpine.sh - name: Install build compiler - run: /bin/sh -c "cd / && curl -so ${ARCH}-cross.tgz ${HOST}/${ARCH}-cross.tgz && tar -xf ${ARCH}-cross.tgz && rm ${ARCH}-cross.tgz && cd ${ARCH}-cross" - env: - ARCH: x86_64-linux-musl - HOST: http://musl.cc/ - TEMP: /tmp - USER: 0 + run: $GITHUB_WORKSPACE/02_install_build_compiler.sh x86_64 - name: Install dependencies workaround - run: /bin/sh -c "cd / && curl -so ${ARCH}-cross.tgz ${HOST}/${ARCH}-cross.tgz && tar -xf ${ARCH}-cross.tgz && rm ${ARCH}-cross.tgz && cd ${ARCH}-cross" - env: - ARCH: aarch64-linux-musl - HOST: http://musl.cc/ - TEMP: /tmp - USER: 0 + run: $GITHUB_WORKSPACE/02_install_build_compiler.sh aarch64 - name: Patch headers run: | diff --git a/build/targets/build_gdb.sh b/build/targets/build_gdb.sh index 47d47fa..e8cb4bb 100755 --- a/build/targets/build_gdb.sh +++ b/build/targets/build_gdb.sh @@ -1,12 +1,16 @@ #!/bin/bash -set -e -set -o pipefail -set -x +if [ -z "$GITHUB_WORKSPACE" ];then + echo "GITHUB_WORKSPACE environemnt variable not set!" + exit 1 +fi if [ "$#" -ne 1 ];then echo "Usage: ${0} [x86|x86_64|armhf|aarch64]" echo "Example: ${0} x86_64" exit 1 fi +set -e +set -o pipefail +set -x source $GITHUB_WORKSPACE/build/lib.sh init_lib $1 @@ -24,7 +28,7 @@ build_gdb() { CMD+="CPP_FOR_BUILD=\"/x86_64-linux-musl-cross/bin/x86_64-linux-musl-g++\" " fi CMD+="${BUILD_DIRECTORY}/binutils-gdb/configure --build=x86_64-linux-musl --host=$(get_host_triple) " - CMD+="--disable-shared --enable-static --enable-gdbserver --disable-nls" + CMD+="--disable-shared --enable-static --enable-gdbserver --disable-nls --disable-inprocess-agent" mkdir -p "${BUILD_DIRECTORY}/gdb_build" cd "${BUILD_DIRECTORY}/gdb_build/"