From 298b71e7c2deaafd0824742dad54c11a3c505d50 Mon Sep 17 00:00:00 2001 From: Evgeny Ermakov Date: Wed, 10 Mar 2021 23:26:08 +1100 Subject: [PATCH 1/3] gdb: clean up Also added build option for Guile. --- srcpkgs/gdb-common | 1 + srcpkgs/gdb/patches/gdb-mips-linux-nat.patch | 11 ++++ srcpkgs/gdb/template | 63 +++++++++----------- 3 files changed, 41 insertions(+), 34 deletions(-) create mode 120000 srcpkgs/gdb-common create mode 100644 srcpkgs/gdb/patches/gdb-mips-linux-nat.patch diff --git a/srcpkgs/gdb-common b/srcpkgs/gdb-common new file mode 120000 index 000000000000..f3e03e3f1a44 --- /dev/null +++ b/srcpkgs/gdb-common @@ -0,0 +1 @@ +gdb \ No newline at end of file diff --git a/srcpkgs/gdb/patches/gdb-mips-linux-nat.patch b/srcpkgs/gdb/patches/gdb-mips-linux-nat.patch new file mode 100644 index 000000000000..ec4e9c2666f5 --- /dev/null +++ b/srcpkgs/gdb/patches/gdb-mips-linux-nat.patch @@ -0,0 +1,11 @@ +--- a/gdb/mips-linux-nat.c ++++ b/gdb/mips-linux-nat.c +@@ -31,7 +31,7 @@ + #include "gdb_proc_service.h" + #include "gregset.h" + +-#include ++#include + #include "nat/gdb_ptrace.h" + #include + #include "inf-ptrace.h" diff --git a/srcpkgs/gdb/template b/srcpkgs/gdb/template index 64787a9ade34..f8feba70f125 100644 --- a/srcpkgs/gdb/template +++ b/srcpkgs/gdb/template @@ -1,36 +1,45 @@ # Template file for 'gdb' pkgname=gdb version=10.1 -revision=3 +revision=4 build_style=gnu-configure pycompile_dirs="/usr/share/gdb/python" configure_args="--disable-werror --disable-nls --with-system-readline --with-system-gdbinit=/etc/gdb/gdbinit --with-system-zlib $(vopt_enable gdbserver) $(vopt_if static 'CFLAGS=-static CXXFLAGS=-static LDFLAGS=-static') - $(vopt_if python --with-python=/usr/bin/python3) + $(vopt_with guile) $(vopt_if python --with-python=/usr/bin/python3) $(vopt_with debuginfod)" -hostmakedepends="texinfo perl pkg-config $(vopt_if python python3-devel)" -makedepends="ncurses-devel zlib-devel readline-devel expat-devel - $(vopt_if python 'python3-devel gettext-devel') - $(vopt_if debuginfod elfutils-devel)" +hostmakedepends="pkg-config texinfo $(vopt_if python python3-devel) $(vopt_if guile guile)" +makedepends="expat-devel ncurses-devel readline-devel zlib-devel $(vopt_if guile guile-devel) + $(vopt_if python 'python3-devel gettext-devel') $(vopt_if debuginfod elfutils-devel)" +depends="gdb-common>=${version}_${revision}" +checkdepends="dejagnu" short_desc="GNU Debugger" maintainer="Anthony Iliopoulos " license="GPL-3.0-or-later" -homepage="https://www.gnu.org/software/gdb/" -distfiles="${GNU_SITE}/${pkgname}/${pkgname}-${version}.tar.xz" +homepage="https://www.gnu.org/software/gdb" +distfiles="${GNU_SITE}/gdb/gdb-${version}.tar.xz" checksum=f82f1eceeec14a3afa2de8d9b0d3c91d5a3820e23e0a01bbb70ef9f0276b62c0 +make_check=extended # Tests take too long, not all of them pass. python_version=3 patch_args="-Np1" +ignore_elf_files=" + /usr/share/gdb/guile/gdb/support.go + /usr/share/gdb/guile/gdb/experimental.go + /usr/share/gdb/guile/gdb/iterator.go + /usr/share/gdb/guile/gdb/types.go + /usr/share/gdb/guile/gdb/printing.go + /usr/share/gdb/guile/gdb.go" if [ "${CROSS_BUILD}" ]; then # Make python3.x detection work in cross builds CFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}" CXXFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}" + makedepends+=" libatomic_ops-devel" # guile fi -CFLAGS+=" -fcommon" -CXXFLAGS+=" -fcommon" + # Package build options -build_options="gdbserver static python debuginfod" +build_options="debuginfod gdbserver guile python static" desc_option_gdbserver="Enable support for building GDB server" desc_option_debuginfod="Enable support for libdebuginfod" # Enable gdbserver if !static. @@ -38,28 +47,14 @@ build_options_default="gdbserver python debuginfod" # Both options cannot be enabled at the same time vopt_conflict gdbserver static -post_extract() { - vsed -i 's,sgidefs.h,asm/sgidefs.h,' gdb/mips-linux-nat.c - mkdir -p build -} -do_configure() { - cd build - ../configure ${configure_args/with-sysroot/with-build-sysroot} \ - CFLAGS_FOR_BUILD="${CFLAGS_FOR_BUILD} -fcommon" - export gl_cv_func_gettimeofday_clobber=no - export gl_cv_func_working_strerror=yes - export gl_cv_func_strerror_0_works=yes -} -do_build() { - cd build - make ${makejobs} all -} -do_install() { - cd build - make DESTDIR=${DESTDIR} ${makejobs} install +post_install() { # resolve conflicts with binutils - rm -rf ${DESTDIR}/usr/{include,lib,lib64} - for f in bfd configure standards; do - rm -f ${DESTDIR}/usr/share/info/${f}.info* - done + rm -r ${DESTDIR}/usr/{include,lib,share/info/bfd.info*} +} + +gdb-common_package() { + short_desc+=" - common files" + pkg_install() { + vmove usr/share + } } From fee272a313cd4d3df6f51ab296adbeaa079d9eee Mon Sep 17 00:00:00 2001 From: Evgeny Ermakov Date: Thu, 11 Mar 2021 01:12:29 +1100 Subject: [PATCH 2/3] avr-gdb: clean up --- .../avr-gdb/patches/gdb-mips-linux-nat.patch | 11 +++ srcpkgs/avr-gdb/template | 73 ++++--------------- 2 files changed, 27 insertions(+), 57 deletions(-) create mode 100644 srcpkgs/avr-gdb/patches/gdb-mips-linux-nat.patch diff --git a/srcpkgs/avr-gdb/patches/gdb-mips-linux-nat.patch b/srcpkgs/avr-gdb/patches/gdb-mips-linux-nat.patch new file mode 100644 index 000000000000..54191222f4a6 --- /dev/null +++ b/srcpkgs/avr-gdb/patches/gdb-mips-linux-nat.patch @@ -0,0 +1,11 @@ +--- gdb/mips-linux-nat.c.orig ++++ gdb/mips-linux-nat.c +@@ -31,7 +31,7 @@ + #include "gdb_proc_service.h" + #include "gregset.h" + +-#include ++#include + #include "nat/gdb_ptrace.h" + #include + #include "inf-ptrace.h" diff --git a/srcpkgs/avr-gdb/template b/srcpkgs/avr-gdb/template index 73d9f9ac7456..a9ba1e8bc0d5 100644 --- a/srcpkgs/avr-gdb/template +++ b/srcpkgs/avr-gdb/template @@ -1,79 +1,38 @@ # Template file for 'avr-gdb' pkgname=avr-gdb version=10.1 -revision=1 +revision=2 wrksrc=gdb-${version} build_style=gnu-configure -pycompile_dirs="/usr/share/gdb/python" -configure_args="\ - --target=avr \ - --program-prefix=avr- \ - --disable-werror \ - --disable-nls \ - --with-system-readline \ - --with-system-gdbinit=/etc/gdb/gdbinit \ - --with-system-zlib $(vopt_enable gdbserver) \ - $(vopt_if static 'CFLAGS=-static CXXFLAGS=-static LDFLAGS=-static') \ - $(vopt_if python --with-python=/usr/bin/python3)" -hostmakedepends="texinfo perl $(vopt_if python python3-devel)" -makedepends="ncurses-devel zlib-devel readline-devel expat-devel +configure_args="--disable-werror --disable-nls --with-system-readline + --with-system-gdbinit=/etc/gdb/gdbinit --with-system-zlib + $(vopt_with guile) $(vopt_if python --with-python=/usr/bin/python3) + --target=avr" +hostmakedepends="pkg-config texinfo $(vopt_if python python3-devel) $(vopt_if guile guile)" +makedepends="expat-devel ncurses-devel readline-devel zlib-devel $(vopt_if guile guile-devel) $(vopt_if python 'python3-devel gettext-devel')" -depends=gdb +depends="gdb-common" short_desc="GNU Debugger for AVR" maintainer="Artur Sinila " license="GPL-3.0-or-later" -homepage="https://www.gnu.org/software/gdb/" +homepage="https://www.gnu.org/software/gdb" distfiles="${GNU_SITE}/gdb/gdb-${version}.tar.xz" checksum=f82f1eceeec14a3afa2de8d9b0d3c91d5a3820e23e0a01bbb70ef9f0276b62c0 -python_version=3 +make_check=no # See gdb/template. replaces="cross-avr-gdb>=0" if [ "${CROSS_BUILD}" ]; then # Make python3.x detection work in cross builds CFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}" CXXFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}" + makedepends+=" libatomic_ops-devel" # guile fi -CFLAGS+=" -fcommon" -CXXFLAGS+=" -fcommon" -# Package build options -build_options="gdbserver static python" -desc_option_gdbserver="Enable support for building GDB server" -# By default, don't enable any of build options -#build_options_default="gdbserver" -# Both options cannot be enabled at the same time -vopt_conflict gdbserver static - -post_extract() { - vsed -i 's,sgidefs.h,asm/sgidefs.h,' gdb/mips-linux-nat.c - mkdir -p build -} - -do_configure() { - cd build - ../configure ${configure_args/with-sysroot/with-build-sysroot} \ - CFLAGS_FOR_BUILD="${CFLAGS_FOR_BUILD} -fcommon" - export gl_cv_func_gettimeofday_clobber=no - export gl_cv_func_working_strerror=yes - export gl_cv_func_strerror_0_works=yes -} -do_build() { - cd build - make ${makejobs} all -} - -do_install() { - cd build - make DESTDIR=${DESTDIR} ${makejobs} install - # resolve conflicts with binutils - rm -rf ${DESTDIR}/usr/include ${DESTDIR}/usr/lib - rm -rf ${DESTDIR}/usr/lib64 - for f in bfd configure standards; do - rm -f ${DESTDIR}/usr/share/info/${f}.info* - done -} +# Package build options +build_options="python" +build_options_default="python" post_install() { - # resolve conflicts with binutils and native gdb - rm -fr usr/{share/{locale,gdb,info},include} + # resolve conflicts with gdb-common + rm -rf ${DESTDIR}/usr/{share/{gdb,info},include} } From 0237a33499fe01950619657bef0e6c6f96847c38 Mon Sep 17 00:00:00 2001 From: Evgeny Ermakov Date: Thu, 11 Mar 2021 01:14:22 +1100 Subject: [PATCH 3/3] cross-arm-none-eabi-gdb: update to 10.1, clean up --- .../patches/gdb-mips-linux-nat.patch | 11 +++ srcpkgs/cross-arm-none-eabi-gdb/template | 69 ++++++++----------- 2 files changed, 40 insertions(+), 40 deletions(-) create mode 100644 srcpkgs/cross-arm-none-eabi-gdb/patches/gdb-mips-linux-nat.patch diff --git a/srcpkgs/cross-arm-none-eabi-gdb/patches/gdb-mips-linux-nat.patch b/srcpkgs/cross-arm-none-eabi-gdb/patches/gdb-mips-linux-nat.patch new file mode 100644 index 000000000000..54191222f4a6 --- /dev/null +++ b/srcpkgs/cross-arm-none-eabi-gdb/patches/gdb-mips-linux-nat.patch @@ -0,0 +1,11 @@ +--- gdb/mips-linux-nat.c.orig ++++ gdb/mips-linux-nat.c +@@ -31,7 +31,7 @@ + #include "gdb_proc_service.h" + #include "gregset.h" + +-#include ++#include + #include "nat/gdb_ptrace.h" + #include + #include "inf-ptrace.h" diff --git a/srcpkgs/cross-arm-none-eabi-gdb/template b/srcpkgs/cross-arm-none-eabi-gdb/template index ac8e6837d72c..b7648d4410d4 100644 --- a/srcpkgs/cross-arm-none-eabi-gdb/template +++ b/srcpkgs/cross-arm-none-eabi-gdb/template @@ -1,48 +1,37 @@ -# Template file for 'cross-${_triplet}-${_pkgname}' -_triplet=arm-none-eabi -_pkgname=gdb -pkgname=cross-${_triplet}-${_pkgname} -version=8.3 +# Template file for 'cross-arm-none-eabi-gdb' +pkgname=cross-arm-none-eabi-gdb +version=10.1 revision=1 -wrksrc="${_pkgname}-${version}" +wrksrc=gdb-${version} build_style=gnu-configure -pycompile_dirs="/usr/share/${_pkgname}" -configure_args=" - --disable-gdbserver - --disable-nls - --disable-werror - --host=${XBPS_CROSS_TRIPLE} - --prefix=/usr - --target=${_triplet} - --with-babeltrace - --with-expat - --with-mpfr - --with-system-readline - --with-system-zlib - --without-isl - $(vopt_with guile) - $(vopt_with python) -" -hostmakedepends="autoconf automake bison flex pkg-config texinfo" -makedepends="babeltrace-devel expat-devel mpfr-devel ncurses-devel - readline-devel zlib-devel $(vopt_if guile guile-devel) - $(vopt_if python 'python3-devel gettext-devel')" -short_desc="GNU Debugger" +configure_args="--disable-werror --disable-nls --with-system-readline + --with-system-gdbinit=/etc/gdb/gdbinit --with-system-zlib --without-isl + $(vopt_with guile) $(vopt_if python --with-python=/usr/bin/python3) + --target=arm-none-eabi" +hostmakedepends="pkg-config texinfo $(vopt_if python python3-devel) $(vopt_if guile guile)" +makedepends="expat-devel ncurses-devel readline-devel zlib-devel $(vopt_if guile guile-devel) + $(vopt_if python 'python3-devel gettext-devel') babeltrace-devel mpfr-devel" +depends="gdb-common" +short_desc="GNU Debugger for ARM" maintainer="Ivan Sokolov " license="GPL-3.0-or-later" -homepage="https://www.gnu.org/software/${_pkgname}" -distfiles="${GNU_SITE}/${_pkgname}/${_pkgname}-${version}.tar.xz" -checksum=802f7ee309dcc547d65a68d61ebd6526762d26c3051f52caebe2189ac1ffd72e -python_version=2 #unverified -build_options="guile python" -# don't enable guile and python interfaces until they are moved into -# platform independent packages -build_options_default=" " -nocross=yes +homepage="https://www.gnu.org/software/gdb" +distfiles="${GNU_SITE}/gdb/gdb-${version}.tar.xz" +checksum=f82f1eceeec14a3afa2de8d9b0d3c91d5a3820e23e0a01bbb70ef9f0276b62c0 +make_check=no # See gdb/template. + +if [ "${CROSS_BUILD}" ]; then + # Make python3.x detection work in cross builds + CFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}" + CXXFLAGS="-I${XBPS_CROSS_BASE}/${py3_inc}" + makedepends+=" libatomic_ops-devel" # guile +fi -CFLAGS="-fcommon" +# Package build options +build_options="guile python" +build_options_default="python" post_install() { - # resolve conflicts with binutils and native gdb - rm -fr ${DESTDIR}/usr/{share/{locale,gdb,info},include} + # resolve conflicts with gdb-common + rm -rf ${DESTDIR}/usr/{share/{gdb,info},include} }