From owner-freebsd-ports@freebsd.org Fri Nov 27 14:41:12 2015 Return-Path: Delivered-To: freebsd-ports@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 82FE8A3A211 for ; Fri, 27 Nov 2015 14:41:12 +0000 (UTC) (envelope-from swills@FreeBSD.org) Received: from mouf.net (mouf.net [IPv6:2607:fc50:0:4400:216:3eff:fe69:33b3]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mouf.net", Issuer "mouf.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 5735711E8; Fri, 27 Nov 2015 14:41:12 +0000 (UTC) (envelope-from swills@FreeBSD.org) Received: from [10.0.1.96] (cpe-071-065-239-148.nc.res.rr.com [71.65.239.148] (may be forged)) (authenticated bits=0) by mouf.net (8.14.9/8.14.9) with ESMTP id tAREf1SC053452 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Fri, 27 Nov 2015 14:41:07 GMT (envelope-from swills@FreeBSD.org) Subject: Re: lang/gcc48 fails to build [on HEAD] To: Baptiste Daroussin , Tijl Coosemans References: <564040EE.6090504@gwdg.de> <5642362C.7000609@gwdg.de> <20151127125954.GA17547@ivaldir.etoilebsd.net> <20151127142405.20af4925@kalimero.tijl.coosemans.org> <20151127134205.GB17547@ivaldir.etoilebsd.net> Cc: Gerald Pfeifer , Rainer Hurling , freebsd-ports@freebsd.org From: Steve Wills X-Enigmail-Draft-Status: N1110 Message-ID: <56586B7D.3080700@FreeBSD.org> Date: Fri, 27 Nov 2015 09:41:01 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <20151127134205.GB17547@ivaldir.etoilebsd.net> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mouf.net [199.48.129.64]); Fri, 27 Nov 2015 14:41:07 +0000 (UTC) X-Spam-Status: No, score=-1.0 required=4.5 tests=ALL_TRUSTED autolearn=unavailable autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mouf.net X-Virus-Scanned: clamav-milter 0.98.7 at mouf.net X-Virus-Status: Clean X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Nov 2015 14:41:12 -0000 On 11/27/2015 08:42, Baptiste Daroussin wrote: > On Fri, Nov 27, 2015 at 02:24:05PM +0100, Tijl Coosemans wrote: >> On Fri, 27 Nov 2015 13:59:54 +0100 Baptiste Daroussin wrote: >>> On Tue, Nov 10, 2015 at 07:23:40PM +0100, Rainer Hurling wrote: >>>> I think I found the problem. >>>> >>>> In my initial mail of this thread, I reported, that after upgrading >>>> Freebsd 11.0-CURRENT to r290538 (including locale and localedef updates) >>>> I am not able to build lang/gccXX any more. All I get are errors like >>>> that in usr/ports/lang/gccXX/work/build/gcc: >>>> >>>> ---- >>>> In file included from .././../gcc-4.8.5/gcc/genflags.c:26: >>>> In file included from ./tm.h:16: >>>> ./options.h:4293:3: error: redefinition of enumerator 'OPT_C' >>>> OPT_C = 129, /* -C */ >>>> ^ >>>> ---- >>>> >>>> After more than 20 of them the build stops with >>>> fatal error: too many errors emitted, stopping now [-ferror-limit=] >>>> 20 errors generated. >>>> >>>> >>>> This is with locale for Germany: >>>> LANG=de_DE.UTF-8 >>>> LC_CTYPE="de_DE.UTF-8" >>>> LC_COLLATE="de_DE.UTF-8" >>>> LC_TIME="de_DE.UTF-8" >>>> LC_NUMERIC="de_DE.UTF-8" >>>> LC_MONETARY="de_DE.UTF-8" >>>> LC_MESSAGES="de_DE.UTF-8" >>>> LC_ALL= >>>> >>>> >>>> If I use 'LC_COLLATE="C"' for the build, the build works fine again: >>>> >>>> cd /usr/ports/lang/gcc48 >>>> env LC_COLLATE="C" make >>>> ... >>>> >>>> >>>> So it seems, that something with the new 'locale' code in base of HEAD >>>> is not working as expected here? (At least for other locales than US?) >>>> >>>> I added bapt@, because he is the author introducing the new code into HEAD. >>>> >>>> Hope, my explanations are clear enough to get the problem. Please feel >>>> free to ask for more information, if needed. >>> >>> Your explanations are good, sorry for the delay for my reply I will look >>> into it. >> >> I ran into this with lang/sdcc* which includes cpp from gcc. At some >> point the build runs an awk script (opt-gather.awk) that collects command >> line options defined in *.opt files, sorts them and then puts them into >> a C array. The problem seems to be that FreeBSD awk takes collation into >> account when sorting strings while GNU awk doesn't. POSIX says that >> FreeBSD is correct, so I was thinking of adding something like this to >> bsd.port.mk: >> >> USE_LOCALE?= C >> LANG= ${USE_LOCALE} >> LC_ALL= ${USE_LOCALE} >> .export LANG LC_ALL >> >> This gives a consistent locale environment for port builds. Some ports >> already set LANG or LC_ALL. That would have to be reviewed and I haven't >> had time for that yet. > > yeah we should imho to that. The same issue appears with GNU tr which also > do not take in account collation (IIRC) while ours do. FWIW, I ran into this building devel/arm-none-eabi-gcc too. Setting LC_ALL and LANG fixed it for me. Also, Mk/bsd.ruby.mk got something similar for gem builds a while ago, though it uses en_US.UTF-8 for LC_ALL and LC_CTYPE=UTF-8. As I recall, this was due to difference in generated docs based on language. We may want to remove the bits from Mk/bsd.ruby.mk if we add it globally. Also, I wonder what impacts this will have beyond fixing builds, such as docs, plist differences or baked in defaults, etc. Steve