Skip to content

Commit 0f252e7

Browse files
committed
[ORC][MachO] Allow multiple LC_BUILD_VERSION commands.
No testcase: I'm still thinking about the best way to test this.
1 parent 0adccd1 commit 0f252e7

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

llvm/include/llvm/ExecutionEngine/Orc/MachOPlatform.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,12 @@ class MachOPlatform : public Platform {
7373
/// will be used.
7474
std::optional<Dylib> IDDylib;
7575

76-
/// Override for LC_BUILD_VERSION. If this is nullopt then
77-
std::optional<BuildVersionOpts> BuildVersion;
78-
7976
/// List of LC_LOAD_DYLIBs.
8077
std::vector<Dylib> LoadDylibs;
8178
/// List of LC_RPATHs.
8279
std::vector<std::string> RPaths;
80+
/// List of LC_BUILD_VERSIONs.
81+
std::vector<BuildVersionOpts> BuildVersion;
8382

8483
HeaderOptions() = default;
8584
HeaderOptions(Dylib D) : IDDylib(std::move(D)) {}

llvm/lib/ExecutionEngine/Orc/MachOPlatform.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1725,11 +1725,9 @@ jitlink::Block &createHeaderBlock(MachOPlatform &MOP,
17251725
else
17261726
B.template addLoadCommand<MachO::LC_ID_DYLIB>(JD.getName(), 0, 0, 0);
17271727

1728-
if (Opts.BuildVersion)
1728+
for (auto &BV : Opts.BuildVersion)
17291729
B.template addLoadCommand<MachO::LC_BUILD_VERSION>(
1730-
Opts.BuildVersion->Platform, Opts.BuildVersion->MinOS,
1731-
Opts.BuildVersion->SDK, static_cast<uint32_t>(0));
1732-
1730+
BV.Platform, BV.MinOS, BV.SDK, static_cast<uint32_t>(0));
17331731
for (auto &D : Opts.LoadDylibs)
17341732
B.template addLoadCommand<MachO::LC_LOAD_DYLIB>(
17351733
D.Name, D.Timestamp, D.CurrentVersion, D.CompatibilityVersion);

0 commit comments

Comments
 (0)