www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2020/10/11/03:25:59

X-Recipient: archive-cygwin AT delorie DOT com
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org C377D3857817
Authentication-Results: sourceware.org;
dmarc=none (p=none dis=none) header.from=maxrnd.com
Authentication-Results: sourceware.org; spf=none smtp.mailfrom=mark AT maxrnd DOT com
Subject: Re: Build spends a long time in "mkimport".
To: Cygwin <cygwin AT cygwin DOT com>, cygwin-developers AT cygwin DOT com
References: <af9f360a0a782f3c4db698e9f4584d16 AT mail DOT kylheku DOT com>
From: Mark Geisert <mark AT maxrnd DOT com>
Message-ID: <fd7836b6-f428-6c18-3656-5123a47197f5@maxrnd.com>
Date: Sun, 11 Oct 2020 00:24:57 -0700
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101
Firefox/52.0 SeaMonkey/2.49.4
MIME-Version: 1.0
In-Reply-To: <af9f360a0a782f3c4db698e9f4584d16@mail.kylheku.com>
X-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS,
KAM_LAZY_DOMAIN_SECURITY, NICE_REPLY_A, SPF_HELO_NONE, SPF_NONE,
TXREP autolearn=no autolearn_force=no version=3.4.2
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on
server2.sourceware.org
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.29
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
Errors-To: cygwin-bounces AT cygwin DOT com
Sender: "Cygwin" <cygwin-bounces AT cygwin DOT com>
X-MIME-Autoconverted: from base64 to 8bit by delorie.com id 09B7Pc8Y001586

Kaz Kylheku (Cygwin) via Cygwin wrote:
> Hi All,
> 
> When building the Cygwin DLL, this single step takes almost ten minutes:
> 
>    ../../.././winsup/cygwin/mkimport --cpu=i686 --ar=ar --as=as --nm=nm 
> --objcopy=objcopy \
>    --replace=atexit= --replace=timezone= --replace=uname=uname_x 
> --replace=__xdrrec_getrec=
> 
>    [ .. SNIP ... ]
> 
>    --replace=truncate=_truncate64 libcygwin.a cygdll.a _cygwin_crt0_common.o \
>    atexit.o cygwin_attach_dll.o cygwin_crt0.o dll_entry.o dll_main.o dso_handle.o \
>    libcmain.o premain0.o premain1.o premain2.o premain3.o pseudo-reloc-dummy.o
> 
> What's puzzling is that there is very CPU activity during this time. It's launching
> some objcopy commands.
> 
> Is there some documentation that provides an overview of what exactly this does,
> other than studying its perl source code?
> 
> Maybe it can be sped up?
> 
> I'm going to have to cycle quite a few times on some changes, so this is frustrating.

Hi Kaz,
I'm redirecting this to the cygwin-developers list as it's a Cygwin build issue. 
Please follow up there.

I've looked at .../winsup/cygwin/mkimport for the same reason as you -- it takes 
forever on my Windows machines.  But I don't know enough perl to make any changes.

Near the end of mkimport there's a loop over all the "--replace" args, 
essentially.  For each one there are two system() calls launching two objcopy 
processes to do something.  This is much slower on Cygwin than it would be 
cross-building from Linux, for example.

One could parallelize the operations on a multicore machine.  But probably better 
would be figuring out, if possible, how to do the objcopy operations in one pass, 
over two calls if necessary.

PTC, as we've always said :-)

..mark
--
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

- Raw text -


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