[ORC][MachO] Allow multiple LC_BUILD_VERSION commands.
No testcase: I'm still thinking about the best way to test this.
This commit is contained in:
@@ -73,13 +73,12 @@ public:
|
||||
/// will be used.
|
||||
std::optional<Dylib> IDDylib;
|
||||
|
||||
/// Override for LC_BUILD_VERSION. If this is nullopt then
|
||||
std::optional<BuildVersionOpts> BuildVersion;
|
||||
|
||||
/// List of LC_LOAD_DYLIBs.
|
||||
std::vector<Dylib> LoadDylibs;
|
||||
/// List of LC_RPATHs.
|
||||
std::vector<std::string> RPaths;
|
||||
/// List of LC_BUILD_VERSIONs.
|
||||
std::vector<BuildVersionOpts> BuildVersion;
|
||||
|
||||
HeaderOptions() = default;
|
||||
HeaderOptions(Dylib D) : IDDylib(std::move(D)) {}
|
||||
|
||||
@@ -1725,11 +1725,9 @@ jitlink::Block &createHeaderBlock(MachOPlatform &MOP,
|
||||
else
|
||||
B.template addLoadCommand<MachO::LC_ID_DYLIB>(JD.getName(), 0, 0, 0);
|
||||
|
||||
if (Opts.BuildVersion)
|
||||
for (auto &BV : Opts.BuildVersion)
|
||||
B.template addLoadCommand<MachO::LC_BUILD_VERSION>(
|
||||
Opts.BuildVersion->Platform, Opts.BuildVersion->MinOS,
|
||||
Opts.BuildVersion->SDK, static_cast<uint32_t>(0));
|
||||
|
||||
BV.Platform, BV.MinOS, BV.SDK, static_cast<uint32_t>(0));
|
||||
for (auto &D : Opts.LoadDylibs)
|
||||
B.template addLoadCommand<MachO::LC_LOAD_DYLIB>(
|
||||
D.Name, D.Timestamp, D.CurrentVersion, D.CompatibilityVersion);
|
||||
|
||||
Reference in New Issue
Block a user