From: Claudio Imbrenda <imbrenda@linux.ibm.com>
To: Vitaly Kuznetsov <vkuznets@redhat.com>
Cc: kvm@vger.kernel.org, Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [kvm-unit-tests PATCH] x86: fix build with GCC10
Date: Mon, 22 Jun 2020 17:03:10 +0200 [thread overview]
Message-ID: <20200622170310.19207029@ibm-vm> (raw)
In-Reply-To: <20200617152124.402765-1-vkuznets@redhat.com>
On Wed, 17 Jun 2020 17:21:24 +0200
Vitaly Kuznetsov <vkuznets@redhat.com> wrote:
> kvm-unit-tests fail to build with GCC10:
>
> /usr/bin/ld: lib/libcflat.a(usermode.o):
> ./kvm-unit-tests/lib/x86/usermode.c:17: multiple definition of
> `jmpbuf'; lib/libcflat.a(fault_test.o):
> ./kvm-unit-tests/lib/x86/fault_test.c:3: first defined here
>
> It seems that 'jmpbuf' doesn't need to be global in either of these
> files, make it static in both.
>
> Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
I stumbled upon the same issue, and I had independently tested this
exact solution :)
Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Tested-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
> ---
> lib/x86/fault_test.c | 2 +-
> lib/x86/usermode.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/lib/x86/fault_test.c b/lib/x86/fault_test.c
> index 078dae3da640..e15a21864562 100644
> --- a/lib/x86/fault_test.c
> +++ b/lib/x86/fault_test.c
> @@ -1,6 +1,6 @@
> #include "fault_test.h"
>
> -jmp_buf jmpbuf;
> +static jmp_buf jmpbuf;
>
> static void restore_exec_to_jmpbuf(void)
> {
> diff --git a/lib/x86/usermode.c b/lib/x86/usermode.c
> index f01ad9be1799..f0325236dd05 100644
> --- a/lib/x86/usermode.c
> +++ b/lib/x86/usermode.c
> @@ -14,7 +14,7 @@
> #define USERMODE_STACK_SIZE 0x2000
> #define RET_TO_KERNEL_IRQ 0x20
>
> -jmp_buf jmpbuf;
> +static jmp_buf jmpbuf;
>
> static void restore_exec_to_jmpbuf(void)
> {
next prev parent reply other threads:[~2020-06-22 15:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-17 15:21 [kvm-unit-tests PATCH] x86: fix build with GCC10 Vitaly Kuznetsov
2020-06-22 15:03 ` Claudio Imbrenda [this message]
2020-06-22 17:22 ` Paolo Bonzini
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=20200622170310.19207029@ibm-vm \
--to=imbrenda@linux.ibm.com \
--cc=kvm@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=vkuznets@redhat.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox