* [PATCH] GNU/Hurd config -pthread update
@ 2007-08-03 20:26 ` Samuel Thibault
2007-08-04 21:19 ` [PATCH] GNU/Hurd config -pthread/profiling update Samuel Thibault
2007-08-08 0:32 ` [PATCH] GNU/Hurd config -pthread update Ian Lance Taylor
0 siblings, 2 replies; 14+ messages in thread
From: Samuel Thibault @ 2007-08-03 20:26 UTC (permalink / raw)
To: gcc-patches
[-- Attachment #1: Type: text/plain, Size: 75 bytes --]
Hi,
Here is a config update for GNU/Hurd for the -pthread option.
Samuel
[-- Attachment #2: patch-gcc-config --]
[-- Type: text/plain, Size: 1177 bytes --]
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
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH] GNU/Hurd config profiling update
@ 2007-08-03 21:00 Samuel Thibault
2007-08-03 20:26 ` [PATCH] GNU/Hurd config -pthread update Samuel Thibault
` (2 more replies)
0 siblings, 3 replies; 14+ messages in thread
From: Samuel Thibault @ 2007-08-03 21:00 UTC (permalink / raw)
To: gcc-patches
[-- Attachment #1: Type: text/plain, Size: 122 bytes --]
Hi,
Here is a patch for fixing profiling support in GNU/Hurd, to be applied
on top of my previous pthread patch.
Samuel
[-- Attachment #2: patch-gcc-prof --]
[-- Type: text/plain, Size: 1855 bytes --]
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
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] GNU/Hurd config -pthread/profiling update
2007-08-03 20:26 ` [PATCH] GNU/Hurd config -pthread update Samuel Thibault
@ 2007-08-04 21:19 ` Samuel Thibault
2007-08-05 23:41 ` Daniel Berlin
2007-08-08 0:32 ` [PATCH] GNU/Hurd config -pthread update Ian Lance Taylor
1 sibling, 1 reply; 14+ messages in thread
From: Samuel Thibault @ 2007-08-04 21:19 UTC (permalink / raw)
To: gcc-patches
[-- Attachment #1: Type: text/plain, Size: 278 bytes --]
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
[-- Attachment #2: patch-gcc-config --]
[-- Type: text/plain, Size: 1177 bytes --]
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
[-- Attachment #3: patch-gcc-prof --]
[-- Type: text/plain, Size: 1855 bytes --]
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
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] GNU/Hurd config profiling update
2007-08-03 21:00 [PATCH] GNU/Hurd config profiling update Samuel Thibault
2007-08-03 20:26 ` [PATCH] GNU/Hurd config -pthread update Samuel Thibault
@ 2007-08-05 15:43 ` Alfred M. Szmidt
2007-08-05 15:57 ` Samuel Thibault
2007-08-08 0:33 ` Ian Lance Taylor
2 siblings, 1 reply; 14+ messages in thread
From: Alfred M. Szmidt @ 2007-08-05 15:43 UTC (permalink / raw)
To: Samuel Thibault; +Cc: gcc-patches
Here is a patch for fixing profiling support in GNU/Hurd, to be applied
on top of my previous pthread patch.
Are you sure that it works? I recall far more things that needed a'fixing....
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] GNU/Hurd config profiling update
2007-08-05 15:43 ` [PATCH] GNU/Hurd config profiling update Alfred M. Szmidt
@ 2007-08-05 15:57 ` Samuel Thibault
2007-08-05 16:14 ` Alfred M. Szmidt
0 siblings, 1 reply; 14+ messages in thread
From: Samuel Thibault @ 2007-08-05 15:57 UTC (permalink / raw)
To: Alfred M. Szmidt; +Cc: gcc-patches
Alfred M. Szmidt, le Sun 05 Aug 2007 17:42:55 +0200, a écrit :
> Here is a patch for fixing profiling support in GNU/Hurd, to be applied
> on top of my previous pthread patch.
>
> Are you sure that it works? I recall far more things that needed a'fixing....
I've just tested it again today, and it does work:
time seconds seconds calls ms/call ms/call name
100.00 0.04 0.04 1 41.20 41.20 main
0.00 0.04 0.00 1000 0.00 0.00 puts
on a stupid for(i=0;i<1000;i++) { for (j=0;j<1000000;j++) {}
printf("ok"); }
Anyway, that's not a reason for not applying the patch ;) Without it,
programs crash immediately (because they would use the dynamic gcrt1.o
instead of the static gcrt0.o)
Samuel
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] GNU/Hurd config profiling update
2007-08-05 15:57 ` Samuel Thibault
@ 2007-08-05 16:14 ` Alfred M. Szmidt
2007-08-05 16:32 ` Samuel Thibault
0 siblings, 1 reply; 14+ messages in thread
From: Alfred M. Szmidt @ 2007-08-05 16:14 UTC (permalink / raw)
To: Samuel Thibault; +Cc: gcc-patches
I've just tested it again today, and it does work:
time seconds seconds calls ms/call ms/call name
100.00 0.04 0.04 1 41.20 41.20 main
0.00 0.04 0.00 1000 0.00 0.00 puts
on a stupid for(i=0;i<1000;i++) { for (j=0;j<1000000;j++) {}
printf("ok"); }
Anyway, that's not a reason for not applying the patch ;) Without it,
programs crash immediately (because they would use the dynamic gcrt1.o
instead of the static gcrt0.o)
I'm not objecting to the patch, it is just that I recalled more
problems with profiling. Like `-ggdb3 -pg' didn't work, and profiling
libraries blew up.
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] GNU/Hurd config profiling update
2007-08-05 16:14 ` Alfred M. Szmidt
@ 2007-08-05 16:32 ` Samuel Thibault
0 siblings, 0 replies; 14+ messages in thread
From: Samuel Thibault @ 2007-08-05 16:32 UTC (permalink / raw)
To: Alfred M. Szmidt; +Cc: gcc-patches
Alfred M. Szmidt, le Sun 05 Aug 2007 18:14:32 +0200, a écrit :
> I recalled more problems with profiling. Like `-ggdb3 -pg' didn't
> work, and profiling libraries blew up.
My previous example, with -ggdb3 -pg, works fine.
Samuel
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] GNU/Hurd config -pthread/profiling update
2007-08-04 21:19 ` [PATCH] GNU/Hurd config -pthread/profiling update Samuel Thibault
@ 2007-08-05 23:41 ` Daniel Berlin
2007-08-06 0:52 ` Samuel Thibault
0 siblings, 1 reply; 14+ messages in thread
From: Daniel Berlin @ 2007-08-05 23:41 UTC (permalink / raw)
To: Samuel Thibault; +Cc: gcc-patches
You need to say what platform you have bootstrapped and regression
tested these patches on.
On 8/4/07, Samuel Thibault <samuel.thibault@ens-lyon.org> wrote:
> 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
>
>
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] GNU/Hurd config -pthread/profiling update
2007-08-05 23:41 ` Daniel Berlin
@ 2007-08-06 0:52 ` Samuel Thibault
2007-08-06 1:40 ` Daniel Berlin
0 siblings, 1 reply; 14+ messages in thread
From: Samuel Thibault @ 2007-08-06 0:52 UTC (permalink / raw)
To: Daniel Berlin; +Cc: gcc-patches
Daniel Berlin, le Sun 05 Aug 2007 19:40:58 -0400, a écrit :
> You need to say what platform you have bootstrapped and regression
> tested these patches on.
This was tested on GNU/Hurd (debian) only since that's the only platform
that uses these config files.
The pthread part has been tested in debian for a long time and permits
the -pthread option to work.
I've tested the profile part with all of:
gcc
gcc -static
gcc -shared
gcc -p
gcc -pg
gcc -profile
gcc -p -static
gcc -pg -static
gcc -profile -static
And all get the corresponding expected behavior. The -profile option
previously wasn't recognized, and -p/-pg were producing programs that
immediately segfault very early in libc initialization.
Samuel
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] GNU/Hurd config -pthread/profiling update
2007-08-06 0:52 ` Samuel Thibault
@ 2007-08-06 1:40 ` Daniel Berlin
0 siblings, 0 replies; 14+ messages in thread
From: Daniel Berlin @ 2007-08-06 1:40 UTC (permalink / raw)
To: Samuel Thibault; +Cc: gcc-patches
On 8/5/07, Samuel Thibault <samuel.thibault@ens-lyon.org> wrote:
> Daniel Berlin, le Sun 05 Aug 2007 19:40:58 -0400, a écrit :
> > You need to say what platform you have bootstrapped and regression
> > tested these patches on.
>
> This was tested on GNU/Hurd (debian) only since that's the only platform
> that uses these config files.
Okeydokey, i'm only pointing this out ecause it is a requirement for
submitting patches.
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] GNU/Hurd config -pthread update
2007-08-03 20:26 ` [PATCH] GNU/Hurd config -pthread update Samuel Thibault
2007-08-04 21:19 ` [PATCH] GNU/Hurd config -pthread/profiling update Samuel Thibault
@ 2007-08-08 0:32 ` Ian Lance Taylor
2007-08-08 6:38 ` Matthias Klose
1 sibling, 1 reply; 14+ messages in thread
From: Ian Lance Taylor @ 2007-08-08 0:32 UTC (permalink / raw)
To: Samuel Thibault; +Cc: gcc-patches
Samuel Thibault <samuel.thibault@ens-lyon.org> writes:
> 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.
This is OK.
Thanks.
Ian
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] GNU/Hurd config profiling update
2007-08-03 21:00 [PATCH] GNU/Hurd config profiling update Samuel Thibault
2007-08-03 20:26 ` [PATCH] GNU/Hurd config -pthread update Samuel Thibault
2007-08-05 15:43 ` [PATCH] GNU/Hurd config profiling update Alfred M. Szmidt
@ 2007-08-08 0:33 ` Ian Lance Taylor
2007-08-08 6:38 ` Matthias Klose
2 siblings, 1 reply; 14+ messages in thread
From: Ian Lance Taylor @ 2007-08-08 0:33 UTC (permalink / raw)
To: Samuel Thibault; +Cc: gcc-patches
Samuel Thibault <samuel.thibault@ens-lyon.org> writes:
> 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.
This is OK.
Thanks.
Ian
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] GNU/Hurd config profiling update
2007-08-08 0:33 ` Ian Lance Taylor
@ 2007-08-08 6:38 ` Matthias Klose
0 siblings, 0 replies; 14+ messages in thread
From: Matthias Klose @ 2007-08-08 6:38 UTC (permalink / raw)
To: Ian Lance Taylor; +Cc: Samuel Thibault, gcc-patches
Ian Lance Taylor writes:
> Samuel Thibault <samuel.thibault@ens-lyon.org> writes:
>
> > 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.
>
> This is OK.
checked in.
Matthias
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH] GNU/Hurd config -pthread update
2007-08-08 0:32 ` [PATCH] GNU/Hurd config -pthread update Ian Lance Taylor
@ 2007-08-08 6:38 ` Matthias Klose
0 siblings, 0 replies; 14+ messages in thread
From: Matthias Klose @ 2007-08-08 6:38 UTC (permalink / raw)
To: Ian Lance Taylor; +Cc: Samuel Thibault, gcc-patches
Ian Lance Taylor writes:
> Samuel Thibault <samuel.thibault@ens-lyon.org> writes:
>
> > 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.
>
> This is OK.
checked in.
Matthias
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2007-08-08 6:38 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-08-03 21:00 [PATCH] GNU/Hurd config profiling update Samuel Thibault
2007-08-03 20:26 ` [PATCH] GNU/Hurd config -pthread update Samuel Thibault
2007-08-04 21:19 ` [PATCH] GNU/Hurd config -pthread/profiling update Samuel Thibault
2007-08-05 23:41 ` Daniel Berlin
2007-08-06 0:52 ` Samuel Thibault
2007-08-06 1:40 ` Daniel Berlin
2007-08-08 0:32 ` [PATCH] GNU/Hurd config -pthread update Ian Lance Taylor
2007-08-08 6:38 ` Matthias Klose
2007-08-05 15:43 ` [PATCH] GNU/Hurd config profiling update Alfred M. Szmidt
2007-08-05 15:57 ` Samuel Thibault
2007-08-05 16:14 ` Alfred M. Szmidt
2007-08-05 16:32 ` Samuel Thibault
2007-08-08 0:33 ` Ian Lance Taylor
2007-08-08 6:38 ` Matthias Klose
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).