Bug 107437 - Port lang/gdc favors libc_r to libpthread
Summary: Port lang/gdc favors libc_r to libpthread
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Rong-En Fan
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-01-02 18:20 UTC by Jason DiCioccio
Modified: 2007-01-06 07:30 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jason DiCioccio 2007-01-02 18:20:11 UTC
When compiling threaded D code with gdc, gdc will automatically link in libc_r
instead of libpthread.  This is due to a check in autoconf that seems to be
targeted at FreeBSD 4.x

Fix: 

!DSPAM:2756,459a9cbd4853422919100!--q9Nur4cNDwqRXMVWv0fbMH3zTGyaRPmxH4dv0uTkSwv57VJD
Content-Type: text/plain; name="file.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="file.diff"

diff -ruN gdc.bak/files/patch-gcc::d::phobos::configure gdc/files/patch-gcc::d::phobos::configure
--- gdc.bak/files/patch-gcc::d::phobos::configure	Wed Dec 31 19:00:00 1969
+++ gdc/files/patch-gcc::d::phobos::configure	Tue Jan  2 12:37:28 2007
@@ -0,0 +1,11 @@
+--- gcc.orig/d/phobos/configure       Tue Jan  2 10:12:52 2007
++++ gcc/d/phobos/configure    Tue Jan  2 10:12:24 2007
+@@ -5912,7 +5912,7 @@
+     echo "$as_me:$LINENO: checking for thread library linker argument" >&5
+ echo $ECHO_N "checking for thread library linker argument... $ECHO_C" >&6
+     d_thread_lib=error
+-    for thrd_lib in "" -lc_r -lpthread -ldce; do
++    for thrd_lib in "" -lpthread -ldce -lc_r; do
+ 	d_savelibs=$LIBS
+ 	LIBS="$LIBS $thrd_lib"
+ 
	
How-To-Repeat: Compile D code with gdc that uses threads.
ldd <resulting binary>
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2007-01-02 18:20:23 UTC
State Changed
From-To: open->feedback

Awaiting maintainers feedback
Comment 2 Masanori OZAWA 2007-01-03 04:05:38 UTC
I checked this patch.
This patch correct the problem that threads does not operate correctly with gdc.
So, I approve.
Please commit it.

Thanks. :)

P.S.
 After, I will update the GDC to 0.20.
Comment 3 Rong-En Fan freebsd_committer freebsd_triage 2007-01-03 11:06:23 UTC
Responsible Changed
From-To: freebsd-ports-bugs->rafan

Eat.
Comment 4 dfilter service freebsd_committer freebsd_triage 2007-01-06 07:24:14 UTC
rafan       2007-01-06 07:24:08 UTC

  FreeBSD ports repository

  Modified files:
    lang/gdc             Makefile 
  Log:
  - Fix threading support, favor pthread
    Since this port supports 5.x and later, we don't need to consider
    the 4.x case (-lc_r). Moreover, gdc uses ld as linker when compiling
    D source files, so PTHREAD_LIBS is not applicable here.
  
  PR:             ports/107437
  Submitted by:   Jason DiCioccio <jd at ods.org>
  Approved by:    Masanori OZAWA <ozawa at ongs.co.jp> (maintainer)
  
  Revision  Changes    Path
  1.24      +3 -2      ports/lang/gdc/Makefile
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 5 Rong-En Fan freebsd_committer freebsd_triage 2007-01-06 07:24:16 UTC
State Changed
From-To: feedback->closed

Committed. Thanks!