From 6486b2b2a25405580558f9da34bf186400314fe6 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Mon, 6 May 2024 12:05:08 -0400 Subject: [PATCH] add patch for gcc sh/fdpic bug 114641 --- patches/gcc-10.3.0/0009-sh-fdpic-pr114641.diff | 12 ++++++++++++ patches/gcc-11.2.0/0009-sh-fdpic-pr114641.diff | 12 ++++++++++++ patches/gcc-5.3.0/0021-sh-fdpic-pr114641.diff | 12 ++++++++++++ patches/gcc-6.5.0/0026-sh-fdpic-pr114641.diff | 12 ++++++++++++ patches/gcc-7.5.0/0023-sh-fdpic-pr114641.diff | 12 ++++++++++++ patches/gcc-8.5.0/0022-sh-fdpic-pr114641.diff | 12 ++++++++++++ patches/gcc-9.4.0/0020-sh-fdpic-pr114641.diff | 12 ++++++++++++ 7 files changed, 84 insertions(+) create mode 100644 patches/gcc-10.3.0/0009-sh-fdpic-pr114641.diff create mode 100644 patches/gcc-11.2.0/0009-sh-fdpic-pr114641.diff create mode 100644 patches/gcc-5.3.0/0021-sh-fdpic-pr114641.diff create mode 100644 patches/gcc-6.5.0/0026-sh-fdpic-pr114641.diff create mode 100644 patches/gcc-7.5.0/0023-sh-fdpic-pr114641.diff create mode 100644 patches/gcc-8.5.0/0022-sh-fdpic-pr114641.diff create mode 100644 patches/gcc-9.4.0/0020-sh-fdpic-pr114641.diff diff --git a/patches/gcc-10.3.0/0009-sh-fdpic-pr114641.diff b/patches/gcc-10.3.0/0009-sh-fdpic-pr114641.diff new file mode 100644 index 0000000..988528e --- /dev/null +++ b/patches/gcc-10.3.0/0009-sh-fdpic-pr114641.diff @@ -0,0 +1,12 @@ +--- gcc-11.4.0/gcc/config/sh/sh.c.orig 2024-04-04 05:52:42.125373614 +0900 ++++ gcc-11.4.0/gcc/config/sh/sh.c 2024-04-04 22:54:01.875106654 +0900 +@@ -9147,7 +9147,7 @@ + { + /* Weak functions may be NULL which doesn't work with + GOTOFFFUNCDESC because the runtime offset is not known. */ +- if (SYMBOL_REF_WEAK (orig)) ++ if (SYMBOL_REF_WEAK (orig) || (TREE_PUBLIC(SYMBOL_REF_DECL(orig)) && DECL_VISIBILITY (SYMBOL_REF_DECL(orig)) != VISIBILITY_HIDDEN)) + emit_insn (gen_symGOTFUNCDESC2reg (reg, orig)); + else + emit_insn (gen_symGOTOFFFUNCDESC2reg (reg, orig)); + diff --git a/patches/gcc-11.2.0/0009-sh-fdpic-pr114641.diff b/patches/gcc-11.2.0/0009-sh-fdpic-pr114641.diff new file mode 100644 index 0000000..988528e --- /dev/null +++ b/patches/gcc-11.2.0/0009-sh-fdpic-pr114641.diff @@ -0,0 +1,12 @@ +--- gcc-11.4.0/gcc/config/sh/sh.c.orig 2024-04-04 05:52:42.125373614 +0900 ++++ gcc-11.4.0/gcc/config/sh/sh.c 2024-04-04 22:54:01.875106654 +0900 +@@ -9147,7 +9147,7 @@ + { + /* Weak functions may be NULL which doesn't work with + GOTOFFFUNCDESC because the runtime offset is not known. */ +- if (SYMBOL_REF_WEAK (orig)) ++ if (SYMBOL_REF_WEAK (orig) || (TREE_PUBLIC(SYMBOL_REF_DECL(orig)) && DECL_VISIBILITY (SYMBOL_REF_DECL(orig)) != VISIBILITY_HIDDEN)) + emit_insn (gen_symGOTFUNCDESC2reg (reg, orig)); + else + emit_insn (gen_symGOTOFFFUNCDESC2reg (reg, orig)); + diff --git a/patches/gcc-5.3.0/0021-sh-fdpic-pr114641.diff b/patches/gcc-5.3.0/0021-sh-fdpic-pr114641.diff new file mode 100644 index 0000000..988528e --- /dev/null +++ b/patches/gcc-5.3.0/0021-sh-fdpic-pr114641.diff @@ -0,0 +1,12 @@ +--- gcc-11.4.0/gcc/config/sh/sh.c.orig 2024-04-04 05:52:42.125373614 +0900 ++++ gcc-11.4.0/gcc/config/sh/sh.c 2024-04-04 22:54:01.875106654 +0900 +@@ -9147,7 +9147,7 @@ + { + /* Weak functions may be NULL which doesn't work with + GOTOFFFUNCDESC because the runtime offset is not known. */ +- if (SYMBOL_REF_WEAK (orig)) ++ if (SYMBOL_REF_WEAK (orig) || (TREE_PUBLIC(SYMBOL_REF_DECL(orig)) && DECL_VISIBILITY (SYMBOL_REF_DECL(orig)) != VISIBILITY_HIDDEN)) + emit_insn (gen_symGOTFUNCDESC2reg (reg, orig)); + else + emit_insn (gen_symGOTOFFFUNCDESC2reg (reg, orig)); + diff --git a/patches/gcc-6.5.0/0026-sh-fdpic-pr114641.diff b/patches/gcc-6.5.0/0026-sh-fdpic-pr114641.diff new file mode 100644 index 0000000..988528e --- /dev/null +++ b/patches/gcc-6.5.0/0026-sh-fdpic-pr114641.diff @@ -0,0 +1,12 @@ +--- gcc-11.4.0/gcc/config/sh/sh.c.orig 2024-04-04 05:52:42.125373614 +0900 ++++ gcc-11.4.0/gcc/config/sh/sh.c 2024-04-04 22:54:01.875106654 +0900 +@@ -9147,7 +9147,7 @@ + { + /* Weak functions may be NULL which doesn't work with + GOTOFFFUNCDESC because the runtime offset is not known. */ +- if (SYMBOL_REF_WEAK (orig)) ++ if (SYMBOL_REF_WEAK (orig) || (TREE_PUBLIC(SYMBOL_REF_DECL(orig)) && DECL_VISIBILITY (SYMBOL_REF_DECL(orig)) != VISIBILITY_HIDDEN)) + emit_insn (gen_symGOTFUNCDESC2reg (reg, orig)); + else + emit_insn (gen_symGOTOFFFUNCDESC2reg (reg, orig)); + diff --git a/patches/gcc-7.5.0/0023-sh-fdpic-pr114641.diff b/patches/gcc-7.5.0/0023-sh-fdpic-pr114641.diff new file mode 100644 index 0000000..988528e --- /dev/null +++ b/patches/gcc-7.5.0/0023-sh-fdpic-pr114641.diff @@ -0,0 +1,12 @@ +--- gcc-11.4.0/gcc/config/sh/sh.c.orig 2024-04-04 05:52:42.125373614 +0900 ++++ gcc-11.4.0/gcc/config/sh/sh.c 2024-04-04 22:54:01.875106654 +0900 +@@ -9147,7 +9147,7 @@ + { + /* Weak functions may be NULL which doesn't work with + GOTOFFFUNCDESC because the runtime offset is not known. */ +- if (SYMBOL_REF_WEAK (orig)) ++ if (SYMBOL_REF_WEAK (orig) || (TREE_PUBLIC(SYMBOL_REF_DECL(orig)) && DECL_VISIBILITY (SYMBOL_REF_DECL(orig)) != VISIBILITY_HIDDEN)) + emit_insn (gen_symGOTFUNCDESC2reg (reg, orig)); + else + emit_insn (gen_symGOTOFFFUNCDESC2reg (reg, orig)); + diff --git a/patches/gcc-8.5.0/0022-sh-fdpic-pr114641.diff b/patches/gcc-8.5.0/0022-sh-fdpic-pr114641.diff new file mode 100644 index 0000000..988528e --- /dev/null +++ b/patches/gcc-8.5.0/0022-sh-fdpic-pr114641.diff @@ -0,0 +1,12 @@ +--- gcc-11.4.0/gcc/config/sh/sh.c.orig 2024-04-04 05:52:42.125373614 +0900 ++++ gcc-11.4.0/gcc/config/sh/sh.c 2024-04-04 22:54:01.875106654 +0900 +@@ -9147,7 +9147,7 @@ + { + /* Weak functions may be NULL which doesn't work with + GOTOFFFUNCDESC because the runtime offset is not known. */ +- if (SYMBOL_REF_WEAK (orig)) ++ if (SYMBOL_REF_WEAK (orig) || (TREE_PUBLIC(SYMBOL_REF_DECL(orig)) && DECL_VISIBILITY (SYMBOL_REF_DECL(orig)) != VISIBILITY_HIDDEN)) + emit_insn (gen_symGOTFUNCDESC2reg (reg, orig)); + else + emit_insn (gen_symGOTOFFFUNCDESC2reg (reg, orig)); + diff --git a/patches/gcc-9.4.0/0020-sh-fdpic-pr114641.diff b/patches/gcc-9.4.0/0020-sh-fdpic-pr114641.diff new file mode 100644 index 0000000..988528e --- /dev/null +++ b/patches/gcc-9.4.0/0020-sh-fdpic-pr114641.diff @@ -0,0 +1,12 @@ +--- gcc-11.4.0/gcc/config/sh/sh.c.orig 2024-04-04 05:52:42.125373614 +0900 ++++ gcc-11.4.0/gcc/config/sh/sh.c 2024-04-04 22:54:01.875106654 +0900 +@@ -9147,7 +9147,7 @@ + { + /* Weak functions may be NULL which doesn't work with + GOTOFFFUNCDESC because the runtime offset is not known. */ +- if (SYMBOL_REF_WEAK (orig)) ++ if (SYMBOL_REF_WEAK (orig) || (TREE_PUBLIC(SYMBOL_REF_DECL(orig)) && DECL_VISIBILITY (SYMBOL_REF_DECL(orig)) != VISIBILITY_HIDDEN)) + emit_insn (gen_symGOTFUNCDESC2reg (reg, orig)); + else + emit_insn (gen_symGOTOFFFUNCDESC2reg (reg, orig)); +