Question

I'm trying to port to Macintosh OSX where clang is provided instead of gcc. When building on Linux with gcc, I pass -static-libgcc to gcc.

What is the nearest equivalent I might replace this option when using clang?

Était-ce utile?

La solution

Probably this has already been sorted out, but for the sake of completeness,
-- you cannot not link with system libraries statically on mac, till you do some extra work of compiling crt0.o.

So, simply remove this flag.

Please see

stackoverflow.com/questions/5259249/creating-static-mac-os-x-c-build

https://developer.apple.com/library/mac/qa/qa1118/_index.html

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top