Updated building framework
This commit is contained in:
parent
8449cf65b5
commit
4a9365f57a
8 changed files with 175 additions and 52 deletions
build/targets
|
@ -14,57 +14,37 @@ build_gdb() {
|
|||
fetch "$GIT_BINUTILS_GDB" "${BUILD_DIRECTORY}/binutils-gdb" git
|
||||
cd "${BUILD_DIRECTORY}/binutils-gdb/" || { echo "Cannot cd to ${BUILD_DIRECTORY}/binutils-gdb/"; exit 1; }
|
||||
git clean -fdx
|
||||
git checkout gdb-9.2-release
|
||||
git checkout gdb-10.1-release
|
||||
|
||||
CMD="CFLAGS=\"${GCC_OPTS}\" "
|
||||
CMD+="CXXFLAGS=\"${GXX_OPTS}\" "
|
||||
CMD+="LDFLAGS=\"-static -pthread\" "
|
||||
if [ "$CURRENT_ARCH" != "x86" ] && [ "$CURRENT_ARCH" != "x86_64" ];then
|
||||
CMD+="LDFLAGS=\"-static\" "
|
||||
if [ "$CURRENT_ARCH" != "x86_64" ];then
|
||||
CMD+="CC_FOR_BUILD=\"/x86_64-linux-musl-cross/bin/x86_64-linux-musl-gcc\" "
|
||||
CMD+="CPP_FOR_BUILD=\"/x86_64-linux-musl-cross/bin/x86_64-linux-musl-g++\" "
|
||||
fi
|
||||
CMD+="${BUILD_DIRECTORY}/binutils-gdb/configure --target=$(get_host_triple) --host=x86_64-unknown-linux-musl "
|
||||
CMD+="--disable-shared --enable-static"
|
||||
CMD+="${BUILD_DIRECTORY}/binutils-gdb/configure --build=x86_64-linux-musl --host=$(get_host_triple) "
|
||||
CMD+="--disable-shared --enable-static --enable-gdbserver --disable-nls"
|
||||
|
||||
GDB_CMD="${CMD} --disable-interprocess-agent"
|
||||
|
||||
cd "${BUILD_DIRECTORY}/binutils-gdb/"
|
||||
mkdir build
|
||||
cd build
|
||||
eval "$GDB_CMD"
|
||||
ls -la
|
||||
|
||||
cd "${BUILD_DIRECTORY}/binutils-gdb/"
|
||||
MAKE_PROG="${MAKE-make}"
|
||||
MAKE="${MAKE_PROG} AR=true LINK=true"
|
||||
export MAKE
|
||||
${MAKE} $* all-libiberty
|
||||
${MAKE} $* all-intl
|
||||
${MAKE} $* all-bfd
|
||||
cd binutils
|
||||
MAKE="${MAKE_PROG}"
|
||||
export MAKE
|
||||
${MAKE} $* ar_DEPENDENCIES= ar_LDADD='../bfd/*.o ../libiberty/*.o `if test -f ../intl/gettext.o; then echo '../intl/*.o'; fi`' ar
|
||||
ls -la
|
||||
cp ar /usr/bin
|
||||
|
||||
cd "${BUILD_DIRECTORY}/binutils-gdb/build"
|
||||
mkdir -p "${BUILD_DIRECTORY}/gdb_build"
|
||||
cd "${BUILD_DIRECTORY}/gdb_build/"
|
||||
eval "$CMD"
|
||||
make -j4
|
||||
|
||||
strip "${BUILD_DIRECTORY}/binutils-gdb/gdb/gdb" "${BUILD_DIRECTORY}/binutils-gdb/gdb/gdbserver/gdbserver"
|
||||
strip "${BUILD_DIRECTORY}/gdb_build/gdb/gdb" "${BUILD_DIRECTORY}/gdb_build/gdbserver/gdbserver"
|
||||
}
|
||||
|
||||
main() {
|
||||
build_gdb
|
||||
if [ ! -f "${BUILD_DIRECTORY}/binutils-gdb/gdb/gdb" ] || \
|
||||
[ ! -f "${BUILD_DIRECTORY}/binutils-gdb/gdb/gdbserver/gdbserver" ];then
|
||||
if [ ! -f "${BUILD_DIRECTORY}/gdb_build/gdb/gdb" ] || \
|
||||
[ ! -f "${BUILD_DIRECTORY}/gdb_build/gdbserver/gdbserver" ];then
|
||||
echo "[-] Building GDB ${CURRENT_ARCH} failed!"
|
||||
exit 1
|
||||
fi
|
||||
GDB_VERSION=$(get_version "${BUILD_DIRECTORY}/binutils-gdb/gdb/gdb --version |head -n1 |awk '{print \$4}'")
|
||||
GDBSERVER_VERSION=$(get_version "${BUILD_DIRECTORY}/binutils-gdb/gdb/gdbserver/gdbserver --version |head -n1 |awk '{print \$4}'")
|
||||
cp "${BUILD_DIRECTORY}/binutils-gdb/gdb/gdb" "${OUTPUT_DIRECTORY}/gdb${GDB_VERSION}"
|
||||
cp "${BUILD_DIRECTORY}/binutils-gdb/gdb/gdbserver/gdbserver" "${OUTPUT_DIRECTORY}/gdbserver${GDBSERVER_VERSION}"
|
||||
GDB_VERSION=$(get_version "${BUILD_DIRECTORY}/gdb_build/gdb/gdb --version |head -n1 |awk '{print \$4}'")
|
||||
GDBSERVER_VERSION=$(get_version "${BUILD_DIRECTORY}/gdb_build/gdbserver/gdbserver --version |head -n1 |awk '{print \$4}'")
|
||||
cp "${BUILD_DIRECTORY}/gdb_build/gdb/gdb" "${OUTPUT_DIRECTORY}/gdb${GDB_VERSION}"
|
||||
cp "${BUILD_DIRECTORY}/gdb_build/gdbserver/gdbserver" "${OUTPUT_DIRECTORY}/gdbserver${GDBSERVER_VERSION}"
|
||||
echo "[+] Finished building GDB ${CURRENT_ARCH}"
|
||||
|
||||
echo ::set-output name=PACKAGED_NAME::"gdb${GDB_VERSION}"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue