Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gdb: clean up templates #29382

Merged
merged 4 commits into from Oct 3, 2021
Merged

gdb: clean up templates #29382

merged 4 commits into from Oct 3, 2021

Conversation

unspecd
Copy link
Contributor

@unspecd unspecd commented Mar 10, 2021

Improved consistency across templates.

Also:

  • Fixed post_install in srcpkgs/avr-gdb.
  • Added build option for Guile.
  • Updated avr-gdb, cross-arm-none-eabi-gdb to 10.2.

General

Have the results of the proposed changes been tested?

  • I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me
  • I generally don't use the affected packages but briefly tested this PR

Does it build and run successfully?

(Please choose at least one native build and, if supported, at least one cross build. More are better.)

  • I built this PR locally for my native architecture, x86_64-musl
  • I built this PR locally for these architectures:
    • aarch64
    • aarch64-musl
    • armv7l
    • ppc
    • ppc-musl

@unspecd unspecd marked this pull request as ready for review March 10, 2021 17:37
srcpkgs/avr-gdb/template Outdated Show resolved Hide resolved
srcpkgs/cross-arm-none-eabi-gdb/template Outdated Show resolved Hide resolved
srcpkgs/gdb/template Outdated Show resolved Hide resolved
srcpkgs/gdb/template Outdated Show resolved Hide resolved
srcpkgs/gdb/template Outdated Show resolved Hide resolved
srcpkgs/gdb/template Outdated Show resolved Hide resolved
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
Copy link
Member

@ericonr ericonr Apr 14, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makedepends should be unconditional (regarding cross builds), most of the time. Are you sure this isn't because you were cross building for a target like armv6l, which fits under our XBPS_TARGET_NO_ATOMIC8 conditional?

Anyway, if this is guile related it should also be hidden behind vopt_if

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is what I get without libatomic_ops-devel:

$ ./xbps-src -a aarch64-musl -o guile pkg gdb

configure: error: in `/builddir/gdb-10.1/gdb':
configure: error: linking guile version guile-2.2 test program failed
See `config.log' for more details
make[1]: *** [Makefile:9734: configure-gdb] Error 1
make[1]: *** Waiting for unfinished jobs....

$ grep -C1 'cannot find -latomic_ops' masterdir/builddir/gdb-10.1/gdb/config.log
configure:11330: aarch64-linux-musl-gcc -o conftest -fstack-clash-protection -D_FORTIFY_SOURCE=2 -O2 -pipe -march=armv8-a -I/usr/aarch64-linux-musl/usr/include/python3.9 -g -I/usr/aarch64-linux-musl/usr/include    -I/usr/aarch64-linux-musl/usr/include -I/usr/aarch64-linux-musl/usr/include/guile/2.2  -Wl,-z,relro -Wl,-z,now -Wl,--as-needed    -L/usr/aarch64-linux-musl/usr/lib conftest.c -lncursesw -lm  -lguile-2.2 -latomic_ops -lgc >&5
/usr/lib/gcc/aarch64-linux-musl/10.2.1/../../../../aarch64-linux-musl/bin/ld: cannot find -latomic_ops
collect2: error: ld returned 1 exit status
--
configure:11339: aarch64-linux-musl-gcc -o conftest -fstack-clash-protection -D_FORTIFY_SOURCE=2 -O2 -pipe -march=armv8-a -I/usr/aarch64-linux-musl/usr/include/python3.9 -g -I/usr/aarch64-linux-musl/usr/include    -I/usr/aarch64-linux-musl/usr/include -I/usr/aarch64-linux-musl/usr/include/guile/2.2  -Wl,-z,relro -Wl,-z,now -Wl,--as-needed    -L/usr/aarch64-linux-musl/usr/lib conftest.c -lncursesw -lm  -lguile-2.2 -latomic_ops -lgc >&5
/usr/lib/gcc/aarch64-linux-musl/10.2.1/../../../../aarch64-linux-musl/bin/ld: cannot find -latomic_ops
collect2: error: ld returned 1 exit status

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, pkgconfig on armv6l says:

Libs: -L${libdir} -lguile-2.2 -latomic_ops -lgc

I'd suggest adding libatomic_ops-devel as a dependency of guile-devel instead :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ping

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do I understand correctly that you suggest the following patch:

File: srcpkgs/guile/template

@@ -40,7 +40,7 @@ libguile_package() {
 
 guile-devel_package() {
 	short_desc+=" - development files"
-	depends="gmp-devel gc-devel guile>=${version}_${revision}"
+	depends="gmp-devel gc-devel guile>=${version}_${revision} libatomic_ops-devel"
 	pkg_install() {
 		vmove usr/bin/guile-config
 		vmove usr/include

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, no, there is the same bug as in #27320.

https://github.com/void-linux/void-packages/pull/29382/checks?check_run_id=2478214035

…
FAIL: numbers.test: Number-theoretic division: euclidean/: mixed types: (130.0 10/7)
FAIL: numbers.test: Number-theoretic division: euclidean/: mixed types: (130.0 -10/7)
FAIL: numbers.test: Number-theoretic division: floor/: mixed types: (130.0 10/7)
FAIL: numbers.test: Number-theoretic division: floor/: mixed types: (-130.0 -10/7)
FAIL: numbers.test: Number-theoretic division: ceiling/: mixed types: (130.0 -10/7)
FAIL: numbers.test: Number-theoretic division: ceiling/: mixed types: (-130.0 10/7)
FAIL: numbers.test: Number-theoretic division: truncate/: mixed types: (130.0 10/7)
FAIL: numbers.test: Number-theoretic division: truncate/: mixed types: (130.0 -10/7)
FAIL: numbers.test: Number-theoretic division: truncate/: mixed types: (-130.0 10/7)
FAIL: numbers.test: Number-theoretic division: truncate/: mixed types: (-130.0 -10/7)
…

srcpkgs/avr-gdb/template Outdated Show resolved Hide resolved
srcpkgs/avr-gdb/template Outdated Show resolved Hide resolved
srcpkgs/cross-arm-none-eabi-gdb/template Outdated Show resolved Hide resolved
srcpkgs/avr-gdb/template Outdated Show resolved Hide resolved
srcpkgs/cross-arm-none-eabi-gdb/template Outdated Show resolved Hide resolved
srcpkgs/gdb/patches/gdb-mips-linux-nat.patch Show resolved Hide resolved
@ericonr
Copy link
Member

ericonr commented May 4, 2021

Missing a revbump for gdb itself.

Copy link
Member

@ericonr ericonr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to be working fine, thanks! Will wait if anyone else has reviews.

Copy link
Member

@ericonr ericonr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The cross gdbs are missing gdbserver now, so add configure arg --enable-gdbserver.

$(vopt_if python 'python3-devel gettext-devel')"
short_desc="GNU Debugger"
configure_args="--target=arm-none-eabi --disable-werror --disable-nls --with-system-readline
--with-system-gdbinit=/etc/gdb/gdbinit --with-system-zlib --without-isl
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does avr-gdb not have without-isl?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I honestly don't know. I am not sure why this library is needed here.

Copy link
Contributor Author

@unspecd unspecd May 6, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The cross gdbs are missing gdbserver now

With --enable-gdbserver:

$ ./xbps-src pkg avr-gdb
...
/builddir/gdb-10.2/gdbserver/remote-utils.cc:1235: undefined reference to `using_threads'
/usr/bin/ld: server.o: in function `main':
/builddir/gdb-10.2/gdbserver/server.cc:3826: undefined reference to `initialize_low()'
...

I don't think that gdbserver makes sense for avr and arm-none-eabi.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Argh, sorry. My mind was in previous revisions of this PR.

Indeed, neither of those packages have gdbserver currently.

Comment on lines -48 to -49
export gl_cv_func_gettimeofday_clobber=no
export gl_cv_func_working_strerror=yes
export gl_cv_func_strerror_0_works=yes
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the commit message please mention that you could eliminate the gnulib env var overrides because they now guess correctly that musl behaves.

$(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)"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i see you sorted the deps, so please sort the build options as well while at it

unspecd and others added 4 commits October 3, 2021 03:39
Also added build option for Guile.

gnulib now detects musl correctly, so we don't need the overrides.

Co-authored-by: Evgeny Ermakov <evgeny.v.ermakov@gmail.com>
Also added build option for Guile.

Co-authored-by: Evgeny Ermakov <evgeny.v.ermakov@gmail.com>
Co-authored-by: Evgeny Ermakov <evgeny.v.ermakov@gmail.com>
@ericonr
Copy link
Member

ericonr commented Oct 3, 2021

I made a bunch of changes and update stuff. Thanks!

@ericonr ericonr mentioned this pull request Oct 3, 2021
3 tasks
@unspecd unspecd deleted the gdb branch October 3, 2021 13:36
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants