Skip to content

Commit a316f9e

Browse files
authored
Disable UBSAN in zig builds. (#3292)
Zig debug builds automatically enable ubsan. As the fix for #1891 had to be reverted, debug builds using zig will crash like so: ``` Illegal instruction at address 0x3237d2 raylib/src/rlgl.h:3690:91: 0x3237d2 in rlDrawVertexArrayElements (/home/rcorre/src/raylib-zig-template/raylib/src/rcore.c) glDrawElements(GL_TRIANGLES, count, GL_UNSIGNED_SHORT, (const unsigned short *)buffer + offset); ``` This disables UBSAN when using zig to build raylib.
1 parent c104a97 commit a316f9e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/build.zig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ pub fn addRaylib(b: *std.Build, target: std.zig.CrossTarget, optimize: std.built
66
"-std=gnu99",
77
"-D_GNU_SOURCE",
88
"-DGL_SILENCE_DEPRECATION=199309L",
9+
"-fno-sanitize=undefined", // https://github.com/raysan5/raylib/issues/1891
910
};
1011

1112
const raylib = b.addStaticLibrary(.{

0 commit comments

Comments
 (0)