Refresher on gcc port and the executables

Ryan Schmidt ryandesign at macports.org
Thu May 23 03:59:13 PDT 2013


On May 23, 2013, at 02:15, Tabitha McNerney wrote:

> For a particular project I am working on, my boss asked me if there was a way to compile some code from source (which depends on and will use of some advanced cryptography potentially for highly sensitive business), such that, in his words, "it is not dependent on any compiler tools from a corporation like Apple, Google or Microsoft" and he said "it should be the same as what is used by open source Linux distros". So this would mean gcc but it makes me think I might need to do something unique such as making gcc from source on my own since my boss doesn't want there to be any company fingerprints (he's really worried but also its his job that could be on the line). For special purposes, is it fairly easy to make gcc and g++ from source, on OS X, in a way that is in fact "divorced" from the Apple tools?

If you don't trust the compilers provided by Apple in Xcode, then you can't trust any compiler built by MacPorts, since MacPorts will build its compilers using a compiler from Xcode.

Not trusting your vendor's compiler seems needlessly paranoid. Then again I don't write security-critical software.

Using, say, a compiler binary provided by Apple to compile your software does not somehow give Apple any rights to your software. That would be silly.

You could ask your boss to clarify his intent, but it sounds like what he wants is for the source code you write to not *require* a specific compiler, but to be *portable* to any normal C compiler. That's a reasonable requirement, and is one that's followed by most of the software ported by MacPorts. The C language is standardized, as is C++; assuming you write standards-compliant code, and don't use e.g. Apple- or Microsoft-specific language or compiler extensions, you should have no problem compiling it on a variety of compilers. You can compile your code with a variety of compilers on a variety of systems to verify if you're succeeded in this goal.



More information about the macports-users mailing list