From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11520 invoked by alias); 27 Feb 2018 14:10:54 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 11511 invoked by uid 89); 27 Feb 2018 14:10:54 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-it0-f43.google.com Received: from mail-it0-f43.google.com (HELO mail-it0-f43.google.com) (209.85.214.43) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 27 Feb 2018 14:10:51 +0000 Received: by mail-it0-f43.google.com with SMTP id w63so15205494ita.3 for ; Tue, 27 Feb 2018 06:10:51 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:reply-to:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=wHk9I9cdCjBr/9X4ol5m0Ej/Gw1JMiicJW3Fuyma/G4=; b=cwLyXNlLLovbF6L2ExNYh2UNbVQp21dwShVP4tJp/NXsUmAqHqYFw3Gb9t/MYSZKi9 +9+Kg0f5lc2LWg9f7y3+E3gJ/yiAnP4Sh8ZhnqYAy+cWt/xNoi9QxrnkVH6d/g5PfiY9 FEVqjKDiX0SuOSTRKCqZZG20YuPX0Wh73He1DZc9WuQWYqjiZNJLbK4hlRKyxjzK22QS aXP08yVrFb4lhlwdN/E5KkWMC4qBQREhWxOpMnf7ff/DeoyILy0aRJz+uSKM6fjdZjvn iIsGBmxlthltI3kWzpA3TB5EmhKGTDGnSw0ppfMuuQUQanXRGjTJCzDxKaGn33aUsY+8 F0rg== X-Gm-Message-State: APf1xPD6nTBdatr2TnEh/ucVjAAYI9x0+956EzQxvAWUewIfa5+NRt0X RUGsvYI8lb2Ge4X/UGAI24w4vg== X-Google-Smtp-Source: AG47ELsVwWg/4oqy8hVopN8Wwut1DTTLepQK6AkEq5IbQ0xFDR7lkWjdga6BL1UzdsPwRpJcMnYFEA== X-Received: by 10.36.148.201 with SMTP id j192mr4965192ite.139.1519740650085; Tue, 27 Feb 2018 06:10:50 -0800 (PST) Received: from [192.168.0.19] (d4-50-42-50.try.wideopenwest.com. [50.4.50.42]) by smtp.gmail.com with ESMTPSA id p187sm7664943iop.44.2018.02.27.06.10.48 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Feb 2018 06:10:49 -0800 (PST) Subject: Re: environ: fix link error on 64-bit Cygwin To: cygwin@cygwin.com References: <36131639.liFsmjX0ip@omega> <0d2666a8-1037-fc9c-a17f-72cc59e9d977@redhat.com> <20180131144046.GD4223@calimero.vinschen.de> <0d34d107-43ff-18f5-4284-b8a6ada9a927@cornell.edu> From: cyg Simple Reply-To: cygwin@cygwin.com Message-ID: <8219adcd-85df-a6bb-b8d5-e6bf2fdb57f6@gmail.com> Date: Tue, 27 Feb 2018 14:10:00 -0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <0d34d107-43ff-18f5-4284-b8a6ada9a927@cornell.edu> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2018-02/txt/msg00291.txt.bz2 On 2/26/2018 4:28 PM, Ken Brown wrote: > On 1/31/2018 9:40 AM, Corinna Vinschen wrote: >> On Jan 31 07:52, Eric Blake wrote: >>> Forwarding from the gnulib list; is this something we should fix in >>> cygwin proper? >> >> Why does anybody remove the -Wl,--disable-auto-import flag?  What for? >> The idea was to never use this flag on Cygwin and to get rid of the >> dllimport/dllexport nonsense... >> >>> On 01/31/2018 04:42 AM, Bruno Haible wrote: >>>> On 64-bit Cygwin, a libunistring build fails like this: >>>> [...] >>>> libtool: link: x86_64-pc-cygwin-gcc -g -O2 -Wl,--disable-auto-import >>>> -o .libs/test-environ.exe test-environ.o  -L/usr/local/cygwin64/lib >>>> libtests.a ../lib/.libs/libunistring.dll.a -liconv libtests.a >>>> -L/usr/local/cygwin64/lib >>>> test-environ.o:test-environ.c:(.rdata$.refptr.environ[.refptr.environ]+0x0): >>>> undefined reference to `environ' >>>> collect2: error: ld returned 1 exit status >>>> >>>> This fixes it. >>>> [...] >>>> +_GL_EXTERN_C __declspec(dllimport) char **environ; >> >> But, other than that, an equivalent newlib patch would be ok. > > Before patching newlib, please note that Bruno's patch doesn't work on > 32-bit Cygwin.  Projects (like emacs and clisp) that use gnulib's unistd > module with that patch will get link errors like this: > >   undefined reference to `_imp__environ' > > I have no idea why this error occurs only on 32-bit. > > I've made Bruno aware of the problem, and I'm waiting to see what he > comes up with. > _imp__environ? Shouldn't that be _imp_environ for Cygwin? _imp__environ to me indicates the VC version of char **_environ instead. Is the correct header being used? -- cyg Simple -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple