From nobody@FreeBSD.org  Wed Nov 14 15:13:51 2012
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id CB3D9E6A
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 14 Nov 2012 15:13:51 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id 995928FC14
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 14 Nov 2012 15:13:51 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.5/8.14.5) with ESMTP id qAEFDpE9082049
	for <freebsd-gnats-submit@FreeBSD.org>; Wed, 14 Nov 2012 15:13:51 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.5/8.14.5/Submit) id qAEFDpRx082048;
	Wed, 14 Nov 2012 15:13:51 GMT
	(envelope-from nobody)
Message-Id: <201211141513.qAEFDpRx082048@red.freebsd.org>
Date: Wed, 14 Nov 2012 15:13:51 GMT
From: Takeshi Taguchi <taguchi@ff.iij4u.or.jp>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [patch] database/db42 clang issue
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         173627
>Category:       ports
>Synopsis:       [patch] database/db42 clang issue
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    mandree
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Nov 14 15:20:00 UTC 2012
>Closed-Date:    Mon Dec 31 11:16:16 UTC 2012
>Last-Modified:  Mon Dec 31 11:16:16 UTC 2012
>Originator:     Takeshi Taguchi
>Release:        FreeBSD-CURRENT
>Organization:
>Environment:
FreeBSD PandaMother-01 10.0-CURRENT FreeBSD 10.0-CURRENT #2: Mon Nov 12 06:56:4\
8 JST 2012     root@PandaMother-01:/usr/obj/usr/src/sys/GENERIC  amd64
>Description:
I could not compile database/db42 with clang.
with gcc, it was successed.

>How-To-Repeat:
# cd /usr/ports/database/db42
# make install
..[snip]...
/usr/bin/ld: .libs/cxx_db.o: relocation R_X86_64_32S against `_ZTV2Db' can not \
be used when making a shared object; recompile with -fPIC
.libs/cxx_db.o: could not read symbols: Bad value
c++: error: linker command failed with exit code 1 (use -v to see invocation)
*** [libdb_cxx-4.2.la] Error code 1

Stop in /usr/ports/databases/db42/work/db-4.2.52/build_unix.
*** [do-build] Error code 1

>Fix:
apply attached patch to databases/db42.


db42 use its own ./libtool rather than out $(LOCALBASE)/bin/libtool.
THIS is a probrem.
attached patch will fix this issue.


Patch attached with submission follows:

--- files/patch-dist::configure.orig	2012-11-13 06:09:38.000000000 +0900
+++ files/patch-dist::configure	2012-11-13 06:17:55.000000000 +0900
@@ -1,7 +1,16 @@
---- ../dist/configure.orig	Wed Dec  5 13:14:02 2001
-+++ ../dist/configure	Wed Dec  5 13:24:01 2001
-@@ -8794,10 +8794,10 @@
- INSTALLER="\$(LIBTOOL) --mode=install cp"
+--- ../dist/configure.orig	2012-11-13 06:08:49.000000000 +0900
++++ ../dist/configure	2012-11-13 06:16:09.000000000 +0900
+@@ -20046,7 +20046,7 @@
+ 
+ 
+ SOFLAGS="-rpath \$(libdir)"
+-LIBTOOL_PROG="${SHELL} ./libtool"
++LIBTOOL_PROG="$prefix/bin/libtool"
+ 
+ # Set SOSUFFIX and friends
+ 
+@@ -20138,13 +20138,13 @@
+ INSTALLER="\$(LIBTOOL) --mode=install cp -p"
  
  MAKEFILE_CC="\$(LIBTOOL) --mode=compile ${MAKEFILE_CC}"
 -MAKEFILE_SOLINK="\$(LIBTOOL) --mode=link ${MAKEFILE_CCLINK} -avoid-version"
@@ -12,4 +21,8 @@
 +MAKEFILE_XSOLINK="\$(LIBTOOL) --mode=link ${MAKEFILE_CXXLINK} -version-info ${DB_VERSION_MINOR}"
  MAKEFILE_CXXLINK="\$(LIBTOOL) --mode=link ${MAKEFILE_CXXLINK}"
  
- # Configure for shared libraries, static libraries, or both.  If both are
+-LIBTOOL="\$(SHELL) ./libtool"
++LIBTOOL="$prefix/bin/libtool"
+ 
+ case "$host_os" in
+ cygwin*)


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->mandree 
Responsible-Changed-By: arved 
Responsible-Changed-When: Wed Nov 21 17:05:22 UTC 2012 
Responsible-Changed-Why:  
over to maintainer 

http://www.freebsd.org/cgi/query-pr.cgi?pr=173627 
State-Changed-From-To: open->feedback 
State-Changed-By: mandree 
State-Changed-When: Sun Dec 23 11:59:11 UTC 2012 
State-Changed-Why:  
feedback required from submitter 

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

From: Matthias Andree <matthias.andree@gmx.de>
To: bug-followup@FreeBSD.org, taguchi@ff.iij4u.or.jp
Cc:  
Subject: Re: ports/173627: [patch] database/db42 clang issue
Date: Sun, 23 Dec 2012 12:58:40 +0100

 Dear Taguchi,
 
 sorry for the trouble, and for the delay in getting back to you.  First
 of all, thank you for taking the time to report the problem and offer a fix.
 
 I would like to avoid an additional libtool dependency.
 Could you please confirm that the original bug persists with:
 
 - a freshly updated, rebuilt and installed 10-CURRENT?
 - an up to date ports tree?
 
 on 9-STABLE (9.1-PRERELEASE) amd64, clang++ gets invoked properly, with
 -DPIC -fPIC, and there is no error, and on Baptiste Daroussin's
 computer, the problem does not show either.
 
 Please report back.  Thank you.
 
 Best regards
 Matthias

From: Matthias Andree <mandree@FreeBSD.org>
To: bug-followup@FreeBSD.org, taguchi@ff.iij4u.or.jp
Cc:  
Subject: Re: ports/173627: [patch] database/db42 clang issue
Date: Sun, 23 Dec 2012 15:43:04 +0100

 I have just successfully built db42 with clang on a system similar to
 yours, freshly installed:
 
 FreeBSD avenir 10.0-CURRENT FreeBSD 10.0-CURRENT #0 r244315: Mon Dec 17
 05:17:35 UTC 2012     root@snap.freebsd.org:/usr/obj/usr/src/sys/GENERIC
  amd64
 
 Anything with your system, any incompatible stuff in /etc/make.conf?
State-Changed-From-To: feedback->closed 
State-Changed-By: mandree 
State-Changed-When: Mon Dec 31 11:16:15 UTC 2012 
State-Changed-Why:  
believed to be a local problem on submitter's computer without further 
instructions to reproduce - please follow up this bug report if you can 
show a way to reproduce the problem elsewhere 

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