* [PATCH] Tweak to NetBSD -pthread option
@ 2002-10-28 9:19 Jason R Thorpe
2002-10-28 14:55 ` Loren James Rittle
0 siblings, 1 reply; 6+ messages in thread
From: Jason R Thorpe @ 2002-10-28 9:19 UTC (permalink / raw)
To: gcc-patches
[-- Attachment #1: Type: text/plain, Size: 436 bytes --]
Fixes an oversight when I initially checked this in (namely, -pthread
should only be present when threads support is actually present in
the compiler).
Committed to mainline.
* config.gcc (*-*-netbsd*): Add NETBSD_ENABLE_PTHREADS to
tm_defines if pthreads are enabled.
* config/netbsd.h (LIB_SPEC): Only support the -pthread option
if NETBSD_ENABLE_PTHREADS is defined.
--
-- Jason R. Thorpe <thorpej@wasabisystems.com>
[-- Attachment #2: nbsd-thread-patch --]
[-- Type: text/plain, Size: 2080 bytes --]
Index: config.gcc
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config.gcc,v
retrieving revision 1.256
diff -c -r1.256 config.gcc
*** config.gcc 24 Oct 2002 08:51:00 -0000 1.256
--- config.gcc 28 Oct 2002 17:02:23 -0000
***************
*** 367,372 ****
--- 367,373 ----
case x${enable_threads} in
xyes | xposix)
thread_file='posix'
+ tm_defines="${tm_defines} NETBSD_ENABLE_PTHREADS"
;;
esac
;;
Index: config/netbsd.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/netbsd.h,v
retrieving revision 1.20
diff -c -r1.20 netbsd.h
*** config/netbsd.h 18 Oct 2002 23:10:34 -0000 1.20
--- config/netbsd.h 28 Oct 2002 17:02:23 -0000
***************
*** 82,92 ****
1. Select the appropriate set of libs, depending on whether we're
profiling.
! 2. Include the pthread library if -pthread is specified.
! 3. Include the posix library if -posix is specified. */
#undef LIB_SPEC
#define LIB_SPEC \
"%{pthread: \
%{!p: \
--- 82,97 ----
1. Select the appropriate set of libs, depending on whether we're
profiling.
! 2. Include the pthread library if -pthread is specified (only
! if threads are enabled).
! 3. Include the posix library if -posix is specified.
!
! FIXME: Could eliminate the duplication here if we were allowed to
! use string concatenation. */
#undef LIB_SPEC
+ #ifdef NETBSD_ENABLE_PTHREADS
#define LIB_SPEC \
"%{pthread: \
%{!p: \
***************
*** 104,109 ****
--- 109,128 ----
%{!pg:-lc}} \
%{p:-lc_p} \
%{pg:-lc_p}}}"
+ #else
+ #define LIB_SPEC \
+ "%{posix: \
+ %{!p: \
+ %{!pg:-lposix}} \
+ %{p:-lposix_p} \
+ %{pg:-lposix_p}} \
+ %{!shared: \
+ %{!symbolic: \
+ %{!p: \
+ %{!pg:-lc}} \
+ %{p:-lc_p} \
+ %{pg:-lc_p}}}"
+ #endif
/* Provide a LIBGCC_SPEC appropriate for NetBSD. We also want to exclude
libgcc with -symbolic. */
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] Tweak to NetBSD -pthread option
2002-10-28 9:19 [PATCH] Tweak to NetBSD -pthread option Jason R Thorpe
@ 2002-10-28 14:55 ` Loren James Rittle
2002-10-28 15:25 ` Jason R Thorpe
2002-10-29 7:39 ` Richard Henderson
0 siblings, 2 replies; 6+ messages in thread
From: Loren James Rittle @ 2002-10-28 14:55 UTC (permalink / raw)
To: gcc-patches; +Cc: thorpej
> Fixes an oversight when I initially checked this in (namely, -pthread
> should only be present when threads support is actually present in
> the compiler).
This is a good fix that more ports should properly support to aid
users of the compiler.
> Committed to mainline.
>
> * config.gcc (*-*-netbsd*): Add NETBSD_ENABLE_PTHREADS to
> tm_defines if pthreads are enabled.
> * config/netbsd.h (LIB_SPEC): Only support the -pthread option
> if NETBSD_ENABLE_PTHREADS is defined.
FYI, when FreeBSD made a similar change, we were asked to only place
new defines for a port in a new file added to tm_file.
Regards,
Loren
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] Tweak to NetBSD -pthread option
2002-10-28 14:55 ` Loren James Rittle
@ 2002-10-28 15:25 ` Jason R Thorpe
2002-10-29 7:39 ` Richard Henderson
1 sibling, 0 replies; 6+ messages in thread
From: Jason R Thorpe @ 2002-10-28 15:25 UTC (permalink / raw)
To: Loren James Rittle; +Cc: gcc-patches
On Mon, Oct 28, 2002 at 04:55:05PM -0600, Loren James Rittle wrote:
> > * config.gcc (*-*-netbsd*): Add NETBSD_ENABLE_PTHREADS to
> > tm_defines if pthreads are enabled.
> > * config/netbsd.h (LIB_SPEC): Only support the -pthread option
> > if NETBSD_ENABLE_PTHREADS is defined.
>
> FYI, when FreeBSD made a similar change, we were asked to only place
> new defines for a port in a new file added to tm_file.
Hm, that's easy though. Though, I've recently seen some things pulled
out of separate files and into tm_defines (c.f. default byte-order for
MIPS targets).
I'm happy to do it either way... is there documentation on what the
actual policy is? (If not, there should be :-)
--
-- Jason R. Thorpe <thorpej@wasabisystems.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] Tweak to NetBSD -pthread option
2002-10-28 14:55 ` Loren James Rittle
2002-10-28 15:25 ` Jason R Thorpe
@ 2002-10-29 7:39 ` Richard Henderson
2002-10-29 8:01 ` Jason R Thorpe
2002-10-30 22:46 ` Loren James Rittle
1 sibling, 2 replies; 6+ messages in thread
From: Richard Henderson @ 2002-10-29 7:39 UTC (permalink / raw)
To: Loren James Rittle; +Cc: gcc-patches, thorpej
On Mon, Oct 28, 2002 at 04:55:05PM -0600, Loren James Rittle wrote:
> FYI, when FreeBSD made a similar change, we were asked to only place
> new defines for a port in a new file added to tm_file.
Err, no, that's wrong. We want to eliminate the
proliferation of tiny config files.
r~
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] Tweak to NetBSD -pthread option
2002-10-29 7:39 ` Richard Henderson
@ 2002-10-29 8:01 ` Jason R Thorpe
2002-10-30 22:46 ` Loren James Rittle
1 sibling, 0 replies; 6+ messages in thread
From: Jason R Thorpe @ 2002-10-29 8:01 UTC (permalink / raw)
To: Richard Henderson, Loren James Rittle, gcc-patches
On Tue, Oct 29, 2002 at 10:39:34AM -0500, Richard Henderson wrote:
> Err, no, that's wrong. We want to eliminate the
> proliferation of tiny config files.
Ok, I'll leave my change the way it is then.
--
-- Jason R. Thorpe <thorpej@wasabisystems.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] Tweak to NetBSD -pthread option
2002-10-29 7:39 ` Richard Henderson
2002-10-29 8:01 ` Jason R Thorpe
@ 2002-10-30 22:46 ` Loren James Rittle
1 sibling, 0 replies; 6+ messages in thread
From: Loren James Rittle @ 2002-10-30 22:46 UTC (permalink / raw)
To: rth; +Cc: thorpej, gcc-patches
Richard,
>> FYI, when FreeBSD made a similar change, we were asked to only place
>> new defines for a port in a new file added to tm_file.
> Err, no, that's wrong.
Yup, of course, I'm wrong. Sorry. ``... we were asked to derive
macros, which might be expressed in tm_file fragment or tm_defines,
from target triple not from a non-standard system header'' would have
been accurate; but pointless to observe in regards to Jason's
patch. ;-) At the time, tm_defines did not exist in its current form
and we ended up being forced to use tm_file fragments.
Given those improvements, tm_defines could now be used by our port.
If it didn't impact outside uses, I'd propose a patch.
> We want to eliminate the proliferation of tiny config files.
Yup.
Regards,
Loren
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2002-10-31 6:46 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-10-28 9:19 [PATCH] Tweak to NetBSD -pthread option Jason R Thorpe
2002-10-28 14:55 ` Loren James Rittle
2002-10-28 15:25 ` Jason R Thorpe
2002-10-29 7:39 ` Richard Henderson
2002-10-29 8:01 ` Jason R Thorpe
2002-10-30 22:46 ` Loren James Rittle
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).