Orange C failed to link on FreeBSD
Here is the error message on FreeBSD:
clang++ -c -D__MSVCRT__ -DHAVE_UNISTD_H=1 -DSQLITE_OS_UNIX -Wno-int-to-pointer-cast -I../util -I../exefmt -I../ -fpermissive -DGNUC -std=gnu++14 -o /test/OrangeC/src/netlib/obj/gcc-linux/NetLinkMain.o NetLinkMain.cpp
clang -L/test/OrangeC/src/../src/lib/gcc-linux -o netlib.exe /test/OrangeC/src/netlib/obj/gcc-linux/NetLinkMain.o -Wl,--start-group -lnetlib -lutil -Wl,--end-group -lstdc++ -lpthread -ldl
ld: error: undefined symbol: ceilf
>>> referenced by NetLinkMain.cpp
>>> /test/OrangeC/src/netlib/obj/gcc-linux/NetLinkMain.o:(std::__1::__math::ceil[abi:se180100](float))
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Build command: gmake COMPILER="gcc-linux" CC=clang CXX=clang++.
How did you run the build? I guess with GNU make?
As we already found out in the other thread #1044, the Makefile shouldn't use -D__MSVCRT__ on this environment #1049 and additionally needs -lm.
How did you run the build? I guess with GNU
make?
Of course. The command is gmake. If you use only make, it will invoke BSD make (bmake) instead.
gcc and g++ on freebsd don't display this behavior for whatever reason but clang and clang++ do.
I can confirm that adding -lm as the LINK flag fixes the issue with the linker crashing out, however.
When I do my big "Add verbosity/mkfifo" changes I'll push a fix for this.
gcc may automatically add -lm I'm not sure....
This depends on the spec file that is installed - gcc's configure machinary checks for libraries it always need to link "specific for this machine", and adds it there.