From: Paolo Bonzini <pbonzini@redhat.com>
To: Shuah Khan <skhan@linuxfoundation.org>,
rkrcmar@redhat.com, shuah@kernel.org
Cc: kvm@vger.kernel.org, linux-kselftest@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] selftests: kvm: Fix libkvm build error
Date: Thu, 3 Oct 2019 12:00:43 +0200 [thread overview]
Message-ID: <4b46d043-9990-e95a-2665-a9382af1f723@redhat.com> (raw)
In-Reply-To: <20191002231430.5839-1-skhan@linuxfoundation.org>
On 03/10/19 01:14, Shuah Khan wrote:
> Fix the following build error from "make TARGETS=kvm kselftest":
>
> libkvm.a(assert.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIC
>
> This error is seen when build is done from the main Makefile using
> kselftest target. In this case KBUILD_CPPFLAGS and CC_OPTION_CFLAGS
> are defined.
>
> When build is invoked using:
>
> "make -C tools/testing/selftests/kvm" KBUILD_CPPFLAGS and CC_OPTION_CFLAGS
> aren't defined.
>
> There is no need to pass in KBUILD_CPPFLAGS and CC_OPTION_CFLAGS for the
> check to determine if --no-pie is necessary, which is the case when these
> two aren't defined when "make -C tools/testing/selftests/kvm" runs.
>
> Fix it by simplifying the no-pie-option logic. With this change, both
> build variations work.
>
> "make TARGETS=kvm kselftest"
> "make -C tools/testing/selftests/kvm"
>
> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
> ---
> Changes since v2:
> -- Removed extra blank line added by accident.
> -- Fixed commit log.
>
> tools/testing/selftests/kvm/Makefile | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/kvm/Makefile b/tools/testing/selftests/kvm/Makefile
> index 62c591f87dab..7ee097658ef0 100644
> --- a/tools/testing/selftests/kvm/Makefile
> +++ b/tools/testing/selftests/kvm/Makefile
> @@ -48,7 +48,7 @@ CFLAGS += -Wall -Wstrict-prototypes -Wuninitialized -O2 -g -std=gnu99 \
> -I$(LINUX_HDR_PATH) -Iinclude -I$(<D) -Iinclude/$(UNAME_M) -I..
>
> no-pie-option := $(call try-run, echo 'int main() { return 0; }' | \
> - $(CC) -Werror $(KBUILD_CPPFLAGS) $(CC_OPTION_CFLAGS) -no-pie -x c - -o "$$TMP", -no-pie)
> + $(CC) -Werror -no-pie -x c - -o "$$TMP", -no-pie)
>
> # On s390, build the testcases KVM-enabled
> pgste-option = $(call try-run, echo 'int main() { return 0; }' | \
>
Queued, thanks.
Paolo
prev parent reply other threads:[~2019-10-03 10:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-02 23:14 Shuah Khan
2019-10-03 10:00 ` Paolo Bonzini [this message]
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=4b46d043-9990-e95a-2665-a9382af1f723@redhat.com \
--to=pbonzini@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=rkrcmar@redhat.com \
--cc=shuah@kernel.org \
--cc=skhan@linuxfoundation.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®