From owner-freebsd-ports-bugs@FreeBSD.ORG Tue Jun 9 03:06:51 2015 Return-Path: Delivered-To: freebsd-ports-bugs@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 011FA165 for ; Tue, 9 Jun 2015 03:06:50 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (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 D70D319AD for ; Tue, 9 Jun 2015 03:06:50 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.14.9/8.14.9) with ESMTP id t5936oKb027555 for ; Tue, 9 Jun 2015 03:06:50 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-ports-bugs@FreeBSD.org Subject: [Bug 200723] security/libressl fails to statically link Date: Tue, 09 Jun 2015 03:06:50 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Ports & Packages X-Bugzilla-Component: Individual Port(s) X-Bugzilla-Version: Latest X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: loox@e-shell.net X-Bugzilla-Status: New X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: vsevolod@FreeBSD.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: maintainer-feedback? X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter flagtypes.name Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Jun 2015 03:06:51 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=200723 Bug ID: 200723 Summary: security/libressl fails to statically link Product: Ports & Packages Version: Latest Hardware: Any OS: Any Status: New Severity: Affects Some People Priority: --- Component: Individual Port(s) Assignee: vsevolod@FreeBSD.org Reporter: loox@e-shell.net Assignee: vsevolod@FreeBSD.org Flags: maintainer-feedback?(vsevolod@FreeBSD.org) This is a sample program: #include #include #include int main() { SSL_library_init(); arc4random(); curl_easy_init(); return (0); } % clang -I /usr/local/include -L /usr/local/lib arc.c -o arc -static -l curl -l z -l cares -l ssl -l crypto /usr/lib/libc.a(arc4random.o): In function `arc4random': /usr/src/lib/libc/gen/arc4random.c:(.text+0x350): multiple definition of `arc4random' /usr/local/lib/libcrypto.a(libcompat_la-arc4random.o):(.text+0x0): first defined here /usr/lib/libc.a(arc4random.o): In function `arc4random_buf': /usr/src/lib/libc/gen/arc4random.c:(.text+0x4c0): multiple definition of `arc4random_buf' /usr/local/lib/libcrypto.a(libcompat_la-arc4random.o):(.text+0xa0): first defined here clang: error: linker command failed with exit code 1 (use -v to see invocation curl is linked to libressl Now a simple patch that makes the above program link: cat /usr/ports/security/libressl/files/patch-crypto-compat-arc4random.c --- crypto/compat/arc4random.c.orig 2015-06-08 21:06:50.000000000 -0500 +++ crypto/compat/arc4random.c 2015-06-08 21:07:03.000000000 -0500 @@ -176,7 +176,7 @@ } uint32_t -arc4random(void) +arc4random_(void) { uint32_t val; @@ -187,7 +187,7 @@ } void -arc4random_buf(void *buf, size_t n) +arc4random_buf_(void *buf, size_t n) { _ARC4_LOCK(); _rs_random_buf(buf, n); With this, the program links correctly. The configure of the port: checking dependency style of cc... gcc3 checking for arc4random_buf... (cached) yes checking for asprintf... (cached) yes And that file is compiled: --- compat/libcompat_la-timingsafe_bcmp.lo --- CC compat/libcompat_la-timingsafe_bcmp.lo --- compat/libcompat_la-arc4random.lo --- CC compat/libcompat_la-arc4random.lo --- compat/libcompat_la-getentropy_freebsd.lo --- CC compat/libcompat_la-getentropy_freebsd.lo For what I can see, this shouldn't be compiled if arc4random_buf is detected. -- You are receiving this mail because: You are the assignee for the bug.