Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 569810 - app-emulation/xen-tools-4.6.0-r5: stacks.c:139:5: error: 'asm' operand has impossible constraints
Summary: app-emulation/xen-tools-4.6.0-r5: stacks.c:139:5: error: 'asm' operand has im...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Xen Devs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-12-26 13:53 UTC by cyberbat
Modified: 2016-02-19 02:10 UTC (History)
2 users (show)

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


Attachments
seabios patch (xen-tools_seabios.patch,481 bytes, patch)
2016-01-04 22:08 UTC, Magnus Granberg
Details | Diff
working patch for seabios in xen (file_569810.txt,563 bytes, patch)
2016-01-15 20:37 UTC, cyberbat
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description cyberbat 2015-12-26 13:53:23 UTC
x86_64-pc-linux-gnu-gcc -Iout/ -Isrc -Os -MD -g -Wall -Wno-strict-aliasing -Wold-style-definition -Wtype-limits -m32 -march=i386 -mregparm=3 -mpreferred-stack-boundary=2 -minline-all-stringops -fomit-frame-pointer -freg-struct-return -ffreestanding -fno-delete-null-pointer-checks -ffunction-sections -fdata-sections -fno-common -fno-merge-constants -nopie -fno-stack-protector  -DMODE16=0 -DMODESEGMENT=0 -c src/cdrom.c -o out/src/cdrom.o
  Compile checking out/src/disk.o
src/stacks.c: In function 'call16_back':
src/stacks.c:139:5: error: 'asm' operand has impossible constraints
     asm volatile(
     ^
# head /var/tmp/portage/app-emulation/xen-tools-4.6.0-r5/temp/build.log
 * Package:    app-emulation/xen-tools-4.6.0-r5
 * Repository: gentoo
 * Maintainer: xen@gentoo.org
 * USE:        abi_x86_64 amd64 elibc_glibc hvm kernel_linux pam pygrub python python_targets_python2_7 qemu screen userland_GNU
 * FEATURES:   preserve-libs sandbox userpriv usersandbox

# emerge --info
Portage 2.2.24 (python 3.4.3-final-0, hardened/linux/amd64, gcc-4.9.3, glibc-2.21-r1, 3.14.51-hardened x86_64)
=================================================================
System uname: Linux-3.14.51-hardened-x86_64-Intel-R-_Core-TM-_i7-4770_CPU_@_3.40GHz-with-gentoo-2.2
KiB Mem:     4030148 total,    799120 free
KiB Swap:   33554428 total,  33554428 free
Timestamp of repository gentoo: Sat, 26 Dec 2015 12:45:01 +0000
sh bash 4.3_p39
ld GNU ld (Gentoo 2.25.1 p1.1) 2.25.1
app-shells/bash:          4.3_p39::gentoo
dev-lang/perl:            5.20.2::gentoo
dev-lang/python:          2.7.10-r1::gentoo, 3.4.3::gentoo
dev-util/pkgconfig:       0.28-r2::gentoo
sys-apps/baselayout:      2.2::gentoo
sys-apps/openrc:          0.18.4::gentoo
sys-apps/sandbox:         2.6-r1::gentoo
sys-devel/autoconf:       2.69::gentoo
sys-devel/automake:       1.13.4::gentoo, 1.14.1::gentoo, 1.15::gentoo
sys-devel/binutils:       2.25.1-r1::gentoo
sys-devel/gcc:            4.8.4::gentoo, 4.9.3::gentoo
sys-devel/gcc-config:     1.7.3::gentoo
sys-devel/libtool:        2.4.6::gentoo
sys-devel/make:           4.1-r1::gentoo
sys-kernel/linux-headers: 3.18::gentoo (virtual/os-headers)
sys-libs/glibc:           2.21-r1::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.de.gentoo.org/gentoo-portage
    priority: -1000

mylay
    location: /var/portage/mylay
    masters: gentoo
    priority: 0

ACCEPT_KEYWORDS=""
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -mtune=native"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -pipe -mtune=native"
DISTDIR="/var/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync 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="ftp://ftp.uni-erlangen.de/pub/mirrors/gentoo"
LANG="en_US.utf8"
LDFLAGS="-Wl,--hash-style=gnu -Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j8"
PKGDIR="/var/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"
PORTAGE_TMPDIR="/var/tmp"
USE="acl amd64 bash-completion berkdb bzip2 caps cli cracklib crypt cxx device-mapper dri gdbm gmp gnutls hardened iconv icu idn ipv6 justify mmx mmxext modules multilib ncurses nls nptl openmp pam pax_kernel pcre pie readline seccomp session sse sse2 ssl ssp ssse3 unicode urandom vim-syntax xattr xtpax 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="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx avx2 fma3 mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en ru" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_4" RUBY_TARGETS="ruby20 ruby21" USERLAND="GNU" VIDEO_CARDS="fbdev glint intel mach64 mga nouveau nv r128 radeon savage sis tdfx trident vesa via vmware dummy v4l" 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"
USE_PYTHON="2.7"
Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Yixun Lan archtester gentoo-dev 2015-12-28 01:51:26 UTC
could you provide full build log?

I'm also CCing @hardended team,see if they can give any advice.
Comment 2 Yixun Lan archtester gentoo-dev 2015-12-28 05:33:37 UTC
em.. the full build log is not necessary.

as a workaround, you could try combination: sys-firmware/seabios[-binary] + app-emulation/xen-tools[system-seabios], remember to build sys-firmware/seabios with non-hardened toolchain (use gcc-config to switch the profile temporarily).
Comment 3 Yixun Lan archtester gentoo-dev 2015-12-28 05:34:40 UTC
oh, see bug 566706 for why I suggest sys-firmware/seabios[-binary]
Comment 4 Yixun Lan archtester gentoo-dev 2015-12-30 08:00:42 UTC
suggestion from hardened team..

#gentoo-hardened: <@Zorry> dlan: try to disable -fstack-check
Comment 5 cyberbat 2016-01-02 19:21:16 UTC
(In reply to Yixun Lan from comment #4)
> suggestion from hardened team..
> 
> #gentoo-hardened: <@Zorry> dlan: try to disable -fstack-check

Please tell me how can I do this? I'm not good enough in software compiling to do it without any instruction in such big packet as xen. I would like to touch only xen, not any other software.
Comment 6 Yixun Lan archtester gentoo-dev 2016-01-04 03:23:40 UTC
(In reply to cyberbat from comment #5)
> Please tell me how can I do this? I'm not good enough in software compiling
> to do it without any instruction in such big packet as xen. I would like to
> touch only xen, not any other software.

I barely have some ideas here (haven't tested! not have hardened system here)

1) the ideal approach: still using hardened toolchain, only add -fno-stack-check flag to files affected (src/stacks.c)

2) add -fno-stack-check to global cflags

3) switch to vanilla toolchain
Comment 7 Magnus Granberg gentoo-dev 2016-01-04 22:08:13 UTC
Created attachment 421928 [details, diff]
seabios patch

Disable -fstack-check in seabios
Comment 8 cyberbat 2016-01-15 20:37:35 UTC
Created attachment 422996 [details, diff]
working patch for seabios in xen
Comment 9 cyberbat 2016-01-15 20:38:13 UTC
(In reply to Magnus Granberg from comment #7)
> Created attachment 421928 [details, diff] [details, diff]
> seabios patch
> 
> Disable -fstack-check in seabios

Seems that it resolves the issue
Comment 10 Ian Delaney (RETIRED) gentoo-dev 2016-01-17 07:26:15 UTC
sys-firmware/seabios is maintained by Cardoe
Comment 11 Yixun Lan archtester gentoo-dev 2016-02-19 02:10:09 UTC
I've pushed this patch to portage tree, please try xen-tools-4.6.1

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