From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 104264 invoked by alias); 21 Apr 2017 19:23:52 -0000 Mailing-List: contact crossgcc-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: crossgcc-owner@sourceware.org Received: (qmail 104244 invoked by uid 89); 21 Apr 2017 19:23:51 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-7.9 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,GIT_PATCH_2,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 spammy=emails X-HELO: nm17-vm6.access.bullet.mail.bf1.yahoo.com Received: from nm17-vm6.access.bullet.mail.bf1.yahoo.com (HELO nm17-vm6.access.bullet.mail.bf1.yahoo.com) (216.109.115.69) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 21 Apr 2017 19:23:50 +0000 Received: from [66.196.81.163] by nm17.access.bullet.mail.bf1.yahoo.com with NNFMP; 21 Apr 2017 19:23:50 -0000 Received: from [98.138.104.99] by tm9.access.bullet.mail.bf1.yahoo.com with NNFMP; 21 Apr 2017 19:23:50 -0000 Received: from [127.0.0.1] by smtp119.sbc.mail.ne1.yahoo.com with NNFMP; 21 Apr 2017 19:23:50 -0000 X-Yahoo-SMTP: 0h0Q7euswBD_g.kcEqbzJWRFfrba801gq1M1 Subject: Re: AW: canadian build for mingw host: patch for gettext 0.19.8.1 To: Titus von Boxberg References: <0cff97321de042e483ca9f7fa31fe225@SOLOWJOW.ELBE.local> Cc: crossgcc maillist From: Alexey Neyman Message-ID: <6b0b9b1a-bc1f-9c89-1168-286c9852f871@att.net> Date: Fri, 21 Apr 2017 19:23:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <0cff97321de042e483ca9f7fa31fe225@SOLOWJOW.ELBE.local> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2017-04/txt/msg00024.txt.bz2 On 04/21/2017 12:15 PM, Titus von Boxberg wrote: > >> -----Ursprüngliche Nachricht----- >> Von: Alexey Neyman [mailto:stilor@att.net] >> Gesendet: Freitag, 21. April 2017 20:26 >> An: Titus von Boxberg >> Cc: crossgcc maillist >> Betreff: Re: AW: canadian build for mingw host: patch for gettext 0.19.8.1 >> >> On 04/21/2017 10:59 AM, Titus von Boxberg wrote: >>> Alexey, all, >>> >>> see below: >>> >>>> -----Ursprüngliche Nachricht----- >>>> Von: Alexey Neyman [mailto:stilor@att.net] >>>> Gesendet: Freitag, 21. April 2017 18:17 >>>> An: Titus von Boxberg >>>> Cc: crossgcc maillist >>>> Betreff: Re: canadian build for mingw host: patch for gettext >>>> 0.19.8.1 >>>> >>>> [CC crossgcc list] >>>> >>>> Hi Titus, >>>> >>>> First off, please send the emails the crossgcc mailing list, not to >>>> me personally - I may not be the only person interested in a certain >>>> patch, etc. >>>> >>>> >>>> On 04/21/2017 04:12 AM, Titus von Boxberg wrote: >>>>> Hi Alexey, >>>>> >>>>> I had to use the patch below to let ct-ng build gettext 0.19.8.1 for >>>>> host >>>> mingw. >>>>> I don't use mingw nor gettext at all (besides for running a cross >>>>> gcc on windows), so I don't really understand why it's required (or >>>>> rather why >>>> mingw defines asprintf). >>>> asprintf is more or less common function now. >>>> >>>> Can you describe how you set up the mingw host? I'd like to add it to >>>> our docs and add that to our testing regimen. >>> I use a (rather old) i686-w64-mingw32 cross compiler from Linux to mingw. >>> gcc version 4.7.2 >> What do you use as a shell, etc? Cygwin? > I'm afraid I don't get the question. > On the ct-ng build machine (Linux), I installed > i686-w64-mingw32-gcc-4.7.2-release-linux64_rubenvb.tar.xz > That's it, afair. > The shell on the host (Windows) is beyond the canadian build (on Linux). > Anyway, I don't use cygwin at all. Ah, I missed 'canadian' in the Subject line. Sorry. >>>> As to the patch itself, what was the problem with using asprintf from >>>> mingw's libraries? A build log fragment would be helpful. >>> gettext contains three definitions of asprintf in three files >>> asprintf.c These conflict with a static implementation of asprintf in >>> mingw header stdio.h As I said: Unfortunately, I don't have a clue about >> gettext and mingw. >> I looked at mingw's and I see what the problem is. The function is >> actually not static - had it been, e.g., 'static inline', it wouldn't have >> conflicted with a built-in implementation of asprintf(). >> >> So, the patch makes sense, but I am not sure if it should be fixed by mingw >> instead. > No, the asprintf in (my) mingw's stdio.h is static: > > static __attribute__ ((__unused__)) > __attribute__ ((__format__ (gnu_printf, 2, 3))) __attribute__((nonnull (1,2))) > int asprintf(char **__ret, const char *__format, ...) > { > register int __retval; > __builtin_va_list __local_argv; __builtin_va_start( __local_argv, __format ); > __retval = __mingw_vasprintf( __ret, __format, __local_argv ); > __builtin_va_end( __local_argv ); > return __retval; > } > > > With my nonexistent knowledge of gettext, I'd deduce that the problem > could be either that gettext's configure does not check for > an external implementation of asprintf at all, or that it cannot detect this > implementation. In either way, it apparently chooses to bring in > gettext's own implementation of asprintf which leads to the duplicate > definition when compiling gettext's asprintf.c In the current version of i686-w64-mingw32 sample's it looks like this: __mingw_ovr __attribute__ ((__format__ (gnu_printf, 2, 3))) __attribute__((nonnull (1,2))) int asprintf(char **__ret, const char *__format, ...) { register int __retval; __builtin_va_list __local_argv; __builtin_va_start( __local_argv, __format ); __retval = __mingw_vasprintf( __ret, __format, __local_argv ); __builtin_va_end( __local_argv ); return __retval; } So, it apparently breaks with either static or not. Please file an issue on Github so that I do not forget about this issue. Attach your .config and the patch. Thanks, Alexey.