From owner-freebsd-ports-bugs@FreeBSD.ORG Fri Apr 25 16:10:01 2014 Return-Path: Delivered-To: freebsd-ports-bugs@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3B162D0 for ; Fri, 25 Apr 2014 16:10:01 +0000 (UTC) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 16D021642 for ; Fri, 25 Apr 2014 16:10:01 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.8/8.14.8) with ESMTP id s3PGA0f4074589 for ; Fri, 25 Apr 2014 16:10:00 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.8/8.14.8/Submit) id s3PGA0Bg074588; Fri, 25 Apr 2014 16:10:00 GMT (envelope-from gnats) Resent-Date: Fri, 25 Apr 2014 16:10:00 GMT Resent-Message-Id: <201404251610.s3PGA0Bg074588@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Natacha Porté Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8B795E91 for ; Fri, 25 Apr 2014 16:00:48 +0000 (UTC) Received: from cgiserv.freebsd.org (cgiserv.freebsd.org [IPv6:2001:1900:2254:206a::50:4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6BA0A15CF for ; Fri, 25 Apr 2014 16:00:48 +0000 (UTC) Received: from cgiserv.freebsd.org ([127.0.1.6]) by cgiserv.freebsd.org (8.14.8/8.14.8) with ESMTP id s3PG0l4n074211 for ; Fri, 25 Apr 2014 16:00:47 GMT (envelope-from nobody@cgiserv.freebsd.org) Received: (from nobody@localhost) by cgiserv.freebsd.org (8.14.8/8.14.8/Submit) id s3PG0lqY074205; Fri, 25 Apr 2014 16:00:47 GMT (envelope-from nobody) Message-Id: <201404251600.s3PG0lqY074205@cgiserv.freebsd.org> Date: Fri, 25 Apr 2014 16:00:47 GMT From: Natacha Porté To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Subject: ports/188993: devel/florist-gpl unusable because libflorist.a has no symbol X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Apr 2014 16:10:01 -0000 >Number: 188993 >Category: ports >Synopsis: devel/florist-gpl unusable because libflorist.a has no symbol >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 Apr 25 16:10:00 UTC 2014 >Closed-Date: >Last-Modified: >Originator: Natacha Porté >Release: 9.2-RELEASE >Organization: >Environment: FreeBSD rebma.instinctive.eu 9.2-RELEASE FreeBSD 9.2-RELEASE #0 r255898: Thu Sep 26 22:50:31 UTC 2013 root@bake.isc.freebsd.org:/usr/obj/usr/src/sys/GENERIC amd64 >Description: When linking a project involving florist (hmac-md5 in this example), I guess a lot of errors caused by undefined symbols, like in the following transcript: gnatbind -x /home/nat/code/natools/obj/hmac-md5.ali gnatlink /home/nat/code/natools/obj/hmac-md5.ali -O3 /usr/local/lib/florist/libf lorist.a -Wl,-rpath,/usr/local/gcc-aux/lib/gcc/x86_64-aux-freebsd9.2/4.9.0/adali b/ -o /home/nat/code/natools/bin/hmac-md5 b~hmac-md5.o: In function `ada_main__finalize_library': b~hmac-md5.adb:(.text+0x10): undefined reference to `posix__signals_E' b~hmac-md5.adb:(.text+0x1a): undefined reference to `posix__signals_E' b~hmac-md5.adb:(.text+0x1f): undefined reference to `posix__signals__finalize_sp ec' b~hmac-md5.o: In function `adainit.part.0': b~hmac-md5.adb:(.text+0x895): undefined reference to `posix___elabs' b~hmac-md5.adb:(.text+0x89c): undefined reference to `posix_E' b~hmac-md5.adb:(.text+0x8a6): undefined reference to `posix_E' [cut of about ~100 "undefined reference" lines] collect2: error: ld returned 1 exit status gnatlink: error when calling /usr/local/gcc-aux/bin/ada gnatmake: *** link failed. further inspection of the statc library using `nm -a /usr/local/lib/florist/libflorist.a` and `readelf -s /usr/local/lib/florist/libflorist.a` showed that there is absolutely no symbol in any of the .o files inside libflorist.a, which explains the linking error. Subsequent investigation showed that libflorist.a was correctly built, but symbols are lost at installation time. According to devel/florist-gpl/files/patch-Makefile.in, the install target is redefined to: $(BSD_INSTALL_LIB) floristlib/*.a $(DESTDIR)$(PREFIX)/lib/florist but $(BSD_INSTALL_LIB) constains the strip flag, which presumably strips ALL symbols from libflorist.a, rendering useless. Looking at other ports, the majority of the ports tree installs .a files using INSTALL_DATA macro, and comparatively few of them use INSTALL_LIB or plain INSTALL. However, those other uses of INSTALL_LIB might be failing without being noticed, since static linking is quite rare outside of Ada projects. This led me to believe that INSTALL_DATA should be used rather than INSTALL_LIB for static libraries. The Porter's Handbook describes INSTALL_LIB as meant for shared libraries, but then again there is absolutely no mention of static libraries in there. So I have changed devel/florist-gpl/files/patch-Makefile.in to use BSD_INSTALL_DATA instead of BSD_INSTALL_LIB, and reinstalled Florist. My Ada projects using Florist then built successfully. >How-To-Repeat: Try to build an Ada project depending on Florist using port-provided florist.gpr and libflorist.a >Fix: Install libflorist.a without stripping. >Release-Note: >Audit-Trail: >Unformatted: