Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 658014 - =sys-devel/gdb-7.12.1 fails to compile: /usr/include/sys/wait.h:158:1: error: expected declaration before ‘}’ token __END_DECLS
Summary: =sys-devel/gdb-7.12.1 fails to compile: /usr/include/sys/wait.h:158:1: error:...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2018-06-12 22:26 UTC by Émeric Maschino
Modified: 2018-06-30 11:06 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (build.log,302.90 KB, text/x-log)
2018-06-12 22:26 UTC, Émeric Maschino
Details
environment (environment,125.55 KB, text/plain)
2018-06-12 22:27 UTC, Émeric Maschino
Details
Fix ia64 defining TRAP_HWBKPT before including gdb_wait.h (linux-ptrace.patch,666 bytes, patch)
2018-06-21 22:07 UTC, Émeric Maschino
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Émeric Maschino 2018-06-12 22:26:13 UTC
Created attachment 535756 [details]
build.log

Hi,

While rebuilding my whole system with 2017 profile and PIE flag, =sys-devel/gdb-7.12.1 failed to reinstall with the following error:

ia64-unknown-linux-gnu-g++ -O2 -pipe   -I. -I. -I./common -I./config -DLOCALEDIR="\"/usr/share/locale\"" -DHAVE_CONFIG_H -I./../include/opcode -I./../opcodes/..   -I../bfd -I./../bfd -I./../include -I../libdecnumber -I./../libdecnumber  -I./gnulib/import -Ibuild-gnulib/import   -DTUI=1  -I/usr/include/python3.5m -I/usr/include/python3.5m -Wall -Wpointer-arith -Wno-unused -Wunused-value -Wunused-function -Wno-switch -Wno-char-subscripts -Wempty-body -Wunused-but-set-parameter -Wunused-but-set-variable -Wno-sign-compare -Wno-write-strings -Wno-narrowing -Wformat-nonliteral  -c -o linux-ptrace.o -MT linux-ptrace.o -MMD -MP -MF .deps/linux-ptrace.Tpo ./nat/linux-ptrace.c
In file included from ./nat/linux-ptrace.c:20:0:
./nat/linux-ptrace.h:175:22: error: expected identifier before numeric constant
 # define TRAP_HWBKPT 4
                      ^
./nat/linux-ptrace.h:175:22: error: expected ‘}’ before numeric constant
./nat/linux-ptrace.h:175:22: error: expected unqualified-id before numeric constant
In file included from /usr/include/features.h:423:0,
                 from /usr/include/bits/libc-header-start.h:33,
                 from /usr/include/stdio.h:27,
                 from build-gnulib/import/stdio.h:43,
                 from ./common/common-defs.h:31,
                 from ./nat/linux-ptrace.c:19:
/usr/include/sys/wait.h:158:1: error: expected declaration before ‘}’ token
 __END_DECLS
 ^

As /usr/include/sys/wait.h belongs to =sys-libs/glibc-2.26-r7, maybe the problem comes from here as (IIRC) I was able to emerge gdb with =sys-libs/glibc-2.25-r11.

Please let me know how I can help further.

Thanks,

     Émeric
Comment 1 Émeric Maschino 2018-06-12 22:27:01 UTC
Created attachment 535758 [details]
environment
Comment 2 Émeric Maschino 2018-06-12 22:27:55 UTC
emerge --info output:

Portage 2.3.40 (python 3.5.5-final-0, default/linux/ia64/17.0/desktop/gnome/systemd, gcc-6.4.0, glibc-2.26-r7, 4.9.95-gentoo ia64)
=================================================================
System uname: Linux-4.9.95-gentoo-ia64-Madison-with-gentoo-2.4.1
KiB Mem:    24978352 total,  14110592 free
KiB Swap:     524272 total,    524272 free
Timestamp of repository gentoo: Tue, 12 Jun 2018 19:15:01 +0000
Head commit of repository gentoo: cc97bf04dbe752df37b48c56857269bede71a9d4
sh bash 4.4_p12
ld GNU ld (Gentoo 2.30 p2) 2.30.0
app-shells/bash:          4.4_p12::gentoo
dev-lang/perl:            5.24.3-r1::gentoo
dev-lang/python:          2.7.14-r1::gentoo, 3.5.5::gentoo
dev-util/cmake:           3.9.6::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.4.1-r2::gentoo
sys-apps/sandbox:         2.13::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69-r4::gentoo
sys-devel/automake:       1.15.1-r2::gentoo
sys-devel/binutils:       2.30-r2::gentoo
sys-devel/gcc:            6.4.0-r1::gentoo
sys-devel/gcc-config:     1.8-r1::gentoo
sys-devel/libtool:        2.4.6-r3::gentoo
sys-devel/make:           4.2.1::gentoo
sys-kernel/linux-headers: 4.13::gentoo (virtual/os-headers)
sys-libs/glibc:           2.26-r7::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.fr.gentoo.org/gentoo-portage
    priority: -1000
    sync-rsync-verify-jobs: 1
    sync-rsync-verify-max-age: 24
    sync-rsync-verify-metamanifest: yes
    sync-rsync-extra-opts: 

localrepo
    location: /usr/local/portage
    masters: gentoo

ACCEPT_KEYWORDS="ia64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="ia64-unknown-linux-gnu"
CFLAGS="-O2 -pipe"
CHOST="ia64-unknown-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -pipe"
DISTDIR="/usr/portage/distfiles"
ENV_UNSET="DBUS_SESSION_BUS_ADDRESS DISPLAY PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync multilib-strict news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="fr_FR.utf8"
LDFLAGS="-Wl,-O1"
LINGUAS="fr_FR"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="X a52 aac acl acpi alsa berkdb branding bzip2 cairo cdda cdr cli colord crypt cups cxx dbus dri dts dvdr eds encode evo exif fam flac fortran gdbm gif glamor gnome gnome-keyring gnome-online-accounts gpm gstreamer gtk ia64 iconv introspection ipv6 jpeg lcms ldap libnotify libsecret libtirpc mad mng modules mp3 mp4 mpeg nautilus ncurses nls nptl ogg opengl openmp pam pango pcre pdf png policykit ppds pulseaudio qt3support readline sdl spell ssl startup-notification svg systemd tcpd tiff tracker truetype udev udisks unicode upower usb vorbis wxwidgets x264 xattr xcb xml xv xvid zlib" ALSA_CARDS="fm801" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon plan sheets stage words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="evdev" KERNEL="linux" L10N="fr" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6 php7-0" POSTGRES_TARGETS="postgres9_5" PYTHON_SINGLE_TARGET="python3_5" PYTHON_TARGETS="python2_7 python3_5" RUBY_TARGETS="ruby23" USERLAND="GNU" VIDEO_CARDS="fbdev radeon" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 3 Émeric Maschino 2018-06-12 22:28:56 UTC
emerge -pqv output:

[ebuild   R   ] sys-devel/gdb-7.12.1  USE="client nls python server xml -lzma -multitarget {-test} -vanilla" PYTHON_SINGLE_TARGET="python3_5 -python2_7 -python3_4" PYTHON_TARGETS="python2_7 python3_5 -python3_4"
Comment 4 Sergei Trofimovich (RETIRED) gentoo-dev 2018-06-15 08:33:55 UTC
The full failure is:

./nat/linux-ptrace.h:175:22: error: expected identifier before numeric constant
 # define TRAP_HWBKPT 4
                      ^
./nat/linux-ptrace.h:175:22: error: expected '}' before numeric constant
./nat/linux-ptrace.h:175:22: error: expected unqualified-id before numeric constant

I think the fix upstream was: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commitdiff;h=5a6c3296a7a90694ad4042f6256f3da6d4fa4ee8
Comment 5 Émeric Maschino 2018-06-20 19:43:35 UTC
(In reply to Sergei Trofimovich from comment #4)
> The full failure is:
> 
> ./nat/linux-ptrace.h:175:22: error: expected identifier before numeric
> constant
>  # define TRAP_HWBKPT 4
>                       ^
> ./nat/linux-ptrace.h:175:22: error: expected '}' before numeric constant
> ./nat/linux-ptrace.h:175:22: error: expected unqualified-id before numeric
> constant
> 
> I think the fix upstream was:
> https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commitdiff;
> h=5a6c3296a7a90694ad4042f6256f3da6d4fa4ee8

You're absolutely right. Manually applying the changes of the upstream fix allowed me to successfully emerge =sys-devel/gdb-7.12.1.

Do you want that I close this BR or keep it open while the upstream fix isn't integrated into Gentoo?

     Émeric
Comment 6 Sergei Trofimovich (RETIRED) gentoo-dev 2018-06-20 20:54:22 UTC
(In reply to Émeric Maschino from comment #5)
> (In reply to Sergei Trofimovich from comment #4)
> > The full failure is:
> > 
> > ./nat/linux-ptrace.h:175:22: error: expected identifier before numeric
> > constant
> >  # define TRAP_HWBKPT 4
> >                       ^
> > ./nat/linux-ptrace.h:175:22: error: expected '}' before numeric constant
> > ./nat/linux-ptrace.h:175:22: error: expected unqualified-id before numeric
> > constant
> > 
> > I think the fix upstream was:
> > https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commitdiff;
> > h=5a6c3296a7a90694ad4042f6256f3da6d4fa4ee8
> 
> You're absolutely right. Manually applying the changes of the upstream fix
> allowed me to successfully emerge =sys-devel/gdb-7.12.1.
> 
> Do you want that I close this BR or keep it open while the upstream fix
> isn't integrated into Gentoo?

Can you attach a patch you've got? I was lazy to tweak it myself. We can just apply your variant to current stable to unbreak it.
Comment 7 Émeric Maschino 2018-06-21 22:07:33 UTC
Created attachment 536746 [details, diff]
Fix ia64 defining TRAP_HWBKPT before including gdb_wait.h
Comment 8 Émeric Maschino 2018-06-21 22:09:41 UTC
(In reply to Sergei Trofimovich from comment #6)
> 
> Can you attach a patch you've got? I was lazy to tweak it myself. We can
> just apply your variant to current stable to unbreak it.

Sure! Please find it in attachment #536746 [details, diff] and feel free to add a header section and/or reformat if necessary.
Comment 9 Larry the Git Cow gentoo-dev 2018-06-30 11:06:47 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c61c0eeba20f941011ed6d87c86664c77f9b4152

commit c61c0eeba20f941011ed6d87c86664c77f9b4152
Author:     Sergei Trofimovich <slyfox@gentoo.org>
AuthorDate: 2018-06-30 11:06:26 +0000
Commit:     Sergei Trofimovich <slyfox@gentoo.org>
CommitDate: 2018-06-30 11:06:40 +0000

    sys-devel/gdb: fix build failure on ia64, bug #658014
    
    It's a backport of upstream fix by Émeric Maschino
    https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commitdiff;h=5a6c3296a7a90694ad4042f6256f3da6d4fa4ee8
    
    Reported-by: Émeric Maschino
    Fixed-by: Émeric Maschino
    Closes: https://bugs.gentoo.org/658014
    Package-Manager: Portage-2.3.41, Repoman-2.3.9

 sys-devel/gdb/files/gdb-7.12.1-ia64-include.patch | 26 +++++++++++++++++++++++
 sys-devel/gdb/gdb-7.12.1.ebuild                   |  1 +
 2 files changed, 27 insertions(+)