Bug 183773 - devel/dmalloc incorrectly installs striped .a libraries
Summary: devel/dmalloc incorrectly installs striped .a libraries
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: William Grzybowski
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-08 06:00 UTC by Paul Koch
Modified: 2013-11-08 13:50 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 Paul Koch 2013-11-08 06:00:01 UTC
Install devel/dmalloc port.

ls /usr/local/lib/libdmalloc*.a

speedy:$ ls -l /usr/local/lib/libdmalloc*.a
-rwxr-xr-x  1 root  wheel  109092 Nov  8 15:45 /usr/local/lib/libdmalloc.a
-rwxr-xr-x  1 root  wheel  111364 Nov  8 15:45 /usr/local/lib/libdmallocth.a
-rwxr-xr-x  1 root  wheel  113202 Nov  8 15:45 /usr/local/lib/libdmallocthcxx.a
-rwxr-xr-x  1 root  wheel  110930 Nov  8 15:45 /usr/local/lib/libdmallocxx.a

Libraries get installed as 755 instead of 644 like all other .a libs.

nm /usr/local/lib/libdmalloc.a

arg_check.o:
nm: arg_check.o: no symbols

compat.o:
nm: compat.o: no symbols

dmalloc_rand.o:
nm: dmalloc_rand.o: no symbols

dmalloc_tab.o:
nm: dmalloc_tab.o: no symbols

env.o:
nm: env.o: no symbols

heap.o:
nm: heap.o: no symbols

chunk.o:
nm: chunk.o: no symbols

error.o:
nm: error.o: no symbols

malloc.o:
nm: malloc.o: no symbols



The error appears to be in the generated dmalloc Makefile where it uses
INSTALL_PROGRAM to install the libs instead of the INSTALL.

Also, ranlib fails on the port install because the installed libs have already been stripped.

Fix: 

Don't know.
How-To-Repeat: Install devel/dmalloc and build a binary which is statically linked against
libdmalloc.  Linker fails because the symbols are stripped from the library.
Comment 1 William Grzybowski freebsd_committer 2013-11-08 13:46:17 UTC
Responsible Changed
From-To: freebsd-ports-bugs->wg

I'll take it.
Comment 2 dfilter service freebsd_committer 2013-11-08 13:46:17 UTC
Author: wg
Date: Fri Nov  8 13:46:09 2013
New Revision: 333224
URL: http://svnweb.freebsd.org/changeset/ports/333224

Log:
  devel/dmalloc: fix static libraries
  
  - Fix static libraries (do not strip)
  - Allow staging (cheating prefix, unsupported DESTDIR)
  - Use options ng for DOCS
  
  PR:		ports/183773
  Reported by:	Paul Koch <paul.koch137 gmail.com>

Modified:
  head/devel/dmalloc/Makefile

Modified: head/devel/dmalloc/Makefile
==============================================================================
--- head/devel/dmalloc/Makefile	Fri Nov  8 13:43:21 2013	(r333223)
+++ head/devel/dmalloc/Makefile	Fri Nov  8 13:46:09 2013	(r333224)
@@ -11,28 +11,36 @@ EXTRACT_SUFX=	.tgz
 MAINTAINER=	ports@FreeBSD.org
 COMMENT=	Portable debug memory allocation library
 
-GNU_CONFIGURE=	yes
-CONFIGURE_ARGS=	--enable-threads --enable-shlib
-CFLAGS+=	-fPIC
+HAS_CONFIGURE=	yes
+CONFIGURE_ARGS=	--enable-threads --enable-shlib --prefix="${STAGEDIR}${PREFIX}"
+CONFIGURE_ENV=	INSTALL_PROGRAM="${INSTALL_DATA}"
+CFLAGS=		-fPIC
 USE_LDCONFIG=	yes
 MAKE_JOBS_UNSAFE=	yes
 
 ALL_TARGET=	all heavy
 INSTALL_TARGET=	install
 
-.if !defined(NOPORTDOCS)
+OPTIONS_DEFINE=	DOCS
+
+.include <bsd.port.options.mk>
+
+.if ${PORT_OPTIONS:MDOCS}
 INSTALL_TARGET+=installdocs
 .endif
 
-NO_STAGE=	yes
 pre-patch:
 	@${REINPLACE_CMD} -e 's|\.@shlibext@|\.@shlibext@.1|' ${WRKSRC}/Makefile.in
 
 post-install:
-	@(cd ${PREFIX}/lib; \
-		${LN} -sf ${PREFIX}/lib/libdmalloc.so.1 ${PREFIX}/lib/libdmalloc.so; \
-		${LN} -sf ${PREFIX}/lib/libdmallocxx.so.1 ${PREFIX}/lib/libdmallocxx.so; \
-		${LN} -sf ${PREFIX}/lib/libdmallocth.so.1 ${PREFIX}/lib/libdmallocth.so; \
-		${LN} -sf ${PREFIX}/lib/libdmallocthcxx.so.1 ${PREFIX}/lib/libdmallocthcxx.so)
+	@(cd ${STAGEDIR}${PREFIX}/lib; \
+		${STRIP_CMD} libdmalloc.so.1; \
+		${LN} -sf libdmalloc.so.1 libdmalloc.so; \
+		${STRIP_CMD} libdmallocxx.so.1; \
+		${LN} -sf libdmallocxx.so.1 libdmallocxx.so; \
+		${STRIP_CMD} libdmallocth.so.1; \
+		${LN} -sf libdmallocth.so.1 libdmallocth.so; \
+		${STRIP_CMD} libdmallocthcxx.so.1; \
+		${LN} -sf libdmallocthcxx.so.1 libdmallocthcxx.so)
 
 .include <bsd.port.mk>
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 3 William Grzybowski freebsd_committer 2013-11-08 13:46:32 UTC
State Changed
From-To: open->closed

Should be fixed, thanks.