GithubHelp home page GithubHelp logo

Comments (1)

prantlf avatar prantlf commented on August 22, 2024

@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:

❯ find /Library/Developer -name libSystem.\*
/Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/usr/lib/libSystem.B.tbd
/Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/usr/lib/libSystem.B_asan.tbd
/Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/usr/lib/libSystem.tbd

❯ find /Library/Developer -name libc.\*
/Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/usr/include/libc.h
/Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/usr/lib/libc.tbd

I tried both branches - master and mob. The error is the same...

from tccbin.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.