Начать Добавить сайт

examining the macOS gcc binary

zoey-on-github.github.ioDR 94 Accessible 300 views

Разработка и программирование A technical blog post reverse-engineering the /usr/bin/gcc binary on macOS, showing how it dispatches to clang through xcrun rather than being a simple alias.

Editor's Review

For reference only
examining the macOS gcc binary page preview

This is a focused reverse-engineering write-up that disassembles Apple's gcc shim and traces its tool-name logic and xcrun invocation. It is valuable for macOS developers and low-level enthusiasts who want to understand what really happens when they type gcc. The scope is narrow and the content is c

Site introduction

This page is a single technical article on a personal blog, dedicated to examining the gcc binary shipped at /usr/bin/gcc on macOS. Rather than a general resource site, it is a deep-dive investigation into one small but widely used piece of the Apple developer toolchain.

The author starts from a common observation: running gcc on a Mac produces clang-style errors, leading many to assume gcc is merely an alias. The article disproves that by showing gcc is a real binary, then walks through disassembled pseudocode to reveal how it inspects its own executable name and maps gcc, cc, llvm-gcc, c++, and llvm-g++ to clang or clang++ before invoking xcrun.

The content is aimed at macOS developers, reverse engineers, and toolchain enthusiasts who want to understand Apple’s compiler shims and the xcselect/xcrun mechanism. Readers without familiarity with disassembly or C tooling may find the code excerpts dense.

Use it as a reference when debugging build scripts that depend on gcc behavior, or as a case study in how Apple redirects legacy compiler names. It is best read alongside the actual binary and Apple’s developer documentation for context.

Comments & Ratings

0

No comments yet. Be the first to review.

Write the first comment

Your email won't be made public; fields marked with * are required.

Rate this site

Click the stars to rate; rating is optional, and clicking the selected star again cancels it.