Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-11873] [Windows] building the toolchain fails #54288

Closed
swift-ci opened this issue Nov 29, 2019 · 7 comments
Closed

[SR-11873] [Windows] building the toolchain fails #54288

swift-ci opened this issue Nov 29, 2019 · 7 comments
Assignees
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. Dispatch Windows Platform: Windows

Comments

@swift-ci
Copy link
Collaborator

Previous ID SR-11873
Radar rdar://problem/57549604
Original Reporter yostane (JIRA User)
Type Bug
Status Closed
Resolution Invalid

Attachment: Download

Environment

OS: Windows 10.0.19030

Visual Studio 2019

Swift: 5.1.1

Additional Detail from JIRA
Votes 0
Component/s
Labels Bug, Dispatch, Windows
Assignee @compnerd
Priority Medium

md5: 0d2c363ee19e991475ae07cfc20d0a77

relates to:

  • SR-14314 [Windows] Linker errors building libdispatch for x86

Issue Description:

  1. Followed instructions to build swift on Windows: https://github.com/apple/swift/blob/master/docs/WindowsBuild.md#MSVC

  2. Reached "building the toolchain step"

  3. The command "ninja -C S:\b\toolchain" fails with errors (ninja and cmake outputs attached)

@beccadax
Copy link
Contributor

beccadax commented Dec 2, 2019

@swift-ci create

@lorentey
Copy link
Member

lorentey commented Dec 2, 2019

There are multiple issues; the first two are errors in corelibs-dispatch, so let's start there.

First, linking the blocks runtime fails with unresolved symbols due to a 32/64 bit issue:

FAILED: BlocksRuntime.dll src/BlocksRuntime/BlocksRuntime.lib 
cmd.exe /C "cd . && "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -E vs_link_dll --intdir=src\BlocksRuntime\CMakeFiles\BlocksRuntime.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100183~1.0\x86\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100183~1.0\x86\mt.exe --manifests  -- C:\PROGRA~2\MICROS~1\2019\COMMUN~1\VC\Tools\MSVC\1423~1.281\bin\Hostx86\x86\link.exe /nologo src\BlocksRuntime\CMakeFiles\BlocksRuntime.dir\data.c.obj src\BlocksRuntime\CMakeFiles\BlocksRuntime.dir\runtime.c.obj  /out:BlocksRuntime.dll /implib:src\BlocksRuntime\BlocksRuntime.lib /pdb:BlocksRuntime.pdb /dll /version:0.0 /machine:X86 /debug /INCREMENTAL /DEF:S:\toolchain\swift-corelibs-libdispatch\src\BlocksRuntime\BlocksRuntime.def  /DEF:S:\toolchain\swift-corelibs-libdispatch\src\BlocksRuntime\BlocksRuntime.def -LIBPATH:C:\PROGRA~2\MICROS~1\2019\COMMUN~1\VC\Tools\MSVC\1423~1.281\Lib\x64  -LIBPATH:C:\PROGRA~2\WI3CF2~1\10\Lib\100183~1.0\ucrt\x64  -LIBPATH:C:\PROGRA~2\WI3CF2~1\10\Lib\100183~1.0\um\x64 kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib  && cd ."
LINK Pass 1: command "C:\PROGRA~2\MICROS~1\2019\COMMUN~1\VC\Tools\MSVC\1423~1.281\bin\Hostx86\x86\link.exe /nologo src\BlocksRuntime\CMakeFiles\BlocksRuntime.dir\data.c.obj src\BlocksRuntime\CMakeFiles\BlocksRuntime.dir\runtime.c.obj /out:BlocksRuntime.dll /implib:src\BlocksRuntime\BlocksRuntime.lib /pdb:BlocksRuntime.pdb /dll /version:0.0 /machine:X86 /debug /INCREMENTAL /DEF:S:\toolchain\swift-corelibs-libdispatch\src\BlocksRuntime\BlocksRuntime.def /DEF:S:\toolchain\swift-corelibs-libdispatch\src\BlocksRuntime\BlocksRuntime.def -LIBPATH:C:\PROGRA~2\MICROS~1\2019\COMMUN~1\VC\Tools\MSVC\1423~1.281\Lib\x64 -LIBPATH:C:\PROGRA~2\WI3CF2~1\10\Lib\100183~1.0\ucrt\x64 -LIBPATH:C:\PROGRA~2\WI3CF2~1\10\Lib\100183~1.0\um\x64 kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:src\BlocksRuntime\CMakeFiles\BlocksRuntime.dir/intermediate.manifest src\BlocksRuntime\CMakeFiles\BlocksRuntime.dir/manifest.res" failed (exit code 1120) with the following output:
S:\toolchain\swift-corelibs-libdispatch\src\BlocksRuntime\BlocksRuntime.def(3) : warning LNK4087: CONSTANT keyword is obsolete; use DATA
S:\toolchain\swift-corelibs-libdispatch\src\BlocksRuntime\BlocksRuntime.def(4) : warning LNK4087: CONSTANT keyword is obsolete; use DATA
   Creating library src\BlocksRuntime\BlocksRuntime.lib and object src\BlocksRuntime\BlocksRuntime.exp
runtime.c.obj : error LNK2019: unresolved external symbol ___security_cookie referenced in function _sprintf
runtime.c.obj : error LNK2019: unresolved external symbol @__security_check_cookie@4 referenced in function _sprintf
runtime.c.obj : error LNK2019: unresolved external symbol __imp__malloc referenced in function __Block_copy_internal
runtime.c.obj : error LNK2019: unresolved external symbol _memmove referenced in function __Block_copy_internal
runtime.c.obj : error LNK2019: unresolved external symbol __imp___wassert referenced in function __Block_byref_release
runtime.c.obj : error LNK2019: unresolved external symbol __imp____stdio_common_vsprintf referenced in function __vsnprintf_l
runtime.c.obj : error LNK2001: unresolved external symbol _free
LINK : error LNK2001: unresolved external symbol __DllMainCRTStartup@12
C:\PROGRA~2\WI3CF2~1\10\Lib\100183~1.0\um\x64\kernel32.lib : warning LNK4272: library machine type 'x64' conflicts with target machine type 'x86'
C:\PROGRA~2\WI3CF2~1\10\Lib\100183~1.0\um\x64\user32.lib : warning LNK4272: library machine type 'x64' conflicts with target machine type 'x86'
C:\PROGRA~2\WI3CF2~1\10\Lib\100183~1.0\um\x64\gdi32.lib : warning LNK4272: library machine type 'x64' conflicts with target machine type 'x86'
C:\PROGRA~2\WI3CF2~1\10\Lib\100183~1.0\um\x64\winspool.lib : warning LNK4272: library machine type 'x64' conflicts with target machine type 'x86'
C:\PROGRA~2\WI3CF2~1\10\Lib\100183~1.0\um\x64\shell32.lib : warning LNK4272: library machine type 'x64' conflicts with target machine type 'x86'
C:\PROGRA~2\WI3CF2~1\10\Lib\100183~1.0\um\x64\ole32.lib : warning LNK4272: library machine type 'x64' conflicts with target machine type 'x86'
C:\PROGRA~2\WI3CF2~1\10\Lib\100183~1.0\um\x64\oleaut32.lib : warning LNK4272: library machine type 'x64' conflicts with target machine type 'x86'
C:\PROGRA~2\WI3CF2~1\10\Lib\100183~1.0\um\x64\uuid.lib : warning LNK4272: library machine type 'x64' conflicts with target machine type 'x86'
C:\PROGRA~2\WI3CF2~1\10\Lib\100183~1.0\um\x64\comdlg32.lib : warning LNK4272: library machine type 'x64' conflicts with target machine type 'x86'
C:\PROGRA~2\WI3CF2~1\10\Lib\100183~1.0\um\x64\advapi32.lib : warning LNK4272: library machine type 'x64' conflicts with target machine type 'x86'
C:\PROGRA~2\MICROS~1\2019\COMMUN~1\VC\Tools\MSVC\1423~1.281\Lib\x64\msvcrtd.lib : warning LNK4272: library machine type 'x64' conflicts with target machine type 'x86'
BlocksRuntime.dll : fatal error LNK1120: 8 unresolved externals

Then there is a calling convention issue:

S:\toolchain\swift-corelibs-libdispatch\src\queue.c(7376,1): error: function declared 'stdcall' here was previously declared without calling convention
_libdispatch_tsd_cleanup(void *ctx)
^
S:\toolchain\swift-corelibs-libdispatch\src/shims/tsd.h(161,13): note: previous declaration is here
extern void _libdispatch_tsd_cleanup(void *ctx);
            ^
3 warnings and 1 error generated.
ninja: build stopped: subcommand failed.

Then there are several clang assertions:

FAILED: tools/swift/stdlib/public/runtime/CMakeFiles/swiftRuntime-windows-x86_64.dir/ProtocolConformance.cpp.obj 
S:\b\toolchain\bin\clang-cl  /nologo /TP -DGTEST_HAS_RTTI=0 -DLLVM_DISABLE_ABI_BREAKING_CHECKS_ENFORCING=1 -DUNICODE -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_FILE_OFFSET_BITS=64 -D_HAS_EXCEPTIONS=0 -D_LARGEFILE_SOURCE -D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -D_UNICODE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Itools\swift\stdlib\public\runtime -IS:\toolchain\swift\stdlib\public\runtime -Itools\swift\include -IS:\toolchain\swift\include -Iinclude -IS:\toolchain\llvm\include -Itools\clang\include -IS:\toolchain\llvm\..\clang\include -IS:\toolchain\cmark\src -Itools\cmark\src -IS:\toolchain\swift-corelibs-libdispatch\src\BlocksRuntime -IS:\toolchain\swift-corelibs-libdispatch -I"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.23.28105\\include" -I"C:\Program Files (x86)\Windows Kits\10\\Include\10.0.18362.0\ucrt" -I"C:\Program Files (x86)\Windows Kits\10\\Include\10.0.18362.0\shared" -I"C:\Program Files (x86)\Windows Kits\10\\Include\10.0.18362.0\um" /GS- /Oy /Gw /Gy /Zc:inline /Zc:strictStrings /Oi /Zc:rvalueCast /W4 -wd4141 -wd4146 -wd4180 -wd4244 -wd4258 -wd4267 -wd4291 -wd4345 -wd4351 -wd4456 -wd4457 -wd4458 -wd4459 -wd4503 -wd4624 -wd4722 -wd4100 -wd4127 -wd4512 -wd4505 -wd4610 -wd4510 -wd4702 -wd4245 -wd4706 -wd4310 -wd4701 -wd4703 -wd4389 -wd4611 -wd4805 -wd4204 -wd4577 -wd4091 -wd4592 -wd4319 -wd4709 -wd4324 -w14062 -we4238 /we4062 /wd4068 /permissive- -DOBJC_OLD_DISPATCH_PROTOTYPES=0 /MDd /Zi /Ob0 /Od /RTC1    /EHs-c- /GR- /W3 -DSWIFT_RUNTIME_CLOBBER_FREED_OBJECTS=1 -DswiftCore_EXPORTS -IS:/toolchain/swift/include -DSWIFT_TARGET_LIBRARY_NAME=swiftRuntime /Od -DLLVM_ON_WIN32 -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_USE_WINAPI_FAMILY_DESKTOP_APP -D_MT -D_DLL -D_ENABLE_ATOMIC_ALIGNMENT_FIX /GR- -D_HAS_STATIC_RTTI=0 -UNDEBUG "-IC:\Program\ Files\ (x86)\Microsoft\ Visual\ Studio\2019\Community\VC\Tools\MSVC\14.23.28105\/include" "-IC:\Program\ Files\ (x86)\Windows\ Kits\10\/Include/10.0.18362.0/ucrt" "-IC:\Program\ Files\ (x86)\Windows\ Kits\10\/Include/10.0.18362.0/shared" "-IC:\Program\ Files\ (x86)\Windows\ Kits\10\/Include/10.0.18362.0/um" -I S:/Library/icu-64/usr/include -I S:/Library/icu-64/usr/include  -fno-sanitize=all /MDd /D_DLL /D_DEBUG -std:c++14 /showIncludes /Fotools\swift\stdlib\public\runtime\CMakeFiles\swiftRuntime-windows-x86_64.dir\ProtocolConformance.cpp.obj /Fdtools\swift\stdlib\public\runtime\CMakeFiles\swiftRuntime-windows-x86_64.dir\ /FS -c S:\toolchain\swift\stdlib\public\runtime\ProtocolConformance.cpp
Assertion failed: (Record->hasTrivialCopyConstructor() || Record->hasTrivialCopyAssignment() || Record->hasTrivialMoveConstructor() || Record->hasTrivialMoveAssignment() || Record->isUnion()) && "Trying to aggregate-copy a type without a trivial copy/move " "constructor or assignment operator", file S:\toolchain\clang\lib\CodeGen\CGExprAgg.cpp, line 1889
Stack dump:
0.  Program arguments: S:\b\toolchain\bin\clang-cl.exe -cc1 -triple i686-pc-windows-msvc19.23.28107 -emit-obj -mrelax-all -mincremental-linker-compatible --mrelax-relocations -disable-free -main-file-name ProtocolConformance.cpp -mrelocation-model static -mthread-model posix -mframe-pointer=none -relaxed-aliasing -fmath-errno -masm-verbose -mconstructor-aliases -target-cpu pentium4 -mllvm -x86-asm-syntax=intel -D_DEBUG -D_MT -D_DLL --dependent-lib=msvcrtd --dependent-lib=oldnames --show-includes -fno-rtti-data -fms-volatile -fdiagnostics-format msvc -gcodeview -debug-info-kind=limited -ffunction-sections -fdata-sections -coverage-notes-file S:\b\toolchain\ProtocolConformance.gcno -resource-dir S:\b\toolchain\lib\clang\9.0.0 -D GTEST_HAS_RTTI=0 -D LLVM_DISABLE_ABI_BREAKING_CHECKS_ENFORCING=1 -D UNICODE -D _CRT_NONSTDC_NO_DEPRECATE -D _CRT_NONSTDC_NO_WARNINGS -D _CRT_SECURE_NO_DEPRECATE -D _CRT_SECURE_NO_WARNINGS -D _FILE_OFFSET_BITS=64 -D _HAS_EXCEPTIONS=0 -D _LARGEFILE_SOURCE -D _SCL_SECURE_NO_DEPRECATE -D _SCL_SECURE_NO_WARNINGS -D _UNICODE -D __STDC_CONSTANT_MACROS -D __STDC_FORMAT_MACROS -D __STDC_LIMIT_MACROS -I tools\swift\stdlib\public\runtime -I S:\toolchain\swift\stdlib\public\runtime -I tools\swift\include -I S:\toolchain\swift\include -I include -I S:\toolchain\llvm\include -I tools\clang\include -I S:\toolchain\llvm\..\clang\include -I S:\toolchain\cmark\src -I tools\cmark\src -I S:\toolchain\swift-corelibs-libdispatch\src\BlocksRuntime -I S:\toolchain\swift-corelibs-libdispatch -I C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.23.28105\\include -I C:\Program Files (x86)\Windows Kits\10\\Include\10.0.18362.0\ucrt -I C:\Program Files (x86)\Windows Kits\10\\Include\10.0.18362.0\shared -I C:\Program Files (x86)\Windows Kits\10\\Include\10.0.18362.0\um -D OBJC_OLD_DISPATCH_PROTOTYPES=0 -D SWIFT_RUNTIME_CLOBBER_FREED_OBJECTS=1 -D swiftCore_EXPORTS -I S:/toolchain/swift/include -D SWIFT_TARGET_LIBRARY_NAME=swiftRuntime -D LLVM_ON_WIN32 -D _CRT_SECURE_NO_WARNINGS -D _CRT_NONSTDC_NO_WARNINGS -D _CRT_USE_WINAPI_FAMILY_DESKTOP_APP -D _MT -D _DLL -D _ENABLE_ATOMIC_ALIGNMENT_FIX -D _HAS_STATIC_RTTI=0 -U NDEBUG -I C:\Program\ Files\ (x86)\Microsoft\ Visual\ Studio\2019\Community\VC\Tools\MSVC\14.23.28105\/include -I C:\Program\ Files\ (x86)\Windows\ Kits\10\/Include/10.0.18362.0/ucrt -I C:\Program\ Files\ (x86)\Windows\ Kits\10\/Include/10.0.18362.0/shared -I C:\Program\ Files\ (x86)\Windows\ Kits\10\/Include/10.0.18362.0/um -I S:/Library/icu-64/usr/include -I S:/Library/icu-64/usr/include -D _DLL -D _DEBUG -internal-isystem S:\b\toolchain\lib\clang\9.0.0\include -internal-isystem C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.23.28105\ATLMFC\include -internal-isystem C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.23.28105\include -internal-isystem C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um -internal-isystem C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt -internal-isystem C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared -internal-isystem C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um -internal-isystem C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt -internal-isystem C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt -O0 -Werror=c++11-compat-deprecated-writable-strings -WCL4 -Wno-unused-parameter -Wall -fdeprecated-macro -fdebug-compilation-dir S:\b\toolchain -ferror-limit 19 -fmessage-length 0 -fno-use-cxa-atexit -fms-extensions -fms-compatibility -fms-compatibility-version=19.23.28107 -std=c++14 -fdelayed-template-parsing -fno-inline -fobjc-runtime=gcc -fdiagnostics-show-option -faddrsig -o tools\swift\stdlib\public\runtime\CMakeFiles\swiftRuntime-windows-x86_64.dir\ProtocolConformance.cpp.obj -x c++ S:\toolchain\swift\stdlib\public\runtime\ProtocolConformance.cpp 
1.  S:\toolchain\swift\stdlib\public\runtime\ProtocolConformance.cpp:757:1: current parser token 'const'
2.  S:\toolchain\swift\stdlib\public\runtime\ProtocolConformance.cpp:661:13: LLVM IR generation of declaration 'swift::_checkGenericRequirements'
3.  S:\toolchain\swift\stdlib\public\runtime\ProtocolConformance.cpp:661:13: Generating code for declaration 'swift::_checkGenericRequirements'
4.  S:\toolchain\swift\stdlib\public\runtime\ProtocolConformance.cpp:666:40: LLVM IR generation of compound statement ('{}')
 #​0 0x02267389 HandleAbort S:\toolchain\llvm\lib\Support\Windows\Signals.inc:408:0
 #​1 0x66ecfd98 (C:\WINDOWS\SYSTEM32\ucrtbased.dll+0x9fd98)
 #​2 0x66ed12e2 (C:\WINDOWS\SYSTEM32\ucrtbased.dll+0xa12e2)
 #​3 0x66ed56d4 (C:\WINDOWS\SYSTEM32\ucrtbased.dll+0xa56d4)
 #​4 0x66ed3cca (C:\WINDOWS\SYSTEM32\ucrtbased.dll+0xa3cca)
 #​5 0x66ed5c7a (C:\WINDOWS\SYSTEM32\ucrtbased.dll+0xa5c7a)
 #​6 0x02a8a111 clang::CodeGen::CodeGenFunction::EmitAggregateCopy(class clang::CodeGen::LValue,class clang::CodeGen::LValue,class clang::QualType,enum clang::CodeGen::AggValueSlot::Overlap_t,bool) S:\toolchain\clang\lib\CodeGen\CGExprAgg.cpp:1883:0
 #​7 0x02752479 clang::CodeGen::CallArg::copyInto(class clang::CodeGen::CodeGenFunction &,class clang::CodeGen::Address)const  S:\toolchain\clang\lib\CodeGen\CGCall.cpp:3554:0
 #​8 0x027457ab clang::CodeGen::CodeGenFunction::EmitCall(class clang::CodeGen::CGFunctionInfo const &,class clang::CodeGen::CGCallee const &,class clang::CodeGen::ReturnValueSlot,class clang::CodeGen::CallArgList const &,class llvm::CallBase * *,class clang::SourceLocation) S:\toolchain\clang\lib\CodeGen\CGCall.cpp:4005:0
 #​9 0x0286f80f clang::CodeGen::CodeGenFunction::EmitCall(class clang::QualType,class clang::CodeGen::CGCallee const &,class clang::CallExpr const *,class clang::CodeGen::ReturnValueSlot,class llvm::Value *) S:\toolchain\clang\lib\CodeGen\CGExpr.cpp:4848:0
#​10 0x0286fbe7 clang::CodeGen::CodeGenFunction::EmitCallExpr(class clang::CallExpr const *,class clang::CodeGen::ReturnValueSlot) S:\toolchain\clang\lib\CodeGen\CGExpr.cpp:4431:0
#&#8203;11 0x02a894b3 <lambda_0592f5a7809cfadd8ead193ff29f88c6>::operator() S:\toolchain\clang\lib\CodeGen\CGExprAgg.cpp:873:0
#&#8203;12 0x02a889f3 llvm::function_ref<class clang::CodeGen::RValue >::callback_fn<class <lambda_0592f5a7809cfadd8ead193ff29f88c6> >(int,class clang::CodeGen::ReturnValueSlot) S:\toolchain\llvm\include\llvm\ADT\STLExtras.h:125:0
#&#8203;13 0x02a8994a llvm::function_ref<class clang::CodeGen::RValue >::operator()(class clang::CodeGen::ReturnValueSlot)const  S:\toolchain\llvm\include\llvm\ADT\STLExtras.h:142:0
#&#8203;14 0x02a96752 `anonymous namespace'::AggExprEmitter::withReturnValueSlot S:\toolchain\clang\lib\CodeGen\CGExprAgg.cpp:288:0
#&#8203;15 0x02a90703 `anonymous namespace'::AggExprEmitter::VisitCallExpr S:\toolchain\clang\lib\CodeGen\CGExprAgg.cpp:875:0
#&#8203;16 0x02a8d09d clang::StmtVisitorBase<std::add_pointer,`anonymous namespace'::AggExprEmitter,void>::Visit S:\b\toolchain\tools\clang\include\clang\AST\StmtNodes.inc:765:0
#&#8203;17 0x02a8da0b `anonymous namespace'::AggExprEmitter::Visit S:\toolchain\clang\lib\CodeGen\CGExprAgg.cpp:106:0
#&#8203;18 0x02a89d20 clang::CodeGen::CodeGenFunction::EmitAggExpr(class clang::Expr const *,class clang::CodeGen::AggValueSlot) S:\toolchain\clang\lib\CodeGen\CGExprAgg.cpp:1836:0
#&#8203;19 0x0286cdc5 clang::CodeGen::CodeGenFunction::EmitAnyExprToMem(class clang::Expr const *,class clang::CodeGen::Address,class clang::Qualifiers,bool) S:\toolchain\clang\lib\CodeGen\CGExpr.cpp:239:0
#&#8203;20 0x028797e8 clang::CodeGen::CodeGenFunction::EmitMaterializeTemporaryExpr(class clang::MaterializeTemporaryExpr const *) S:\toolchain\clang\lib\CodeGen\CGExpr.cpp:554:0
#&#8203;21 0x02876980 clang::CodeGen::CodeGenFunction::EmitLValue(class clang::Expr const *) S:\toolchain\clang\lib\CodeGen\CGExpr.cpp:1370:0
#&#8203;22 0x028702e2 clang::CodeGen::CodeGenFunction::EmitCastLValue(class clang::CastExpr const *) S:\toolchain\clang\lib\CodeGen\CGExpr.cpp:4256:0
#&#8203;23 0x0287695a clang::CodeGen::CodeGenFunction::EmitLValue(class clang::Expr const *) S:\toolchain\clang\lib\CodeGen\CGExpr.cpp:1367:0
#&#8203;24 0x02acf989 clang::CodeGen::CodeGenFunction::EmitCXXMemberOrOperatorMemberCallExpr(class clang::CallExpr const *,class clang::CXXMethodDecl const *,class clang::CodeGen::ReturnValueSlot,bool,class clang::NestedNameSpecifier *,bool,class clang::Expr const *) S:\toolchain\clang\lib\CodeGen\CGExprCXX.cpp:249:0
#&#8203;25 0x02acf42e clang::CodeGen::CodeGenFunction::EmitCXXMemberCallExpr(class clang::CXXMemberCallExpr const *,class clang::CodeGen::ReturnValueSlot) S:\toolchain\clang\lib\CodeGen\CGExprCXX.cpp:187:0
#&#8203;26 0x0286fa49 clang::CodeGen::CodeGenFunction::EmitCallExpr(class clang::CallExpr const *,class clang::CodeGen::ReturnValueSlot) S:\toolchain\clang\lib\CodeGen\CGExpr.cpp:4410:0
#&#8203;27 0x02a7f7d8 `anonymous namespace'::ScalarExprEmitter::VisitCallExpr S:\toolchain\clang\lib\CodeGen\CGExprScalar.cpp:581:0
#&#8203;28 0x02a7f3ba clang::StmtVisitorBase<std::add_pointer,`anonymous namespace'::ScalarExprEmitter,llvm::Value *>::VisitCXXMemberCallExpr S:\b\toolchain\tools\clang\include\clang\AST\StmtNodes.inc:775:0
#&#8203;29 0x02a7c0cd clang::StmtVisitorBase<std::add_pointer,`anonymous namespace'::ScalarExprEmitter,llvm::Value *>::Visit S:\b\toolchain\tools\clang\include\clang\AST\StmtNodes.inc:775:0
#&#8203;30 0x02a7ca1e `anonymous namespace'::ScalarExprEmitter::Visit S:\toolchain\clang\lib\CodeGen\CGExprScalar.cpp:424:0
#&#8203;31 0x02a81a98 `anonymous namespace'::ScalarExprEmitter::VisitExprWithCleanups S:\toolchain\clang\lib\CodeGen\CGExprScalar.cpp:2352:0
#&#8203;32 0x02a7c298 clang::StmtVisitorBase<std::add_pointer,`anonymous namespace'::ScalarExprEmitter,llvm::Value *>::Visit S:\b\toolchain\tools\clang\include\clang\AST\StmtNodes.inc:977:0
#&#8203;33 0x02a7ca1e `anonymous namespace'::ScalarExprEmitter::Visit S:\toolchain\clang\lib\CodeGen\CGExprScalar.cpp:424:0
#&#8203;34 0x02a78c7b clang::CodeGen::CodeGenFunction::EmitScalarExpr(class clang::Expr const *,bool) S:\toolchain\clang\lib\CodeGen\CGExprScalar.cpp:4489:0
#&#8203;35 0x0279c765 clang::CodeGen::CodeGenFunction::EmitScalarInit(class clang::Expr const *,class clang::ValueDecl const *,class clang::CodeGen::LValue,bool) S:\toolchain\clang\lib\CodeGen\CGDecl.cpp:748:0
#&#8203;36 0x0279b3e7 clang::CodeGen::CodeGenFunction::EmitExprAsInit(class clang::Expr const *,class clang::ValueDecl const *,class clang::CodeGen::LValue,bool) S:\toolchain\clang\lib\CodeGen\CGDecl.cpp:1874:0
#&#8203;37 0x0279ab97 clang::CodeGen::CodeGenFunction::EmitAutoVarInit(class clang::CodeGen::CodeGenFunction::AutoVarEmission const &) S:\toolchain\clang\lib\CodeGen\CGDecl.cpp:1832:0
#&#8203;38 0x0279a5e7 clang::CodeGen::CodeGenFunction::EmitAutoVarDecl(class clang::VarDecl const &) S:\toolchain\clang\lib\CodeGen\CGDecl.cpp:1284:0
#&#8203;39 0x0279d1b0 clang::CodeGen::CodeGenFunction::EmitVarDecl(class clang::VarDecl const &) S:\toolchain\clang\lib\CodeGen\CGDecl.cpp:190:0
#&#8203;40 0x0279b12e clang::CodeGen::CodeGenFunction::EmitDecl(class clang::Decl const &) S:\toolchain\clang\lib\CodeGen\CGDecl.cpp:136:0
#&#8203;41 0x02a5dd33 clang::CodeGen::CodeGenFunction::EmitDeclStmt(class clang::DeclStmt const &) S:\toolchain\clang\lib\CodeGen\CGStmt.cpp:1129:0
#&#8203;42 0x02a5f6de clang::CodeGen::CodeGenFunction::EmitSimpleStmt(class clang::Stmt const *) S:\toolchain\clang\lib\CodeGen\CGStmt.cpp:350:0
#&#8203;43 0x02a5f91f clang::CodeGen::CodeGenFunction::EmitStmt(class clang::Stmt const *,class llvm::ArrayRef<class clang::Attr const *>) S:\toolchain\clang\lib\CodeGen\CGStmt.cpp:49:0
#&#8203;44 0x02a5d9e7 clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(class clang::CompoundStmt const &,bool,class clang::CodeGen::AggValueSlot) S:\toolchain\clang\lib\CodeGen\CGStmt.cpp:386:0
#&#8203;45 0x02a5d917 clang::CodeGen::CodeGenFunction::EmitCompoundStmt(class clang::CompoundStmt const &,bool,class clang::CodeGen::AggValueSlot) S:\toolchain\clang\lib\CodeGen\CGStmt.cpp:376:0
#&#8203;46 0x02a5f6c4 clang::CodeGen::CodeGenFunction::EmitSimpleStmt(class clang::Stmt const *) S:\toolchain\clang\lib\CodeGen\CGStmt.cpp:349:0
#&#8203;47 0x02a5f91f clang::CodeGen::CodeGenFunction::EmitStmt(class clang::Stmt const *,class llvm::ArrayRef<class clang::Attr const *>) S:\toolchain\clang\lib\CodeGen\CGStmt.cpp:49:0
#&#8203;48 0x02a5cc1d clang::CodeGen::CodeGenFunction::EmitCXXForRangeStmt(class clang::CXXForRangeStmt const &,class llvm::ArrayRef<class clang::Attr const *>) S:\toolchain\clang\lib\CodeGen\CGStmt.cpp:1002:0
#&#8203;49 0x02a5fd1f clang::CodeGen::CodeGenFunction::EmitStmt(class clang::Stmt const *,class llvm::ArrayRef<class clang::Attr const *>) S:\toolchain\clang\lib\CodeGen\CGStmt.cpp:187:0
#&#8203;50 0x02a5d9e7 clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(class clang::CompoundStmt const &,bool,class clang::CodeGen::AggValueSlot) S:\toolchain\clang\lib\CodeGen\CGStmt.cpp:386:0
#&#8203;51 0x027f78c4 clang::CodeGen::CodeGenFunction::EmitFunctionBody(class clang::Stmt const *) S:\toolchain\clang\lib\CodeGen\CodeGenFunction.cpp:1022:0
#&#8203;52 0x027fa320 clang::CodeGen::CodeGenFunction::GenerateCode(class clang::GlobalDecl,class llvm::Function *,class clang::CodeGen::CGFunctionInfo const &) S:\toolchain\clang\lib\CodeGen\CodeGenFunction.cpp:1188:0
#&#8203;53 0x0263a780 clang::CodeGen::CodeGenModule::EmitGlobalFunctionDefinition(class clang::GlobalDecl,class llvm::GlobalValue *) S:\toolchain\clang\lib\CodeGen\CodeGenModule.cpp:4295:0
#&#8203;54 0x0263a54f clang::CodeGen::CodeGenModule::EmitGlobalDefinition(class clang::GlobalDecl,class llvm::GlobalValue *) S:\toolchain\clang\lib\CodeGen\CodeGenModule.cpp:2750:0
#&#8203;55 0x02639f9f clang::CodeGen::CodeGenModule::EmitGlobal(class clang::GlobalDecl) S:\toolchain\clang\lib\CodeGen\CodeGenModule.cpp:2503:0
#&#8203;56 0x0263c6ab clang::CodeGen::CodeGenModule::EmitTopLevelDecl(class clang::Decl *) S:\toolchain\clang\lib\CodeGen\CodeGenModule.cpp:5096:0
#&#8203;57 0x0607ac9e `anonymous namespace'::CodeGeneratorImpl::HandleTopLevelDecl S:\toolchain\clang\lib\CodeGen\ModuleBuilder.cpp:162:0
#&#8203;58 0x06075a4b clang::BackendConsumer::HandleTopLevelDecl(class clang::DeclGroupRef) S:\toolchain\clang\lib\CodeGen\CodeGenAction.cpp:171:0
#&#8203;59 0x04862d8c clang::ParseAST(class clang::Sema &,bool,bool) S:\toolchain\clang\lib\Parse\ParseAST.cpp:162:0
#&#8203;60 0x02cbf2f1 clang::ASTFrontendAction::ExecuteAction(void) S:\toolchain\clang\lib\Frontend\FrontendAction.cpp:1046:0
#&#8203;61 0x06075536 clang::CodeGenAction::ExecuteAction(void) S:\toolchain\clang\lib\CodeGen\CodeGenAction.cpp:1061:0
#&#8203;62 0x02cbf0a6 clang::FrontendAction::Execute(void) S:\toolchain\clang\lib\Frontend\FrontendAction.cpp:939:0
#&#8203;63 0x02c73687 clang::CompilerInstance::ExecuteAction(class clang::FrontendAction &) S:\toolchain\clang\lib\Frontend\CompilerInstance.cpp:976:0
#&#8203;64 0x02de409a clang::ExecuteCompilerInvocation(class clang::CompilerInstance *) S:\toolchain\clang\lib\FrontendTool\ExecuteCompilerInvocation.cpp:294:0
#&#8203;65 0x00877e7f cc1_main(class llvm::ArrayRef<char const *>,char const *,void *) S:\toolchain\clang\tools\driver\cc1_main.cpp:250:0
#&#8203;66 0x0086a92e ExecuteCC1Tool S:\toolchain\clang\tools\driver\driver.cpp:309:0
#&#8203;67 0x00870654 main S:\toolchain\clang\tools\driver\driver.cpp:381:0
#&#8203;68 0x05cdfb63 invoke_main d:\agent\_work\4\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:78:0
#&#8203;69 0x05cdfa37 _scrt_common_main_seh d:\agent\_work\4\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288:0
#&#8203;70 0x05cdf8dd _scrt_common_main d:\agent\_work\4\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:331:0
#&#8203;71 0x05cdfbc8 mainCRTStartup d:\agent\_work\4\s\src\vctools\crt\vcstartup\src\startup\exe_main.cpp:17:0
#&#8203;72 0x7716f989 (C:\WINDOWS\System32\KERNEL32.DLL+0x1f989)
#&#8203;73 0x77345de4 (C:\WINDOWS\SYSTEM32\ntdll.dll+0x65de4)
#&#8203;74 0x77345db4 (C:\WINDOWS\SYSTEM32\ntdll.dll+0x65db4)
clang-cl: error: clang frontend command failed due to signal (use -v to see invocation)
compnerd.org clang version 9.0.0 (https://github.com/apple/llvm-project 289b5a4ec6da25d44383ee107c9f5612717fce3b) (based on LLVM 9.0.0)
Target: i686-pc-windows-msvc
Thread model: posix
InstalledDir: S:\b\toolchain\bin
clang-cl: note: diagnostic msg: PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace, preprocessed source, and associated run script.
clang-cl: note: diagnostic msg: Error generating preprocessed source(s).

@swift-ci
Copy link
Collaborator Author

swift-ci commented Dec 2, 2019

Comment by Yassine BENABBAS (JIRA)

On the clang assertions part, it says on the first to last line that we should submit a bug to https://bugs.llvm.org/.

Should I report this problem to LLVM bugs ?

@compnerd
Copy link
Collaborator

I think that this is due to the fact that the "x86 Developer Command Prompt" was used rather than the "x64 Developer Command Prompt". I don't think that there is much we can do in this case. You are building for 64-bit with a compiler that only targets 32-bit code.

@compnerd
Copy link
Collaborator

If you are still running into this from the "x64 Developer Command Prompt" please re-open.

@swift-ci
Copy link
Collaborator Author

Comment by Yassine BENABBAS (JIRA)

Hi, thanks. I'll try again.

@triplef
Copy link

triplef commented Aug 5, 2021

This issue is reproducible when building libdispatch in an x86 Developer Command Prompt (SR-14314), and seems to stem from CMake adding a bunch of extra `LIBPATH` options to the linker command referencing the x64 toolchain (see linker command above).

Any idea what this could be caused by? Building other CMake C++ projects using clang-cl in the same Developer Command Prompt works fine, so I don’t think it’s an issue with the compiler.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. Dispatch Windows Platform: Windows
Projects
None yet
Development

No branches or pull requests

5 participants