gnustep / tools-windows-msvc

Objective-C on Windows using Clang and GNUstep.
MIT License
44 stars 10 forks source link

tools-windows-msvc: Trying to run as instruction but compilation doesn't work #22

Closed DartViet closed 1 year ago

DartViet commented 2 years ago

I already in install clang in Msys2 and do as instruction, but so far still got this:

It's just a Hello World file.

is there anything I should add to make this works ?

image

triplef commented 2 years ago

Hi, did you launch the MSYS2 shell from a Visual Studio environment like the "x64 Native Tools Command Prompt"?

DartViet commented 2 years ago

Yeah, I got this:

` C:\Users\MyOwnPC\Documents\Projects\ObjectiveC1>clang-cl -I C:\GNUstep\x64\Debug\include -fobjc-runtime=gnustep-2.0 -Xclang -fexceptions -Xclang -fobjc-exceptions -fblocks -DGNUSTEP -DGNUSTEP_WITH_DLL -DGNUSTEP_RUNTIME=1 -D_NONFRAGILE_ABI=1 -D_NATIVE_OBJC_EXCEPTIONS /MDd /c main1.m Assertion failed: cast(getOperand(1)->getType()) ->isOpaqueOrPointeeTypeMatches(getOperand(0)->getType()) && "Ptr must be a pointer to Val type!", file D:\a\1\s\llvm-project\llvm\lib\IR\Instructions.cpp, line 1493 PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace, preprocessed source, and associated run script. Stack dump:

  1. Program arguments: clang-cl -I C:\GNUstep\x64\Debug\include -fobjc-runtime=gnustep-2.0 -Xclang -fexceptions -Xclang -fobjc-exceptions -fblocks -DGNUSTEP -DGNUSTEP_WITH_DLL -DGNUSTEP_RUNTIME=1 -D_NONFRAGILE_ABI=1 -D_NATIVE_OBJC_EXCEPTIONS /MDd /c main1.m
  2. parser at end of file
  3. Per-file LLVM IR generation

    0 0x00007ff7713eff35 (C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\clang-cl.exe+0x165ff35)

    1 0x00007ff955521881 (C:\Windows\System32\ucrtbase.dll+0x71881)

    2 0x00007ff955522851 (C:\Windows\System32\ucrtbase.dll+0x72851)

    3 0x00007ff95552426e (C:\Windows\System32\ucrtbase.dll+0x7426e)

    4 0x00007ff955524165 (C:\Windows\System32\ucrtbase.dll+0x74165)

    5 0x00007ff9555244f1 (C:\Windows\System32\ucrtbase.dll+0x744f1)

    6 0x00007ff770d1d7b3 (C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\clang-cl.exe+0xf8d7b3)

    7 0x00007ff770d1c94f (C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\clang-cl.exe+0xf8c94f)

    8 0x00007ff770d1c80e (C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\clang-cl.exe+0xf8c80e)

    9 0x00007ff77092bc2d (C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\clang-cl.exe+0xb9bc2d)

    10 0x00007ff7718bf146 (C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\clang-cl.exe+0x1b2f146)

    11 0x00007ff77170592d (C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\clang-cl.exe+0x197592d)

    12 0x00007ff773ce8e67 (C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\clang-cl.exe+0x3f58e67)

    13 0x00007ff773ce531e (C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\clang-cl.exe+0x3f5531e)

    14 0x00007ff772b206d4 (C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\clang-cl.exe+0x2d906d4)

    15 0x00007ff771d4f005 (C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\clang-cl.exe+0x1fbf005)

    16 0x00007ff773ce431d (C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\clang-cl.exe+0x3f5431d)

    17 0x00007ff771d4ee18 (C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\clang-cl.exe+0x1fbee18)

    18 0x00007ff771d11f0c (C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\clang-cl.exe+0x1f81f0c)

    19 0x00007ff771dc9a89 (C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\clang-cl.exe+0x2039a89)

    20 0x00007ff76fe14a04 (C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\clang-cl.exe+0x84a04)

    21 0x00007ff76fe0f4c6 (C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\clang-cl.exe+0x7f4c6)

    22 0x00007ff771c359d7 (C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\clang-cl.exe+0x1ea59d7)

    23 0x00007ff7713ce65f (C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\clang-cl.exe+0x163e65f)

    24 0x00007ff771c35f8a (C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\clang-cl.exe+0x1ea5f8a)

    25 0x00007ff771bb3ff9 (C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\clang-cl.exe+0x1e23ff9)

    26 0x00007ff771bb4221 (C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\clang-cl.exe+0x1e24221)

    27 0x00007ff771b9cc7c (C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\clang-cl.exe+0x1e0cc7c)

    28 0x00007ff76fe11984 (C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\clang-cl.exe+0x81984)

    29 0x00007ff773a32ec0 (C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\clang-cl.exe+0x3ca2ec0)

    30 0x00007ff9558a7034 (C:\Windows\System32\KERNEL32.DLL+0x17034)

    31 0x00007ff9575a26a1 (C:\Windows\SYSTEM32\ntdll.dll+0x526a1)

    clang-cl: error: clang frontend command failed due to signal (use -v to see invocation) compnerd.org clang version 14.0.0 Target: x86_64-pc-windows-msvc Thread model: posix InstalledDir: C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin clang-cl: note: diagnostic msg:


PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT: Preprocessed source(s) and associated run script(s) are located at: clang-cl: note: diagnostic msg: C:\Users\MyOwnPC\AppData\Local\Temp\main1-1b73e0.m clang-cl: note: diagnostic msg: C:\Users\MyOwnPC\AppData\Local\Temp\main1-1b73e0.sh clang-cl: note: diagnostic msg:


`

triplef commented 2 years ago

This looks like one of the issues from Clang 14 documented here: https://github.com/gnustep/tools-windows-msvc#status-and-known-issues

Please try with Clang 13 e.g. the one bundled with Visual Studio 2019.

triplef commented 1 year ago

Feel free to re-open this if you’re still running into issues.