[v2] RTEMS: Add -ftls-model=local-exec to multilibs
Commit Message
Use the local-exec TLS model for all multilibs of all RTEMS targets with proper
TLS support.
gcc/ChangeLog:
* config.gcc (aarch64-*-rtems*): Extend tmake_file.
* config/arm/t-rtems (MULTILIB_EXTRA_OPTS): Define to use
-ftls-model=local-exec.
* config/i386/t-rtems (MULTILIB_EXTRA_OPTS): Likewise.
* config/m68k/t-rtems (MULTILIB_EXTRA_OPTS): Likewise.
* config/microblaze/t-rtems (MULTILIB_EXTRA_OPTS): Likewise.
* config/nios2/t-rtems (MULTILIB_EXTRA_OPTS): Likewise.
* config/riscv/t-rtems (MULTILIB_EXTRA_OPTS): Likewise.
* config/rs6000/t-rtems (MULTILIB_EXTRA_OPTS): Likewise.
* config/sparc/t-rtems (MULTILIB_EXTRA_OPTS): Likewise.
* config/aarch64/t-aarch64-rtems: New file.
---
v2:
* Include aarch64. This required a new RTEMS-specific file.
gcc/config.gcc | 1 +
gcc/config/aarch64/t-aarch64-rtems | 20 ++++++++++++++++++++
gcc/config/arm/t-rtems | 1 +
gcc/config/i386/t-rtems | 1 +
gcc/config/m68k/t-rtems | 1 +
gcc/config/microblaze/t-rtems | 1 +
gcc/config/nios2/t-rtems | 1 +
gcc/config/riscv/t-rtems | 2 ++
gcc/config/rs6000/t-rtems | 1 +
gcc/config/sparc/t-rtems | 2 ++
10 files changed, 31 insertions(+)
create mode 100644 gcc/config/aarch64/t-aarch64-rtems
@@ -1093,6 +1093,7 @@ aarch64*-*-elf | aarch64*-*-fuchsia* | aarch64*-*-rtems*)
;;
aarch64-*-rtems*)
tm_file="${tm_file} aarch64/rtems.h rtems.h"
+ tmake_file="${tmake_file} aarch64/t-aarch64-rtems"
;;
esac
case $target in
new file mode 100644
@@ -0,0 +1,20 @@
+# Machine description for AArch64 architecture.
+# Copyright (C) 2022 Free Software Foundation, Inc.
+#
+# This file is part of GCC.
+#
+# GCC is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# GCC is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING3. If not see
+# <http://www.gnu.org/licenses/>.
+
+MULTILIB_EXTRA_OPTS = ftls-model=local-exec
@@ -8,6 +8,7 @@ MULTILIB_EXCEPTIONS =
MULTILIB_REUSE =
MULTILIB_MATCHES =
MULTILIB_REQUIRED =
+MULTILIB_EXTRA_OPTS = ftls-model=local-exec
# Enumeration of multilibs
@@ -24,3 +24,4 @@ MULTILIB_MATCHES += march?pentium=march?k6 march?pentiumpro=march?athlon
MULTILIB_EXCEPTIONS = \
march=pentium/*msoft-float* \
march=pentiumpro/*msoft-float*
+MULTILIB_EXTRA_OPTS = ftls-model=local-exec
@@ -7,3 +7,4 @@ M68K_MLIB_CPU += && (match(MLIB, "^68") \
|| MLIB == "5329" \
|| MLIB == "5407" \
|| MLIB == "5475")
+MULTILIB_EXTRA_OPTS = ftls-model=local-exec
@@ -1 +1,2 @@
# Custom multilibs for RTEMS
+MULTILIB_EXTRA_OPTS = ftls-model=local-exec
@@ -8,6 +8,7 @@ MULTILIB_EXCEPTIONS =
MULTILIB_REUSE =
MULTILIB_MATCHES =
MULTILIB_REQUIRED =
+MULTILIB_EXTRA_OPTS = ftls-model=local-exec
# Enumeration of multilibs
@@ -1,3 +1,5 @@
+MULTILIB_EXTRA_OPTS = ftls-model=local-exec
+
MULTILIB_OPTIONS =
MULTILIB_DIRNAMES =
@@ -23,6 +23,7 @@ MULTILIB_DIRNAMES =
MULTILIB_MATCHES =
MULTILIB_EXCEPTIONS =
MULTILIB_REQUIRED =
+MULTILIB_EXTRA_OPTS = ftls-model=local-exec
MULTILIB_OPTIONS += mcpu=403/mcpu=505/mcpu=603e/mcpu=604/mcpu=860/mcpu=7400/mcpu=8540/mcpu=e6500
MULTILIB_DIRNAMES += m403 m505 m603e m604 m860 m7400 m8540 me6500
@@ -17,6 +17,8 @@
# <http://www.gnu.org/licenses/>.
#
+MULTILIB_EXTRA_OPTS = ftls-model=local-exec
+
MULTILIB_OPTIONS = msoft-float mcpu=v8/mcpu=leon3/mcpu=leon3v7/mcpu=leon \
mfix-ut699/mfix-at697f/mfix-gr712rc
MULTILIB_DIRNAMES = soft v8 leon3 leon3v7 leon ut699 at697f gr712rc