public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: cyg Simple <cygsimple@gmail.com>
To: cygwin@cygwin.com
Subject: Re: Extremely slow compilation of C++ because of cc1plus does bad systemcalls
Date: Thu, 01 Feb 2018 14:04:00 -0000	[thread overview]
Message-ID: <73e4785e-6088-8fe2-9e8c-345d13222f8a@gmail.com> (raw)
In-Reply-To: <CAEhDDbCGmRwJqRJ=9aCaA-55v0ngqS3iHwHZb_qVVYuzt3f=Ew@mail.gmail.com>

On 2/1/2018 4:04 AM, Csaba Raduly wrote:
> Hi Magnus,
> 
> 
> On Thu, Feb 1, 2018 at 8:45 AM, Magnus Persson  wrote:
>> When compiling a very small and simple C++ program (which took 6
>> seconds), i profiled the execution. cc1plus was speding a lot of time
>> trying to create .exe-files AND .lnk-files.
>>
>> This was the command-line:
>> g++ -c -O0 -DGTEST_DONT_DEFINE_FAIL  -std=gnu++14 -Iw64
>> -Icommon/freertos/include  -Iw64/config/ -Icommon -Icommon/dali
>> -Icommon/debug -Icommon/config  -isystem ../Tools/googletest/include
>> -isystem ../Tools/googlemock/include -DUNITTEST -g -Wall -Werror
>> -pthread  unittest/block_hvac_unittest.cc -o
>> obj_unit_linux/unittest/block_hvac_unittest.o
>>
>> I used procmon to capture all system-calls done. This is a part of
>> what happened:
>> (search for .exe  AND .lnk)
>> Why does the preprocessor try to create these files (my command is
>> just trying to compile (no linking)) ?
>>
> (snip)
>> 08:25:49.3882166 cc1plus.exe 7256 CreateFile
>> C:\cygwin64\lib\gcc\x86_64-w64-mingw32\6.4.0\include\c++\backward\clwbintrin.h.lnk
>> NAME NOT FOUND Desired Access: Read EA, Read Attributes, Read Control,
>> Disposition: Open, Options: Open Reparse Point, Attributes: n/a,
>> ShareMode: Read, Write, Delete, AllocationSize: n/a
>> 08:25:49.3882946 cc1plus.exe 7256 CreateFile
>> C:\cygwin64\lib\gcc\x86_64-w64-mingw32\6.4.0\include\c++\backward\clwbintrin.h.exe.lnk
>> NAME NOT FOUND Desired Access: Read EA, Read Attributes, Read Control,
>> Disposition: Open, Options: Open Reparse Point, Attributes: n/a,
>> ShareMode: Read, Write, Delete, AllocationSize: n/a
> 
> 
> https://msdn.microsoft.com/en-us/library/windows/desktop/aa363874(v=vs.85).aspx
>  (Creating and Opening Files) says
> 
> "The CreateFile function can create a new file or open an existing file. "
> 
> 
> The options specified ( Desired Access: Read EA, Read Attributes, Read
> Control, Disposition: Open, Options: Open Reparse Point ) suggest that
> the compiler is trying to read, or is checking the existence of these
> files.
> 

That's not the whole story.  It's Cygwin the OP is using and every file
function will check for FILE.exe if FILE doesn't exist and then FILE.lnk
if FILE.exe doesn't exist.  If the OP doesn't want this then use the
native versions of the compilers instead of the Cygwin cross compiler.

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

      reply	other threads:[~2018-02-01 14:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-01  7:46 Magnus Persson
2018-02-01  9:04 ` Csaba Raduly
2018-02-01 14:04   ` cyg Simple [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=73e4785e-6088-8fe2-9e8c-345d13222f8a@gmail.com \
    --to=cygsimple@gmail.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).