MONDAY, OCTOBER 12, 2026
darwin
Darwin: Make C++ source locations linker-visible
Compiler-generated C++ source location information is now visible to the linker on Darwin systems.
On Darwin (macOS) systems, compiler-generated constants for C++ source code locations are now made linker-visible. This ensures that these symbolic names, which are distinct from regular code symbols, can be correctly resolved by the linker, potentially improving debugging and symbol resolution for C++ programs compiled on this platform.
In Details
The ASM_GENERATE_INTERNAL_LABEL macro in config/darwin.h has been updated to handle C++ source location information. These are compiler-synthesized constants that need to be linker-visible on Darwin to ensure proper symbol resolution, as they are not passed through the standard symbol generation channels.
For Context
- Darwin
- The Unix-like operating system developed by Apple, serving as the basis for macOS, iOS, and other Apple platforms. GCC's Darwin backend targets this OS.
- linker
- A program that combines one or more object files and libraries into a single executable file, resolving symbolic references between them.
- source location
- Information generated by the compiler that maps compiled code back to the original source file and line number, crucial for debugging and stack traces.
- ASM_GENERATE_INTERNAL_LABEL
- A GCC macro used to generate internal labels in assembly code, often for compiler-generated symbols or internal constructs.