ports/106464: Build broken lang/clisp 2.41 with fastcgi module

Hyo.geol at FreeBSD.org Hyo.geol at FreeBSD.org
Fri Dec 8 01:10:13 UTC 2006


>Number:         106464
>Category:       ports
>Synopsis:       Build broken lang/clisp 2.41 with fastcgi module
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Dec 08 01:10:02 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Hyo geol, Lee
>Release:        -current 7.0
>Organization:
Ajou university
>Environment:
FreeBSD localhost.localdomain 7.0-CURRENT FreeBSD 7.0-CURRENT #5: Thu Dec  7 06:27:17 KST 2006     root at localhost.localdomain:/usr/obj/usr/src/sys/EZ8KERNEL  amd64

>Description:
Clisp version 2.41 port(lang/clisp) bulid is broken when turn on fastcgi module.(WITH_FASTCGI=on)

There are 2 reasons. 

First, clisp fastcgi module in version 2.41 has build error.
This build error is already reported to clisp project site and closed.
(https://sourceforge.net/tracker/?func=detail&atid=101355&aid=1595306&group_id=1355)
So, first problem will be ok in next release. 

Second, clisp fastcgi module use strndup function and i got linking error
because there is no strndup function in FreeBSD.


>How-To-Repeat:
Build lang/clisp with WITH_FASTCGI option.

>Fix:
First problem has fixed in clisp cvs, and will be find at next release.
See https://sourceforge.net/tracker/?func=detail&atid=101355&aid=1595306&group_id=1355

Second problem in fastcgi_wrappers.c will be ok use another version strndup.

I attached patch file.

Patch attached with submission follows:

--- ./modules/fastcgi/fastcgi.lisp.orig	Fri Dec  8 08:42:55 2006
+++ ./modules/fastcgi/fastcgi.lisp	Fri Dec  8 08:45:45 2006
@@ -146,7 +146,8 @@
 
 
 ; --------------   "C" functions
-;(c-lines "#include \"fastcgi.h\"~%"); completely wrapped
+(eval-when (compile)
+  (setq ffi:*output-c-functions* t))
 
 ; Our wrappers
 (def-call-out fcgi_getenv       (:arguments (var c-string))               (:return-type c-string))
--- ./modules/fastcgi/fastcgi_wrappers.c.orig	Fri Dec  8 09:28:45 2006
+++ ./modules/fastcgi/fastcgi_wrappers.c	Fri Dec  8 09:35:23 2006
@@ -41,6 +41,25 @@
 /* Crank this up as needed */
 #define TEMPBUFSIZE 65536
 
+#ifdef __FreeBSD__
+char* t_strndup(const char* string, size_t n)
+{
+	char* copy_string = 0;
+
+	if(0 == string || 0 == n)
+		return 0;
+	
+	copy_string = (char*) malloc(n + 1);	
+	if(0 == copy_string)
+		return 0;
+	
+	memcpy(copy_string, string, n);
+	*(copy_string + n) = '\0';		
+
+	return copy_string;
+}
+#endif
+
 /* Local functions */
 static char * read_stdio(FILE *);
 static int    write_stdio(FILE *, char *, int);
@@ -91,7 +110,11 @@
       result[i+1] = NULL;
     }
     else {
+#ifdef __FreeBSD__
+		result[i] = t_strndup(*envp, equ - *envp);
+#else							
       result[i] = strndup(*envp, equ - *envp);
+#endif	  
       result[i+1] = strdup(equ + 1);
     }
   }

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



More information about the freebsd-ports-bugs mailing list