mesonbuild / sdl2

Meson build files for SDL2
MIT License
4 stars 6 forks source link

Windows 11: Fails when using clang tool chain #23

Open Rdna123 opened 2 years ago

Rdna123 commented 2 years ago

Using sdl2 example from meson website. Error:

ninja: Entering directory `C:/Users/chknm/TestingGrounds/C/testc/builddir'
[6/176] Compiling C object subprojects/SDL2-2.0.18/libsdl2.a.p/src_audio_SDL_audiocvt.c.obj
FAILED: subprojects/SDL2-2.0.18/libsdl2.a.p/src_audio_SDL_audiocvt.c.obj 
"clang" "-Isubprojects\SDL2-2.0.18\libsdl2.a.p" "-Isubprojects\SDL2-2.0.18" "-I..\subprojects\SDL2-2.0.18" "-Isubprojects\SDL2-2.0.18\include" "-I..\subprojects\SDL2-2.0.18\include" "-I..\subprojects\SDL2-2.0.18\src\hidapi\hidapi" "-fcolor-diagnostics" "-D_FILE_OFFSET_BITS=64" "-Wall" "-Winvalid-pch" "-O0" "-g" "-DUSING_GENERATED_CONFIG_H" -MD -MQ subprojects/SDL2-2.0.18/libsdl2.a.p/src_audio_SDL_audiocvt.c.obj -MF "subprojects\SDL2-2.0.18\libsdl2.a.p\src_audio_SDL_audiocvt.c.obj.d" -o subprojects/SDL2-2.0.18/libsdl2.a.p/src_audio_SDL_audiocvt.c.obj "-c" ../subprojects/SDL2-2.0.18/src/audio/SDL_audiocvt.c
../subprojects/SDL2-2.0.18/src/audio/SDL_audiocvt.c:83:39: warning: implicit declaration of function '_mm_hadd_ps' is invalid in C99 [-Wimplicit-function-declaration]
        _mm_storeu_ps(dst, _mm_mul_ps(_mm_hadd_ps(_mm_load_ps(src), _mm_loadu_ps(src+4)), divby2));
                                      ^
../subprojects/SDL2-2.0.18/src/audio/SDL_audiocvt.c:83:39: error: passing 'int' to parameter of incompatible type '__m128' (vector of 4 'float' values)
        _mm_storeu_ps(dst, _mm_mul_ps(_mm_hadd_ps(_mm_load_ps(src), _mm_loadu_ps(src+4)), divby2));
                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\chknm\scoop\apps\llvm\current\lib\clang\13.0.0\include\xmmintrin.h:155:19: note: passing argument to parameter '__a' here      
_mm_mul_ps(__m128 __a, __m128 __b)
                  ^
1 warning and 1 error generated.
[7/176] Compiling C object subprojects/SDL2-2.0.18/libsdl2.a.p/src_atomic_SDL_spinlock.c.obj
../subprojects/SDL2-2.0.18/src/atomic/SDL_spinlock.c:186:5: warning: '_ReadWriteBarrier' is deprecated: use other intrinsics or C++11 atomics instead [-Wdeprecated-declarations]
    _ReadWriteBarrier();
    ^
C:\Users\chknm\scoop\apps\llvm\current\lib\clang\13.0.0\include\intrin.h:154:21: note: '_ReadWriteBarrier' has been explicitly marked deprecated here
void __attribute__((__deprecated__(
                    ^
../subprojects/SDL2-2.0.18/src/atomic/SDL_spinlock.c:82:5: warning: unused typedef 'SDL_compile_time_assert_locksize' [-Wunused-local-typedef]
    SDL_COMPILE_TIME_ASSERT(locksize, sizeof(*lock) == sizeof(long));
    ^
..\subprojects\SDL2-2.0.18\include/SDL_stdinc.h:358:20: note: expanded from macro 'SDL_COMPILE_TIME_ASSERT'
       typedef int SDL_compile_time_assert_ ## name[(x) * 2 - 1]
                   ^
<scratch space>:109:1: note: expanded from here
SDL_compile_time_assert_locksize
^
2 warnings generated.
[23/176] Compiling C object subprojects/SDL2-2.0.18/libsdl2.a.p/src_dynapi_SDL_dynapi.c.obj
ninja: build stopped: subcommand failed.
Rdna123 commented 2 years ago

When building directly works fine, when building as a subproject it produces the before given error

cdecompilador commented 2 years ago

me too

SimonFJ20 commented 1 year ago

I think I have the same issue, having installed SDL2-2.24.2 with meson wrap install sdl2 and trying to build with Clang CC=clang CXX=clang++ meson build-clang and meson compile -C build-clang.

It works fine when using MSVC through x64 Native Tools Command Prompt for VS 2017, by running meson setup builddir and meson compile -C builddir.

Using Git Bash on Window.

image

$ meson -v
0.63.2

$ clang --version
clang version 15.0.2
Target: x86_64-pc-windows-msvc
Thread model: posix
InstalledDir: C:\Program Files\LLVM\bin
My project's `meson.build` ``` project( 'simulator', 'cpp', version : '0.1', default_options: [ 'warning_level=3', 'cpp_std=c++17', 'default_library=static', 'werror=true', ], ) sources = files( 'Simulator.cpp', 'SDL2App.cpp' ) sdl2_dep = dependency('sdl2') executable( 'simulator', sources, win_subsystem: 'windows', dependencies: sdl2_dep, ) ```

First I had problems compiling because of errors and such. I just used -Wno-error=... to stop all the warnings from causing errors. I also removed the 2nd argument in some functions requiring a single argument and renamed an undeclared symbol.

Diff of my changes ```diff --- ./subprojects/SDL2-2.24.2/meson.build_before 2022-11-22 11:38:43.387488600 +0100 +++ ./subprojects/SDL2-2.24.2/meson.build 2022-11-22 11:46:25.416177400 +0100 @@ -14,10 +14,22 @@ c_args = cc.get_supported_arguments( '-Wdeclaration-after-statement', '-Wshadow', '-fno-strict-aliasing', '-mpreferred-stack-boundary=2', + '-Wno-error=sign-compare', + '-Wno-error=strict-prototypes', + '-Wno-error=unused-parameter', + '-Wno-error=unused-but-set-variable', + '-Wno-error=implicit-function-declaration', + '-Wno-error=missing-field-initializers', + '-Wno-error=ignored-qualifiers', + '-Wno-error=deprecated-declarations', + '-Wno-error=implicit-int-float-conversion', + '-Wno-error=float-conversion', + '-Wno-error=shorten-64-to-32', + '-Wno-error=unused-const-variable', + '-Wno-error=shadow', + '-Wno-error=switch', + '-Wno-error=pedantic', + '-Wno-error=gnu-zero-variadic-macro-arguments', ) --- ./subprojects/SDL2-2.24.2/src/audio/SDL_audiocvt.c_before 2022-11-22 11:39:03.554818100 +0100 +++ ./subprojects/SDL2-2.24.2/src/audio/SDL_audiocvt.c 2022-11-22 11:12:47.285282100 +0100 @@ -113 +113 @@ - _mm_storeu_ps(dst, _mm_mul_ps(_mm_hadd_ps(_mm_loadu_ps(src), _mm_loadu_ps(src+4)), divby2)); + _mm_storeu_ps(dst, _mm_mul_ps(_mm_add_ps(_mm_loadu_ps(src), _mm_loadu_ps(src+4)), divby2)); --- ./subprojects/SDL2-2.24.2/src/render/direct3d12/SDL_render_d3d12.c_before" 2022-11-22 11:25:46.731267200 +0100 +++ ./subprojects/SDL2-2.24.2/src/render/direct3d12/SDL_render_d3d12.c 2022-11-22 11:36:24.246565900 +0100 @@ -395 +395 @@ - D3D_CALL_RET(heap, GetCPUDescriptorHandleForHeapStart, &CPUHeapStart); + D3D_CALL_RET(heap, GetCPUDescriptorHandleForHeapStart); @@ -398 +398 @@ - D3D_CALL_RET(heap, GetGPUDescriptorHandleForHeapStart, &GPUHandle); + D3D_CALL_RET(heap, GetGPUDescriptorHandleForHeapStart); @@ -433 +433 @@ - D3D_CALL_RET(data->rtvDescriptorHeap, GetCPUDescriptorHandleForHeapStart, &rtvDescriptor); + D3D_CALL_RET(data->rtvDescriptorHeap, GetCPUDescriptorHandleForHeapStart); @@ -1081 +1081 @@ - D3D_CALL_RET(data->samplerDescriptorHeap, GetCPUDescriptorHandleForHeapStart, &data->nearestPixelSampler); + D3D_CALL_RET(data->samplerDescriptorHeap, GetCPUDescriptorHandleForHeapStart); @@ -1374 +1374 @@ - D3D_CALL_RET(data->rtvDescriptorHeap, GetCPUDescriptorHandleForHeapStart, &rtvDescriptor); + D3D_CALL_RET(data->rtvDescriptorHeap, GetCPUDescriptorHandleForHeapStart); @@ -1600 +1600 @@ - D3D_CALL_RET(rendererData->srvDescriptorHeap, GetCPUDescriptorHandleForHeapStart, &textureData->mainTextureResourceView); + D3D_CALL_RET(rendererData->srvDescriptorHeap, GetCPUDescriptorHandleForHeapStart); @@ -1610 +1610 @@ - D3D_CALL_RET(rendererData->srvDescriptorHeap, GetCPUDescriptorHandleForHeapStart, &textureData->mainTextureResourceViewU); + D3D_CALL_RET(rendererData->srvDescriptorHeap, GetCPUDescriptorHandleForHeapStart); @@ -1619 +1619 @@ - D3D_CALL_RET(rendererData->srvDescriptorHeap, GetCPUDescriptorHandleForHeapStart, &textureData->mainTextureResourceViewV); + D3D_CALL_RET(rendererData->srvDescriptorHeap, GetCPUDescriptorHandleForHeapStart); @@ -1634 +1634 @@ - D3D_CALL_RET(rendererData->srvDescriptorHeap, GetCPUDescriptorHandleForHeapStart, &textureData->mainTextureResourceViewNV); + D3D_CALL_RET(rendererData->srvDescriptorHeap, GetCPUDescriptorHandleForHeapStart); @@ -1652 +1652 @@ - D3D_CALL_RET(rendererData->textureRTVDescriptorHeap, GetCPUDescriptorHandleForHeapStart, &textureData->mainTextureRenderTargetView); + D3D_CALL_RET(rendererData->textureRTVDescriptorHeap, GetCPUDescriptorHandleForHeapStart); @@ -1719 +1719 @@ - D3D_CALL_RET(texture, GetDesc, &textureDesc); + D3D_CALL_RET(texture, GetDesc); @@ -1983 +1983 @@ - D3D_CALL_RET(textureData->mainTexture, GetDesc, &textureDesc); + D3D_CALL_RET(textureData->mainTexture, GetDesc); @@ -2097 +2097 @@ - D3D_CALL_RET(textureData->mainTexture, GetDesc, &textureDesc); + D3D_CALL_RET(textureData->mainTexture, GetDesc); @@ -2813 +2813 @@ - D3D_CALL_RET(backBuffer, GetDesc, &textureDesc); + D3D_CALL_RET(backBuffer, GetDesc); ```

Now I only get linker errors:

Linker errors ``` $ meson compile [1/68] Linking target subprojects/SDL2-2.24.2/test/testshape.exe FAILED: subprojects/SDL2-2.24.2/test/testshape.exe subprojects/SDL2-2.24.2/test/testshape.pdb "clang" -Wl,/MACHINE:X64 -Wl,/OUT:subprojects/SDL2-2.24.2/test/testshape.exe subprojects/SDL2-2.24.2/test/testshape.exe.p/testshape.c.obj "-Wl,/nologo" "-Wl,/release" "-Wl,/nologo" "-Wl,/DEBUG" "-Wl,/PDB:subprojects\SDL2-2.24.2\test\testshape.pdb" "-Wl,/WHOLEARCHIVE:subprojects\SDL2-2.24.2\libsdl2main.a" "subprojects\SDL2-2.24.2\test\libsdl2_test.a" "subprojects\SDL2-2.24.2\libsdl2main.a" "-luser32" "-lgdi32" "-lwinmm" "-limm32" "-lole32" "-loleaut32" "-lversion" "-luuid" "-ladvapi32" "-lsetupapi" "-lshell32" "-ldinput8" "-luser32" "-lgdi32" "-lwinmm" "-limm32" "-lole32" "-loleaut32" "-lversion" "-luuid" "-ladvapi32" "-lsetupapi" "-lshell32" "-ldinput8" "-Wl,/SUBSYSTEM:CONSOLE" "-lkernel32" "-lwinspool" "-lcomdlg32" subprojects\SDL2-2.24.2\test\libsdl2_test.a : fatal error LNK1136: invalid or corrupt file clang: error: linker command failed with exit code 1136 (use -v to see invocation) [2/68] Linking target subprojects/SDL2-2.24.2/test/testspriteminimal.exe FAILED: subprojects/SDL2-2.24.2/test/testspriteminimal.exe subprojects/SDL2-2.24.2/test/testspriteminimal.pdb "clang" -Wl,/MACHINE:X64 -Wl,/OUT:subprojects/SDL2-2.24.2/test/testspriteminimal.exe subprojects/SDL2-2.24.2/test/testspriteminimal.exe.p/testspriteminimal.c.obj subprojects/SDL2-2.24.2/test/testspriteminimal.exe.p/testutils.c.obj "-Wl,/nologo" "-Wl,/release" "-Wl,/nologo" "-Wl,/DEBUG" "-Wl,/PDB:subprojects\SDL2-2.24.2\test\testspriteminimal.pdb" "-Wl,/WHOLEARCHIVE:subprojects\SDL2-2.24.2\libsdl2main.a" "subprojects\SDL2-2.24.2\test\libsdl2_test.a" "subprojects\SDL2-2.24.2\libsdl2main.a" "-luser32" "-lgdi32" "-lwinmm" "-limm32" "-lole32" "-loleaut32" "-lversion" "-luuid" "-ladvapi32" "-lsetupapi" "-lshell32" "-ldinput8" "-luser32" "-lgdi32" "-lwinmm" "-limm32" "-lole32" "-loleaut32" "-lversion" "-luuid" "-ladvapi32" "-lsetupapi" "-lshell32" "-ldinput8" "-Wl,/SUBSYSTEM:CONSOLE" "-lkernel32" "-lwinspool" "-lcomdlg32" subprojects\SDL2-2.24.2\test\libsdl2_test.a : fatal error LNK1136: invalid or corrupt file clang: error: linker command failed with exit code 1136 (use -v to see invocation) [3/68] Linking target subprojects/SDL2-2.24.2/test/testtimer.exe FAILED: subprojects/SDL2-2.24.2/test/testtimer.exe subprojects/SDL2-2.24.2/test/testtimer.pdb "clang" -Wl,/MACHINE:X64 -Wl,/OUT:subprojects/SDL2-2.24.2/test/testtimer.exe subprojects/SDL2-2.24.2/test/testtimer.exe.p/testtimer.c.obj "-Wl,/nologo" "-Wl,/release" "-Wl,/nologo" "-Wl,/DEBUG" "-Wl,/PDB:subprojects\SDL2-2.24.2\test\testtimer.pdb" "-Wl,/WHOLEARCHIVE:subprojects\SDL2-2.24.2\libsdl2main.a" "subprojects\SDL2-2.24.2\test\libsdl2_test.a" "subprojects\SDL2-2.24.2\libsdl2main.a" "-luser32" "-lgdi32" "-lwinmm" "-limm32" "-lole32" "-loleaut32" "-lversion" "-luuid" "-ladvapi32" "-lsetupapi" "-lshell32" "-ldinput8" "-luser32" "-lgdi32" "-lwinmm" "-limm32" "-lole32" "-loleaut32" "-lversion" "-luuid" "-ladvapi32" "-lsetupapi" "-lshell32" "-ldinput8" "-Wl,/SUBSYSTEM:CONSOLE" "-lkernel32" "-lwinspool" "-lcomdlg32" subprojects\SDL2-2.24.2\test\libsdl2_test.a : fatal error LNK1136: invalid or corrupt file clang: error: linker command failed with exit code 1136 (use -v to see invocation) [4/68] Linking target subprojects/SDL2-2.24.2/test/testsprite2.exe FAILED: subprojects/SDL2-2.24.2/test/testsprite2.exe subprojects/SDL2-2.24.2/test/testsprite2.pdb "clang" -Wl,/MACHINE:X64 -Wl,/OUT:subprojects/SDL2-2.24.2/test/testsprite2.exe subprojects/SDL2-2.24.2/test/testsprite2.exe.p/testsprite2.c.obj subprojects/SDL2-2.24.2/test/testsprite2.exe.p/testutils.c.obj "-Wl,/nologo" "-Wl,/release" "-Wl,/nologo" "-Wl,/DEBUG" "-Wl,/PDB:subprojects\SDL2-2.24.2\test\testsprite2.pdb" "-Wl,/WHOLEARCHIVE:subprojects\SDL2-2.24.2\libsdl2main.a" "subprojects\SDL2-2.24.2\test\libsdl2_test.a" "subprojects\SDL2-2.24.2\libsdl2main.a" "-luser32" "-lgdi32" "-lwinmm" "-limm32" "-lole32" "-loleaut32" "-lversion" "-luuid" "-ladvapi32" "-lsetupapi" "-lshell32" "-ldinput8" "-luser32" "-lgdi32" "-lwinmm" "-limm32" "-lole32" "-loleaut32" "-lversion" "-luuid" "-ladvapi32" "-lsetupapi" "-lshell32" "-ldinput8" "-Wl,/SUBSYSTEM:CONSOLE" "-lkernel32" "-lwinspool" "-lcomdlg32" subprojects\SDL2-2.24.2\test\libsdl2_test.a : fatal error LNK1136: invalid or corrupt file clang: error: linker command failed with exit code 1136 (use -v to see invocation) [5/68] Linking target subprojects/SDL2-2.24.2/test/testver.exe FAILED: subprojects/SDL2-2.24.2/test/testver.exe subprojects/SDL2-2.24.2/test/testver.pdb "clang" -Wl,/MACHINE:X64 -Wl,/OUT:subprojects/SDL2-2.24.2/test/testver.exe subprojects/SDL2-2.24.2/test/testver.exe.p/testver.c.obj "-Wl,/nologo" "-Wl,/release" "-Wl,/nologo" "-Wl,/DEBUG" "-Wl,/PDB:subprojects\SDL2-2.24.2\test\testver.pdb" "-Wl,/WHOLEARCHIVE:subprojects\SDL2-2.24.2\libsdl2main.a" "subprojects\SDL2-2.24.2\test\libsdl2_test.a" "subprojects\SDL2-2.24.2\libsdl2main.a" "-luser32" "-lgdi32" "-lwinmm" "-limm32" "-lole32" "-loleaut32" "-lversion" "-luuid" "-ladvapi32" "-lsetupapi" "-lshell32" "-ldinput8" "-luser32" "-lgdi32" "-lwinmm" "-limm32" "-lole32" "-loleaut32" "-lversion" "-luuid" "-ladvapi32" "-lsetupapi" "-lshell32" "-ldinput8" "-Wl,/SUBSYSTEM:CONSOLE" "-lkernel32" "-lwinspool" "-lcomdlg32" subprojects\SDL2-2.24.2\test\libsdl2_test.a : fatal error LNK1136: invalid or corrupt file clang: error: linker command failed with exit code 1136 (use -v to see invocation) [6/68] Linking target subprojects/SDL2-2.24.2/test/testurl.exe FAILED: subprojects/SDL2-2.24.2/test/testurl.exe subprojects/SDL2-2.24.2/test/testurl.pdb "clang" -Wl,/MACHINE:X64 -Wl,/OUT:subprojects/SDL2-2.24.2/test/testurl.exe subprojects/SDL2-2.24.2/test/testurl.exe.p/testurl.c.obj "-Wl,/nologo" "-Wl,/release" "-Wl,/nologo" "-Wl,/DEBUG" "-Wl,/PDB:subprojects\SDL2-2.24.2\test\testurl.pdb" "-Wl,/WHOLEARCHIVE:subprojects\SDL2-2.24.2\libsdl2main.a" "subprojects\SDL2-2.24.2\test\libsdl2_test.a" "subprojects\SDL2-2.24.2\libsdl2main.a" "-luser32" "-lgdi32" "-lwinmm" "-limm32" "-lole32" "-loleaut32" "-lversion" "-luuid" "-ladvapi32" "-lsetupapi" "-lshell32" "-ldinput8" "-luser32" "-lgdi32" "-lwinmm" "-limm32" "-lole32" "-loleaut32" "-lversion" "-luuid" "-ladvapi32" "-lsetupapi" "-lshell32" "-ldinput8" "-Wl,/SUBSYSTEM:CONSOLE" "-lkernel32" "-lwinspool" "-lcomdlg32" subprojects\SDL2-2.24.2\test\libsdl2_test.a : fatal error LNK1136: invalid or corrupt file clang: error: linker command failed with exit code 1136 (use -v to see invocation) [7/68] Linking target subprojects/SDL2-2.24.2/test/teststreaming.exe FAILED: subprojects/SDL2-2.24.2/test/teststreaming.exe subprojects/SDL2-2.24.2/test/teststreaming.pdb "clang" -Wl,/MACHINE:X64 -Wl,/OUT:subprojects/SDL2-2.24.2/test/teststreaming.exe subprojects/SDL2-2.24.2/test/teststreaming.exe.p/teststreaming.c.obj subprojects/SDL2-2.24.2/test/teststreaming.exe.p/testutils.c.obj "-Wl,/nologo" "-Wl,/release" "-Wl,/nologo" "-Wl,/DEBUG" "-Wl,/PDB:subprojects\SDL2-2.24.2\test\teststreaming.pdb" "-Wl,/WHOLEARCHIVE:subprojects\SDL2-2.24.2\libsdl2main.a" "subprojects\SDL2-2.24.2\test\libsdl2_test.a" "subprojects\SDL2-2.24.2\libsdl2main.a" "-luser32" "-lgdi32" "-lwinmm" "-limm32" "-lole32" "-loleaut32" "-lversion" "-luuid" "-ladvapi32" "-lsetupapi" "-lshell32" "-ldinput8" "-luser32" "-lgdi32" "-lwinmm" "-limm32" "-lole32" "-loleaut32" "-lversion" "-luuid" "-ladvapi32" "-lsetupapi" "-lshell32" "-ldinput8" "-Wl,/SUBSYSTEM:CONSOLE" "-lkernel32" "-lwinspool" "-lcomdlg32" subprojects\SDL2-2.24.2\test\libsdl2_test.a : fatal error LNK1136: invalid or corrupt file clang: error: linker command failed with exit code 1136 (use -v to see invocation) [8/68] Linking target subprojects/SDL2-2.24.2/test/testviewport.exe FAILED: subprojects/SDL2-2.24.2/test/testviewport.exe subprojects/SDL2-2.24.2/test/testviewport.pdb "clang" -Wl,/MACHINE:X64 -Wl,/OUT:subprojects/SDL2-2.24.2/test/testviewport.exe subprojects/SDL2-2.24.2/test/testviewport.exe.p/testviewport.c.obj subprojects/SDL2-2.24.2/test/testviewport.exe.p/testutils.c.obj "-Wl,/nologo" "-Wl,/release" "-Wl,/nologo" "-Wl,/DEBUG" "-Wl,/PDB:subprojects\SDL2-2.24.2\test\testviewport.pdb" "-Wl,/WHOLEARCHIVE:subprojects\SDL2-2.24.2\libsdl2main.a" "subprojects\SDL2-2.24.2\test\libsdl2_test.a" "subprojects\SDL2-2.24.2\libsdl2main.a" "-luser32" "-lgdi32" "-lwinmm" "-limm32" "-lole32" "-loleaut32" "-lversion" "-luuid" "-ladvapi32" "-lsetupapi" "-lshell32" "-ldinput8" "-luser32" "-lgdi32" "-lwinmm" "-limm32" "-lole32" "-loleaut32" "-lversion" "-luuid" "-ladvapi32" "-lsetupapi" "-lshell32" "-ldinput8" "-Wl,/SUBSYSTEM:CONSOLE" "-lkernel32" "-lwinspool" "-lcomdlg32" subprojects\SDL2-2.24.2\test\libsdl2_test.a : fatal error LNK1136: invalid or corrupt file clang: error: linker command failed with exit code 1136 (use -v to see invocation) [9/68] Linking target subprojects/SDL2-2.24.2/test/torturethread.exe FAILED: subprojects/SDL2-2.24.2/test/torturethread.exe subprojects/SDL2-2.24.2/test/torturethread.pdb "clang" -Wl,/MACHINE:X64 -Wl,/OUT:subprojects/SDL2-2.24.2/test/torturethread.exe subprojects/SDL2-2.24.2/test/torturethread.exe.p/torturethread.c.obj "-Wl,/nologo" "-Wl,/release" "-Wl,/nologo" "-Wl,/DEBUG" "-Wl,/PDB:subprojects\SDL2-2.24.2\test\torturethread.pdb" "-Wl,/WHOLEARCHIVE:subprojects\SDL2-2.24.2\libsdl2main.a" "subprojects\SDL2-2.24.2\test\libsdl2_test.a" "subprojects\SDL2-2.24.2\libsdl2main.a" "-luser32" "-lgdi32" "-lwinmm" "-limm32" "-lole32" "-loleaut32" "-lversion" "-luuid" "-ladvapi32" "-lsetupapi" "-lshell32" "-ldinput8" "-luser32" "-lgdi32" "-lwinmm" "-limm32" "-lole32" "-loleaut32" "-lversion" "-luuid" "-ladvapi32" "-lsetupapi" "-lshell32" "-ldinput8" "-Wl,/SUBSYSTEM:CONSOLE" "-lkernel32" "-lwinspool" "-lcomdlg32" subprojects\SDL2-2.24.2\test\libsdl2_test.a : fatal error LNK1136: invalid or corrupt file clang: error: linker command failed with exit code 1136 (use -v to see invocation) [10/68] Linking target subprojects/SDL2-2.24.2/test/testwm2.exe FAILED: subprojects/SDL2-2.24.2/test/testwm2.exe subprojects/SDL2-2.24.2/test/testwm2.pdb "clang" -Wl,/MACHINE:X64 -Wl,/OUT:subprojects/SDL2-2.24.2/test/testwm2.exe subprojects/SDL2-2.24.2/test/testwm2.exe.p/testwm2.c.obj "-Wl,/nologo" "-Wl,/release" "-Wl,/nologo" "-Wl,/DEBUG" "-Wl,/PDB:subprojects\SDL2-2.24.2\test\testwm2.pdb" "-Wl,/WHOLEARCHIVE:subprojects\SDL2-2.24.2\libsdl2main.a" "subprojects\SDL2-2.24.2\test\libsdl2_test.a" "subprojects\SDL2-2.24.2\libsdl2main.a" "-luser32" "-lgdi32" "-lwinmm" "-limm32" "-lole32" "-loleaut32" "-lversion" "-luuid" "-ladvapi32" "-lsetupapi" "-lshell32" "-ldinput8" "-luser32" "-lgdi32" "-lwinmm" "-limm32" "-lole32" "-loleaut32" "-lversion" "-luuid" "-ladvapi32" "-lsetupapi" "-lshell32" "-ldinput8" "-Wl,/SUBSYSTEM:CONSOLE" "-lkernel32" "-lwinspool" "-lcomdlg32" subprojects\SDL2-2.24.2\test\libsdl2_test.a : fatal error LNK1136: invalid or corrupt file clang: error: linker command failed with exit code 1136 (use -v to see invocation) [11/68] Linking target subprojects/SDL2-2.24.2/test/testyuv.exe FAILED: subprojects/SDL2-2.24.2/test/testyuv.exe subprojects/SDL2-2.24.2/test/testyuv.pdb "clang" -Wl,/MACHINE:X64 -Wl,/OUT:subprojects/SDL2-2.24.2/test/testyuv.exe subprojects/SDL2-2.24.2/test/testyuv.exe.p/testyuv.c.obj subprojects/SDL2-2.24.2/test/testyuv.exe.p/testyuv_cvt.c.obj "-Wl,/nologo" "-Wl,/release" "-Wl,/nologo" "-Wl,/DEBUG" "-Wl,/PDB:subprojects\SDL2-2.24.2\test\testyuv.pdb" "-Wl,/WHOLEARCHIVE:subprojects\SDL2-2.24.2\libsdl2main.a" "subprojects\SDL2-2.24.2\test\libsdl2_test.a" "subprojects\SDL2-2.24.2\libsdl2main.a" "-luser32" "-lgdi32" "-lwinmm" "-limm32" "-lole32" "-loleaut32" "-lversion" "-luuid" "-ladvapi32" "-lsetupapi" "-lshell32" "-ldinput8" "-luser32" "-lgdi32" "-lwinmm" "-limm32" "-lole32" "-loleaut32" "-lversion" "-luuid" "-ladvapi32" "-lsetupapi" "-lshell32" "-ldinput8" "-Wl,/SUBSYSTEM:CONSOLE" "-lkernel32" "-lwinspool" "-lcomdlg32" subprojects\SDL2-2.24.2\test\libsdl2_test.a : fatal error LNK1136: invalid or corrupt file clang: error: linker command failed with exit code 1136 (use -v to see invocation) [12/68] Linking target subprojects/SDL2-2.24.2/test/testmessage.exe FAILED: subprojects/SDL2-2.24.2/test/testmessage.exe subprojects/SDL2-2.24.2/test/testmessage.pdb "clang" -Wl,/MACHINE:X64 -Wl,/OUT:subprojects/SDL2-2.24.2/test/testmessage.exe subprojects/SDL2-2.24.2/test/testmessage.exe.p/testmessage.c.obj "-Wl,/nologo" "-Wl,/release" "-Wl,/nologo" "-Wl,/DEBUG" "-Wl,/PDB:subprojects\SDL2-2.24.2\test\testmessage.pdb" "-Wl,/WHOLEARCHIVE:subprojects\SDL2-2.24.2\libsdl2main.a" "subprojects\SDL2-2.24.2\test\libsdl2_test.a" "subprojects\SDL2-2.24.2\libsdl2main.a" "-luser32" "-lgdi32" "-lwinmm" "-limm32" "-lole32" "-loleaut32" "-lversion" "-luuid" "-ladvapi32" "-lsetupapi" "-lshell32" "-ldinput8" "-luser32" "-lgdi32" "-lwinmm" "-limm32" "-lole32" "-loleaut32" "-lversion" "-luuid" "-ladvapi32" "-lsetupapi" "-lshell32" "-ldinput8" "-Wl,/SUBSYSTEM:CONSOLE" "-lkernel32" "-lwinspool" "-lcomdlg32" subprojects\SDL2-2.24.2\test\libsdl2_test.a : fatal error LNK1136: invalid or corrupt file clang: error: linker command failed with exit code 1136 (use -v to see invocation) [13/68] Linking target subprojects/SDL2-2.24.2/test/testqsort.exe FAILED: subprojects/SDL2-2.24.2/test/testqsort.exe subprojects/SDL2-2.24.2/test/testqsort.pdb "clang" -Wl,/MACHINE:X64 -Wl,/OUT:subprojects/SDL2-2.24.2/test/testqsort.exe subprojects/SDL2-2.24.2/test/testqsort.exe.p/testqsort.c.obj "-Wl,/nologo" "-Wl,/release" "-Wl,/nologo" "-Wl,/DEBUG" "-Wl,/PDB:subprojects\SDL2-2.24.2\test\testqsort.pdb" "-Wl,/WHOLEARCHIVE:subprojects\SDL2-2.24.2\libsdl2main.a" "subprojects\SDL2-2.24.2\test\libsdl2_test.a" "subprojects\SDL2-2.24.2\libsdl2main.a" "-luser32" "-lgdi32" "-lwinmm" "-limm32" "-lole32" "-loleaut32" "-lversion" "-luuid" "-ladvapi32" "-lsetupapi" "-lshell32" "-ldinput8" "-luser32" "-lgdi32" "-lwinmm" "-limm32" "-lole32" "-loleaut32" "-lversion" "-luuid" "-ladvapi32" "-lsetupapi" "-lshell32" "-ldinput8" "-Wl,/SUBSYSTEM:CONSOLE" "-lkernel32" "-lwinspool" "-lcomdlg32" subprojects\SDL2-2.24.2\test\libsdl2_test.a : fatal error LNK1136: invalid or corrupt file clang: error: linker command failed with exit code 1136 (use -v to see invocation) [14/68] Linking target subprojects/SDL2-2.24.2/test/testrendercopyex.exe FAILED: subprojects/SDL2-2.24.2/test/testrendercopyex.exe subprojects/SDL2-2.24.2/test/testrendercopyex.pdb "clang" -Wl,/MACHINE:X64 -Wl,/OUT:subprojects/SDL2-2.24.2/test/testrendercopyex.exe subprojects/SDL2-2.24.2/test/testrendercopyex.exe.p/testrendercopyex.c.obj subprojects/SDL2-2.24.2/test/testrendercopyex.exe.p/testutils.c.obj "-Wl,/nologo" "-Wl,/release" "-Wl,/nologo" "-Wl,/DEBUG" "-Wl,/PDB:subprojects\SDL2-2.24.2\test\testrendercopyex.pdb" "-Wl,/WHOLEARCHIVE:subprojects\SDL2-2.24.2\libsdl2main.a" "subprojects\SDL2-2.24.2\test\libsdl2_test.a" "subprojects\SDL2-2.24.2\libsdl2main.a" "-luser32" "-lgdi32" "-lwinmm" "-limm32" "-lole32" "-loleaut32" "-lversion" "-luuid" "-ladvapi32" "-lsetupapi" "-lshell32" "-ldinput8" "-luser32" "-lgdi32" "-lwinmm" "-limm32" "-lole32" "-loleaut32" "-lversion" "-luuid" "-ladvapi32" "-lsetupapi" "-lshell32" "-ldinput8" "-Wl,/SUBSYSTEM:CONSOLE" "-lkernel32" "-lwinspool" "-lcomdlg32" subprojects\SDL2-2.24.2\test\libsdl2_test.a : fatal error LNK1136: invalid or corrupt file clang: error: linker command failed with exit code 1136 (use -v to see invocation) ninja: build stopped: subcommand failed. ```
bempelise commented 1 month ago

I have the same issue too:

I get subprojects\SDL2-2.30.6\libsdl2_test.a : fatal error LNK1107: invalid or corrupt file: cannot read at 0x7CEA

when building sdl2 as described in the meson tutorial.

I'm on windows 11, clang 18.1.8, meson 1.4.2 and SDL2 2.30.6.