model3d: disable alignment sanitizer for all of model3d
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
parent
d21cce37a4
commit
c96ff64958
2 changed files with 3 additions and 2 deletions
|
|
@ -24,7 +24,9 @@ pub fn testStep(b: *std.build.Builder, mode: std.builtin.Mode, target: std.zig.C
|
|||
pub fn link(b: *std.build.Builder, step: *std.build.LibExeObjStep, target: std.zig.CrossTarget) void {
|
||||
const lib = b.addStaticLibrarySource("model3d", null);
|
||||
lib.setTarget(target);
|
||||
lib.addCSourceFile(sdkPath("/src/c/m3d.c"), &.{ "-std=c89" });
|
||||
// Note: model3d needs unaligned accesses, which are safe on all modern architectures.
|
||||
// See https://gitlab.com/bztsrc/model3d/-/issues/19
|
||||
lib.addCSourceFile(sdkPath("/src/c/m3d.c"), &.{ "-std=c89", "-fno-sanitize=alignment" });
|
||||
lib.linkLibC();
|
||||
step.addIncludePath(sdkPath("/src/c/"));
|
||||
step.linkLibrary(lib);
|
||||
|
|
|
|||
1
libs/model3d/src/c/m3d.h
vendored
1
libs/model3d/src/c/m3d.h
vendored
|
|
@ -2377,7 +2377,6 @@ static M3D_FLOAT _m3d_rsq(M3D_FLOAT x)
|
|||
/**
|
||||
* Function to decode a Model 3D into in-memory format
|
||||
*/
|
||||
__attribute__((no_sanitize("alignment"))) // TODO(model3d): https://gitlab.com/bztsrc/model3d/-/issues/19
|
||||
m3d_t *m3d_load(unsigned char *data, m3dread_t readfilecb, m3dfree_t freecb, m3d_t *mtllib)
|
||||
{
|
||||
unsigned char *end, *chunk, *buff, weights[8];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue