From: Andreas Tobler <andreast@FreeBSD.org>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH] fix compilation/link with clang, target-i386/cpu.c
Date: Mon, 11 Nov 2013 22:12:01 +0100 [thread overview]
Message-ID: <52814821.2020803@FreeBSD.org> (raw)
In-Reply-To: <CAFEAcA84L1x8nN9O31HM0S1gTunvGvq+R4yyA0_ECGFF5E3Vng@mail.gmail.com>
On 11.11.13 22:02, Peter Maydell wrote:
> On 11 November 2013 20:10, Andreas Tobler <andreast@freebsd.org> wrote:
>> Paolo asked me to test and submit the below patch to fix compilation and
>> link with clang.
>>
>> Paolo reduced the issue to a clang bug where dead code is not properly
>> eliminated before linktime. (the clang bug ID: 17882)
>
> Thanks for the patch. However, it looks a bit odd to me. Can
> you quote the error message clang produces, please?
[tcx58:build/qemu/objdir] andreast% gmake
CC x86_64-softmmu/target-i386/cpu.o
LINK x86_64-softmmu/qemu-system-x86_64
target-i386/cpu.o: In function `cpu_x86_cpuid':
/export/devel/net/src/qemu/qemu-master/target-i386/cpu.c:2203: undefined
reference to `kvm_arch_get_supported_cpuid'
/export/devel/net/src/qemu/qemu-master/target-i386/cpu.c:2204: undefined
reference to `kvm_arch_get_supported_cpuid'
/export/devel/net/src/qemu/qemu-master/target-i386/cpu.c:2223: undefined
reference to `kvm_arch_get_supported_cpuid'
cc: error: linker command failed with exit code 1 (use -v to see invocation)
gmake[1]: *** [qemu-system-x86_64] Error 1
gmake: *** [subdir-x86_64-softmmu] Error 2
> I think I would agree with the commenter in the bug report you
> reference (http://llvm.org/bugs/show_bug.cgi?id=17882)
> that this is not a clang bug. We shouldn't be relying on the
> compiler's dead code elimination to get rid of references to
> functions that don't exist in certain configurations. This will
> always be unreliable (especially if compiling without optimization).
> Instead we should either be using ifdefs or stub functions (probably
> the latter in this case).
I know it is a difficult business. And probably you're right, but from a
dump users point of view I do not agree.
I'm used to gcc, which is able to compile this, and I expect other
compilers to be able to do the same. The compiler should work for me not
vice versa :)
> If you put a stub implementation of kvm_arch_get_supported_cpuid()
> into target-i386/kvm-stub.c does this fix the compilation issue?
Will try and let you know.
Thanks,
Andreas
next prev parent reply other threads:[~2013-11-11 21:12 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-11 20:10 [Qemu-devel] [PATCH] fix compilation/link with clang, target-i386/cpu.c Andreas Tobler
2013-11-11 21:02 ` Peter Maydell
2013-11-11 21:12 ` Andreas Tobler [this message]
2013-11-11 21:14 ` Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=52814821.2020803@FreeBSD.org \
--to=andreast@freebsd.org \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.