ccxvii / mujs

An embeddable Javascript interpreter in C.
http://mujs.com/
ISC License
813 stars 98 forks source link

Does not build on macOS #168

Open LeSuisse opened 1 year ago

LeSuisse commented 1 year ago

Hello,

While upgrading mujs in nixpkgs (https://github.com/NixOS/nixpkgs/pull/203664), we spotted an issue with the macOS builds.

building
build flags: SHELL=/nix/store/1bsjl5incfnszv7scdh4d02sh45vw2w1-bash-5.1-p16/bin/bash prefix=\$\(out\)
clang -std=c99 -pedantic -Wall -Wextra -Wno-unused-parameter -Wunreachable-code -O2  -o build/release/main.o -c main.c
clang -std=c99 -pedantic -Wall -Wextra -Wno-unused-parameter -Wunreachable-code -O2  -o build/release/libmujs.o -c one.c
ar cr build/release/libmujs.a build/release/libmujs.o
clang -Wl,-s -o build/release/mujs build/release/main.o -Lbuild/release -l:libmujs.a  -lm
ld: warning: option -s is obsolete and being ignored
ld: library not found for -l:libmujs.a
clang-11: error: linker command failed with exit code 1 (use -v to see invocation)

It looks like the changes made in d592c785c0b2f9fea982ac3fe7b88fdd7c4817fc is causing some troubles, reverting the patch makes it work on macOS.