Opened 5 years ago
Closed 5 years ago
#59257 closed defect (fixed)
qemu @4.1.0 Undefined symbols _clock_gettime
Reported by: | dubiousjim | Owned by: | raimue (Rainer Müller) |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | |
Keywords: | legacy-os | Cc: | Ionic (Mihai Moldovan), kencu (Ken) |
Port: | qemu |
Description
Really the failure is during the destroot stage, with the log message:
make[1]: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_emulators_qemu/qemu/work/qemu-4.1.0/slirp' make[1]: Nothing to be done for `all'. make[1]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_emulators_qemu/qemu/work/qemu-4.1.0/slirp' CC block.o no symbols LINK qemu-nbd Undefined symbols for architecture x86_64: "_clock_gettime", referenced from: _read_f in qemu-io-cmds.o _readv_f in qemu-io-cmds.o _write_f in qemu-io-cmds.o _writev_f in qemu-io-cmds.o _aio_read_f in qemu-io-cmds.o _aio_read_done in qemu-io-cmds.o _aio_write_f in qemu-io-cmds.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: *** [qemu-nbd] Error 1 make: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_emulators_qemu/qemu/work/qemu-4.1.0' Command failed: cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_emulators_qemu/qemu/work/qemu-4.1.0" && /usr/bin/make -w install DESTDIR=/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_emulators_qemu/qemu/work/destroot Exit code: 2 Error: Failed to destroot qemu: command execution failed
Log attached.
Attachments (2)
Change History (18)
Changed 5 years ago by dubiousjim
comment:1 Changed 5 years ago by kencu (Ken)
comment:2 follow-up: 6 Changed 5 years ago by kencu (Ken)
here you are, if you'd like to try it. some tweaking for exactly what systems need what fixes might be helpful.
<https://github.com/kencu/macports-ports/commit/b303e51d04c7ef481176bb2ea1c775625d208252>
$ port -v installed | grep qemu qemu @4.1.0_0+cocoa+ssh+target_arm+target_i386+target_m68k+target_ppc+target_x86_64+usb+vnc (active) platform='darwin 10' archs='x86_64' date='2019-10-12T14:50:06-0700'
comment:3 Changed 5 years ago by dubiousjim
Thanks! This built and installed fine. Haven't yet tested the result.
comment:5 Changed 5 years ago by kencu (Ken)
Summary: | qemu @4.1.0 build failure with +target_x86_64 → qemu @4.1.0 Undefined symbols _clock_gettime |
---|
comment:6 Changed 5 years ago by Ionic (Mihai Moldovan)
Cc: | Ionic added |
---|
I don't like your commit, though, for these reasons:
- adding linker flags to
C{,XX}
compiler calls sounds just plain wrong on many levels - the thread-local-storage change looks interesting, but isn't
qemu
special in that it can use emulated TLS, for which base has no support? You're essentially just replacing the black-/fallback list with that base feature, but not adding the special flag (which may not actually be needed if it worked for you, so... maybe not an issue after all? Have you tested the resulting binaries?) mktemp
isn't globally too old, only on some platforms AFAICT, so we could avoid a useless dependency on most (newer) systems- same for the cocoa interface change
Let's analyze this issue a bit further: funnily, the legacysupport
PG does work! qemu
builds fine.
However, it's reconfiguring and rebuilding in the destroot
(install
) stage and I guess that the flags are lost during the reconfiguration. That's what we actually have to fix - why would we need to rebuild the software after it was already built? The timestamping detection seems to be buggy for some reason.
Changed 5 years ago by Ionic (Mihai Moldovan)
Attachment: | qemu-out-of-source.patch added |
---|
Switch to out-of-source builds to work around reconfiguration problems.
comment:7 Changed 5 years ago by Ionic (Mihai Moldovan)
Cc: | kencu added |
---|
I've looked around and noticed that Linux distros generally build qemu out-of-source.
The reason for this is that the qemu
build system is essentially buggy when it comes to in-source-tree builds and always reconfigures (wrongly) at install/destroot time. I've tried to work around that issue and touch the file that is getting "too old" for its Makefile dependencies, but that didn't fix the actual problem because updating its timestamp just causes a different set of rebuilds (since it's being used as a prerequisite in other rules).
Switching to out-of-source builds fixes that problem in a pretty nice way.
I've also added Ken's fix for older mktemp
versions on 10.10-. Can someone on 10.10 and 10.11 tell me what a simple call to /usr/bin/mktemp
does? I know that it fails with a usage message on 10.9 and works on 10.12, but I have no data for either 10.10 or 10.11.
comment:8 Changed 5 years ago by kencu (Ken)
Yes, I hacked in a fix and moved on. That's why I didn't try to PR it. The legacysupport PG did not work for me, but that was then and this is now and who knows? maybe I flubbed something. Good luck! look forward to your product.
comment:9 Changed 5 years ago by Ionic (Mihai Moldovan)
The legacysupport PG worked fine for the initial build. The issue is that the software reconfigured itself in a bad way during destrooting when calling make install
and everything went haywire after that.
Just using an out-of-source build works fine on that front without requiring weird and ugly hacks.
I'll let Raim take over as the package maintainer. :)
comment:10 Changed 5 years ago by kencu (Ken)
That -femultedtls
business is a clang-specific flag that is automatically added by default by my clang
+emulatedtls variant when needed.
It's not something that qemu pays attention to, AFAIK.
So go with my change, I would say.
comment:11 Changed 5 years ago by Ionic (Mihai Moldovan)
Okay, makes sense to me. This said, that change is irrelevant to this bug report but an improvement to the port, and I hence think that Raim should apply it in a separate commit later on.
comment:12 Changed 5 years ago by kencu (Ken)
sure. BTW, that current femulatedtls flag actually doesn't work on it's own any more. The implementation was moved into llvm, as of maybe clang 7, so it just won't function anyway.
comment:13 Changed 5 years ago by dubiousjim
@Ionic asked about bare invocations of mktemp on OSX 10.10 (and 10.11, but I'm using 10.10). Not sure if that info is still needed, but in case it is:
$ /usr/bin/mktemp usage: mktemp [-d] [-q] [-t prefix] [-u] template ... mktemp [-d] [-q] [-u] -t prefix
comment:14 Changed 5 years ago by raimue (Rainer Müller)
Keywords: | legacy-os added |
---|
comment:15 Changed 5 years ago by Ionic (Mihai Moldovan)
Yep, thanks, so it's the usage message as well.
I'm just gonna push the changes, this kept on lingering for way too long.
comment:16 Changed 5 years ago by Mihai Moldovan <ionic@…>
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
I have this sorted out back to Snow Leopard at least. I'll post up a link shortly for you to try out.