-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Open
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behaviorcompiler-rtcontributor friendlyThis issue is limited in scope and/or knowledge of Zig internals.This issue is limited in scope and/or knowledge of Zig internals.
Milestone
Description
Zig Version
0.15.0-dev.99+c1db72cdb
Steps to Reproduce and Observed Behavior
Tried finding existing reports or similar issues, but no luck. Apologies if there's an existing one I couldn't find.
Found while trying to build dvui for wasm32-freestanding
in ReleaseSafe mode, which fails, but which works in Debug mode. The smallest reproducible snippet I could find is
// test.zig
export fn bla(f: i32) f64 {
return @exp2(@as(f64, @floatFromInt(f)));
}
Then
$ zig build-exe -target wasm32-freestanding -O Debug -fno-entry -rdynamic test.zig
$ echo $?
0
$ zig-0.15.0-dev build-exe -target wasm32-freestanding -O ReleaseSafe -fno-entry -rdynamic test.zig
error: wasm-ld: test.wasm.o: undefined symbol: ldexp
Changing the argument from i32
to i64
makes it pass:
export fn bla(f: i64) f64 {
return @exp2(@as(f64, @floatFromInt(f)));
}
Changing the integer to i32 argument and the floats to f32 makes it fail on undefined symbol: ldexpf
.
Expected Behavior
I expected a build which succeeds in Debug to also succeed in any of the release build modes.
Metadata
Metadata
Assignees
Labels
bugObserved behavior contradicts documented or intended behaviorObserved behavior contradicts documented or intended behaviorcompiler-rtcontributor friendlyThis issue is limited in scope and/or knowledge of Zig internals.This issue is limited in scope and/or knowledge of Zig internals.