From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 68464 invoked by alias); 1 Feb 2018 14:04:20 -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 68440 invoked by uid 89); 1 Feb 2018 14:04:19 -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=HContent-Transfer-Encoding:8bit, story X-HELO: mail-io0-f169.google.com Received: from mail-io0-f169.google.com (HELO mail-io0-f169.google.com) (209.85.223.169) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 01 Feb 2018 14:04:17 +0000 Received: by mail-io0-f169.google.com with SMTP id p188so19260596ioe.12 for ; Thu, 01 Feb 2018 06:04:17 -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:reply-to:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=BOcwHVtw/KFWSS06h4UnPYmD8QFMON3rgdFY8FJalZ8=; b=ZhgyL95gIGszLJf+TCM+XpHTBfGoxjiK0jPPE19gL5g4RRcq5pqml8Pn7oIk9lC1E5 YQDOmzsirrF2LYh916Pv4+rr9ljEvLIEjwLQMMUx555TW7SP9OtsUuEotncatrcnRC2X 7fsgUE+omCc1mtiRutCXD1aktOHcSQ0wuJRdXaWnEGfM/u8bYqIfTTz9040ueMlG8lhc C065FHwpqhyPwFPCnBDlr9LLay6YRsMgsCRq6YnmZnEDpxst6F4O7cYpve3/E220wIr5 2QtYeKkzlSSUw0kCB7Xtkr0vcxmR+jrQAS2j9ofMWUPrqLxZjuJHY7qDid9rUTaI77ET fMAg== X-Gm-Message-State: AKwxytdQMQs/CxYvdRmuSqHKXa9Dut/YiZOoUBlyACiIULQ39f2IWrSF a3v6I1ABNyIwXBpRJibM0ibtRg== X-Google-Smtp-Source: AH8x225HWFqcf14ZnxQgEchILXmTsFpResfIANBlCOlK0GRQfL/7viDW1Epsqkwu18FruEPpSmCysw== X-Received: by 10.107.178.195 with SMTP id b186mr41625392iof.9.1517493855609; Thu, 01 Feb 2018 06:04:15 -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 q82sm11419itc.3.2018.02.01.06.04.14 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Feb 2018 06:04:14 -0800 (PST) Subject: Re: Extremely slow compilation of C++ because of cc1plus does bad systemcalls To: cygwin@cygwin.com References: Reply-To: cygwin@cygwin.com From: cyg Simple Message-ID: <73e4785e-6088-8fe2-9e8c-345d13222f8a@gmail.com> Date: Thu, 01 Feb 2018 14:04:00 -0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2018-02/txt/msg00003.txt.bz2 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