Kernel KVM virtualization development
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: kvm@vger.kernel.org
Cc: Andrew Jones <andrew.jones@linux.dev>,
	Janosch Frank <frankja@linux.ibm.com>,
	Paolo Bonzini <pbonzini@redhat.com>
Subject: [kvm-unit-tests PATCH] Makefile: Move -no-pie from CFLAGS into LDFLAGS
Date: Tue, 22 Aug 2023 09:49:06 +0200	[thread overview]
Message-ID: <20230822074906.7205-1-thuth@redhat.com> (raw)

"-no-pie" is an option for linking, not for compiling, so we must put
this into the lDFLAGS, not into CFLAGS. Without this change, the linking
currently fails on Ubuntu 22.04 when compiling on a s390x host.

Reported-by: Janosch Frank <frankja@linux.ibm.com>
Fixes: e489c25e ("Rework the common LDFLAGS to become more useful again")
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 8809a8b6..e7998a40 100644
--- a/Makefile
+++ b/Makefile
@@ -80,7 +80,7 @@ COMMON_CFLAGS += $(if $(U32_LONG_FMT),-D__U32_LONG_FMT__,)
 ifeq ($(CONFIG_EFI),y)
 COMMON_CFLAGS += $(EFI_CFLAGS)
 else
-COMMON_CFLAGS += $(fno_pic) $(no_pie)
+COMMON_CFLAGS += $(fno_pic)
 endif
 COMMON_CFLAGS += $(wclobbered)
 COMMON_CFLAGS += $(wunused_but_set_parameter)
@@ -92,7 +92,7 @@ CFLAGS += -Woverride-init -Wmissing-prototypes -Wstrict-prototypes
 
 autodepend-flags = -MMD -MF $(dir $*).$(notdir $*).d
 
-LDFLAGS += -nostdlib -z noexecstack
+LDFLAGS += -nostdlib $(no_pie) -z noexecstack
 
 $(libcflat): $(cflatobjs)
 	$(AR) rcs $@ $^
-- 
2.39.3


             reply	other threads:[~2023-08-22  7:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-22  7:49 Thomas Huth [this message]
2023-08-22  8:07 ` [kvm-unit-tests PATCH] Makefile: Move -no-pie from CFLAGS into LDFLAGS Andrew Jones
2023-08-22  8:37 ` Janosch Frank
2023-08-22  9:28   ` Thomas Huth

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=20230822074906.7205-1-thuth@redhat.com \
    --to=thuth@redhat.com \
    --cc=andrew.jones@linux.dev \
    --cc=frankja@linux.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@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