Skip to content

Commit

Permalink
Updated GDB build script
Browse files Browse the repository at this point in the history
  • Loading branch information
takeshixx committed Apr 19, 2021
1 parent 7facf8d commit 885534e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 54 deletions.
57 changes: 7 additions & 50 deletions .github/workflows/build-gdb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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: |
Expand Down
12 changes: 8 additions & 4 deletions build/targets/build_gdb.sh
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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/"
Expand Down

0 comments on commit 885534e

Please sign in to comment.