Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 555468 - app-emulation/qemu: wrong assembler used w/multiboot when cross compiling
Summary: app-emulation/qemu: wrong assembler used w/multiboot when cross compiling
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Unspecified (show other bugs)
Hardware: x86 Linux
: Normal normal (vote)
Assignee: Gentoo QEMU Project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-07-20 12:13 UTC by José Pekkarinen
Modified: 2017-05-04 13:11 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description José Pekkarinen 2015-07-20 12:13:42 UTC
Hi,

Steps to reproduce:

1) Generate a crossdev toolchain for x86_64(let's say x86_64-pc-linux-gnu)
2) x86_64-pc-linux-gnu-emerge =app-emulation/qemu-2.2.1-r2

It will select the default as binary in the system instead of x86_64-pc-linux-gnu-as to generate output files and hence, the x86_64-pc-linug-gnu-lg will not be able to handle the following steps.

make  BUILD_DIR=/usr/x86_64-pc-linux-gnu/tmp/portage/app-emulation/qemu-2.2.1-r2/work/qemu-2.2.1/softmmu-build -C pc-bios/optionrom V="1" TARGET_DIR="optionrom/"
make[1]: Entering directory '/usr/x86_64-pc-linux-gnu/tmp/portage/app-emulation/qemu-2.2.1-r2/work/qemu-2.2.1/softmmu-build/pc-bios/optionrom'
x86_64-pc-linux-gnu-gcc -E -I/usr/x86_64-pc-linux-gnu/tmp/portage/app-emulation/qemu-2.2.1-r2/work/qemu-2.2.1/tcg -I/usr/x86_64-pc-linux-gnu/tmp/portage/app-emulation/qemu-2.2.1-r2/work/qemu-2.2.1/tcg/i386 -I/usr/x86_64-pc-linux-gnu/tmp/portage/app-emulation/qemu-2.2.1-r2/work/qemu-2.2.1/linux-headers -I/usr/x86_64-pc-linux-gnu/tmp/portage/app-emulation/qemu-2.2.1-r2/work/qemu-2.2.1/softmmu-build/linux-headers -I. -I/usr/x86_64-pc-linux-gnu/tmp/portage/app-emulation/qemu-2.2.1-r2/work/qemu-2.2.1 -I/usr/x86_64-pc-linux-gnu/tmp/portage/app-emulation/qemu-2.2.1-r2/work/qemu-2.2.1/include -I/usr/x86_64-pc-linux-gnu/tmp/portage/app-emulation/qemu-2.2.1-r2/work/qemu-2.2.1/pc-bios/optionrom -I. -Wall -Wstrict-prototypes -Werror -fomit-frame-pointer -fno-builtin -I/usr/x86_64-pc-linux-gnu/tmp/portage/app-emulation/qemu-2.2.1-r2/work/qemu-2.2.1   -fno-stack-protector  -MMD -MP -MT multiboot.asm -MF ./multiboot.d -Wall -Wstrict-prototypes -Werror -fomit-frame-pointer -fno-builtin -I/usr/x86_64-pc-linux-gnu/tmp/portage/app-emulation/qemu-2.2.1-r2/work/qemu-2.2.1   -fno-stack-protector  -o multiboot.asm /usr/x86_64-pc-linux-gnu/tmp/portage/app-emulation/qemu-2.2.1-r2/work/qemu-2.2.1/pc-bios/optionrom/multiboot.S
x86_64-pc-linux-gnu-gcc -E -I/usr/x86_64-pc-linux-gnu/tmp/portage/app-emulation/qemu-2.2.1-r2/work/qemu-2.2.1/tcg -I/usr/x86_64-pc-linux-gnu/tmp/portage/app-emulation/qemu-2.2.1-r2/work/qemu-2.2.1/tcg/i386 -I/usr/x86_64-pc-linux-gnu/tmp/portage/app-emulation/qemu-2.2.1-r2/work/qemu-2.2.1/linux-headers -I/usr/x86_64-pc-linux-gnu/tmp/portage/app-emulation/qemu-2.2.1-r2/work/qemu-2.2.1/softmmu-build/linux-headers -I. -I/usr/x86_64-pc-linux-gnu/tmp/portage/app-emulation/qemu-2.2.1-r2/work/qemu-2.2.1 -I/usr/x86_64-pc-linux-gnu/tmp/portage/app-emulation/qemu-2.2.1-r2/work/qemu-2.2.1/include -I/usr/x86_64-pc-linux-gnu/tmp/portage/app-emulation/qemu-2.2.1-r2/work/qemu-2.2.1/pc-bios/optionrom -I. -Wall -Wstrict-prototypes -Werror -fomit-frame-pointer -fno-builtin -I/usr/x86_64-pc-linux-gnu/tmp/portage/app-emulation/qemu-2.2.1-r2/work/qemu-2.2.1   -fno-stack-protector  -MMD -MP -MT linuxboot.asm -MF ./linuxboot.d -Wall -Wstrict-prototypes -Werror -fomit-frame-pointer -fno-builtin -I/usr/x86_64-pc-linux-gnu/tmp/portage/app-emulation/qemu-2.2.1-r2/work/qemu-2.2.1   -fno-stack-protector  -o linuxboot.asm /usr/x86_64-pc-linux-gnu/tmp/portage/app-emulation/qemu-2.2.1-r2/work/qemu-2.2.1/pc-bios/optionrom/linuxboot.S
x86_64-pc-linux-gnu-gcc -E -I/usr/x86_64-pc-linux-gnu/tmp/portage/app-emulation/qemu-2.2.1-r2/work/qemu-2.2.1/tcg -I/usr/x86_64-pc-linux-gnu/tmp/portage/app-emulation/qemu-2.2.1-r2/work/qemu-2.2.1/tcg/i386 -I/usr/x86_64-pc-linux-gnu/tmp/portage/app-emulation/qemu-2.2.1-r2/work/qemu-2.2.1/linux-headers -I/usr/x86_64-pc-linux-gnu/tmp/portage/app-emulation/qemu-2.2.1-r2/work/qemu-2.2.1/softmmu-build/linux-headers -I. -I/usr/x86_64-pc-linux-gnu/tmp/portage/app-emulation/qemu-2.2.1-r2/work/qemu-2.2.1 -I/usr/x86_64-pc-linux-gnu/tmp/portage/app-emulation/qemu-2.2.1-r2/work/qemu-2.2.1/include -I/usr/x86_64-pc-linux-gnu/tmp/portage/app-emulation/qemu-2.2.1-r2/work/qemu-2.2.1/pc-bios/optionrom -I. -Wall -Wstrict-prototypes -Werror -fomit-frame-pointer -fno-builtin -I/usr/x86_64-pc-linux-gnu/tmp/portage/app-emulation/qemu-2.2.1-r2/work/qemu-2.2.1   -fno-stack-protector  -MMD -MP -MT kvmvapic.asm -MF ./kvmvapic.d -Wall -Wstrict-prototypes -Werror -fomit-frame-pointer -fno-builtin -I/usr/x86_64-pc-linux-gnu/tmp/portage/app-emulation/qemu-2.2.1-r2/work/qemu-2.2.1   -fno-stack-protector  -o kvmvapic.asm /usr/x86_64-pc-linux-gnu/tmp/portage/app-emulation/qemu-2.2.1-r2/work/qemu-2.2.1/pc-bios/optionrom/kvmvapic.S
as  -o multiboot.o multiboot.asm
as  -o linuxboot.o linuxboot.asm
as  -o kvmvapic.o kvmvapic.asm
x86_64-pc-linux-gnu-ld  -Ttext 0 -e _start -s -o multiboot.img multiboot.o
x86_64-pc-linux-gnu-ld: i386 architecture of input file `multiboot.o' is incompatible with i386:x86-64 output
Makefile:24: recipe for target 'multiboot.img' failed
make[1]: *** [multiboot.img] Error 1
make[1]: Leaving directory '/usr/x86_64-pc-linux-gnu/tmp/portage/app-emulation/qemu-2.2.1-r2/work/qemu-2.2.1/softmmu-build/pc-bios/optionrom'
Makefile:194: recipe for target 'romsubdir-optionrom' failed
make: *** [romsubdir-optionrom] Error 2
make: *** Waiting for unfinished jobs....
 * ERROR: app-emulation/qemu-2.2.1-r2::gentoo failed (compile phase):
 *   emake failed
 * 
 * If you need support, post the output of `emerge --info '=app-emulation/qemu-2.2.1-r2::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=app-emulation/qemu-2.2.1-r2::gentoo'`.
 * The complete build log is located at '/usr/x86_64-pc-linux-gnu/tmp/portage/app-emulation/qemu-2.2.1-r2/temp/build.log'.
 * The ebuild environment file is located at '/usr/x86_64-pc-linux-gnu/tmp/portage/app-emulation/qemu-2.2.1-r2/temp/environment'.
 * Working directory: '/usr/x86_64-pc-linux-gnu/tmp/portage/app-emulation/qemu-2.2.1-r2/work/qemu-2.2.1/softmmu-build'
 * S: '/usr/x86_64-pc-linux-gnu/tmp/portage/app-emulation/qemu-2.2.1-r2/work/qemu-2.2.1'
Comment 1 José Pekkarinen 2015-07-20 12:14:40 UTC
Portage 2.2.20 (python 2.7.9-final-0, default/linux/amd64/13.0, gcc-4.9.3, unavailable, 4.0.6 x86_64)
=================================================================
System uname: Linux-4.0.6-x86_64-Intel-R-_Core-TM-_i5-3340M_CPU_@_2.70GHz-with-gentoo-2.2
KiB Mem:     8047240 total,   1110476 free
KiB Swap:    8191996 total,   8191796 free
Timestamp of repository gentoo: Mon, 20 Jul 2015 09:30:01 +0000
sh bash 4.3_p33-r2
ld GNU ld (Gentoo 2.25 p1.2) 2.25
distcc 3.1 i686-pc-linux-gnu [disabled]
Repositories:

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

jpekkari-crossdev
    location: /usr/local/portage-crossdev
    masters: gentoo
    priority: 0

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=core-avx-i -mtune=core-avx-i -fomit-frame-pointer -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib/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/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -march=core-avx-i -mtune=core-avx-i -fomit-frame-pointer -pipe"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs buildpkg config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news nodoc noinfo noman parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_GB.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j5"
PKGDIR="/usr/x86_64-pc-linux-gnu/packages/"
PORTAGE_CONFIGROOT="/usr/x86_64-pc-linux-gnu/"
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="/usr/x86_64-pc-linux-gnu/tmp/"
USE="acl amd64 berkdb bzip2 cli cracklib crypt cxx dri fortran gdbm iconv ipv6 mmx mmxext modules multilib ncurses nls nptl openmp pcre readline session sse sse2 ssl tcpd unicode 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 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" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7" QEMU_SOFTMMU_TARGETS="x86_64" QEMU_USER_TARGETS="x86_64" RUBY_TARGETS="ruby19 ruby20" 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"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
Comment 2 José Pekkarinen 2015-07-25 13:41:25 UTC
Hi,

I tried to build manually today and passing the --cross-prefix=x86_64-pc-linux-gnu- option I can see the following output:

  AS    optionrom/multiboot.o
  AS    optionrom/linuxboot.o
  AS    optionrom/kvmvapic.o
  Building optionrom/multiboot.img
  Building optionrom/linuxboot.img
  Building optionrom/kvmvapic.img
  Building optionrom/multiboot.raw
  Building optionrom/linuxboot.raw
  Building optionrom/kvmvapic.raw

The build finish and I can install it in the prefix, however, even having the following output:

file /usr/x86_64-pc-linux-gnu/usr/bin/qemu-system-x86_64
/usr/x86_64-pc-linux-gnu/usr/bin/qemu-system-x86_64: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, not stripped

I receive the following when trying to execute:

/usr/x86_64-pc-linux-gnu/usr/bin/qemu-system-x86_64 --version
bash: /usr/x86_64-pc-linux-gnu/usr/bin/qemu-system-x86_64: No such file or directory

ls -laZ /usr/x86_64-pc-linux-gnu/usr/bin/qemu-system-x86_64
-rwxr-xr-x 1 root root ? 6352944 Jul 25 16:24 /usr/x86_64-pc-linux-gnu/usr/bin/qemu-system-x86_64

And comparing with the 32-bit version, everything seems to be normal:

ls -laZ /usr/bin/qemu-system-x86_64 
-rwxr-xr-x 1 root root ? 5774156 Jul 18 18:57 /usr/bin/qemu-system-x86_64

Any clue?

Thanks!
Comment 3 José Pekkarinen 2015-09-11 12:30:15 UTC
Hi, I tried this yesterday evening and it still fails the same than before. Building manually adding the cross-prefix option continues letting me build and install it though. Any updates on this?

Thanks!

José.
Comment 4 Matthias Maier gentoo-dev 2017-05-04 13:11:56 UTC
Thank you for the update!