All of lore.kernel.org
 help / color / mirror / Atom feed
* disable-pie build
@ 2023-11-11  2:39 Michael Tokarev
  2023-11-11 16:09 ` Paolo Bonzini
  2023-11-12 17:03 ` Paolo Bonzini
  0 siblings, 2 replies; 7+ messages in thread
From: Michael Tokarev @ 2023-11-11  2:39 UTC (permalink / raw)
  To: QEMU Developers, Paolo Bonzini

Hi!

It looks like --disable-pie configure, which uses -fno-pie -no-pie flags
for the compiler, is broken: it does not not tell the *linker* about the
option, so the link fails (at least on debian bookworm):

/usr/bin/ld: libcommon.fa.p/hw_core_cpu-common.c.o: relocation R_X86_64_32 against `.rodata' can not be used when making a PIE object; recompile with 
-fPIE
/usr/bin/ld: failed to set dynamic section sizes: bad value

This is failing for *all* executables, including tests, qemu-img, etc.

The following change fixes it:

diff --git a/meson.build b/meson.build
index a9c4f28247..0b7ca45d48 100644
--- a/meson.build
+++ b/meson.build
@@ -278,7 +278,8 @@ endif
  # tries to build an executable instead of a shared library and fails.  So
  # don't add -no-pie anywhere and cross fingers. :(
  if not get_option('b_pie')
-  qemu_common_flags += cc.get_supported_arguments('-fno-pie', '-no-pie')
+  qemu_common_flags += cc.get_supported_arguments('-fno-pie')
+  qemu_ldflags += cc.get_supported_arguments('-no-pie')
  endif

  if not get_option('stack_protector').disabled()




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

end of thread, other threads:[~2023-11-12 19:12 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-11  2:39 disable-pie build Michael Tokarev
2023-11-11 16:09 ` Paolo Bonzini
2023-11-11 20:09   ` Volker Rümelin
2023-11-12  9:13     ` Paolo Bonzini
2023-11-12 10:22       ` Michael Tokarev
2023-11-12 17:03 ` Paolo Bonzini
2023-11-12 19:11   ` Michael Tokarev

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.