From nobody@FreeBSD.org  Wed Oct 16 18:47:35 2002
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 501AE37B401
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 16 Oct 2002 18:47:35 -0700 (PDT)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id E4DAA43EAC
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 16 Oct 2002 18:47:34 -0700 (PDT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.12.6/8.12.6) with ESMTP id g9H1lY7R012545
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 16 Oct 2002 18:47:34 -0700 (PDT)
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.12.6/8.12.6/Submit) id g9H1lYRj012544;
	Wed, 16 Oct 2002 18:47:34 -0700 (PDT)
Message-Id: <200210170147.g9H1lYRj012544@www.freebsd.org>
Date: Wed, 16 Oct 2002 18:47:34 -0700 (PDT)
From: Liu Kang <lazykang@hotmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: updated version of mod_dtcl and a patch that can fix link problem
X-Send-Pr-Version: www-1.0

>Number:         44156
>Category:       ports
>Synopsis:       updated version of mod_dtcl and a patch that can fix link problem
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    mi
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Oct 16 18:50:01 PDT 2002
>Closed-Date:    Wed Oct 23 09:14:24 PDT 2002
>Last-Modified:  Wed Oct 23 09:14:24 PDT 2002
>Originator:     Liu Kang
>Release:        4.7 & 5
>Organization:
Beijing Polytechnic University
>Environment:
FreeBSD ftp.bjpu.edu.cn 4.7-STABLE FreeBSD 4.7-STABLE #19: Wed Oct 16 04:30:06 CST 2002     root@ftp.bjpu.edu.cn:/usr/obj/usr/src/sys/FTP  i386
>Description:
mod_dtcl was marked as broken, because of link problem.
when run make in ports/www/mod_dtcl it says:
....
/usr/libexec/elf/ld: cannot find -lm
*** Error code 1
..
"cannot find -lm" means the linker can not find the math library. 
I think there is a mistake in ports/www/mod_dtcl/files/Makefile.bsd,
which set lib path=/usr/local/lib, while freebsd's math library is in /usr/lib .

A new version of mod_dtcl is available too. could you please make a update :)
>How-To-Repeat:
      run make in ports/www/mod_dtcl 
>Fix:
--- Makefile.orig       Thu Oct 17 09:06:56 2002
+++ Makefile    Thu Oct 17 09:09:27 2002
@@ -6,13 +6,11 @@
 #
 
 PORTNAME=      mod_dtcl
-PORTVERSION=   0.11.5
+PORTVERSION=   0.12.0
 CATEGORIES=    www tcl83
 MASTER_SITES=  http://tcl.apache.org/mod_dtcl/download/
 
 MAINTAINER=    mi@aldan.algebra.com
-
-BROKEN=                "Does not compile"
 
 BUILD_DEPENDS= ${LOCALBASE}/sbin/apxs:${PORTSDIR}/www/apache13
 LIB_DEPENDS=   tcl83:${PORTSDIR}/lang/tcl83

--- distinfo.orig       Thu Oct 17 09:40:36 2002
+++ distinfo    Thu Oct 17 09:10:07 2002
@@ -1 +1 @@
-MD5 (mod_dtcl-0.11.5.tar.gz) = 2761fa569d6f0b48331968d8aba494aa
+MD5 (mod_dtcl-0.12.0.tar.gz) = 960bb4a57412e60425b99889e13712e2


patch for files/Makefile.bsd: (in order to slove link problem)

--- Makefile.bsd.orig   Thu Oct 17 09:42:37 2002
+++ Makefile.bsd        Thu Oct 17 09:30:06 2002
@@ -13,7 +13,7 @@
 
 SHLIB_NAME=    libmod_dtcl.so.1
 
-LDADD= -L${PREFIX}/lib -ltcl${TCL_NDVER} -lm
+LDADD= -L/usr/lib -L${PREFIX}/lib -ltcl${TCL_NDVER} -lm
 LDFLAGS=${LDADD}
 
 SRCS=  mod_dtcl.c
@@ -23,5 +23,3 @@
 NOMAN= True    # don't bother with the man-page here, let the port handle it
 
 .include <bsd.lib.mk>
-
-      
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports->mi 
Responsible-Changed-By: arved 
Responsible-Changed-When: Sun Oct 20 10:18:52 PDT 2002 
Responsible-Changed-Why:  
Over to MAINTAINER 

http://www.freebsd.org/cgi/query-pr.cgi?pr=44156 

From: Mikhail Teterin <mi+celsius@aldan.algebra.com>
To: freebsd-gnats-submit@FreeBSD.org, lazykang@hotmail.com
Cc: bde@FreeBSD.org, obrien@FreeBSD.org, ru@FreeBSD.org
Subject: Re: ports/44156: updated version of mod_dtcl and a patch that can fix link problem
Date: Tue, 22 Oct 2002 14:38:08 +0200

 The port's files/Makefile.bsd (a bsd.lib.mk's client) places -lm into LDADD  
 -- the technique, that worked at the time the port was made. Why would it not 
 work any more?
 
 The bsd.lib.mk now (quietly -- hidden with the ``@'') calls ``ld -x -r'' after 
 the compiler invocation for each .c.So compile). Is it needed? Why are the 
 -lX flags choke the ld if it is?
 
 Using -L/usr/lib does not seem right -- the -lm is a standard library, which 
 the linker is supposed to find automaticly. The submitted patch is a 
 workaround (thanks, Liu), but the real problem, it seems to me, was 
 introduced somewhere along the:
 
 date: 2002/05/10 09:32:39;  author: obrien;  state: Exp;  lines: +1 -1
 [Ab]use LDFLAGS rather than CFLAGS.
 BDE tells me POSIX pretends `ld' as a directly callable entity does not exist.
 ----------------------------
 revision 1.120
 date: 2002/05/10 01:30:34;  author: obrien;  state: Exp;  lines: +1 -1
 Pass CFLAGS to {CC} when using it as an `ld' replacement.
 ----------------------------
 revision 1.119
 date: 2002/05/09 16:43:07;  author: obrien;  state: Exp;  lines: +8 -8
 Pay attention to LDFLAGS when linking.
 
 	-mi

From: Bruce Evans <bde@zeta.org.au>
To: Mikhail Teterin <mi+celsius@aldan.algebra.com>
Cc: freebsd-gnats-submit@FreeBSD.org, <lazykang@hotmail.com>,
	<bde@FreeBSD.org>, <obrien@FreeBSD.org>, <ru@FreeBSD.org>
Subject: Re: ports/44156: updated version of mod_dtcl and a patch that can
 fix link problem
Date: Wed, 23 Oct 2002 14:31:20 +1000 (EST)

 On Tue, 22 Oct 2002, Mikhail Teterin wrote:
 
 > The port's files/Makefile.bsd (a bsd.lib.mk's client) places -lm into LDADD
 > -- the technique, that worked at the time the port was made. Why would it not
 > work any more?
 >
 > The bsd.lib.mk now (quietly -- hidden with the ``@'') calls ``ld -x -r'' after
 > the compiler invocation for each .c.So compile). Is it needed? Why are the
 > -lX flags choke the ld if it is?
 
 -lm in LDADD should just work, but putting in in LDFLAGS would cause the
 problems that you seem to be describing.
 
 The special `ld -x -r' step was broken in rev.1.119 of bsd.lib.mk
 by adding ${LDFLAGS} to it.  This step is very special and shouldn't
 use general linker flags.  It just manipulates the symbol table and
 might be done using objcopy these days.  But this breakage is mainly
 of style.  Perhaps only bad flags like -lm cause problems.
 
 I removed the ``ld -x r'' many years ago, so the ${LDFLAGS} breakage just
 caused patch conflicts.
 
 > Using -L/usr/lib does not seem right -- the -lm is a standard library, which
 > the linker is supposed to find automaticly. The submitted patch is a
 > workaround (thanks, Liu), but the real problem, it seems to me, was
 > introduced somewhere along the:
 
 [This is 1.121]
 > date: 2002/05/10 09:32:39;  author: obrien;  state: Exp;  lines: +1 -1
 > [Ab]use LDFLAGS rather than CFLAGS.
 > BDE tells me POSIX pretends `ld' as a directly callable entity does not exist.
 > ----------------------------
 > revision 1.120
 > date: 2002/05/10 01:30:34;  author: obrien;  state: Exp;  lines: +1 -1
 > Pass CFLAGS to {CC} when using it as an `ld' replacement.
 > ----------------------------
 > revision 1.119
 > date: 2002/05/09 16:43:07;  author: obrien;  state: Exp;  lines: +8 -8
 > Pay attention to LDFLAGS when linking.
 
 I'm not happy with using general LDFLAGS in the library linkage step either.
 It may be necessary to use extra flags, unlike in the ``ld -x -r'' step, but
 its not clear that general flags in LDFLAGS won't cause problems.
 
 Bruce
 

From: Mikhail Teterin <mi+celsius@aldan.algebra.com>
To: Bruce Evans <bde@zeta.org.au>
Cc: freebsd-gnats-submit@FreeBSD.org, <lazykang@hotmail.com>,
	<bde@FreeBSD.org>, <obrien@FreeBSD.org>, <ru@FreeBSD.org>
Subject: Re: ports/44156: updated version of mod_dtcl and a patch that can fix link problem
Date: Wed, 23 Oct 2002 09:19:03 +0200

 On Wednesday 23 October 2002 06:31 am, Bruce Evans wrote:
 = On Tue, 22 Oct 2002, Mikhail Teterin wrote:
 =
 = > The port's files/Makefile.bsd (a bsd.lib.mk's client) places -lm
 = > into LDADD -- the technique, that worked at the time the port was
 = > made. Why would it not work any more?
 = >
 = > The bsd.lib.mk now (quietly -- hidden with the ``@'') calls
 = > ``ld -x -r'' after the compiler invocation for each .c.So compile).
 = > Is it needed? Why do the -lX flags choke the ld if it is?
 =
 = -lm in LDADD should just work, but putting in in LDFLAGS would
 = cause the problems that you seem to be describing.
 
 Well, it *is* in LDADD in the client Makefile -- 
 ports/www/mod_dtcl/files/Makefile.bsd . It is the bsd.lib.mk, that
 puts it into the LDFLAGS.
 
 = The special `ld -x -r' step was broken in rev.1.119 of bsd.lib.mk
 = by adding ${LDFLAGS} to it.  This step is very special and shouldn't
 = use general linker flags.  It just manipulates the symbol table and
 = might be done using objcopy these days.  But this breakage is mainly
 = of style.  Perhaps only bad flags like -lm cause problems.
 
 I'm confused -- you seem to aprove of putting -lm into LDADD at first,
 but now you call it "bad"?
 
 It seems, there are three problems:
 
 	. ld does not find the standard library -- -lm -- in some
 	  circumstances;
 	. bsd.lib.mk places LDADD onto ld's command line in the special,
 	  hidden, postcompiling step (which we, probably, don't even need);
 	. if the thing, ld is used for in that special step, does, indeed,
 	  have to be done, it should be done with objcopy...
 
 I'm going to commit the workaround (add the explicit -L/usr/lib to LDADD in
 the port's files/Makefile.bsd), but could, someone, please, take over this PR,
 so the bsd.lib.mk and/or ld get fixed?
 
 	-mi

From: Bruce Evans <bde@zeta.org.au>
To: Mikhail Teterin <mi+celsius@aldan.algebra.com>
Cc: freebsd-gnats-submit@FreeBSD.org, <lazykang@hotmail.com>,
	<bde@FreeBSD.org>, <obrien@FreeBSD.org>, <ru@FreeBSD.org>
Subject: Re: ports/44156: updated version of mod_dtcl and a patch that can
 fix link problem
Date: Wed, 23 Oct 2002 18:23:04 +1000 (EST)

 On Wed, 23 Oct 2002, Mikhail Teterin wrote:
 
 > On Wednesday 23 October 2002 06:31 am, Bruce Evans wrote:
 > = On Tue, 22 Oct 2002, Mikhail Teterin wrote:
 > =
 > = > The port's files/Makefile.bsd (a bsd.lib.mk's client) places -lm
 > = > into LDADD -- the technique, that worked at the time the port was
 > = > made. Why would it not work any more?
 > = >
 > = > The bsd.lib.mk now (quietly -- hidden with the ``@'') calls
 > = > ``ld -x -r'' after the compiler invocation for each .c.So compile).
 > = > Is it needed? Why do the -lX flags choke the ld if it is?
 > =
 > = -lm in LDADD should just work, but putting in in LDFLAGS would
 > = cause the problems that you seem to be describing.
 >
 > Well, it *is* in LDADD in the client Makefile --
 > ports/www/mod_dtcl/files/Makefile.bsd . It is the bsd.lib.mk, that
 > puts it into the LDFLAGS.
 
 But bsd.lib.mk doesn't put LDADD in LDFLAGS.  The client Makefile
 probably does it.
 
 > = The special `ld -x -r' step was broken in rev.1.119 of bsd.lib.mk
 > = by adding ${LDFLAGS} to it.  This step is very special and shouldn't
 > = use general linker flags.  It just manipulates the symbol table and
 > = might be done using objcopy these days.  But this breakage is mainly
 > = of style.  Perhaps only bad flags like -lm cause problems.
 >
 > I'm confused -- you seem to aprove of putting -lm into LDADD at first,
 > but now you call it "bad"?
 
 LDFLAGS != LDADD.
 
 Bruce
 
State-Changed-From-To: open->closed 
State-Changed-By: mi 
State-Changed-When: Wed Oct 23 09:13:14 PDT 2002 
State-Changed-Why:  
Upgrade committed. Thanks, Liu! 
The breakage fixed by not defining LDFLAGS. Thanks, Bruce! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=44156 
>Unformatted:
