delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2013/06/21/12:56:57

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:to:from:subject:date:message-id:references
:mime-version:content-type:content-transfer-encoding; q=dns; s=
default; b=MFjsL9AqNVAnrFrjkaDFkwp/ieSRdf5UU/QlRkwCOZohGh/ux48ak
SVyioJI4zercuG22MmEOREap5rLmsppa1+aMJegPcX9tkAbzLEXAZlQgYez0FgQD
+a3wCtk06jo/KbP8TKOw4QdvBDouEfZTCf054W6z9TPGAU55LaYed4=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:to:from:subject:date:message-id:references
:mime-version:content-type:content-transfer-encoding; s=default;
bh=ct2Jtc8kNHAPD4t+XJENZX0inuQ=; b=mETXvtO67E02e1fgdc3+y+MIfCw7
OM+I5xOYr0voJaTxx1PkqwV3l0sT7gfH2OYIELXM6sz1XtXRjarXxAck/ApI7U1m
1JwBMi+G0ejsI+Srzo2RkyjtrT0aV9QCH5rqvnNruK0/qGiCjCrSzHrivj/Q+o8H
mNfd/XAGaIMD9d4=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
X-Spam-SWARE-Status: No, score=-4.8 required=5.0 tests=BAYES_00,FREEMAIL_FROM,KHOP_THREADED,RCVD_IN_DNSWL_NONE,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS,TW_YG autolearn=ham version=3.3.1
To: cygwin AT cygwin DOT com
From: Jean-Pierre Flori <jpflori AT gmail DOT com>
Subject: Re: libtool weirdness (was Re: Broken MPIR 2.6.0 on Cygwin64)
Date: Fri, 21 Jun 2013 16:56:23 +0000 (UTC)
Lines: 78
Message-ID: <kq20jn$t2h$1@ger.gmane.org>
References: <CAHhGz88vEgzz1i4sUjE0ugNzaf+j++r1_qT=Y6abMaB4_F=PCg AT mail DOT gmail DOT com> <20130621083039 DOT GH1620 AT calimero DOT vinschen DOT de> <kq1694$ung$1 AT ger DOT gmane DOT org> <20130621094344 DOT GB25850 AT calimero DOT vinschen DOT de> <20130621113357 DOT GF25850 AT calimero DOT vinschen DOT de>
Mime-Version: 1.0
User-Agent: Pan/0.139 (Sexual Chocolate; GIT bf56508 git://git.gnome.org/pan2)

Hi all,

Here is my experience with a shared version of the library after taking 
Corinna's message into account, starting from a clean MPIR tarball (except 
for updating the FSF config.sub/guess) without autoreconfing, and using 
the Cygwin shipped yasm rather than the one included in MPIR (in case the 
Cygwin one has patches).

Le Fri, 21 Jun 2013 13:33:57 +0200, Corinna Vinschen a écrit :
> Then I tried to build it.  Of course, cygport autoreconfs and our
> libtool version 2.4.2 is installed.  Configure runs fine.
> 
> When building, first it failed to build in the mpn subdir, because it
> accidentally calls yasm with the -f elf64 flag.  I fixed that locally by
> tweaking mpn/Makefile by setting OBJECT_FORMAT from -f elf64 to -f
The -f elf64 did not make the build fail, but as this suggests I changed 
it to -f win64...
> win64.  There's also the problem that libtool adds the -DPIC flag and
> this leads to using the wrong code path in mpn/modexact_1c_odd.as.
> Change lines 107ff to
> 
>   ;%ifdef PIC ;    mov      r9, [mod_table wrt rip wrt ..gotpcrel]
>   ;%else
>       lea      r9, [mod_table wrt rip]
>   ;%endif
> 
...what make compiling modexact_1c_odd.as fail (which it did not with -f 
elf64).
Same workaround solves the problem.
> effectively disabling the GOT table access, then it builds.
> 
> But that's just a minor inconvenience, the real problem comes in the
> final link stage.  When trying to link libmpir.la, something weird
> happens.
> The libtool command line is basically this:
> 
>   /bin/sh ./libtool --tag=CC    --mode=link gcc -std=gnu99  \
>   -ggdb -O2 -pipe -fdebug-prefix-map=[...] -fdebug-prefix-map=[...] \
>   -no-undefined -Wl,--export-all-symbols \
>   -Wl,--output-def,.libs/libmpir-3.dll.def \
>   -version-info 11:0 :5  \
>   -o libmpir.la -rpath \
>   [loooooong list of .lo files]
> 
> This gets converted by libtool into the following calls:
> 
>   libtool: link: /usr/x86_64-pc-cygwin/bin/ld.exe -r -o
>   .libs/libmpir.la-1.o \
>   [long list of .o files]
>   libtool: link: /usr/x86_64-pc-cygwin/bin/ld.exe -r -o
>   .libs/libmpir.la-2.o \
>   [second long list of .o files]
>   libtool: link: rm -f .libs/libmpir.la-1.o libtool: link: gcc
>   -std=gnu99 -shared .libs/libmpir.la-2.o   -O2 \
>   -Wl,--export-all-symbols -Wl,--output-def -Wl,.libs/libmpir-3.dll.def 
>    \ -o .libs/libmpir-11.dll \				# Problem 
2
>   -Wl,--enable-auto-image-base \
>   -Xlinker --out-implib -Xlinker .libs/libmpir-11.dll	# Problem 1
> 
As before I don't have these two problems (not autoreconf in my case) and 
get correct cygmpir.dll and libmpir.dll.a.

I also corrected elf64 to win64 in tests/Makefile as yasm is used there 
as well.

And the bad news is: tests still segfault.

I'll also check with the static library now.

I'll also check without assembly optimizations, or lowering gcc 
optimization level, etc.

Best and thanks for the help!
Hopefully you can come up with proper fixes to the build system (to use -f 
win64 and no -DPIC) and the rest will follow.

JP


--
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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019