All of lore.kernel.org
 help / color / mirror / Atom feed
* [kvm-unit-tests PATCH] Makefile: Move -no-pie from CFLAGS into LDFLAGS
@ 2023-08-22  7:49 Thomas Huth
  2023-08-22  8:07 ` Andrew Jones
  2023-08-22  8:37 ` Janosch Frank
  0 siblings, 2 replies; 4+ messages in thread
From: Thomas Huth @ 2023-08-22  7:49 UTC (permalink / raw)
  To: kvm; +Cc: Andrew Jones, Janosch Frank, Paolo Bonzini

"-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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [kvm-unit-tests PATCH] Makefile: Move -no-pie from CFLAGS into LDFLAGS
  2023-08-22  7:49 [kvm-unit-tests PATCH] Makefile: Move -no-pie from CFLAGS into LDFLAGS Thomas Huth
@ 2023-08-22  8:07 ` Andrew Jones
  2023-08-22  8:37 ` Janosch Frank
  1 sibling, 0 replies; 4+ messages in thread
From: Andrew Jones @ 2023-08-22  8:07 UTC (permalink / raw)
  To: Thomas Huth; +Cc: kvm, Janosch Frank, Paolo Bonzini

On Tue, Aug 22, 2023 at 09:49:06AM +0200, Thomas Huth wrote:
> "-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
                ^ L

> 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
> 

Otherwise,

Reviewed-by: Andrew Jones <andrew.jones@linux.dev>

Thanks,
drew

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [kvm-unit-tests PATCH] Makefile: Move -no-pie from CFLAGS into LDFLAGS
  2023-08-22  7:49 [kvm-unit-tests PATCH] Makefile: Move -no-pie from CFLAGS into LDFLAGS Thomas Huth
  2023-08-22  8:07 ` Andrew Jones
@ 2023-08-22  8:37 ` Janosch Frank
  2023-08-22  9:28   ` Thomas Huth
  1 sibling, 1 reply; 4+ messages in thread
From: Janosch Frank @ 2023-08-22  8:37 UTC (permalink / raw)
  To: Thomas Huth, kvm; +Cc: Andrew Jones, Paolo Bonzini

On 8/22/23 09:49, Thomas Huth wrote:
> "-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>

Just tested it on my system, this fixes the compile problem.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [kvm-unit-tests PATCH] Makefile: Move -no-pie from CFLAGS into LDFLAGS
  2023-08-22  8:37 ` Janosch Frank
@ 2023-08-22  9:28   ` Thomas Huth
  0 siblings, 0 replies; 4+ messages in thread
From: Thomas Huth @ 2023-08-22  9:28 UTC (permalink / raw)
  To: Janosch Frank, kvm; +Cc: Andrew Jones, Paolo Bonzini

On 22/08/2023 10.37, Janosch Frank wrote:
> On 8/22/23 09:49, Thomas Huth wrote:
>> "-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>
> 
> Just tested it on my system, this fixes the compile problem.

Great, thanks for checking, so I pushed it now to the repo.

  Thomas


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-08-22  9:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-22  7:49 [kvm-unit-tests PATCH] Makefile: Move -no-pie from CFLAGS into LDFLAGS Thomas Huth
2023-08-22  8:07 ` Andrew Jones
2023-08-22  8:37 ` Janosch Frank
2023-08-22  9:28   ` Thomas Huth

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.