Open andrewrk opened 9 months ago
Would we want to try to fix the UB locally? If so, I might consider doing that and submitting a PR.
Is that going too far for such a repackaged lib? Or would it be welcome due to the special case of upstream being somewhat abandoned?
Right now I've had to do some hackery to work around this when using this dependency in my project:
const libmp3lame = b.dependency("libmp3lame", .{
.target = target,
.optimize = optimize,
});
const libmp3lame_artifact = libmp3lame.artifact("mp3lame");
for (libmp3lame_artifact.root_module.link_objects.items) |link_object| {
switch (std.meta.activeTag(link_object)) {
.c_source_files => {
const new_flags = std.mem.concat(b.allocator, []const u8, &.{
link_object.c_source_files.flags,
&.{
"-fno-sanitize=undefined",
},
}) catch @panic("OOM");
link_object.c_source_files.flags = new_flags;
},
else => {},
}
}
... which works, but fixing the UB might be nice too.
Upstream appears to be effectively dead, but there's undefined behavior happening here: