From owner-freebsd-current@FreeBSD.ORG Tue Jun 12 15:56:26 2012 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 409D7106566C; Tue, 12 Jun 2012 15:56:26 +0000 (UTC) (envelope-from jps@semihalf.com) Received: from smtp.semihalf.com (smtp.semihalf.com [213.17.239.109]) by mx1.freebsd.org (Postfix) with ESMTP id AA7518FC24; Tue, 12 Jun 2012 15:56:25 +0000 (UTC) Received: from localhost (unknown [213.17.239.109]) by smtp.semihalf.com (Postfix) with ESMTP id 9CBBAC384B; Tue, 12 Jun 2012 17:56:24 +0200 (CEST) X-Virus-Scanned: by amavisd-new at semihalf.com Received: from smtp.semihalf.com ([213.17.239.109]) by localhost (smtp.semihalf.com [213.17.239.109]) (amavisd-new, port 10024) with ESMTP id 10U7ND3v-Jha; Tue, 12 Jun 2012 17:56:23 +0200 (CEST) Received: from [192.168.1.115] (apn-37-7-77-157.dynamic.gprs.plus.pl [37.7.77.157]) by smtp.semihalf.com (Postfix) with ESMTPSA id 7C4CBC3842; Tue, 12 Jun 2012 17:56:18 +0200 (CEST) Message-ID: <4FD7669C.8030802@semihalf.com> Date: Tue, 12 Jun 2012 17:56:12 +0200 From: Jan Sieka User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:9.0) Gecko/20111227 Thunderbird/9.0 MIME-Version: 1.0 To: Konstantin Belousov References: <4FCE211D.10204@semihalf.com> <0FE5C5BF-FADE-49BA-BF38-00018A752F14@kientzle.com> <4FD6FB72.10900@semihalf.com> <20120612084917.GL2337@deviant.kiev.zoral.com.ua> In-Reply-To: <20120612084917.GL2337@deviant.kiev.zoral.com.ua> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: gjb@semihalf.com, Rafal Jaworowski , freebsd-arm@freebsd.org, freebsd-current@freebsd.org, Ian Lepore Subject: Re: Possible fix for Perl failing with ../lib/auto/POSIX/POSIX.so: Undefined symbol "__flt_rounds" on ARM X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jun 2012 15:56:26 -0000 On 2012.06.12 10:49, Konstantin Belousov wrote: > On Tue, Jun 12, 2012 at 10:18:58AM +0200, Jan Sieka wrote: >> On 2012.06.09 18:11, Tim Kientzle wrote: >>> >>> On Jun 5, 2012, at 8:09 AM, Jan Sieka wrote: >>> >>>> Hello Ian! >>>> >>>> I tried recently to compile and run Perl 5.12 on ARM (SheevaPlug) using >>>> HEAD from 22.05.2012 and got the following error while trying to run: >>>> /usr/ports/lang/perl5.12 # make test >>>> [...] >>>> ../lib/auto/POSIX/POSIX.so: Undefined symbol "__flt_rounds >>>> [...] >>>> >>>> After investigating the issue it appeared that __flt_rounds symbol is >>>> not exported by libc. Applying the following patch, recompilling world >>>> and Perl fixed the problem and allowed to use Perl on SheevaPlug: >>>> >>>> diff --git a/lib/libc/arm/Symbol.map b/lib/libc/arm/Symbol.map >>>> index e8c7f1d..8cdcdaf 100644 >>>> --- a/lib/libc/arm/Symbol.map >>>> +++ b/lib/libc/arm/Symbol.map >>>> @@ -70,6 +70,7 @@ FBSDprivate_1.0 { >>>> __divdf3; >>>> __floatsisf; >>>> __floatsidf; >>>> + __flt_rounds; >>>> __fixsfsi; >>>> __fixdfsi; >>>> __fixunssfsi; >>>> >>>> Can you comment whether this is a correct solution? >>> >>> Great! I had the same problem compiling Python last >>> week and had planned to track it down. >>> >>> I just committed this to -CURRENT and will also >>> merge it to the armv6 tree. >> Hello Tim! >> >> Thanks for committing this but unfortunately that patch wasn't correct. >> I had another discussion on freebsd-current@ (I forgot to do a >> cross-list CC - now fixed) about how to add symbols to Symbols.map files >> (see this thread: >> http://lists.freebsd.org/pipermail/freebsd-current/2012-June/034511.html) and >> from the answer and hints given by Konstantin Belousov I have prepared >> another patch that adheres to library versioning guidelines. If nobody >> objects this patch then feel free to commit it: >> >> diff --git a/lib/libc/arm/Symbol.map b/lib/libc/arm/Symbol.map >> index dc46013..48f6747 100644 >> --- a/lib/libc/arm/Symbol.map >> +++ b/lib/libc/arm/Symbol.map >> @@ -33,6 +33,10 @@ FBSD_1.0 { >> sbrk; >> }; >> >> +FBSD_1.3 { >> + __flt_rounds; >> +}; >> + >> FBSDprivate_1.0 { >> /* PSEUDO syscalls */ >> __sys_getlogin; >> >> I have verified the above patch is working on SheevaPlug on FreeBSD >> 10-CURRENT from 2012-05-15 and Perl 5.12.4. Perl has to be recompiled >> after applying this patch. > Well, both committed version and this version should work, the question > is which fix is right. Is __flt_rounds supposed to be linked to by > applications ? If the symbols are used by normal programs, that I think > we should indeed guarantee ABI stability for them, and FBSD_1.3 > namespace is the right namespace to use. Both versions work indeed. I have analysed other architectures' lib/libc//Symbol.map files and __flt_rounds should go into FBSD_ and *not* into FBSDprivate section. I have verified that at least one of the Perl's libraries (POSIX.so) links to __flt_rounds. Python also links to this function. So to the best of my knowledge current patch is the righteous one. Best regards, Jan Sieka