Skip to content

Commit 912849c

Browse files
Fabian GiesenH. Peter Anvin
authored andcommitted
Document Mach-O build_version directive
Signed-off-by: Fabian Giesen <fabian.giesen@epicgames.com> Resolved Conflicts: doc/outfmt.src Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
1 parent 83655f0 commit 912849c

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

doc/outfmt.src

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1092,6 +1092,38 @@ this extension:
10921092
Using with static linker will clear the private extern attribute.
10931093
But linker option like \c{-keep_private_externs} can avoid it.
10941094

1095+
\S{macho-bver} \c{macho} specific directive \i\c{build_version}
1096+
1097+
The directive \c{build_version} generates a \c{LC_BUILD_VERSION}
1098+
load command in the Mach-O header, which allows specifying a
1099+
target platform, minimum OS version and optionally SDK version.
1100+
Newer Xcode linker versions warn if this is not present in object
1101+
files.
1102+
1103+
This directive takes the target platform name and minimum OS
1104+
version as arguments, in this form:
1105+
1106+
\c build_version macos,10,7
1107+
1108+
Platform names that make sense for x86 code are \c{macos},
1109+
\c{iossimulator}, \c{tvossimulator} and \c{watchossimulator}.
1110+
1111+
Optionally, a trailing version number and minimum SDK version
1112+
can also be specified with this syntax:
1113+
1114+
\c build_version macos, 10, 14, 0 sdk_version 10, 14, 0
1115+
1116+
This is a macro implemented as a \c{%pragma}. It can also be
1117+
specified in its \c{%pragma} form, in which case it will not
1118+
affect non-Mach-O builds of the same source code:
1119+
1120+
\c %pragma macho build_version ...
1121+
1122+
This latter form is also useful on the command line when using
1123+
the \c{--pragma} command-line switch:
1124+
1125+
\c nasm -f macho64 --pragma "macho build_version macos,10,9" ...
1126+
10951127
\H{elffmt} \i\c{elf32}, \i\c{elf64}, \i\c{elfx32}:
10961128
\I{ELF}\I{linux, elf}Executable and Linkable Format Object Files
10971129

0 commit comments

Comments
 (0)