[PATCH] GNU/Hurd config -pthread/profiling update
Samuel Thibault
samuel.thibault@ens-lyon.org
Sat Aug 4 21:19:00 GMT 2007
Samuel Thibault, le Fri 03 Aug 2007 22:26:29 +0200, a écrit :
> Here is a config update for GNU/Hurd for the -pthread option.
>
> Here is a patch for fixing profiling support in GNU/Hurd, to be applied
> on top of my previous pthread patch.
Could someone apply them?
Samuel
-------------- next part --------------
2007-08-03 Samuel Thibault <samuel.thibault@ens-lyon.org>
* gcc/config/i386/gnu.h (CPP_SPEC): Add -pthread option.
* gcc/config/gnu.h (LIB_SPEC): Likewise.
Index: gcc/config/i386/gnu.h
===================================================================
--- gcc/config/i386/gnu.h (r�vision 127183)
+++ gcc/config/i386/gnu.h (copie de travail)
@@ -12,7 +12,7 @@
while (0)
#undef CPP_SPEC
-#define CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{bsd:-D_BSD_SOURCE}"
+#define CPP_SPEC "%{pthread:-D_REENTRANT} %{posix:-D_POSIX_SOURCE} %{bsd:-D_BSD_SOURCE}"
#undef CC1_SPEC
#define CC1_SPEC "%(cc1_cpu)"
Index: gcc/config/gnu.h
===================================================================
--- gcc/config/gnu.h (r�vision 127183)
+++ gcc/config/gnu.h (copie de travail)
@@ -6,7 +6,7 @@
/* Default C library spec. Use -lbsd-compat for gcc -bsd. */
#undef LIB_SPEC
-#define LIB_SPEC "%{bsd:-lbsd-compat} %{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p}"
+#define LIB_SPEC "%{pthread:-lpthread} %{bsd:-lbsd-compat} %{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p}"
/* Standard include directory. In GNU, "/usr" is a four-letter word. */
#undef STANDARD_INCLUDE_DIR
-------------- next part --------------
2007-08-03 Samuel Thibault <samuel.thibault@ens-lyon.org>
* gcc/config/i386/gnu.h (STARTFILE_SPEC): Use gcrt0.o in profile mode, add
-profile option, add pie support.
(ENDFILE_SPEC): New spec.
* gcc/config/gnu.h (LIB_SPEC): Add -profile option.
Index: gcc/config/i386/gnu.h
===================================================================
--- gcc/config/i386/gnu.h (r�vision 127183)
+++ gcc/config/i386/gnu.h (copie de travail)
@@ -26,13 +26,19 @@
%{static:-static}}"
#undef STARTFILE_SPEC
+#if defined HAVE_LD_PIE
#define STARTFILE_SPEC \
- "%{!shared: \
- %{!static: \
- %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} %{!p:crt1.o%s}}} \
- %{static:crt0.o%s}} \
- crti.o%s %{static:crtbeginT.o%s}\
- %{!static:%{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}}"
+ "%{!shared: %{pg|p|profile:gcrt0.o%s;pie:Scrt1.o%s;static:crt0.o%s;:crt1.o%s}} \
+ crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
+#else
+#define STARTFILE_SPEC \
+ "%{!shared: %{pg|p|profile:gcrt0.o%s;static:crt0.o%s;:crt1.o%s}} \
+ crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
+#endif
+#undef ENDFILE_SPEC
+#define ENDFILE_SPEC \
+ "%{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s"
+
/* FIXME: Is a Hurd-specific fallback mechanism necessary? */
#undef MD_UNWIND_SUPPORT
Index: gcc/config/gnu.h
--- gcc/config/gnu.h (r�vision 127183)
+++ gcc/config/gnu.h (copie de travail)
@@ -6,7 +6,7 @@
/* Default C library spec. Use -lbsd-compat for gcc -bsd. */
#undef LIB_SPEC
-#define LIB_SPEC "%{pthread:-lpthread} %{bsd:-lbsd-compat} %{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p}"
+#define LIB_SPEC "%{pthread:-lpthread} %{bsd:-lbsd-compat} %{pg|p|profile:-lc_p;:-lc}"
/* Standard include directory. In GNU, "/usr" is a four-letter word. */
#undef STANDARD_INCLUDE_DIR
More information about the Gcc-patches
mailing list