Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 895746 - app-emulation/qemu-7.2.0-r2 error: ‘BLKDISCARD’ undeclared here (not in a function); did you mean ‘CDISCARD’?
Summary: app-emulation/qemu-7.2.0-r2 error: ‘BLKDISCARD’ undeclared here (not in a fun...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: PPC64 Linux
: Normal normal
Assignee: Virtualization Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-02-21 18:10 UTC by darkbasic
Modified: 2023-02-22 11:32 UTC (History)
1 user (show)

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


Attachments
build.log.gz (build.log.gz,56.97 KB, application/gzip)
2023-02-21 18:11 UTC, darkbasic
Details

Note You need to log in before you can comment on or make changes to this bug.
Description darkbasic 2023-02-21 18:10:30 UTC
[1241/1301] powerpc64le-unknown-linux-gnu-gcc -m64 -mlittle-endian -Ilibqemu-aarch64-linux-user.fa.p -I. -I.. -Itarget/arm -I../target/arm -I../common-user/host/ppc64 -I../linux-user/include/host/ppc64 -I../linux-user/include -Ilinux-user -I../linux-user -I../linux-user/aarch64 -Iq>
FAILED: libqemu-aarch64-linux-user.fa.p/linux-user_syscall.c.o
powerpc64le-unknown-linux-gnu-gcc -m64 -mlittle-endian -Ilibqemu-aarch64-linux-user.fa.p -I. -I.. -Itarget/arm -I../target/arm -I../common-user/host/ppc64 -I../linux-user/include/host/ppc64 -I../linux-user/include -Ilinux-user -I../linux-user -I../linux-user/aarch64 -Iqapi -Itrace >
../linux-user/ioctls.h:108:12: error: ‘BLKDISCARD’ undeclared here (not in a function); did you mean ‘CDISCARD’?
  108 |      IOCTL(BLKDISCARD, IOC_W, MK_PTR(MK_ARRAY(TYPE_ULONGLONG, 2)))
      |            ^~~~~~~~~~
../linux-user/syscall.c:5712:23: note: in definition of macro ‘IOCTL’
 5712 |     { TARGET_ ## cmd, cmd, #cmd, access, 0, {  __VA_ARGS__ } },
      |                       ^~~
../linux-user/ioctls.h:109:12: error: ‘BLKIOMIN’ undeclared here (not in a function)
  109 |      IOCTL(BLKIOMIN, IOC_R, MK_PTR(TYPE_INT))
      |            ^~~~~~~~
../linux-user/syscall.c:5712:23: note: in definition of macro ‘IOCTL’
 5712 |     { TARGET_ ## cmd, cmd, #cmd, access, 0, {  __VA_ARGS__ } },
      |                       ^~~
../linux-user/ioctls.h:110:12: error: ‘BLKIOOPT’ undeclared here (not in a function)
  110 |      IOCTL(BLKIOOPT, IOC_R, MK_PTR(TYPE_INT))
      |            ^~~~~~~~
../linux-user/syscall.c:5712:23: note: in definition of macro ‘IOCTL’
 5712 |     { TARGET_ ## cmd, cmd, #cmd, access, 0, {  __VA_ARGS__ } },
      |                       ^~~
../linux-user/ioctls.h:111:12: error: ‘BLKALIGNOFF’ undeclared here (not in a function); did you mean ‘G_ALIGNOF’?
  111 |      IOCTL(BLKALIGNOFF, IOC_R, MK_PTR(TYPE_INT))
      |            ^~~~~~~~~~~
../linux-user/syscall.c:5712:23: note: in definition of macro ‘IOCTL’
 5712 |     { TARGET_ ## cmd, cmd, #cmd, access, 0, {  __VA_ARGS__ } },
      |                       ^~~
../linux-user/ioctls.h:112:12: error: ‘BLKPBSZGET’ undeclared here (not in a function); did you mean ‘BLKBSZGET’?
  112 |      IOCTL(BLKPBSZGET, IOC_R, MK_PTR(TYPE_INT))
      |            ^~~~~~~~~~
../linux-user/syscall.c:5712:23: note: in definition of macro ‘IOCTL’
 5712 |     { TARGET_ ## cmd, cmd, #cmd, access, 0, {  __VA_ARGS__ } },
      |                       ^~~
../linux-user/ioctls.h:113:12: error: ‘BLKDISCARDZEROES’ undeclared here (not in a function); did you mean ‘TARGET_BLKDISCARDZEROES’?
  113 |      IOCTL(BLKDISCARDZEROES, IOC_R, MK_PTR(TYPE_INT))
      |            ^~~~~~~~~~~~~~~~
../linux-user/syscall.c:5712:23: note: in definition of macro ‘IOCTL’
 5712 |     { TARGET_ ## cmd, cmd, #cmd, access, 0, {  __VA_ARGS__ } },
      |                       ^~~
../linux-user/ioctls.h:114:12: error: ‘BLKSECDISCARD’ undeclared here (not in a function); did you mean ‘CDISCARD’?
  114 |      IOCTL(BLKSECDISCARD, IOC_W, MK_PTR(MK_ARRAY(TYPE_ULONGLONG, 2)))
      |            ^~~~~~~~~~~~~
../linux-user/syscall.c:5712:23: note: in definition of macro ‘IOCTL’
 5712 |     { TARGET_ ## cmd, cmd, #cmd, access, 0, {  __VA_ARGS__ } },
      |                       ^~~
../linux-user/ioctls.h:115:12: error: ‘BLKROTATIONAL’ undeclared here (not in a function)
  115 |      IOCTL(BLKROTATIONAL, IOC_R, MK_PTR(TYPE_SHORT))
      |            ^~~~~~~~~~~~~
../linux-user/syscall.c:5712:23: note: in definition of macro ‘IOCTL’
 5712 |     { TARGET_ ## cmd, cmd, #cmd, access, 0, {  __VA_ARGS__ } },
      |                       ^~~
../linux-user/ioctls.h:116:12: error: ‘BLKZEROOUT’ undeclared here (not in a function); did you mean ‘BLKROGET’?
  116 |      IOCTL(BLKZEROOUT, IOC_W, MK_PTR(MK_ARRAY(TYPE_ULONGLONG, 2)))
      |            ^~~~~~~~~~
../linux-user/syscall.c:5712:23: note: in definition of macro ‘IOCTL’
 5712 |     { TARGET_ ## cmd, cmd, #cmd, access, 0, {  __VA_ARGS__ } },
      |                       ^~~
../linux-user/ioctls.h:132:12: error: ‘FIBMAP’ undeclared here (not in a function)
  132 |      IOCTL(FIBMAP, IOC_W | IOC_R, MK_PTR(TYPE_LONG))
      |            ^~~~~~
../linux-user/syscall.c:5712:23: note: in definition of macro ‘IOCTL’
 5712 |     { TARGET_ ## cmd, cmd, #cmd, access, 0, {  __VA_ARGS__ } },
      |                       ^~~
../linux-user/ioctls.h:138:12: error: ‘FIGETBSZ’ undeclared here (not in a function)
  138 |      IOCTL(FIGETBSZ, IOC_R, MK_PTR(TYPE_LONG))
      |            ^~~~~~~~
../linux-user/syscall.c:5712:23: note: in definition of macro ‘IOCTL’
 5712 |     { TARGET_ ## cmd, cmd, #cmd, access, 0, {  __VA_ARGS__ } },
      |                       ^~~


Dropping qemu-7.2.0-linux-headers-6.2-glibc-2.36.patch fixes the issue.
Comment 1 darkbasic 2023-02-21 18:11:53 UTC
Created attachment 853508 [details]
build.log.gz

talos2 ~ # emerge --info
Portage 3.0.44 (python 3.10.9-final-0, default/linux/ppc64le/17.0/desktop/gnome/systemd/merged-usr, gcc-12, glibc-2.36-r5, 6.1.12-gentoo-dist ppc64le)
=================================================================
System uname: Linux-6.1.12-gentoo-dist-ppc64le-POWER9,_altivec_supported-with-glibc2.36
KiB Mem:    65402560 total,  49778408 free
KiB Swap:   16777212 total,  16777212 free
Timestamp of repository bobwya: Mon, 20 Feb 2023 20:31:52 +0000
Head commit of repository bobwya: a38b5628d52a08d0078178f8f66a10330338d64a

Timestamp of repository gentoo: Tue, 21 Feb 2023 14:32:02 +0000
Head commit of repository gentoo: 0342e5e1bb87aad208402a6b44b1f659b5cc3c84

Timestamp of repository guru: Sun, 19 Feb 2023 19:48:59 +0000
Head commit of repository guru: 84dbf80cd43088c3b2df25ee82032cae9d54e4ed

Timestamp of repository pf4public: Tue, 21 Feb 2023 13:16:54 +0000
Head commit of repository pf4public: 7ed57cc1462ce60c70747ef2eda42c6b64c89250

sh bash 5.1_p16-r2
ld GNU ld (Gentoo 2.39 p5) 2.39.0
ccache version 4.7.4 [disabled]
app-misc/pax-utils:        1.3.5::gentoo
app-shells/bash:           5.1_p16-r2::gentoo
dev-java/java-config:      2.3.1::gentoo
dev-lang/perl:             5.36.0-r1::gentoo
dev-lang/python:           3.10.9-r1::gentoo, 3.11.1-r1::gentoo
dev-lang/rust:             1.66.1::gentoo
dev-util/ccache:           4.7.4::gentoo
dev-util/cmake:            3.25.2::gentoo
dev-util/meson:            1.0.0::gentoo
sys-apps/baselayout:       2.9::gentoo
sys-apps/sandbox:          2.29::gentoo
sys-apps/systemd:          252.4-r1::gentoo
sys-devel/autoconf:        2.13-r7::gentoo, 2.71-r5::gentoo
sys-devel/automake:        1.16.5::gentoo
sys-devel/binutils:        2.39-r4::gentoo
sys-devel/binutils-config: 5.4.1::gentoo
sys-devel/clang:           15.0.7-r1::gentoo
sys-devel/gcc:             12.2.1_p20230121-r1::gentoo
sys-devel/gcc-config:      2.8::gentoo
sys-devel/libtool:         2.4.7::gentoo
sys-devel/lld:             15.0.7::gentoo
sys-devel/llvm:            15.0.7::gentoo
sys-devel/make:            4.3::gentoo
sys-kernel/linux-headers:  5.15-r3::gentoo (virtual/os-headers)
sys-libs/glibc:            2.36-r5::gentoo
Repositories:

bobwya
    location: /var/db/repos/bobwya
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/bobwya.git
    masters: gentoo
    priority: -1100
    volatile: True

gentoo
    location: /var/db/repos/gentoo
    sync-type: git
    sync-uri: https://anongit.gentoo.org/git/repo/sync/gentoo.git
    priority: -1000
    volatile: True
    sync-git-verify-commit-signature: yes

darkbasic
    location: /var/db/repos/darkbasic
    masters: gentoo
    volatile: True

guru
    location: /var/db/repos/guru
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/guru.git
    masters: gentoo
    volatile: True

pf4public
    location: /var/db/repos/pf4public
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/pf4public.git
    masters: gentoo
    volatile: True

ACCEPT_KEYWORDS="ppc64"
ACCEPT_LICENSE="@FREE @FREE unRAR fping freedist Microsoft-vscode"
CBUILD="powerpc64le-unknown-linux-gnu"
CFLAGS="-O2 -pipe -mcpu=power9 -mtune=power9"
CHOST="powerpc64le-unknown-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/config /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/php/apache2-php8.1/ext-active/ /etc/php/cgi-php8.1/ext-active/ /etc/php/cli-php8.1/ext-active/ /etc/php/fpm-php8.1/ext-active/ /etc/php/phpdbg-php8.1/ext-active/ /etc/revdep-rebuild /etc/sandbox.d"
CXXFLAGS="-O2 -pipe -mcpu=power9 -mtune=power9"
DISTDIR="/var/cache/distfiles"
EMERGE_DEFAULT_OPTS="--jobs 32"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GDK_PIXBUF_MODULE_FILE GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR XDG_STATE_HOME"
FCFLAGS="-O2 -pipe -mcpu=power9 -mtune=power9"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs buildpkg-live config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe -mcpu=power9 -mtune=power9"
GENTOO_MIRRORS="https://gentoo.mirror.garr.it/"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LEX="flex"
MAKEOPTS="-j32"
PKGDIR="/var/cache/binpkgs"
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"
SHELL="/bin/bash"
USE="X a52 aac acl alsa bluetooth branding btrfs bzip2 cairo cdda cdr cli colord crypt cups dbus dri dts dvd dvdr eds encode evo exif flac fortran gdbm gif gnome gnome-keyring gnome-online-accounts gpm gstreamer gtk gui iconv icu introspection ipv6 jpeg lcms libglvnd libnotify libsecret mad mng mp3 mp4 mpeg nautilus ncurses networkmanager nls nptl ogg opencl opengl openmp pam pango pcre pdf pipewire png policykit ppc64 ppds pulseaudio qt5 readline screencast sdl seccomp sound spell ssl startup-notification svg systemd test-rust tiff tracker truetype udev udisks unicode upower usb vaapi vorbis vpx vulkan wayland wxwidgets x264 xattr xcb xft xml xv xvid zeroconf zlib" ADA_TARGET="gnat_2021" 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 sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_PPC="altivec vsx vsx2 vsx3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="libinput" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-4 php8-0" POSTGRES_TARGETS="postgres12 postgres13" PYTHON_SINGLE_TARGET="python3_10" PYTHON_TARGETS="python3_10" QEMU_SOFTMMU_TARGETS="ppc ppc64 i386 x86_64 arm aarch64" QEMU_USER_TARGETS="ppc ppc64 i386 x86_64 arm aarch64" RUBY_TARGETS="ruby27 ruby30" USERLAND="GNU" VIDEO_CARDS="amdgpu radeon" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq proto steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LC_ALL, LD, LFLAGS, LIBTOOL, LINGUAS, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RANLIB, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-02-21 18:15:14 UTC
Can you try https://gitlab.com/qemu-project/qemu/-/commit/6003159ce18faad4e1bc7bf9c85669019cd4950e on top of the patch you dropped?
Comment 3 darkbasic 2023-02-21 19:33:42 UTC
Builds fine. I would also add the patch from this (https://gitlab.com/qemu-project/qemu/-/issues/1471) bug report because otherwise 7.2 is useless for most purposes. I carry it since several days and works fine.

I would also appreciate some help bisecting a nasty issue in qemu: https://gitlab.com/qemu-project/qemu/-/issues/1494

Some commit after 7.2 broke fetching go dependencies (unexpected fault address).
Unfortunately it's not 100% reproducible and I already failed to correctly bisect it once, so I've decided to automate it and run the command which triggers the issue (makepkg -s) at least 10 times per commit.

# cd /home/niko/devel/qemu
# git bisect start
# git bisect good b67b00e6b4c7831a3f5bc684bc0df7a9bfd1bd56
# git bisect run /home/niko/chroots/arch-x86_64.sh


arch-x86_64.sh:

#!/bin/bash
export EGIT_OVERRIDE_COMMIT_QEMU_PROJECT_QEMU=$(git rev-parse HEAD)
emerge -v --oneshot app-emulation/qemu
basedir="/home/niko/chroots/arch-x86_64"
cp /etc/resolv.conf ${basedir}/etc/
mount --make-slave --bind  ${basedir} ${basedir}
mount -t proc none ${basedir}/proc
mount -t sysfs none ${basedir}/sys/
mount --make-rslave --rbind /dev ${basedir}/dev
mount --make-rslave --rbind /run ${basedir}/run
chroot ${basedir} su -c bisect-qemu niko
sleep 3
umount -R ${basedir}/run
umount -R ${basedir}/dev
umount ${basedir}/sys
umount ${basedir}/proc
umount ${basedir}


bisect-qemu:

#!/bin/bash
cd /home/niko/devel/yay
rm -rf pkg src
makepkg -sf || exit 1
rm -rf pkg src
makepkg -sf || exit 1
rm -rf pkg src
makepkg -sf || exit 1
rm -rf pkg src
makepkg -sf || exit 1
rm -rf pkg src
makepkg -sf || exit 1
rm -rf pkg src
makepkg -sf || exit 1
rm -rf pkg src
makepkg -sf || exit 1
rm -rf pkg src
makepkg -sf || exit 1
rm -rf pkg src
makepkg -sf || exit 1
rm -rf pkg src
makepkg -sf || exit 1


This way whenever makepkg returns an error it should automatically mark the commit as bad. The problem is that I've unvelied a new flavour of the same issue: sometimes it doesn't crash but it just never returns and keeps running the command forever.

What's the easiest way to timeout makepkg and let it return with an error message if it does?
Comment 4 darkbasic 2023-02-22 10:27:21 UTC
> I would also appreciate some help bisecting a nasty issue in qemu

I ended up prefixing makepkg with the timeout command. Not sure if will work because once I did that it never happened again: https://gitlab.com/qemu-project/qemu/-/issues/1494#note_1288167270

I've manage to bisect it but I think I still didn't get the right commit. I will increase the repetitions to 30.
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-02-22 10:33:51 UTC
(In reply to darkbasic from comment #3)
> Builds fine. I would also add the patch from this
> (https://gitlab.com/qemu-project/qemu/-/issues/1471) bug report because
> otherwise 7.2 is useless for most purposes. I carry it since several days
> and works fine.
> 

Thanks, I'll throw that in.

> I would also appreciate some help bisecting a nasty issue in qemu:
> https://gitlab.com/qemu-project/qemu/-/issues/1494

Would you mind filing another bug on our bugzilla (just copy/paste your comment there) just so it's easier to keep track of? I can try help a bit then.
Comment 6 darkbasic 2023-02-22 11:03:32 UTC
> Would you mind filing another bug on our bugzilla (just copy/paste your comment there) just so it's easier to keep track of? I can try help a bit then.

Thanks, here it is: https://bugs.gentoo.org/895866
Comment 7 Larry the Git Cow gentoo-dev 2023-02-22 11:32:38 UTC
The bug has been closed via the following commit(s):

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

commit 5b8aab265a7189016df100a2551f9c72055e8cd7
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2023-02-22 11:28:44 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-02-22 11:32:27 +0000

    app-emulation/qemu: add additional glibc-2.36/linux-headers-6.2 patch
    
    Closes: https://bugs.gentoo.org/895662
    Closes: https://bugs.gentoo.org/895746
    Signed-off-by: Sam James <sam@gentoo.org>

 .../qemu-7.2.0-linux-headers-6.2-glibc-2.36.patch  | 71 ++++++++++++++++++++++
 1 file changed, 71 insertions(+)

Additionally, it has been referenced in the following commit(s):

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

commit 7e648ec4592e45730aefc986e949b73aefffdf8d
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2023-02-22 11:32:11 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-02-22 11:32:28 +0000

    app-emulation/qemu: backport fix for TCG for x86
    
    Bug: https://bugs.gentoo.org/895746
    Signed-off-by: Sam James <sam@gentoo.org>

 .../qemu/files/qemu-7.2.0-tcg-curl-ssl.patch       | 182 ++++
 app-emulation/qemu/qemu-7.2.0-r3.ebuild            | 973 +++++++++++++++++++++
 2 files changed, 1155 insertions(+)