Opened 13 years ago

Closed 12 years ago

#33862 closed defect (fixed)

qemu: error: redefinition of ‘flush_icache_range’

Reported by: trog24 (Frank J. R. Hanstick) Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version: 2.0.4
Keywords: Cc: khepler
Port: qemu

Description

Using:

sudo port upgrade outdated

qemu failed to build due to:

:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_emulators_qemu/qemu/work/qemu-1.0.1/tcg/tci/tcg-target.h:161: error: redefinition of ‘flush_icache_range’
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_emulators_qemu/qemu/work/qemu-1.0.1/cache-utils.h:16: error: previous definition of ‘flush_icache_range’ was here
:info:build make[1]: *** [tcg/tcg.o] Error 1
:info:build make[1]: *** Waiting for unfinished jobs....
:info:build make: *** [subdir-i386-softmmu] Error 2
:info:build make: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_emulators_qemu/qemu/work/qemu-1.0.1'
:info:build shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_emulators_qemu/qemu/work/qemu-1.0.1" && /usr/bin/make -j2 -w all " returned error 2
:error:build Target org.macports.build returned: shell command failed (see log for details)
:debug:build Backtrace: shell command failed (see log for details)
    while executing
"command_exec build"
    (procedure "portbuild::build_main" line 8)
    invoked from within
"$procedure $targetname"
:info:build Warning: the following items did not execute (for qemu): org.macports.install org.macports.build org.macports.destroot
:notice:build Log for qemu is at: /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_ports_emulators_qemu/qemu/main.log

The platform is a dual 1.73 GHz PowerPC G4 running MacOS 10.5.8. Attached is the build log.

Attachments (4)

main.log (43.9 KB) - added by trog24 (Frank J. R. Hanstick) 13 years ago.
qemu fail log.
patch-tcg-target-h.diff (567 bytes) - added by khepler 12 years ago.
patch to fix flush_icache_range redefinition
patch-configure.diff (729 bytes) - added by khepler 12 years ago.
updated configure patch for 1.1.1-1
Portfile (2.8 KB) - added by khepler 12 years ago.
Portfile for qemu-1.1.1-1 with conditional tcg-interpreter support

Download all attachments as: .zip

Change History (13)

Changed 13 years ago by trog24 (Frank J. R. Hanstick)

Attachment: main.log added

qemu fail log.

comment:1 Changed 13 years ago by ryandesign (Ryan Carsten Schmidt)

Summary: Qemu fails to build on ppc-G4qemu: error: redefinition of ‘flush_icache_range’

comment:2 Changed 13 years ago by jruschme@…

This is apparently an upstream problem which has been fixed upstream. See:

https://lists.gnu.org/archive/html/qemu-devel/2012-03/msg00769.html

comment:3 Changed 13 years ago by trog24 (Frank J. R. Hanstick)

qemu failed to build today (19 April) for the redefinition problem.

comment:4 Changed 12 years ago by trog24 (Frank J. R. Hanstick)

qemu failed to upgrade because of redefinition problem on 9 June 2012 following a MacPorts upgrade and cleaning out the old qemu.

comment:5 Changed 12 years ago by khepler

This problem still exists in 1.1.1-1. It's unclear if Qemu upstream really knows about this. The messages I found on the dev list seemed rather confused themselves.

I'm attaching the portfile I modified for 1.1.1-1 along with a patch for this problem and an updated configure patch. I removed the cocoa-uint16 patch because it no longer looks relevant. It builds on PowerPC Leopard, but needs more testing.

Changed 12 years ago by khepler

Attachment: patch-tcg-target-h.diff added

patch to fix flush_icache_range redefinition

Changed 12 years ago by khepler

Attachment: patch-configure.diff added

updated configure patch for 1.1.1-1

comment:6 Changed 12 years ago by khepler

Cc: khepler@… added

Cc Me!

comment:7 Changed 12 years ago by ironstorm@…

Was looking to get qemu 1.1.1/arm running to try to work on some Raspberry Pi images.

Found the Portfile attached here (thanks btw), looks like the patch-tcg-target-h.diff patch needs to be skipped on OSX 10.8/intel.

When it's included you get this:

  LINK  arm-softmmu/qemu-system-arm
Undefined symbols for architecture x86_64:
  "_flush_icache_range", referenced from:
      _tcg_prologue_init in tcg.o
      _tcg_gen_code in tcg.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [qemu-system-arm] Error 1
make: *** [subdir-arm-softmmu] Error 2

Changed 12 years ago by khepler

Attachment: Portfile added

Portfile for qemu-1.1.1-1 with conditional tcg-interpreter support

comment:8 in reply to:  7 Changed 12 years ago by khepler

Replying to ironstorm@…:

Found the Portfile attached here (thanks btw), looks like the patch-tcg-target-h.diff patch needs to be skipped on OSX 10.8/intel.

Thanks for testing! Sorry it took a little time, but I tracked the actual problem down to the --enable-tcg-interpreter configure flag. Removing this flag fixes the issue I thought I was solving with the tcg-target-h.patch file, but it appears to be required for the clang/llvm toolchain (e.g. Xcode 4).

Regardless, that patch seems to produces broken binaries on my system even though it completed the build, so it's right out. (see: "Needs testing" :) I'm increasing the port's revision number in case anyone else built the broken version. This was entirely my fault; I slightly misread the compiler error. Sorry about that.

Would you be kind enough to test this new Portfile on 10.8? It also needs to be tested on 10.6 and 10.7, if anyone could oblige...

comment:9 Changed 12 years ago by raimue (Rainer Müller)

Resolution: fixed
Status: newclosed

Should be fixed after r97499 which upgraded to qemu 1.2.0 and enabled use of TCG instead of the TCG interpreter.

Note: See TracTickets for help on using tickets.