[Bug target/71749] Define _REENTRANT on ARC when -pthread is passed

2023-09-28 Thread roger at nextmovesoftware dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71749

Roger Sayle  changed:

   What|Removed |Added

 CC||roger at nextmovesoftware dot 
com
 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |FIXED

--- Comment #6 from Roger Sayle  ---
This has been fixed on mainline since March 2017 thanks to:
2017-03-28  Claudiu Zissulescu  
Thomas Petazzoni 

[Bug target/71749] Define _REENTRANT on ARC when -pthread is passed

2017-03-02 Thread thomas.petazz...@free-electrons.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71749

--- Comment #5 from Thomas Petazzoni  ---
Sure, feel free to submit it. If that's easier for the gcc submission process,
feel free to submit it under your own name: for such a small contribution, I
really don't care if my authorship is preserved.

[Bug target/71749] Define _REENTRANT on ARC when -pthread is passed

2017-03-02 Thread claziss at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71749

--- Comment #4 from Claudiu Zissulescu  ---
If it is ok with you, I will do it in ur name as well. But first, let me see
how the nightly goes.

[Bug target/71749] Define _REENTRANT on ARC when -pthread is passed

2017-03-02 Thread thomas.petazz...@free-electrons.com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71749

--- Comment #3 from Thomas Petazzoni  ---
Will you submit the patch to gcc mainline yourself?

[Bug target/71749] Define _REENTRANT on ARC when -pthread is passed

2017-03-02 Thread claziss at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71749

--- Comment #2 from Claudiu Zissulescu  ---
Proposed patch for mainline:

diff --git a/gcc/config/arc/arc.h b/gcc/config/arc/arc.h
index 5cc9dc1..d270390 100644
--- a/gcc/config/arc/arc.h
+++ b/gcc/config/arc/arc.h
@@ -62,7 +62,8 @@ along with GCC; see the file COPYING3.  If not see
 %{mdsp-packa:-D__Xdsp_packa} %{mcrc:-D__Xcrc} %{mdvbf:-D__Xdvbf} \
 %{mtelephony:-D__Xtelephony} %{mxy:-D__Xxy} %{mmul64: -D__Xmult32} \
 %{mlock:-D__Xlock} %{mswape:-D__Xswape} %{mrtsc:-D__Xrtsc} \
-%{mcpu=nps400:-D__NPS400__}"
+%{mcpu=nps400:-D__NPS400__} \
+%(subtarget_cpp_spec)"

 #undef CC1_SPEC
 #define CC1_SPEC "\
@@ -74,6 +75,27 @@ extern const char *arc_cpu_to_as (int argc, const char
**argv);
 #define EXTRA_SPEC_FUNCTIONS   \
   { "cpu_to_as", arc_cpu_to_as },

+/* This macro defines names of additional specifications to put in the specs
+   that can be used in various specifications like CC1_SPEC.  Its definition
+   is an initializer with a subgrouping for each command option.
+
+   Each subgrouping contains a string constant, that defines the
+   specification name, and a string constant that used by the GCC driver
+   program.
+
+   Do not define this macro if it does not need to do anything.  */
+#define EXTRA_SPECS  \
+  { "subtarget_cpp_spec",  SUBTARGET_CPP_SPEC }, \
+  SUBTARGET_EXTRA_SPECS
+
+#ifndef SUBTARGET_EXTRA_SPECS
+#define SUBTARGET_EXTRA_SPECS
+#endif
+
+#ifndef SUBTARGET_CPP_SPEC
+#define SUBTARGET_CPP_SPEC ""
+#endif
+
 #undef ASM_SPEC
 #define ASM_SPEC  "%{mbig-endian|EB:-EB} %{EL} "   \
   "%:cpu_to_as(%{mcpu=*:%*}) %{mspfp*} %{mdpfp*} %{mfpu=fpuda*:-mfpuda}"
diff --git a/gcc/config/arc/elf.h b/gcc/config/arc/elf.h
index e0c3350..fbdb1d7 100644
--- a/gcc/config/arc/elf.h
+++ b/gcc/config/arc/elf.h
@@ -26,7 +26,8 @@ along with GCC; see the file COPYING3.  If not see

 #define ARC_TLS_EXTRA_START_SPEC "crttls.o%s"

-#define EXTRA_SPECS \
+#undef SUBTARGET_EXTRA_SPECS
+#define SUBTARGET_EXTRA_SPECS \
   { "arc_tls_extra_start_spec", ARC_TLS_EXTRA_START_SPEC }, \

 #undef STARTFILE_SPEC
diff --git a/gcc/config/arc/linux.h b/gcc/config/arc/linux.h
index 590f1a9..db60870 100644
--- a/gcc/config/arc/linux.h
+++ b/gcc/config/arc/linux.h
@@ -86,3 +86,8 @@ along with GCC; see the file COPYING3.  If not see
 /* Pre/post modify with register displacement are default off.  */
 #undef TARGET_AUTO_MODIFY_REG_DEFAULT
 #define TARGET_AUTO_MODIFY_REG_DEFAULT 0
+
+#undef SUBTARGET_CPP_SPEC
+#define SUBTARGET_CPP_SPEC "\
+   %{pthread:-D_REENTRANT} \
+"

[Bug target/71749] Define _REENTRANT on ARC when -pthread is passed

2017-02-27 Thread claziss at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71749

Claudiu Zissulescu  changed:

   What|Removed |Added

 CC||claziss at gmail dot com

--- Comment #1 from Claudiu Zissulescu  ---
This is not the place to propose patches. If you want, you can make rework your
patch on the current gcc and propose it to gcc-patches. Please cc me to quickly
review your patch.

Thanks,
Claudiu