| Summary: | CMake won't compile in VS2019 (patch included) | ||
|---|---|---|---|
| Product: | SDL | Reporter: | dark_sylinc |
| Component: | *don't know* | Assignee: | Sam Lantinga <slouken> |
| Status: | WAITING --- | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | amaranth72, martin.gerhardy, tom.hultonharrop |
| Version: | 2.0.13 | Keywords: | target-2.0.14 |
| Hardware: | x86_64 | ||
| OS: | Windows 10 | ||
| Attachments: |
Patch
Patch v2 |
||
|
Description
dark_sylinc
2020-04-27 02:09:04 UTC
DO NOT USE THIS PATCH After looking into: https://developercommunity.visualstudio.com/content/problem/711317/unexpected-implicit-memset-in-release-optimized-bu.html It would seem SDL does as much as possible to avoid the CRT; and it already uses #pragma function() in src/stdlib/SDL_stdlib.c but it does not do that with memset. Created attachment 4324 [details]
Patch v2
New fix to the problem, without linking to libc
I worked around this problem in a different manner: https://github.com/love2d/megasource/commit/7ed6273a1a8e913157236cd18a0de46fd029a447 I'm not sure which way is better. Fixed, thanks! https://hg.libsdl.org/SDL/rev/d5fe4ad4d29c Now the reverse is happening. Without that revision everything links fine ---------------------------------------------------------------- 2020-05-06T15:14:11.7285275Z libvcruntimed.lib(memcpy.obj) : error LNK2005: memcpy already defined in sdl2.lib(SDL_stdlib.obj) [D:\a\engine\engine\build\src\modules\voxelutil\tests-voxelutil.vcxproj] Github Actions output for the version: ---------------------------------------------------------------- 2020-05-06T14:53:25.8733456Z Microsoft Windows Server 2019 2020-05-06T14:53:25.8733674Z 10.0.17763 2020-05-06T14:53:25.8734418Z Environment: windows-2019 2020-05-06T14:53:25.8734599Z Version: 20200426.1 2020-05-06T14:53:25.8734923Z Included Software: https://github.com/actions/virtual-environments/blob/win19/20200426.1/images/win/Windows2019-Readme.md *** Bug 5334 has been marked as a duplicate of this bug. *** Okay, we need to not define memset() and memcpy() in SDL. I want to fix this for 2.0.14. It turns out that we do need to define memset and memcpy in SDL to handle compiler intrinsic optimization. Can you check the latest SDL snapshot and make sure it works for your scenarios? http://www.libsdl.org/tmp/SDL-2.0.zip Thanks! |