Skip to contentSkip to conversation

ioemu: Use XEN_TARGET_ARCH instead of uname -m.

Xen-staging Aron Griffis 3 participants 6 messages Jan 27, 2008 – Jan 28, 2008 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

Keir, Bastian,

What is this changeset intended to fix? My cross-compilation seems to work fine without it. With it, the cross-compile blows up because the custom ld-script doesn't handle a sys-root (i.e. it overrides the linker, gross!)

By my reading, this patch overrides the host CPU detection with XEN_TARGET_ARCH, but that's incorrect because the host CPU should be the machine on which ioemu is being built, right?

Thanks,
Aron

Xen staging patchbot-unstable wrote: [Tue Jan 22 2008, 09:36:29AM EST]

Quoted 82 lines

# HG changeset patch
# User Keir Fraser <[email protected]> # Date 1201012477 0
# Node ID 51a7e508bd01a1a7d083eada58062aa7b08b839b # Parent 5e03f0bc0aa2fbe8535bedca02d6ab6e4b530794
ioemu: Use XEN_TARGET_ARCH instead of uname -m.

---
 tools/Makefile        |    2 +-
 tools/ioemu/configure |   36 ++++--------------------------------
 2 files changed, 5 insertions(+), 33 deletions(-)

diff -r 5e03f0bc0aa2 -r 51a7e508bd01 tools/Makefile

tools/Makefile +1 -1
@@ -78,7 +78,7 @@ endif
 endif
 ioemu ioemuinstall:
 	[ -f $(IOEMU_DIR)/config-host.mak ] || \
-	  ( cd $(IOEMU_DIR) && sh configure --prefix=/usr \
+	  ( cd $(IOEMU_DIR) && XEN_TARGET_ARCH=$(XEN_TARGET_ARCH) sh configure --prefix=/usr \
 		$(IOEMU_CONFIGURE_CROSS) )
 	$(MAKE) -C $(IOEMU_DIR) $(patsubst ioemu%,%,$@)
 ioemuclean:

diff -r 5e03f0bc0aa2 -r 51a7e508bd01 tools/ioemu/configure

tools/ioemu/configure +4 -32
@@ -29,43 +29,15 @@ make="make"
 make="make"
 install="install"
 strip="strip"
-cpu=`uname -m`
 target_list=""
-case "$cpu" in
-  i386|i486|i586|i686|i86pc|BePC)
+case "$XEN_TARGET_ARCH" in
+  x86_32)
     cpu="i386"
   ;;
-  armv*b)
-    cpu="armv4b"
-  ;;
-  armv*l)
-    cpu="armv4l"
-  ;;
-  alpha)
-    cpu="alpha"
-  ;;
-  "Power Macintosh"|ppc|ppc64)
+  powerpc)
     cpu="powerpc"
   ;;
-  mips)
-    cpu="mips"
-  ;;
-  s390)
-    cpu="s390"
-  ;;
-  sparc|sun4[muv])
-    cpu="sparc"
-  ;;
-  sparc64)
-    cpu="sparc64"
-  ;;
-  ia64)
-    cpu="ia64"
-  ;;
-  m68k)
-    cpu="m68k"
-  ;;
-  x86_64|amd64)
+  x86_64)
     cpu="x86_64"
     libdir="lib64"
   ;;

_______________________________________________
Xen-staging mailing list
[email protected]
http://lists.xensource.com/xen-staging

#2 lore raw

I'm not sure what particular scenario Bastian was intending to fix, but the patch does appear to make sense. qemu-dm is going to run in the target system's dom0. So the 'host CPU' type for qemu-dm is related to XEN_TARGET_ARCH, not XEN_COMPILE_ARCH nor 'uname -m'. This is a bit confusing because for qemu there are three environments to consider: build, host and emulated. I do believe that host CPU need not == build CPU.

-- Keir

Quoted 103 lines · Aron Griffis

Keir, Bastian,

What is this changeset intended to fix? My cross-compilation seems to work fine without it. With it, the cross-compile blows up because the custom ld-script doesn't handle a sys-root (i.e. it overrides the linker, gross!)

By my reading, this patch overrides the host CPU detection with XEN_TARGET_ARCH, but that's incorrect because the host CPU should be the machine on which ioemu is being built, right?

Thanks,
Aron

Xen staging patchbot-unstable wrote: [Tue Jan 22 2008, 09:36:29AM EST]

Quoted 78 lines

# HG changeset patch
# User Keir Fraser <[email protected]> # Date 1201012477 0
# Node ID 51a7e508bd01a1a7d083eada58062aa7b08b839b # Parent 5e03f0bc0aa2fbe8535bedca02d6ab6e4b530794
ioemu: Use XEN_TARGET_ARCH instead of uname -m.

---
 tools/Makefile        |    2 +-
 tools/ioemu/configure |   36 ++++--------------------------------
 2 files changed, 5 insertions(+), 33 deletions(-)

diff -r 5e03f0bc0aa2 -r 51a7e508bd01 tools/Makefile

tools/Makefile Tue Jan 22 14:34:37 2008 +0000 renamed from tools/Makefile Tue Jan 22 14:31:10 2008 +0000 +1 -2
@@ -78,7 +78,7 @@ endif
 endif
 ioemu ioemuinstall:
 [ -f $(IOEMU_DIR)/config-host.mak ] || \
-   ( cd $(IOEMU_DIR) && sh configure --prefix=/usr \
+   ( cd $(IOEMU_DIR) && XEN_TARGET_ARCH=$(XEN_TARGET_ARCH) sh configure
--prefix=/usr \
 $(IOEMU_CONFIGURE_CROSS) )
 $(MAKE) -C $(IOEMU_DIR) $(patsubst ioemu%,%,$@)
 ioemuclean:

diff -r 5e03f0bc0aa2 -r 51a7e508bd01 tools/ioemu/configure

tools/ioemu/configure Tue Jan 22 14:34:37 2008 +0000 renamed from tools/ioemu/configure Tue Jan 22 14:31:10 2008 +0000 +4 -32
@@ -29,43 +29,15 @@ make="make"
 make="make"
 install="install"
 strip="strip"
-cpu=`uname -m`
 target_list=""
-case "$cpu" in
-  i386|i486|i586|i686|i86pc|BePC)
+case "$XEN_TARGET_ARCH" in
+  x86_32)
     cpu="i386"
   ;;
-  armv*b)
-    cpu="armv4b"
-  ;;
-  armv*l)
-    cpu="armv4l"
-  ;;
-  alpha)
-    cpu="alpha"
-  ;;
-  "Power Macintosh"|ppc|ppc64)
+  powerpc)
     cpu="powerpc"
   ;;
-  mips)
-    cpu="mips"
-  ;;
-  s390)
-    cpu="s390"
-  ;;
-  sparc|sun4[muv])
-    cpu="sparc"
-  ;;
-  sparc64)
-    cpu="sparc64"
-  ;;
-  ia64)
-    cpu="ia64"
-  ;;
-  m68k)
-    cpu="m68k"
-  ;;
-  x86_64|amd64)
+  x86_64)
     cpu="x86_64"
     libdir="lib64"
   ;;
Quoted 5 lines

_______________________________________________
Xen-staging mailing list
[email protected]
http://lists.xensource.com/xen-staging

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#3 lore raw

Keir Fraser wrote: [Sun Jan 27 2008, 05:21:06PM EST]

Quoted 6 lines

I'm not sure what particular scenario Bastian was intending to fix, but the patch does appear to make sense. qemu-dm is going to run in the target system's dom0. So the 'host CPU' type for qemu-dm is related to XEN_TARGET_ARCH, not XEN_COMPILE_ARCH nor 'uname -m'. This is a bit confusing because for qemu there are three environments to consider: build, host and emulated. I do believe that host CPU need not == build CPU.

Thanks Keir. It doesn't work for me at the moment (including the ia64 follow-on patch) because it uses a custom ld script, tools/ioemu/ia64.ld

Here is the output when using that script. You can see pretty easily that it's ignoring the sys-root. Jump down for a patch that fixes this particular issue...

------------------------------------------------------------
Current output
------------------------------------------------------------

$ make -j1 XEN_TARGET_ARCH=ia64 CROSS_COMPILE=ia64-linux-gnu- ioemu
[ -f ioemu/config-host.mak ] || \
          ( cd ioemu && XEN_TARGET_ARCH=ia64 sh configure --prefix=/usr \
                --cross-prefix=ia64-linux-gnu- --interp-prefix=/usr/ia64-linux-gnu/sys-root )
make -C ioemu 
make[1]: Entering directory `/home/agriffis/work/xen/20080102-cross/xen-unstable.hg/tools/ioemu'
make -C i386-dm all
*** PCI passthrough capability has been enabled ***
make[2]: Entering directory `/home/agriffis/work/xen/20080102-cross/xen-unstable.hg/tools/ioemu/i386-dm'
ia64-linux-gnu-gcc  -Wl,-G0 -Wl,-T,/home/agriffis/work/xen/20080102-cross/xen-unstable.hg/tools/ioemu/ia64.ld -o qemu-dm vl.o osdep.o readline.o monitor.o pci.o console.o isa_mmio.o cutils.o block.o block-raw.o block-cow.o block-qcow.o aes.o block-vmdk.o block-cloop.o block-dmg.o block-bochs.o block-vpc.o block-vvfat.o block-qcow2.o pass-through.o scsi-disk.o cdrom.o lsi53c895a.o usb.o usb-hub.o usb-linux.o usb-hid.o usb-ohci.o usb-msd.o ne2000.o rtl8139.o pcnet.o e100.o ide.o pckbd.o ps2.o vga.o sb16.o es1370.o dma.o audio.o noaudio.o wavaudio.o ossaudio.o wavcapture.o extboot.o fdc.o mc146818rtc.o serial.o pc.o cirrus_vga.o mixeng.o parallel.o acpi.o usb-uhci.o smbus_eeprom.o piix4acpi.o xenstore.o xen_platform.o xen_machine_fv.o xen_machine_pv.o xenfb.o xen_console.o tpm_tis.o vnc.o d3d
 es.o libqemu.a  -lm -L../../libxc -lxenctrl -lxenguest -L../../xenstore -lxenstore -lz -lpci -lgnutls     -lutil -lrt
/usr/lib/gcc/ia64-linux-gnu/4.1.2/../../../../ia64-linux-gnu/bin/ld: warning: libpthread.so.0, needed by ../../libxc/libxenctrl.so, not found (try using -rpath or -rpath-link)
/usr/lib/gcc/ia64-linux-gnu/4.1.2/../../../../ia64-linux-gnu/bin/ld: warning: libtasn1.so.3, needed by /usr/ia64-linux-gnu/sys-root/usr/lib/libgnutls.so, not found (try using -rpath or -rpath-link)
/usr/lib/gcc/ia64-linux-gnu/4.1.2/../../../../ia64-linux-gnu/bin/ld: warning: libgcrypt.so.11, needed by /usr/ia64-linux-gnu/sys-root/usr/lib/libgnutls.so, not found (try using -rpath or -rpath-link)
/usr/lib/gcc/ia64-linux-gnu/4.1.2/../../../../ia64-linux-gnu/bin/ld: warning: libgpg-error.so.0, needed by /usr/ia64-linux-gnu/sys-root/usr/lib/libgnutls.so, not found (try using -rpath or -rpath-link)
/usr/lib/gcc/ia64-linux-gnu/4.1.2/../../../../ia64-linux-gnu/bin/ld: warning: ld-linux-ia64.so.2, needed by /usr/ia64-linux-gnu/sys-root/usr/lib/librt.so, not found (try using -rpath or -rpath-link)
/usr/ia64-linux-gnu/sys-root/usr/lib/libgnutls.so: undefined reference to `asn1_array2tree@LIBTASN1_0_3'
/usr/ia64-linux-gnu/sys-root/usr/lib/libgnutls.so: undefined reference to `asn1_copy_node@LIBTASN1_0_3'
/usr/ia64-linux-gnu/sys-root/usr/lib/libgnutls.so: undefined reference to `gcry_md_setkey@GCRYPT_1.2'
../../libxc/libxenctrl.so: undefined reference to `pthread_getspecific@GLIBC_2.2'
/usr/ia64-linux-gnu/sys-root/usr/lib/libgnutls.so: undefined reference to `gcry_mpi_new@GCRYPT_1.2'
/usr/ia64-linux-gnu/sys-root/usr/lib/libgnutls.so: undefined reference to `gcry_mpi_mod@GCRYPT_1.2'
/usr/ia64-linux-gnu/sys-root/usr/lib/libgnutls.so: undefined reference to `gcry_mpi_sub_ui@GCRYPT_1.2'
/usr/ia64-linux-gnu/sys-root/usr/lib/libgnutls.so: undefined reference to `gcry_mpi_release@GCRYPT_1.2'
/usr/ia64-linux-gnu/sys-root/usr/lib/libgnutls.so: undefined reference to `gcry_mpi_mulm@GCRYPT_1.2'
/usr/ia64-linux-gnu/sys-root/usr/lib/libgnutls.so: undefined reference to `gcry_md_get_algo_dlen@GCRYPT_1.2'
/usr/ia64-linux-gnu/sys-root/usr/lib/libgnutls.so: undefined reference to `gcry_mpi_invm@GCRYPT_1.2'
/usr/ia64-linux-gnu/sys-root/usr/lib/librt.so: undefined reference to `_pthread_cleanup_pop@GLIBC_2.2'
/usr/ia64-linux-gnu/sys-root/usr/lib/libgnutls.so: undefined reference to `gcry_cipher_decrypt@GCRYPT_1.2'
/usr/ia64-linux-gnu/sys-root/usr/lib/libgnutls.so: undefined reference to `gcry_cipher_open@GCRYPT_1.2'
/usr/ia64-linux-gnu/sys-root/usr/lib/libgnutls.so: undefined reference to `asn1_number_of_elements@LIBTASN1_0_3'
/usr/ia64-linux-gnu/sys-root/usr/lib/libgnutls.so: undefined reference to `gcry_mpi_snew@GCRYPT_1.2'
/usr/ia64-linux-gnu/sys-root/usr/lib/libgnutls.so: undefined reference to `gcry_mpi_add@GCRYPT_1.2'
/usr/ia64-linux-gnu/sys-root/usr/lib/libgnutls.so: undefined reference to `gcry_prime_release_factors@GCRYPT_1.2'
/usr/ia64-linux-gnu/sys-root/usr/lib/libgnutls.so: undefined reference to `gcry_pk_encrypt@GCRYPT_1.2'
../../libxc/libxenctrl.so: undefined reference to `pthread_once@GLIBC_2.2'
/usr/ia64-linux-gnu/sys-root/usr/lib/libgnutls.so: undefined reference to `gcry_cipher_ctl@GCRYPT_1.2'
/usr/ia64-linux-gnu/sys-root/usr/lib/libgnutls.so: undefined reference to `gcry_mpi_copy@GCRYPT_1.2'
/usr/ia64-linux-gnu/sys-root/usr/lib/libgnutls.so: undefined reference to `gcry_mpi_set_ui@GCRYPT_1.2'
/usr/ia64-linux-gnu/sys-root/lib/libc.so.6.1: undefined reference to `_dl_unmap@GLIBC_PRIVATE'
/usr/ia64-linux-gnu/sys-root/usr/lib/libgnutls.so: undefined reference to `gcry_md_copy@GCRYPT_1.2'
/usr/ia64-linux-gnu/sys-root/usr/lib/libgnutls.so: undefined reference to `gcry_check_version@GCRYPT_1.2'
../../libxc/libxenctrl.so: undefined reference to `pthread_key_create@GLIBC_2.2'
/usr/ia64-linux-gnu/sys-root/lib/libc.so.6.1: undefined reference to `_dl_argv@GLIBC_PRIVATE'
/usr/ia64-linux-gnu/sys-root/usr/lib/libgnutls.so: undefined reference to `gcry_mpi_subm@GCRYPT_1.2'
/usr/ia64-linux-gnu/sys-root/usr/lib/libgnutls.so: undefined reference to `gcry_md_write@GCRYPT_1.2'
../../xenstore/libxenstore.so: undefined reference to `pthread_create@GLIBC_2.2'
/usr/ia64-linux-gnu/sys-root/usr/lib/libgnutls.so: undefined reference to `gcry_control@GCRYPT_1.2'
/usr/ia64-linux-gnu/sys-root/usr/lib/libgnutls.so: undefined reference to `gcry_mpi_div@GCRYPT_1.2'
/usr/ia64-linux-gnu/sys-root/lib/libc.so.6.1: undefined reference to `_rtld_global_ro@GLIBC_PRIVATE'
/usr/ia64-linux-gnu/sys-root/usr/lib/libgnutls.so: undefined reference to `gcry_prime_check@GCRYPT_1.2'
/usr/ia64-linux-gnu/sys-root/usr/lib/libgnutls.so: undefined reference to `gcry_randomize@GCRYPT_1.2'
/usr/ia64-linux-gnu/sys-root/usr/lib/libgnutls.so: undefined reference to `gcry_mpi_cmp@GCRYPT_1.2'
/usr/ia64-linux-gnu/sys-root/usr/lib/librt.so: undefined reference to `pthread_barrier_init@GLIBC_2.2'
/usr/ia64-linux-gnu/sys-root/usr/lib/libgnutls.so: undefined reference to `gcry_pk_sign@GCRYPT_1.2'
/usr/ia64-linux-gnu/sys-root/usr/lib/libgnutls.so: undefined reference to `gcry_cipher_close@GCRYPT_1.2'
/usr/ia64-linux-gnu/sys-root/lib/libc.so.6.1: undefined reference to `__tls_get_addr@GLIBC_2.3'
../../libxc/libxenctrl.so: undefined reference to `pthread_setspecific@GLIBC_2.2'
/usr/ia64-linux-gnu/sys-root/usr/lib/libgnutls.so: undefined reference to `gcry_mpi_scan@GCRYPT_1.2'
/usr/ia64-linux-gnu/sys-root/usr/lib/libgnutls.so: undefined reference to `gcry_mpi_print@GCRYPT_1.2'
/usr/ia64-linux-gnu/sys-root/usr/lib/libgnutls.so: undefined reference to `gcry_prime_group_generator@GCRYPT_1.2'
/usr/ia64-linux-gnu/sys-root/lib/libc.so.6.1: undefined reference to `_dl_lookup_address@GLIBC_PRIVATE'
/usr/ia64-linux-gnu/sys-root/usr/lib/libgnutls.so: undefined reference to `gcry_mpi_randomize@GCRYPT_1.2'
../../xenstore/libxenstore.so: undefined reference to `pthread_cancel@GLIBC_2.2'
/usr/ia64-linux-gnu/sys-root/usr/lib/libgnutls.so: undefined reference to `asn1_write_value@LIBTASN1_0_3'
/usr/ia64-linux-gnu/sys-root/usr/lib/libgnutls.so: undefined reference to `gcry_md_hash_buffer@GCRYPT_1.2'
/usr/ia64-linux-gnu/sys-root/usr/lib/libgnutls.so: undefined reference to `gcry_mpi_get_nbits@GCRYPT_1.2'
/usr/ia64-linux-gnu/sys-root/usr/lib/libgnutls.so: undefined reference to `gcry_mpi_add_ui@GCRYPT_1.2'
/usr/ia64-linux-gnu/sys-root/usr/lib/libgnutls.so: undefined reference to `asn1_create_element@LIBTASN1_0_3'
/usr/ia64-linux-gnu/sys-root/usr/lib/libgnutls.so: undefined reference to `gcry_pk_verify@GCRYPT_1.2'
/usr/ia64-linux-gnu/sys-root/usr/lib/librt.so: undefined reference to `pthread_attr_setstacksize@GLIBC_2.3.3'
/usr/ia64-linux-gnu/sys-root/usr/lib/libgnutls.so: undefined reference to `asn1_der_decoding_startEnd@LIBTASN1_0_3'
/usr/ia64-linux-gnu/sys-root/usr/lib/libgnutls.so: undefined reference to `gcry_create_nonce@GCRYPT_1.2'
/usr/ia64-linux-gnu/sys-root/usr/lib/libgnutls.so: undefined reference to `gcry_sexp_find_token@GCRYPT_1.2'
/usr/ia64-linux-gnu/sys-root/usr/lib/libgnutls.so: undefined reference to `gcry_sexp_nth_mpi@GCRYPT_1.2'
/usr/ia64-linux-gnu/sys-root/usr/lib/libgnutls.so: undefined reference to `asn1_read_value@LIBTASN1_0_3'
/usr/ia64-linux-gnu/sys-root/usr/lib/libgnutls.so: undefined reference to `gcry_mpi_addm@GCRYPT_1.2'
/usr/ia64-linux-gnu/sys-root/usr/lib/libgnutls.so: undefined reference to `asn1_der_coding@LIBTASN1_0_3'
/usr/ia64-linux-gnu/sys-root/usr/lib/libgnutls.so: undefined reference to `gcry_pk_decrypt@GCRYPT_1.2'
/usr/ia64-linux-gnu/sys-root/usr/lib/libgnutls.so: undefined reference to `gcry_md_read@GCRYPT_1.2'
/usr/ia64-linux-gnu/sys-root/lib/libc.so.6.1: undefined reference to `_dl_out_of_memory@GLIBC_PRIVATE'
/usr/ia64-linux-gnu/sys-root/usr/lib/libgnutls.so: undefined reference to `gcry_pk_genkey@GCRYPT_1.2'
/usr/ia64-linux-gnu/sys-root/usr/lib/libgnutls.so: undefined reference to `gcry_sexp_build@GCRYPT_1.2'
/usr/ia64-linux-gnu/sys-root/lib/libc.so.6.1: undefined reference to `_dl_symbol_address@GLIBC_PRIVATE'
/usr/ia64-linux-gnu/sys-root/usr/lib/libgnutls.so: undefined reference to `gcry_mpi_powm@GCRYPT_1.2'
/usr/ia64-linux-gnu/sys-root/usr/lib/libgnutls.so: undefined reference to `gcry_mpi_clear_highbit@GCRYPT_1.2'
../../xenstore/libxenstore.so: undefined reference to `pthread_join@GLIBC_2.2'
/usr/ia64-linux-gnu/sys-root/usr/lib/libgnutls.so: undefined reference to `gcry_md_ctl@GCRYPT_1.2'
/usr/ia64-linux-gnu/sys-root/lib/libc.so.6.1: undefined reference to `_r_debug@GLIBC_2.2'
/usr/ia64-linux-gnu/sys-root/usr/lib/libgnutls.so: undefined reference to `gcry_sexp_release@GCRYPT_1.2'
/usr/ia64-linux-gnu/sys-root/usr/lib/libgnutls.so: undefined reference to `gcry_md_open@GCRYPT_1.2'
/usr/ia64-linux-gnu/sys-root/usr/lib/librt.so: undefined reference to `_rtld_global@GLIBC_PRIVATE'
/usr/ia64-linux-gnu/sys-root/usr/lib/libgnutls.so: undefined reference to `gcry_set_allocation_handler@GCRYPT_1.2'
/usr/ia64-linux-gnu/sys-root/usr/lib/libgnutls.so: undefined reference to `gcry_prime_generate@GCRYPT_1.2'
/usr/ia64-linux-gnu/sys-root/usr/lib/libgnutls.so: undefined reference to `asn1_der_decoding@LIBTASN1_0_3'
/usr/ia64-linux-gnu/sys-root/usr/lib/librt.so: undefined reference to `pthread_detach@GLIBC_2.2'
/usr/ia64-linux-gnu/sys-root/usr/lib/libgnutls.so: undefined reference to `asn1_check_version@LIBTASN1_0_3'
../../xenstore/libxenstore.so: undefined reference to `__isoc99_sscanf@GLIBC_2.7'
/usr/ia64-linux-gnu/sys-root/lib/libc.so.6.1: undefined reference to `__libc_enable_secure@GLIBC_PRIVATE'
/usr/ia64-linux-gnu/sys-root/usr/lib/librt.so: undefined reference to `pthread_sigmask@GLIBC_2.2'
/usr/ia64-linux-gnu/sys-root/usr/lib/libgnutls.so: undefined reference to `asn1_find_structure_from_oid@LIBTASN1_0_3'
/usr/ia64-linux-gnu/sys-root/usr/lib/libgnutls.so: undefined reference to `asn1_delete_structure@LIBTASN1_0_3'
/usr/ia64-linux-gnu/sys-root/usr/lib/libgnutls.so: undefined reference to `gcry_mpi_mul@GCRYPT_1.2'
/usr/ia64-linux-gnu/sys-root/usr/lib/libgnutls.so: undefined reference to `gcry_md_close@GCRYPT_1.2'
/usr/ia64-linux-gnu/sys-root/usr/lib/libgnutls.so: undefined reference to `gcry_mpi_cmp_ui@GCRYPT_1.2'
/usr/ia64-linux-gnu/sys-root/usr/lib/libgnutls.so: undefined reference to `gcry_cipher_encrypt@GCRYPT_1.2'
/usr/ia64-linux-gnu/sys-root/usr/lib/librt.so: undefined reference to `pthread_barrier_wait@GLIBC_2.2'
/usr/ia64-linux-gnu/sys-root/usr/lib/librt.so: undefined reference to `_pthread_cleanup_push@GLIBC_2.2'
collect2: ld returned 1 exit status
make[2]: *** [qemu-dm] Error 1
make[2]: Leaving directory `/home/agriffis/work/xen/20080102-cross/xen-unstable.hg/tools/ioemu/i386-dm'
make[1]: *** [subdir-i386-dm] Error 2
make[1]: Leaving directory `/home/agriffis/work/xen/20080102-cross/xen-unstable.hg/tools/ioemu'
make: *** [ioemu] Error 2
------------------------------------------------------------

Here's a small patch which reduces this output significantly by fixing the sys-root problem. It seems that the '=' tells ld to use the sys-root, if it was built with --with-sysroot:

tools/ioemu/ia64.ld +1 -1
diff -r 32d4dda41994 tools/ioemu/ia64.ld
@@ -3,7 +3,7 @@ OUTPUT_FORMAT("elf64-ia64-little", "elf6
 	      "elf64-ia64-little")
 OUTPUT_ARCH(ia64)
 ENTRY(_start)
-SEARCH_DIR("/usr/ia64-linux/lib"); SEARCH_DIR("/usr/local/lib"); SEARCH_DIR("/lib"); SEARCH_DIR("/usr/lib");
+SEARCH_DIR("=/usr/ia64-linux/lib"); SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
 /* Do we need any of these for elf?
    __DYNAMIC = 0;    */
 SECTIONS

However even with this patch, the build still fails. I guess I need to understand the point of these custom ld-scripts... With it commented out in Makefile.target, the build works fine!

------------------------------------------------------------
Output after patch
------------------------------------------------------------

$ make -j1 XEN_TARGET_ARCH=ia64 CROSS_COMPILE=ia64-linux-gnu- ioemu
[ -f ioemu/config-host.mak ] || \
          ( cd ioemu && XEN_TARGET_ARCH=ia64 sh configure --prefix=/usr \
                --cross-prefix=ia64-linux-gnu- --interp-prefix=/usr/ia64-linux-gnu/sys-root )
make -C ioemu 
make[1]: Entering directory `/home/agriffis/work/xen/20080102-cross/xen-unstable.hg/tools/ioemu'
make -C i386-dm all
*** PCI passthrough capability has been enabled ***
make[2]: Entering directory `/home/agriffis/work/xen/20080102-cross/xen-unstable.hg/tools/ioemu/i386-dm'
ia64-linux-gnu-gcc  -Wl,-G0 -Wl,-T,/home/agriffis/work/xen/20080102-cross/xen-unstable.hg/tools/ioemu/ia64.ld -o qemu-dm vl.o osdep.o readline.o monitor.o pci.o console.o isa_mmio.o cutils.o block.o block-raw.o block-cow.o block-qcow.o aes.o block-vmdk.o block-cloop.o block-dmg.o block-bochs.o block-vpc.o block-vvfat.o block-qcow2.o pass-through.o scsi-disk.o cdrom.o lsi53c895a.o usb.o usb-hub.o usb-linux.o usb-hid.o usb-ohci.o usb-msd.o ne2000.o rtl8139.o pcnet.o e100.o ide.o pckbd.o ps2.o vga.o sb16.o es1370.o dma.o audio.o noaudio.o wavaudio.o ossaudio.o wavcapture.o extboot.o fdc.o mc146818rtc.o serial.o pc.o cirrus_vga.o mixeng.o parallel.o acpi.o usb-uhci.o smbus_eeprom.o piix4acpi.o xenstore.o xen_platform.o xen_machine_fv.o xen_machine_pv.o xenfb.o xen_console.o tpm_tis.o vnc.o d3d
 es.o libqemu.a  -lm -L../../libxc -lxenctrl -lxenguest -L../../xenstore -lxenstore -lz -lpci -lgnutls     -lutil -lrt
../../xenstore/libxenstore.so: undefined reference to `__isoc99_sscanf@GLIBC_2.7'
collect2: ld returned 1 exit status
make[2]: *** [qemu-dm] Error 1
make[2]: Leaving directory `/home/agriffis/work/xen/20080102-cross/xen-unstable.hg/tools/ioemu/i386-dm'
make[1]: *** [subdir-i386-dm] Error 2
make[1]: Leaving directory `/home/agriffis/work/xen/20080102-cross/xen-unstable.hg/tools/ioemu'
make: *** [ioemu] Error 2
------------------------------------------------------------

Thanks,
Aron

#4 lore raw
Quoted 3 lines · Aron Griffis

However even with this patch, the build still fails. I guess I need to understand the point of these custom ld-scripts... With it commented out in Makefile.target, the build works fine!

I'll have to take a look, I'm not sure if custom linker scripts are inherited from upstream qemu. We certainly used to use one for 32-bit x86 so that we could 1:1 map as much guest physical memory as possible. That need has gone away with the mapcache, and anyway virtual address space was never a limiting factor for 64-bit architectures in the first place.

-- Keir

#5 lore raw
Quoted 9 lines · Keir Fraser
Quoted 3 lines

However even with this patch, the build still fails. I guess I need to understand the point of these custom ld-scripts... With it commented out in Makefile.target, the build works fine!

I'll have to take a look, I'm not sure if custom linker scripts are inherited from upstream qemu. We certainly used to use one for 32-bit x86 so that we could 1:1 map as much guest physical memory as possible. That need has gone away with the mapcache, and anyway virtual address space was never a limiting factor for 64-bit architectures in the first place.

ia64 is the only qemu_dm-supported architecture using a linker script. If you don't need it, please submit a patch to remove it from VL_LDFLAGS in Makefile.target.

-- Keir

#6 lore raw
In reply to Keir Fraser
Quoted 6 lines · Keir Fraser

I'm not sure what particular scenario Bastian was intending to fix, but the patch does appear to make sense. qemu-dm is going to run in the target system's dom0. So the 'host CPU' type for qemu-dm is related to XEN_TARGET_ARCH, not XEN_COMPILE_ARCH nor 'uname -m'. This is a bit confusing because for qemu there are three environments to consider: build, host and emulated. I do believe that host CPU need not == build CPU.

We also need it (or something like it) to correctly get a 64-bit qemu-dm on Solaris.

regards
john