Skip to content

Provide a higher level build setting than MACH_O_TYPE #104

@cmcgee1024

Description

@cmcgee1024

Currently, SwiftBuild uses this setting to determine whether the linker is producing an executable (mh_executable), static library (staticlib), dynamic library (mh_dylib), or combining multiple object files into a single object file (mh_object). Note that the latter setting is not used to compile a source file to an object file, it is combining multiple object files into a single one, a process that is sometimes called “partial linking”.

The default macOS linker ld64 supports partial linking with a “-r” flag, and Linux ld/gold supports a very similar mode with the same flag. However, the Visual Studio Windows linker (link.exe) does not support this mode at all. You can compile a static “.lib” from multiple object files, but this lib cannot be used in place of an object file (.obj) further along, much like how you can’t use archives “.a” files in place of objects “.o” on macOS or Linux.

A new higher level abstraction is necessary to allow the PIF to model the steps in a platform neutral, and executable file format (ELF/PE) way.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions