Skip to content

Commit 1ae691e

Browse files
authored
Build libSDL with -fwrapv-pointer (#24243)
This works around undefined behavior that is now being exploited by clang. See llvm/llvm-project#130742
1 parent 38e1646 commit 1ae691e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tools/ports/sdl2.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ def create(final):
7070
srcs += ['thread/%s/%s' % (thread_backend, s) for s in thread_srcs]
7171

7272
srcs = [os.path.join(src_dir, 'src', s) for s in srcs]
73-
flags = ['-sUSE_SDL=0']
73+
# TODO: Remove fwrapv when we update to a version which includes https://github.com/libsdl-org/SDL/pull/12581
74+
flags = ['-sUSE_SDL=0', '-fwrapv-pointer']
7475
includes = [ports.get_include_dir('SDL2')]
7576
if settings.PTHREADS:
7677
flags += ['-pthread']

0 commit comments

Comments
 (0)