Web lists-archives.com

Extremely slow compilation of C++ because of cc1plus does bad systemcalls




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

08:25:49.3879979 cc1plus.exe 7256 QueryAllInformationFile
C:\cygwin64\lib\gcc\x86_64-w64-mingw32\6.4.0\include\c++\backward
BUFFER OVERFLOW CreationTime: 03/11/2017 13:52:16, LastAccessTime:
03/11/2017 13:52:16, LastWriteTime: 03/11/2017 13:52:16, ChangeTime:
03/11/2017 13:52:16, FileAttributes: DCNCI, AllocationSize: 4,096,
EndOfFile: 4,096, NumberOfLinks: 1, DeletePending: False, Directory:
True, IndexNumber: 0xe000000065c3f, EaSize: 0, Access: Read EA, Read
Attributes, Read Control, Position: 0, Mode: , AlignmentRequirement:
Word
08:25:49.3880077 cc1plus.exe 7256 CloseFile
C:\cygwin64\lib\gcc\x86_64-w64-mingw32\6.4.0\include\c++\backward
SUCCESS
08:25:49.3880800 cc1plus.exe 7256 CreateFile
C:\cygwin64\lib\gcc\x86_64-w64-mingw32\6.4.0\include\c++\backward\clwbintrin.h
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.3881391 cc1plus.exe 7256 CreateFile
C:\cygwin64\lib\gcc\x86_64-w64-mingw32\6.4.0\include\c++\backward\clwbintrin.h.exe
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.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
08:25:49.3883608 cc1plus.exe 7256 CreateFile
C:\cygwin64\lib\gcc\x86_64-w64-mingw32\6.4.0\include\c++\backward
SUCCESS Desired Access: Read EA, Read Attributes, Read Control,
Disposition: Open, Options: Open Reparse Point, Attributes: n/a,
ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult:
Opened
08:25:49.3883767 cc1plus.exe 7256 QueryInformationVolume
C:\cygwin64\lib\gcc\x86_64-w64-mingw32\6.4.0\include\c++\backward
SUCCESS VolumeCreationTime: 20/11/2015 20:57:08, VolumeSerialNumber:
8CA4-C6C6, SupportsObjects: True, VolumeLabel: OS
08:25:49.3883849 cc1plus.exe 7256 QueryAllInformationFile
C:\cygwin64\lib\gcc\x86_64-w64-mingw32\6.4.0\include\c++\backward
BUFFER OVERFLOW CreationTime: 03/11/2017 13:52:16, LastAccessTime:
03/11/2017 13:52:16, LastWriteTime: 03/11/2017 13:52:16, ChangeTime:
03/11/2017 13:52:16, FileAttributes: DCNCI, AllocationSize: 4,096,
EndOfFile: 4,096, NumberOfLinks: 1, DeletePending: False, Directory:
True, IndexNumber: 0xe000000065c3f, EaSize: 0, Access: Read EA, Read
Attributes, Read Control, Position: 0, Mode: , AlignmentRequirement:
Word
08:25:49.3883957 cc1plus.exe 7256 CloseFile
C:\cygwin64\lib\gcc\x86_64-w64-mingw32\6.4.0\include\c++\backward
SUCCESS
08:25:49.3884696 cc1plus.exe 7256 CreateFile
C:\cygwin64\lib\gcc\x86_64-w64-mingw32\6.4.0\include\c++\backward\clwbintrin.h
NAME NOT FOUND Desired Access: Generic Read, Disposition: Open,
Options: Synchronous IO Non-Alert, Attributes: n/a, ShareMode: Read,
Write, Delete, AllocationSize: n/a
08:25:49.3885450 cc1plus.exe 7256 CreateFile
C:\cygwin64\lib\gcc\x86_64-w64-mingw32\6.4.0\include\clwbintrin.h
SUCCESS Desired Access: Read EA, Read Attributes, Read Control,
Disposition: Open, Options: Open Reparse Point, Attributes: n/a,
ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult:
Opened
08:25:49.3885619 cc1plus.exe 7256 QueryInformationVolume
C:\cygwin64\lib\gcc\x86_64-w64-mingw32\6.4.0\include\clwbintrin.h
SUCCESS VolumeCreationTime: 20/11/2015 20:57:08, VolumeSerialNumber:
8CA4-C6C6, SupportsObjects: True, VolumeLabel: OS
08:25:49.3885701 cc1plus.exe 7256 QueryAllInformationFile
C:\cygwin64\lib\gcc\x86_64-w64-mingw32\6.4.0\include\clwbintrin.h
BUFFER OVERFLOW CreationTime: 03/11/2017 13:52:14, LastAccessTime:
03/11/2017 13:52:14, LastWriteTime: 19/10/2017 03:25:55, ChangeTime:
03/11/2017 13:52:14, FileAttributes: ACNCI, AllocationSize: 4,096,
EndOfFile: 1,585, NumberOfLinks: 1, DeletePending: False, Directory:
False, IndexNumber: 0xb000000065ba0, EaSize: 0, Access: Read EA, Read
Attributes, Read Control, Position: 0, Mode: , AlignmentRequirement:
Word
08:25:49.3885799 cc1plus.exe 7256 CloseFile
C:\cygwin64\lib\gcc\x86_64-w64-mingw32\6.4.0\include\clwbintrin.h
SUCCESS
08:25:49.3886558 cc1plus.exe 7256 CreateFile
C:\cygwin64\lib\gcc\x86_64-w64-mingw32\6.4.0\include\clwbintrin.h
SUCCESS Desired Access: Read EA, Read Attributes, Read Control,
Disposition: Open, Options: Open Reparse Point, Attributes: n/a,
ShareMode: Read, Write, Delete, AllocationSize: n/a, OpenResult:
Opened
08:25:49.3886707 cc1plus.exe 7256 QueryInformationVolume
C:\cygwin64\lib\gcc\x86_64-w64-mingw32\6.4.0\include\clwbintrin.h
SUCCESS VolumeCreationTime: 20/11/2015 20:57:08, VolumeSerialNumber:
8CA4-C6C6, SupportsObjects: True, VolumeLabel: OS
08:25:49.3886794 cc1plus.exe 7256 QueryAllInformationFile
C:\cygwin64\lib\gcc\x86_64-w64-mingw32\6.4.0\include\clwbintrin.h
BUFFER OVERFLOW CreationTime: 03/11/2017 13:52:14, LastAccessTime:
03/11/2017 13:52:14, LastWriteTime: 19/10/2017 03:25:55, ChangeTime:
03/11/2017 13:52:14, FileAttributes: ACNCI, AllocationSize: 4,096,
EndOfFile: 1,585, NumberOfLinks: 1, DeletePending: False, Directory:
False, IndexNumber: 0xb000000065ba0, EaSize: 0, Access: Read EA, Read
Attributes, Read Control, Position: 0, Mode: , AlignmentRequirement:
Word
08:25:49.3886882 cc1plus.exe 7256 CloseFile
C:\cygwin64\lib\gcc\x86_64-w64-mingw32\6.4.0\include\clwbintrin.h
SUCCESS
08:25:49.3887626 cc1plus.exe 7256 CreateFile
C:\cygwin64\lib\gcc\x86_64-w64-mingw32\6.4.0\include\clwbintrin.h
SUCCESS Desired Access: Generic Read, Disposition: Open, Options:
Synchronous IO Non-Alert, Attributes: n/a, ShareMode: Read, Write,
Delete, AllocationSize: n/a, OpenResult: Opened
08:25:49.3887800 cc1plus.exe 7256 QueryAllInformationFile
C:\cygwin64\lib\gcc\x86_64-w64-mingw32\6.4.0\include\clwbintrin.h
BUFFER OVERFLOW CreationTime: 03/11/2017 13:52:14, LastAccessTime:
03/11/2017 13:52:14, LastWriteTime: 19/10/2017 03:25:55, ChangeTime:
03/11/2017 13:52:14, FileAttributes: ACNCI, AllocationSize: 4,096,
EndOfFile: 1,585, NumberOfLinks: 1, DeletePending: False, Directory:
False, IndexNumber: 0xb000000065ba0, EaSize: 0, Access: Generic Read,
Position: 0, Mode: Synchronous IO Non-Alert, AlignmentRequirement:
Word
08:25:49.3887918 cc1plus.exe 7256 QuerySecurityFile
C:\cygwin64\lib\gcc\x86_64-w64-mingw32\6.4.0\include\clwbintrin.h
SUCCESS Information: Owner, Group, DACL
08:25:49.3888057 cc1plus.exe 7256 ReadFile
C:\cygwin64\lib\gcc\x86_64-w64-mingw32\6.4.0\include\clwbintrin.h
SUCCESS Offset: 0, Length: 1,585, Priority: Normal
08:25:49.3888406 cc1plus.exe 7256 CloseFile
C:\cygwin64\lib\gcc\x86_64-w64-mingw32\6.4.0\include\clwbintrin.h
SUCCESS
08:25:49.3889586 cc1plus.exe 7256 CreateFile
C:\Users\mp\bb3\raybaseddev\rtos_rpuck\w64\clflushoptintrin.h 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.3890346 cc1plus.exe 7256 CreateFile
C:\Users\mp\bb3\raybaseddev\rtos_rpuck\w64\clflushoptintrin.h.exe 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.3890987 cc1plus.exe 7256 CreateFile
C:\Users\mp\bb3\raybaseddev\rtos_rpuck\w64\clflushoptintrin.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.3891639 cc1plus.exe 7256 CreateFile
C:\Users\mp\bb3\raybaseddev\rtos_rpuck\w64\clflushoptintrin.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
08:25:49.3892337 cc1plus.exe 7256 CreateFile
C:\Users\mp\bb3\raybaseddev\rtos_rpuck\w64 SUCCESS Desired Access:
Read EA, Read Attributes, Read Control, Disposition: Open, Options:
Open Reparse Point, Attributes: n/a, ShareMode: Read, Write, Delete,
AllocationSize: n/a, OpenResult: Opened
08:25:49.3892516 cc1plus.exe 7256 QueryInformationVolume
C:\Users\mp\bb3\raybaseddev\rtos_rpuck\w64 SUCCESS VolumeCreationTime:
20/11/2015 20:57:08, VolumeSerialNumber: 8CA4-C6C6, SupportsObjects:
True, VolumeLabel: OS
08:25:49.3892604 cc1plus.exe 7256 QueryAllInformationFile
C:\Users\mp\bb3\raybaseddev\rtos_rpuck\w64 BUFFER OVERFLOW
CreationTime: 22/06/2017 06:43:59, LastAccessTime: 07/12/2017
07:47:08, LastWriteTime: 07/12/2017 07:47:08, ChangeTime: 07/12/2017
07:47:08, FileAttributes: D, AllocationSize: 4,096, EndOfFile: 4,096,
NumberOfLinks: 1, DeletePending: False, Directory: True, IndexNumber:
0x50000000d2955, EaSize: 0, Access: Read EA, Read Attributes, Read
Control, Position: 0, Mode: , AlignmentRequirement: Word
08:25:49.3892696 cc1plus.exe 7256 CloseFile
C:\Users\mp\bb3\raybaseddev\rtos_rpuck\w64 SUCCESS
08:25:49.3893476 cc1plus.exe 7256 CreateFile
C:\Users\mp\bb3\raybaseddev\rtos_rpuck\w64\clflushoptintrin.h 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.3894112 cc1plus.exe 7256 CreateFile
C:\Users\mp\bb3\raybaseddev\rtos_rpuck\w64\clflushoptintrin.h.exe 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.3894749 cc1plus.exe 7256 CreateFile
C:\Users\mp\bb3\raybaseddev\rtos_rpuck\w64\clflushoptintrin.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

Best regards, Magnus

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