⛏️ index : buildtools.git

author PulkoMandy <pulkomandy@pulkomandy.tk> 2022-04-10 18:29:06.0 +02:00:00
committer Adrien Destugues <pulkomandy@gmail.com> 2022-04-21 15:43:56.0 +00:00:00
commit
493aaad4dc61224ff101425c283a36960fb6841b [patch]
tree
63212960c675a868c3eb4743dc16070dfe562662
parent
faaf2fe1c82eb0997e642c175023fe74a8321d4f
download
493aaad4dc61224ff101425c283a36960fb6841b.tar.gz

gcc: make -fPIE do the same as -fPIC

Should fix the root cause of https://github.com/haikuports/haikuports/issues/4316

Some CPU architectures do similar things (for example because they don't
support PIC at all). So it should be fine to do it here. See for example
gcc/gcc/config/gcn/gcn.c

Change-Id: Ie23e4ece0d09c1083ad3c3bf43756f3207bbdafe
Reviewed-on: https://review.haiku-os.org/c/buildtools/+/5194
Reviewed-by: X512 <danger_mail@list.ru>
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>

Diff

 gcc/gcc/config/haiku.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/gcc/gcc/config/haiku.c b/gcc/gcc/config/haiku.c
index bf62ad5..af14c02 100644
--- a/gcc/gcc/config/haiku.c
+++ a/gcc/gcc/config/haiku.c
@@ -29,4 +29,11 @@
    dwarf_strict = 1;
  if (!global_options_set.x_dwarf_version)
    dwarf_version = 4;

  /* PIE does not work on Haiku, but PIC does the right thing for position
   * independant executables. So if asked for PIE, do PIC instead.
   */
  if (flag_pie && !flag_pic)
    flag_pic = flag_pie;
  flag_pie = 0;
}