Files
wasm-test/fdlibm
2026-09-16 19:23:09 +02:00
..
2026-09-16 19:23:09 +02:00
2026-09-16 19:23:09 +02:00
2026-09-16 19:23:09 +02:00
2026-09-16 19:23:09 +02:00
2026-09-16 19:23:09 +02:00
2026-09-16 19:23:09 +02:00
2026-09-16 19:23:09 +02:00
2026-09-16 19:23:09 +02:00
2026-09-16 19:23:09 +02:00

clang --target=wasm32 -O2 -ffreestanding -fno-builtin -nostdlib -Wl,--no-entry -Wl,--export=sin -Wl,--export=cos -o fdlibm.wasm \
  s_sin.c s_cos.c k_sin.c k_cos.c e_rem_pio2.c k_rem_pio2.c s_scalbn.c

define __LITTLE_ENDIAN for wasm
must provide implementation for the functions below

# wasm-ld-21: error: /tmp/e_rem_pio2-14e979.o: undefined symbol: fabs
# wasm-ld-21: error: /tmp/k_rem_pio2-6d7f33.o: undefined symbol: floor
# wasm-ld-21: error: /tmp/s_scalbn-8b4ff9.o: undefined symbol: copysign
# wasm-ld-21: error: /tmp/s_scalbn-8b4ff9.o: undefined symbol: copysign
# wasm-ld-21: error: /tmp/s_scalbn-8b4ff9.o: undefined symbol: copysign
# clang: error: linker command failed with exit code 1 (use -v to see invocation)