Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 Oct 2007 11:57:45 GMT
From:      Masanori OZAWA <ozawa@ongs.co.jp>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/117318: [PATCH] lang/gdc: link error fixed.
Message-ID:  <200710191157.l9JBvjli051307@www.freebsd.org>
Resent-Message-ID: <200710191200.l9JC07cD039691@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         117318
>Category:       ports
>Synopsis:       [PATCH] lang/gdc: link error fixed.
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Fri Oct 19 12:00:06 UTC 2007
>Closed-Date:
>Last-Modified:
>Originator:     Masanori OZAWA
>Release:        7.0-PRERELEASE
>Organization:
ONGS Inc.
>Environment:
FreeBSD mithos.ongs.co.jp 7.0-PRERELEASE FreeBSD 7.0-PRERELEASE #0: Tue Oct 16 18:46:35 JST 2007     root@mithos.ongs.co.jp:/usr/obj/usr/src/sys/MITHOS  i386
>Description:
- GDC gets a fail of link with GCC42(on 8-current/7-PR1)
  because libstdc++ is not in the default link target
  where libphobos of GDC needs it.
  To fix that issue, I have added a patch that make libstdc++
  a link tareget of GDC.
  Sometimes 6-stable says that it is a overplus link but it is
  no problem.
>How-To-Repeat:

>Fix:


Patch attached with submission follows:

diff -urBN gdc.orig/Makefile gdc/Makefile
--- gdc.orig/Makefile	Wed Oct 17 19:12:42 2007
+++ gdc/Makefile	Fri Oct 19 16:26:56 2007
@@ -7,7 +7,7 @@
 
 PORTNAME=	gdc
 PORTVERSION=	0.24
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	lang
 MASTER_SITES=	${MASTER_SITE_GCC} \
 		${MASTER_SITE_SOURCEFORGE:S/%SUBDIR%/dgcc/g:S/$/:gdc/g}
diff -urBN gdc.orig/files/patch-gcc_d_d-spec.c gdc/files/patch-gcc_d_d-spec.c
--- gdc.orig/files/patch-gcc_d_d-spec.c	Thu Jan  1 09:00:00 1970
+++ gdc/files/patch-gcc_d_d-spec.c	Fri Oct 19 16:26:36 2007
@@ -0,0 +1,31 @@
+--- gcc/d/d-spec.c.orig	2007-10-16 20:24:22.000000000 +0900
++++ gcc/d/d-spec.c	2007-10-16 20:29:07.000000000 +0900
+@@ -46,6 +46,10 @@
+ #define MATH_LIBRARY_PROFILE "-lm"
+ #endif
+ 
++#ifndef LIBSTDCXX
++#define LIBSTDCXX "-lstdc++"
++#endif
++
+ #ifndef LIBPHOBOS
+ #define LIBPHOBOS "-lgphobos"
+ #endif
+@@ -295,7 +299,7 @@
+     /* There is one extra argument added here for the runtime
+        library: -lgphobos.  The -pthread argument is added by
+        setting need_pthreads. */
+-    num_args = argc + added + need_math + shared_libgcc + (library > 0 ? 1 : 0) + 1;
++    num_args = argc + added + need_math + shared_libgcc + (library > 0 ? 2 : 0) + 1;
+     arglist = xmalloc (num_args * sizeof (char *));
+ 
+     i = 0;
+@@ -353,6 +357,8 @@
+     /* Add `-lstdc++' if we haven't already done so.  */
+     if (library > 0)
+ 	{
++	    arglist[j++] = LIBSTDCXX;
++	    added_libraries++;
+ 	    arglist[j++] = saw_profile_flag ? LIBPHOBOS_PROFILE : LIBPHOBOS;
+ 	    added_libraries++;
+ 	    need_pthreads = 1;


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200710191157.l9JBvjli051307>