Open kbaladurin opened 6 years ago
@iarischenko @alpencolt @sergign60
The repro code no longer compiles:
SHOVON-X1CT:lab andrewau$ dotnet publish /p:NativeCodeGen=cpp -r osx-x64
Microsoft (R) Build Engine version 15.9.20+g88f5fadfbe for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.
Restore completed in 42.19 ms for /Users/andrewau/lab/lab.csproj.
lab -> /Users/andrewau/lab/bin/Debug/netcoreapp2.1/osx-x64/lab.dll
/usr/bin/clang
obj/Debug/netcoreapp2.1/osx-x64/native/lab.cpp(25561,15): error GB553787D: redefinition of '__slot__Invoke' [/Users/andrewau/lab/lab.csproj]
typedef void(*__slot__Invoke)(::lab::Hello::Program_Callback*);
^
obj/Debug/netcoreapp2.1/osx-x64/native/lab.cpp:25543:16: note: previous definition is here
typedef void(*__slot__Invoke)(::lab::Hello::Program_Callback*);
^
/_/src/System.Console/src/System/ConsolePal.Unix.cs(1171,36): warning GCAD25DD9: unknown escape sequence '\X' [-Wunknown-escape-sequence] [/Users/andrewau/lab/lab.csproj]
void* _43 = __load_string_literal("\X1B]0;%p1%s\X07");return (::System_Private_CoreLib::System::String*)_43;}_bb335: {
^~
/_/src/System.Console/src/System/ConsolePal.Unix.cs(1171,48): warning GCAD25DD9: unknown escape sequence '\X' [-Wunknown-escape-sequence] [/Users/andrewau/lab/lab.csproj]
void* _43 = __load_string_literal("\X1B]0;%p1%s\X07");return (::System_Private_CoreLib::System::String*)_43;}_bb335: {
^~
/_/src/System.Console/src/System/ConsolePal.Unix.cs(1173,36): warning GCAD25DD9: unknown escape sequence '\X' [-Wunknown-escape-sequence] [/Users/andrewau/lab/lab.csproj]
void* _33 = __load_string_literal("\X1B];%p1%s\X07");return (::System_Private_CoreLib::System::String*)_33;}_bb341: {
^~
/_/src/System.Console/src/System/ConsolePal.Unix.cs(1173,47): warning GCAD25DD9: unknown escape sequence '\X' [-Wunknown-escape-sequence] [/Users/andrewau/lab/lab.csproj]
void* _33 = __load_string_literal("\X1B];%p1%s\X07");return (::System_Private_CoreLib::System::String*)_33;}_bb341: {
^~
/_/src/System.Console/src/System/ConsolePal.Unix.cs(1175,36): warning GCAD25DD9: unknown escape sequence '\X' [-Wunknown-escape-sequence] [/Users/andrewau/lab/lab.csproj]
void* _39 = __load_string_literal("\X1B]30;%p1%s\X07");return (::System_Private_CoreLib::System::String*)_39;}_bb347: {
^~
/_/src/System.Console/src/System/ConsolePal.Unix.cs(1175,49): warning GCAD25DD9: unknown escape sequence '\X' [-Wunknown-escape-sequence] [/Users/andrewau/lab/lab.csproj]
void* _39 = __load_string_literal("\X1B]30;%p1%s\X07");return (::System_Private_CoreLib::System::String*)_39;}_bb347: {
^~
/_/src/System.Console/src/System/ConsolePal.Unix.cs(1177,36): warning GCAD25DD9: unknown escape sequence '\X' [-Wunknown-escape-sequence] [/Users/andrewau/lab/lab.csproj]
void* _29 = __load_string_literal("\X1Bk%p1%s\X1B");return (::System_Private_CoreLib::System::String*)_29;}_bb353: {
^~
/_/src/System.Console/src/System/ConsolePal.Unix.cs(1177,46): warning GCAD25DD9: unknown escape sequence '\X' [-Wunknown-escape-sequence] [/Users/andrewau/lab/lab.csproj]
void* _29 = __load_string_literal("\X1Bk%p1%s\X1B");return (::System_Private_CoreLib::System::String*)_29;}_bb353: {
^~
8 warnings and 1 error generated.
/Users/andrewau/git/corert/bin/OSX.x64.Debug/build/Microsoft.NETCore.Native.targets(268,5): error MSB3073: The command "clang "obj/Debug/netcoreapp2.1/osx-x64/native/lab.cpp" -o "obj/Debug/netcoreapp2.1/osx-x64/native/lab.o" -I /Users/andrewau/git/corert/bin/OSX.x64.Debug//inc -g -O0 -c -Wno-invalid-offsetof" exited with code 1. [/Users/andrewau/lab/lab.csproj]
SHOVON-X1CT:lab andrewau$
The build error is fixed with #7622, the warnings related to \X
is fixed in #7635.
Following example crashes in cppgen mode:
Generated code for
Func
:As far as I understand we shouldn't call
GetFunctionPointerForDelegate
here because it implements general delegate marshalling (for both instance and static methods) and we don't want to support instance ones (https://github.com/dotnet/corert/issues/3294#issuecomment-330319017).