Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 689082 - app-emulation/xen-tools-4.11.1-r5 - tcgbios.c: In function ‘TCGInterruptHandler’: tcgbios.c:1519:33: error: taking address of packed member of ‘struct <anonymous>’ may result in an unaligned pointer value [-Werror=address-of-packed-member] 1519 ...
Summary: app-emulation/xen-tools-4.11.1-r5 - tcgbios.c: In function ‘TCGInterruptHandl...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Gentoo Xen Devs
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2019-07-01 13:48 UTC by awilum
Modified: 2020-08-19 12:58 UTC (History)
1 user (show)

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


Attachments
build.log.xz (build.log.xz,69.39 KB, application/x-xz)
2019-07-01 13:48 UTC, awilum
Details
emerge --info output (emerge--info.txt,6.04 KB, text/plain)
2019-07-01 13:52 UTC, awilum
Details
XEN-4.11.2 - configure --disable-xen LOG (xen-4.11.2_configure__disable-xen.log.xz,1.96 KB, text/plain)
2019-07-03 11:13 UTC, awilum
Details
XEN-4.11.2 - BUILD.LOG (xen-4.11.2_build.log.xz,13.02 KB, application/x-xz)
2019-07-03 11:13 UTC, awilum
Details

Note You need to log in before you can comment on or make changes to this bug.
Description awilum 2019-07-01 13:48:48 UTC
Created attachment 581612 [details]
build.log.xz

tcgbios.c: In function ‘TCGInterruptHandler’:
tcgbios.c:1519:33: error: taking address of packed member of ‘struct <anonymous>’ may result in an unaligned pointer value [-Werror=address-of-packed-member]
 1519 |                                 &regs->u.r32.edx);
      |                                 ^~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[10]: *** [/var/tmp/portage/app-emulation/xen-tools-4.11.1-r5/work/xen-4.11.1/tools/firmware/rombios/32bit/tcgbios/../../../../../tools/Rules.mk:225: tcgbios.o] Error 1
make[10]: Leaving directory '/var/tmp/portage/app-emulation/xen-tools-4.11.1-r5/work/xen-4.11.1/tools/firmware/rombios/32bit/tcgbios'
make[9]: *** [/var/tmp/portage/app-emulation/xen-tools-4.11.1-r5/work/xen-4.11.1/tools/firmware/rombios/32bit/../../../../tools/Rules.mk:249: subdir-all-tcgbios] Error 2
make[9]: Leaving directory '/var/tmp/portage/app-emulation/xen-tools-4.11.1-r5/work/xen-4.11.1/tools/firmware/rombios/32bit'
make[8]: *** [/var/tmp/portage/app-emulation/xen-tools-4.11.1-r5/work/xen-4.11.1/tools/firmware/rombios/32bit/../../../../tools/Rules.mk:244: subdirs-all] Error 2
make[8]: Leaving directory '/var/tmp/portage/app-emulation/xen-tools-4.11.1-r5/work/xen-4.11.1/tools/firmware/rombios/32bit'
make[7]: *** [/var/tmp/portage/app-emulation/xen-tools-4.11.1-r5/work/xen-4.11.1/tools/firmware/rombios/../../../tools/Rules.mk:249: subdir-all-32bit] Error 2
make[7]: Leaving directory '/var/tmp/portage/app-emulation/xen-tools-4.11.1-r5/work/xen-4.11.1/tools/firmware/rombios'
make[6]: *** [/var/tmp/portage/app-emulation/xen-tools-4.11.1-r5/work/xen-4.11.1/tools/firmware/rombios/../../../tools/Rules.mk:244: subdirs-all] Error 2
make[6]: Leaving directory '/var/tmp/portage/app-emulation/xen-tools-4.11.1-r5/work/xen-4.11.1/tools/firmware/rombios'
make[5]: *** [/var/tmp/portage/app-emulation/xen-tools-4.11.1-r5/work/xen-4.11.1/tools/firmware/../../tools/Rules.mk:249: subdir-all-rombios] Error 2
make[5]: Leaving directory '/var/tmp/portage/app-emulation/xen-tools-4.11.1-r5/work/xen-4.11.1/tools/firmware'
make[4]: *** [/var/tmp/portage/app-emulation/xen-tools-4.11.1-r5/work/xen-4.11.1/tools/firmware/../../tools/Rules.mk:244: subdirs-all] Error 2
make[4]: Leaving directory '/var/tmp/portage/app-emulation/xen-tools-4.11.1-r5/work/xen-4.11.1/tools/firmware'
make[3]: *** [Makefile:36: all] Error 2
make[3]: Leaving directory '/var/tmp/portage/app-emulation/xen-tools-4.11.1-r5/work/xen-4.11.1/tools/firmware'
make[2]: *** [/var/tmp/portage/app-emulation/xen-tools-4.11.1-r5/work/xen-4.11.1/tools/../tools/Rules.mk:249: subdir-all-firmware] Error 2
make[2]: Leaving directory '/var/tmp/portage/app-emulation/xen-tools-4.11.1-r5/work/xen-4.11.1/tools'
make[1]: *** [/var/tmp/portage/app-emulation/xen-tools-4.11.1-r5/work/xen-4.11.1/tools/../tools/Rules.mk:244: subdirs-all] Error 2
make[1]: Leaving directory '/var/tmp/portage/app-emulation/xen-tools-4.11.1-r5/work/xen-4.11.1/tools'
make: *** [Makefile:59: build-tools] Error 2
 * ERROR: app-emulation/xen-tools-4.11.1-r5::gentoo failed (compile phase):
 *   emake failed
 * 
################################################################################
msi /tmp # eix xen-tools
[U] app-emulation/xen-tools
     Available versions:  4.10.3-r2(0/4.10)^t 4.11.1-r5(0/4.11)^t ~4.12.0-r3(0/4.12)^t {api custom-cflags debug doc flask (+)hvm +ipxe ocaml ovmf +pam pygrub python +qemu +qemu-traditional +rombios screen sdl static-libs system-ipxe system-qemu system-seabios PYTHON_TARGETS="python2_7"}
     Installed versions:  4.11.1-r4(0/4.11)^t(09:50:40 18/04/2019)(hvm ovmf pam pygrub python qemu qemu-traditional sdl -api -custom-cflags -debug -doc -flask -ocaml -screen -static-libs -system-qemu -system-seabios PYTHON_TARGETS="python2_7")
     Homepage:            https://www.xenproject.org
     Description:         Xen tools including QEMU and xl
################################################################################
msi /tmp # emerge --info
Portage 2.3.66 (python 3.6.5-final-0, default/linux/amd64/17.1/desktop, gcc-9.1.0, glibc-2.29-r2, 5.1.15-msi x86_64)
=================================================================
System uname: Linux-5.1.15-msi-x86_64-AMD_Ryzen_7_1700X_Eight-Core_Processor-with-gentoo-2.6
KiB Mem:     8124712 total,   4694612 free
KiB Swap:     524284 total,    524284 free
Timestamp of repository gentoo: Mon, 01 Jul 2019 10:15:01 +0000
Head commit of repository gentoo: e4fc35f44c3e62590cffef8f75882a0dbee51e9a
sh bash 4.4_p23-r1
ld GNU ld (Gentoo 2.32 p2) 2.32.0
app-shells/bash:          4.4_p23-r1::gentoo
dev-java/java-config:     2.2.0-r4::gentoo
dev-lang/perl:            5.28.2-r1::gentoo
dev-lang/python:          2.7.15::gentoo, 3.6.5::gentoo
dev-util/cmake:           3.14.3::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.6-r1::gentoo
sys-apps/openrc:          0.41.2::gentoo
sys-apps/sandbox:         2.13::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r4::gentoo
sys-devel/automake:       1.15.1-r2::gentoo, 1.16.1-r1::gentoo
sys-devel/binutils:       2.31.1-r6::gentoo, 2.32-r1::gentoo
sys-devel/gcc:            9.1.0-r1::gentoo
sys-devel/gcc-config:     2.0::gentoo
sys-devel/libtool:        2.4.6-r3::gentoo
sys-devel/make:           4.2.1-r4::gentoo
sys-kernel/linux-headers: 4.14-r1::gentoo (virtual/os-headers)
sys-libs/glibc:           2.29-r2::gentoo
Repositories:

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

crossdev
    location: /usr/local/portage-crossdev
    masters: gentoo
    priority: 10
Installed sets: @tbs5520
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="@FREE"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=znver1 --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=512"
CHOST="x86_64-pc-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 -march=znver1 --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=512"
DISTDIR="/tmp/"
ENV_UNSET="DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN 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-docompress binpkg-dostrip binpkg-logs 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 sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="ftp://ftp.free.fr/mirrors/ftp.gentoo.org/"
LANG="fr_FR.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="fr"
MAKEOPTS="-j4"
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 amd64 bash-completion berkdb bluetooth branding bzip2 cairo cdda cdr cli consolekit crypt cups cxx dbus dri dts dvd dvdr egl emboss encode exif fam flac fortran gdbm gif glamor gles gles1 gles2 gpm gtk iconv ipv6 jpeg lcms ldap libnotify libtirpc mad mng mp3 mp4 mpeg multilib ncurses nls nptl ogg opencl opengl openmp pam pango pcre pdf png policykit ppds qt5 readline sdl seccomp smp spell ssl startup-notification svg tcpd tiff truetype udev udisks unicode upower usb vaapi vdpau vorbis vulkan wxwidgets x264 xattr xcb xml xv xvid zlib" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" 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_X86="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3" 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" GRUB_PLATFORMS="efi-64" INPUT_DEVICES="libinput joystick" KERNEL="linux" L10N="fr" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" NETBEANS_MODULES="apisupport cnd groovy gsf harness ide identity j2ee java mobility nb php profiler soa visualweb webcommon websvccommon xml" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-2" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_6" PYTHON_TARGETS="python2_7 python3_6" QEMU_SOFTMMU_TARGETS="x86_64 arm" QEMU_USER_TARGETS="arm" RUBY_TARGETS="ruby24" SANE_BACKENDS="epson" USERLAND="GNU" VIDEO_CARDS="amdgpu radeonsi virgl" 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 1 awilum 2019-07-01 13:52:57 UTC
Created attachment 581614 [details]
emerge --info output
Comment 2 Tomáš Mózes 2019-07-02 10:58:54 UTC
Confirmed on gcc 9.
Comment 3 Tomáš Mózes 2019-07-02 12:05:24 UTC
Can you please test 4.11.2 from the PR if it works for you? Thanks.
Comment 4 awilum 2019-07-03 11:10:20 UTC
Hi Thomas,

I did a test with the 4.11.2 version form xenproject.org.

I applied the same patches that I had seen in the "build.log.xz" :
1) patches-upstream;
2) patches-gentoo;

and, I need to change the eselect python to python2.7.

In conclusion, We have the same error.

I am going to put my configure, and build logs
Comment 5 awilum 2019-07-03 11:13:10 UTC
Created attachment 581848 [details]
XEN-4.11.2 - configure --disable-xen LOG
Comment 6 awilum 2019-07-03 11:13:58 UTC
Created attachment 581850 [details]
XEN-4.11.2 - BUILD.LOG
Comment 7 Tomáš Mózes 2019-07-04 05:48:34 UTC
Are the gentoo patches from the PR being applied?

This error:
gcc   -m32 -march=i686 -DBUILD_ID -fno-strict-aliasing -std=gnu99 -Wall -Wstrict-prototypes -Wdeclaration-after-statement -Wno-unused-but-set-variable -Wno-unused-local-typedefs   -O2 -fomit-frame-pointer -D__XEN_INTERFACE_VERSION__=__XEN_LATEST_INTERFACE_VERSION__ -MMD -MF .tcgbios.o.d -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -mno-tls-direct-seg-refs  -DNDEBUG -Werror -fno-stack-protector -fno-exceptions -fno-builtin -msoft-float -I/home/ziman/DEVs/XEN/xen-4.11.2/tools/firmware/rombios/32bit/tcgbios/../../../../../tools/include -I.. -I../.. -I../../../../libacpi -fno-pic -fno-PIE  -c -o tcgbios.o tcgbios.c 
tcgbios.c: Dans la fonction « TCGInterruptHandler »:
tcgbios.c:1519:33: erreur: prendre l'adresse du membre compacté de « struct <anonyme> » peut résulter en une valeur de pointeur non alignée [-Werror=address-of-packed-member]
 1519 |                                 &regs->u.r32.edx);
      |                                 ^~~~~~~~~~~~~~~~

Can be temporarily solved by (disabling the gcc 9 check):
diff --git a/tools/firmware/rombios/32bit/tcgbios/Makefile b/tools/firmware/rombios/32bit/tcgbios/Makefile
index 4dbc713..0138b58 100644
--- a/tools/firmware/rombios/32bit/tcgbios/Makefile
+++ b/tools/firmware/rombios/32bit/tcgbios/Makefile
@@ -3,7 +3,7 @@ include $(XEN_ROOT)/tools/firmware/Rules.mk
 
 TARGET  = tcgbiosext.o
 
-CFLAGS += $(CFLAGS_xeninclude) -I.. -I../.. -I../../../../libacpi
+CFLAGS += -Wno-address-of-packed-member $(CFLAGS_xeninclude) -I.. -I../.. -I../../../../libacpi
 $(call cc-option-add,CFLAGS,CC,-fno-pic)
 $(call cc-option-add,CFLAGS,CC,-fno-PIE)
Comment 8 awilum 2019-07-05 12:18:37 UTC
I put it into my /etc/portage/patches/app-emulation/xen-tools/tcgbiosext.patch
and launch the emerge -u app-emulation/xen-tools-4.11.1-r5

The patch that you did, was able to build the app-emulation/xen-tools-4.11.1-r5


"Are the gentoo patches from the PR being applied?"

I dont know what is "the gentoo patches from the PR"

The patches that I used, was form the "emerge -f app-emulation/xen-tools"
I got 2 tar.xz of patches directories:
1) patches-upstream;
2) patches-gentoo;
And then I patch manual each patch file that I have seen in the build.log for the 4.11.1-r5 to the xen-4.11.2 from xenproject.org.

Thanks you, Thomas.
Comment 9 Larry the Git Cow gentoo-dev 2019-10-06 12:45:40 UTC
The bug has been closed via the following commit(s):

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

commit c58b86194ce19d54a2f47d4712cb237b1f880ebb
Author:     Tomas Mozes <hydrapolic@gmail.com>
AuthorDate: 2019-07-02 12:01:08 +0000
Commit:     Thomas Deutschmann <whissi@gentoo.org>
CommitDate: 2019-10-06 12:44:29 +0000

    app-emulation/xen-tools: bump to 4.11.2
    
    Closes: https://bugs.gentoo.org/689082
    Signed-off-by: Tomáš Mózes <hydrapolic@gmail.com>
    Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>

 app-emulation/xen-tools/Manifest                  |   3 +
 app-emulation/xen-tools/files/gentoo-patches.conf |  13 +
 app-emulation/xen-tools/xen-tools-4.11.2.ebuild   | 474 ++++++++++++++++++++++
 3 files changed, 490 insertions(+)
Comment 10 ziomario 2020-08-19 12:58:15 UTC
Hello. I found this error also in ubuntu 20.04,while I was trying to compile the xen tools for enabling GVT for my integrated intel gpu with xen. You can find the discussion here :

https://github.com/intel/gvt-linux/issues/167

basically I don't know if (and how) I can fix this error on ubuntu 20.04. I don't know if I can use the patches suggested in this page also on ubuntu 20.04 or I should open a specific bug on the ubuntu's bug tracker ? let me know. thanks.