You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now, using tcc (built from git) on macos 11 (or anything prior to 12.0) will fail with:
ld: warning: object file (/Users/x/d/v/thirdparty/tcc/lib/libgc.a(gc.o)) was built for newer macOS version (12.0) than being linked (10.7)
Undefined symbols for architecture x86_64:
"____chkstk_darwin", referenced from:
_GC_forward_exception in libgc.a(gc.o)
_GC_mark_thread in libgc.a(gc.o)
ld: symbol(s) not found for architecture x86_64
clang-11: error: linker command failed with exit code 1 (use -v to see invocation)
This is resolved by rebuilding libgc.a and passing the -mmacosx-version-min=10.7, which matches what v itself is passing to tcc internally.
@jmesmon , what magic did you use to get tcc compiled on MacOS? :-) I'm struggling with the libc missing. I run the latest MacOS 13.
The build succeeds:
❯ ./configure
Binary directory /usr/local/bin
TinyCC directory /usr/local/lib/tcc
Library directory /usr/local/lib
Include directory /usr/local/include
Manual directory /usr/local/share/man
Info directory /usr/local/share/info
Doc directory /usr/local/share/doc
/usr/include dir /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include
Source path /Users/prantlf/Sources/github/tinycc
C compiler clang (14.0)
Target OS Darwin
CPU x86_64
Config OSX
Creating config.mak and config.h
❯ make
...
❯ ls -al tcc
-rwxr-xr-x@ 1 prantlf staff 437016 Jun 11 11:20 tcc
But the tests do not:
❯ make test
------------ hello-exe ------------
tcc: error: library 'c' not found
tcc: error: undefined symbol '_printf'
+ ../tcc -vv
tcc version 0.9.27 2023-05-29 mob@583c3b4 (x86_64 Darwin)
install: /usr/local/lib/tcc
include:
/usr/local/lib/tcc/include
/usr/local/include
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include
libraries:
/usr/local/lib/tcc
/usr/lib
/lib
/usr/local/lib
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib
libtcc1:
/usr/local/lib/tcc/libtcc1.a
+ otool -L ../tcc
../tcc:
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1319.100.3)
+ exit 1
make[2]: *** [hello-exe] Error 1
make[1]: *** [all] Error 2
make: *** [test] Error 2
I get the same "library 'c' not found" error when trying to build examples.ex1.c from the tcc repository. I can compile it to the object file, but I cannot link it.
There's neither /usr/lib/libSystem.B.dylib nor /usr/lib/libSystem.dylib on my system. I found the .tbd files, but they're not enough for tcc:
Right now, using tcc (built from git) on macos 11 (or anything prior to 12.0) will fail with:
This is resolved by rebuilding
libgc.a
and passing the-mmacosx-version-min=10.7
, which matches what v itself is passing to tcc internally.This specifically affects https://github.com/vlang/tccbin/tree/thirdparty-macos-amd64
I've worked around this locally by manually rebuilding
libgc.a
with these commands (from thetcc
repo):(tangential relation to vlang/v#16386)
The text was updated successfully, but these errors were encountered: