From nobody@FreeBSD.org  Fri Apr 18 00:06:36 2014
Return-Path: <nobody@FreeBSD.org>
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 766FC611
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 18 Apr 2014 00:06:36 +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 63B1A13BA
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 18 Apr 2014 00:06:36 +0000 (UTC)
Received: from cgiserv.freebsd.org ([127.0.1.6])
	by cgiserv.freebsd.org (8.14.8/8.14.8) with ESMTP id s3I06aPZ030709
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 18 Apr 2014 00:06:36 GMT
	(envelope-from nobody@cgiserv.freebsd.org)
Received: (from nobody@localhost)
	by cgiserv.freebsd.org (8.14.8/8.14.8/Submit) id s3I06aEd030705;
	Fri, 18 Apr 2014 00:06:36 GMT
	(envelope-from nobody)
Message-Id: <201404180006.s3I06aEd030705@cgiserv.freebsd.org>
Date: Fri, 18 Apr 2014 00:06:36 GMT
From: Alan Somers <asomers@freebsd.org>
To: freebsd-gnats-submit@FreeBSD.org
Subject: devel/rubygem-ffi can't load libc on FreeBSD 10
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         188741
>Category:       ports
>Synopsis:       devel/rubygem-ffi can't load libc on FreeBSD 10
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    ruby
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Apr 18 00:10:00 UTC 2014
>Closed-Date:    
>Last-Modified:  Fri Apr 18 00:10:05 UTC 2014
>Originator:     Alan Somers
>Release:        10.0 RELEASE
>Organization:
Sp
>Environment:
FreeBSD newisys-1u-1 10.0-RELEASE FreeBSD 10.0-RELEASE #0 r260789: Thu Jan 16 22:34:59 UTC 2014     root@snap.freebsd.org:/usr/obj/usr/src/sys/GENERIC  amd64
>Description:
On FreeBSD 10.0, but not earlier versions, rubygem-ffi cannot load libc.so.  This bug is known upstream but not yet fixed.  The easiest way to demonstrate it is to cd to the ports directory and do "cd work/ffi-1.9.3; rake test".

Full details of the bug are at this link:
https://github.com/ffi/ffi/issues/308


>How-To-Repeat:
"cd work/ffi-1.9.3; rake test"
>Fix:
A patch (attached) is at this link:
https://github.com/Carpetsmoker/ffi/commit/ac63e07f76ed65e4ad8865ef1804ce6e7a333d19#diff-ff27654be928731017894d9ade3611a9

Patch attached with submission follows:

--- lib/ffi/library.rb.orig	2014-04-17 17:47:49.000000000 -0600
+++ lib/ffi/library.rb	2014-04-17 17:50:22.000000000 -0600
@@ -114,9 +114,9 @@
 
             rescue Exception => ex
               ldscript = false
-              if ex.message =~ /(([^ \t()])+\.so([^ \t:()])*):([ \t])*invalid ELF header/
-                if File.read($1) =~ /GROUP *\( *([^ \)]+) *\)/
-                  libname = $1
+              if ex.message =~ /(([^ \t()])+\.so([^ \t:()])*):([ \t])*(invalid ELF header|file too short|invalid file format)/
+                if File.read($1) =~ /(?:GROUP|INPUT) *\( *([^\)]+)/
+                  libname = $1.split(' ')[0]
                   ldscript = true
                 end
               end


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->ruby 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Fri Apr 18 00:10:04 UTC 2014 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

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