⛏️ index : buildtools.git

author Alexander von Gluck IV <kallisti5@unixzen.com> 2021-12-28 10:44:56.0 -06:00:00
committer Alex von Gluck IV <kallisti5@unixzen.com> 2021-12-28 18:37:54.0 +00:00:00
commit
7b6c9e88a2b00679382ba16112c848225fcd4a3d [patch]
tree
8e922fe05877eb3e2aaf549f0b090c8668d93564
parent
55771191ca0b8382e3e1b05c8758c08c1a398eda
download
7b6c9e88a2b00679382ba16112c848225fcd4a3d.tar.gz

gcc/config: Fix LINK_SPEC on aarch64,m68k,mips,riscv,rs6000

* Results in an internal compiler error: in do_spec_1, at gcc.c:5971
* %{!o*:-o %b} is "no output flag to linker, add one with input name"
* ld blah.o becomes ld blah.o -o blah
* We really shouldn't be playing with this in linker specs... It also
  breaks on gcc 11.

Change-Id: I63d0afecd16f25423874419c0ac9496404b2069e
Reviewed-on: https://review.haiku-os.org/c/buildtools/+/4834
Reviewed-by: Fredrik Holmqvist <fredrik.holmqvist@gmail.com>

Diff

 gcc/gcc/config/aarch64/aarch64-haiku.h | 2 +-
 gcc/gcc/config/m68k/haiku.h            | 2 +-
 gcc/gcc/config/mips/haiku.h            | 2 +-
 gcc/gcc/config/riscv/haiku.h           | 2 +-
 gcc/gcc/config/rs6000/haiku.h          | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/gcc/gcc/config/aarch64/aarch64-haiku.h b/gcc/gcc/config/aarch64/aarch64-haiku.h
index a61ebfa..2305a55 100644
--- a/gcc/gcc/config/aarch64/aarch64-haiku.h
+++ a/gcc/gcc/config/aarch64/aarch64-haiku.h
@@ -67,7 +67,7 @@


#undef	LINK_SPEC
#define LINK_SPEC "%{!o*:-o %b} -m " TARGET_LINKER_EMULATION " %{!r:-shared} %{nostart:-e 0} %{shared:-e 0} %{!shared: %{!nostart: -no-undefined}}\
#define LINK_SPEC "-m " TARGET_LINKER_EMULATION " %{!r:-shared} %{nostart:-e 0} %{shared:-e 0} %{!shared: %{!nostart: -no-undefined}}\
	%{mbig-endian:-EB} %{mlittle-endian:-EL} " CA53_ERR_835769_SPEC " " CA53_ERR_843419_SPEC " -X"

#endif  /* GCC_AARCH64_HAIKU_H */
diff --git a/gcc/gcc/config/m68k/haiku.h b/gcc/gcc/config/m68k/haiku.h
index e9495d4..ce43a66 100644
--- a/gcc/gcc/config/m68k/haiku.h
+++ a/gcc/gcc/config/m68k/haiku.h
@@ -108,7 +108,7 @@

#undef	LINK_SPEC
/*#define LINK_SPEC "%{!o*:-o %b} -m elf_m68k_haiku -shared -no-undefined %{nostart:-e 0}"*/
#define LINK_SPEC "%{!o*:-o %b} -m m68kelf %{!r:-shared} %{nostart:-e 0} %{shared:-e 0} %{!shared: %{!nostart: -no-undefined}}"
#define LINK_SPEC "-m m68kelf %{!r:-shared} %{nostart:-e 0} %{shared:-e 0} %{!shared: %{!nostart: -no-undefined}}"

/* XXX: not sure for the rest there... */

diff --git a/gcc/gcc/config/mips/haiku.h b/gcc/gcc/config/mips/haiku.h
index f6d2efb..870173d 100644
--- a/gcc/gcc/config/mips/haiku.h
+++ a/gcc/gcc/config/mips/haiku.h
@@ -40,5 +40,5 @@
  while (0)

#undef	LINK_SPEC
#define LINK_SPEC "%{!o*:-o %b} -m elf_mipsel_haiku %{!r:-shared} %{nostart:-e 0}"
#define LINK_SPEC "-m elf_mipsel_haiku %{!r:-shared} %{nostart:-e 0}"

diff --git a/gcc/gcc/config/riscv/haiku.h b/gcc/gcc/config/riscv/haiku.h
index 1338375..9b31a4d 100644
--- a/gcc/gcc/config/riscv/haiku.h
+++ a/gcc/gcc/config/riscv/haiku.h
@@ -54,4 +54,4 @@
#define ICACHE_FLUSH_FUNC "__riscv_flush_icache"

#undef	LINK_SPEC
#define LINK_SPEC "%{!o*:-o %b} -melf" XLEN_SPEC "lriscv %{!r:-shared} %{nostart:-e 0} %{shared:-e 0} %{!shared: %{!nostart: -no-undefined}} -X"
#define LINK_SPEC "-melf" XLEN_SPEC "lriscv %{!r:-shared} %{nostart:-e 0} %{shared:-e 0} %{!shared: %{!nostart: -no-undefined}} -X"
diff --git a/gcc/gcc/config/rs6000/haiku.h b/gcc/gcc/config/rs6000/haiku.h
index 4dff89e..fee7c3c 100644
--- a/gcc/gcc/config/rs6000/haiku.h
+++ a/gcc/gcc/config/rs6000/haiku.h
@@ -53,4 +53,4 @@
/* If ELF is the default format, we should not use /lib/elf.  */

#undef	LINK_SPEC
#define LINK_SPEC "%{!o*:-o %b} -m elf32ppchaiku %{!r:-shared} %{nostart:-e 0} %{shared:-e 0} %{!shared: %{!nostart: -no-undefined}}"
#define LINK_SPEC "-m elf32ppchaiku %{!r:-shared} %{nostart:-e 0} %{shared:-e 0} %{!shared: %{!nostart: -no-undefined}}"