You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/sys-devel/binutils-apple/files/ld64-241.9-nosnapshots.patch

645 lines
23 KiB

Allow to disable snapshot support because of missing Block API on OS X < 10.6.
--- ld64-241.9/src/ld/InputFiles.cpp.orig 2015-01-16 15:26:31.000000000 -0800
+++ ld64-241.9/src/ld/InputFiles.cpp 2015-01-16 15:26:54.000000000 -0800
@@ -1144,7 +1144,9 @@
case ld::File::Reloc:
{
ld::relocatable::File* reloc = (ld::relocatable::File*)file;
+#ifdef SUPPORT_SNAPSHOTS
_options.snapshot().recordObjectFile(reloc->path());
+#endif
if ( _options.dumpDependencyInfo() )
_options.dumpDependency(Options::depObjectFile, reloc->path());
}
@@ -1244,7 +1246,9 @@
if ( dylibFile->justInTimeforEachAtom(name, handler) ) {
// we found a definition in this dylib
// done, unless it is a weak definition in which case we keep searching
+#ifdef SUPPORT_SNAPSHOTS
_options.snapshot().recordDylibSymbol(dylibFile, name);
+#endif
if ( !dylibFile->hasWeakExternals() || !dylibFile->hasWeakDefinition(name)) {
return true;
}
@@ -1258,7 +1262,9 @@
if ( archiveFile->justInTimeDataOnlyforEachAtom(name, handler) ) {
if ( _options.traceArchives() )
logArchive(archiveFile);
+#ifdef SUPPORT_SNAPSHOTS
_options.snapshot().recordArchive(archiveFile->path());
+#endif
// found data definition in static library, done
return true;
}
@@ -1267,7 +1273,9 @@
if ( archiveFile->justInTimeforEachAtom(name, handler) ) {
if ( _options.traceArchives() )
logArchive(archiveFile);
+#ifdef SUPPORT_SNAPSHOTS
_options.snapshot().recordArchive(archiveFile->path());
+#endif
// found definition in static library, done
return true;
}
@@ -1294,7 +1302,9 @@
if ( dylibFile->justInTimeforEachAtom(name, handler) ) {
// we found a definition in this dylib
// done, unless it is a weak definition in which case we keep searching
+#ifdef SUPPORT_SNAPSHOTS
_options.snapshot().recordDylibSymbol(dylibFile, name);
+#endif
if ( !dylibFile->hasWeakExternals() || !dylibFile->hasWeakDefinition(name)) {
return true;
}
--- ld64-241.9/src/ld/ld.cpp.orig 2015-01-16 15:26:32.000000000 -0800
+++ ld64-241.9/src/ld/ld.cpp 2015-01-16 15:26:54.000000000 -0800
@@ -1180,11 +1180,13 @@
// implement assert() function to print out a backtrace before aborting
void __assert_rtn(const char* func, const char* file, int line, const char* failedexpr)
{
+#ifdef SUPPORT_SNAPSHOTS
Snapshot *snapshot = Snapshot::globalSnapshot;
snapshot->setSnapshotMode(Snapshot::SNAPSHOT_DEBUG);
snapshot->createSnapshot();
snapshot->recordAssertionMessage("Assertion failed: (%s), function %s, file %s, line %d.\n", failedexpr, func, file, line);
+#endif
void* callStack[128];
int depth = ::backtrace(callStack, 128);
@@ -1202,9 +1204,13 @@
}
long offset = (uintptr_t)callStack[i] - (uintptr_t)info.dli_saddr;
fprintf(stderr, "%d %p %s + %ld\n", i, callStack[i], symboName, offset);
+#ifdef SUPPORT_SNAPSHOTS
snapshot->recordAssertionMessage("%d %p %s + %ld\n", i, callStack[i], symboName, offset);
+#endif
}
+#ifdef SUPPORT_SNAPSHOTS
fprintf(stderr, "A linker snapshot was created at:\n\t%s\n", snapshot->rootDir());
+#endif
fprintf(stderr, "ld: Assertion failed: (%s), function %s, file %s, line %d.\n", failedexpr, func, file, line);
exit(1);
}
--- ld64-241.9/src/ld/Options.cpp.orig 2015-01-16 15:26:32.000000000 -0800
+++ ld64-241.9/src/ld/Options.cpp 2015-01-16 15:27:26.000000000 -0800
@@ -183,7 +183,11 @@
fMarkAppExtensionSafe(false), fCheckAppExtensionSafe(false), fForceLoadSwiftLibs(false),
fDebugInfoStripping(kDebugInfoMinimal), fTraceOutputFile(NULL),
fMacVersionMin(ld::macVersionUnset), fIOSVersionMin(ld::iOSVersionUnset),
- fSaveTempFiles(false), fSnapshotRequested(false), fPipelineFifo(NULL),
+ fSaveTempFiles(false),
+#ifdef SUPPORT_SNAPSHOTS
+ fSnapshotRequested(false),
+#endif
+ fPipelineFifo(NULL),
fDependencyInfoPath(NULL), fDependencyFileDescriptor(-1)
{
this->checkForClassic(argc, argv);
@@ -589,7 +593,9 @@
}
break;
}
+#ifdef SUPPORT_SNAPSHOTS
fLinkSnapshot.recordArch(fArchitectureName);
+#endif
// only use compressed LINKEDIT for:
// Mac OS X 10.6 or later
// iOS 3.1 or later
@@ -1908,8 +1914,10 @@
//
void Options::parse(int argc, const char* argv[])
{
+#ifdef SUPPORT_SNAPSHOTS
// Store the original args in the link snapshot.
fLinkSnapshot.recordRawArgs(argc, argv);
+#endif
// pass one builds search list from -L and -F options
this->buildSearchPaths(argc, argv);
@@ -1922,17 +1930,21 @@
const char* arg = argv[i];
if ( arg[0] == '-' ) {
+#ifdef SUPPORT_SNAPSHOTS
// by default, copy one arg to the snapshot link command, and do no file copying
int snapshotArgIndex = i;
int snapshotArgCount = -1; // -1 means compute count based on change in index
int snapshotFileArgIndex = -1; // -1 means no data file parameter to arg
+#endif
// Since we don't care about the files passed, just the option names, we do this here.
if (fPrintOptions)
fprintf (stderr, "[Logging ld64 options]\t%s\n", arg);
if ( (arg[1] == 'L') || (arg[1] == 'F') ) {
+#ifdef SUPPORT_SNAPSHOTS
snapshotArgCount = 0; // stripped out of link snapshot
+#endif
if (arg[2] == '\0')
++i;
// previously handled by buildSearchPaths()
@@ -1979,12 +1991,16 @@
fOutputKind = kKextBundle;
}
else if ( strcmp(arg, "-o") == 0 ) {
- snapshotArgCount = 0;
fOutputFile = argv[++i];
+#ifdef SUPPORT_SNAPSHOTS
+ snapshotArgCount = 0;
fLinkSnapshot.setSnapshotName(fOutputFile);
+#endif
}
else if ( strncmp(arg, "-lazy-l", 7) == 0 ) {
+#ifdef SUPPORT_SNAPSHOTS
snapshotArgCount = 0;
+#endif
FileInfo info = findLibrary(&arg[7], true);
info.options.fLazyLoad = true;
info.ordinal = ld::File::Ordinal::makeArgOrdinal((uint16_t)i);
@@ -1992,13 +2008,17 @@
fUsingLazyDylibLinking = true;
}
else if ( strcmp(arg, "-lto_library") == 0 ) {
+#ifdef SUPPORT_SNAPSHOTS
snapshotFileArgIndex = 1;
+#endif
fOverridePathlibLTO = argv[++i];
if ( fOverridePathlibLTO == NULL )
throw "missing argument to -lto_library";
}
else if ( (arg[1] == 'l') && (strncmp(arg,"-lazy_",6) !=0) ) {
+#ifdef SUPPORT_SNAPSHOTS
snapshotArgCount = 0;
+#endif
FileInfo info = findLibrary(&arg[2]);
info.ordinal = ld::File::Ordinal::makeArgOrdinal((uint16_t)i);
addLibrary(info);
@@ -2006,8 +2026,10 @@
// This causes a dylib to be weakly bound at
// link time. This corresponds to weak_import.
else if ( strncmp(arg, "-weak-l", 7) == 0 ) {
+#ifdef SUPPORT_SNAPSHOTS
// SNAPSHOT FIXME: what should we do for link snapshots? (ignore for now)
snapshotArgCount = 0;
+#endif
FileInfo info = findLibrary(&arg[7]);
info.options.fWeakImport = true;
info.ordinal = ld::File::Ordinal::makeArgOrdinal((uint16_t)i);
@@ -2065,12 +2087,16 @@
else if ( strcmp(arg, "-sectorder") == 0 ) {
if ( (argv[i+1]==NULL) || (argv[i+2]==NULL) || (argv[i+3]==NULL) )
throw "-sectorder missing <segment> <section> <file-path>";
+#ifdef SUPPORT_SNAPSHOTS
snapshotFileArgIndex = 3;
+#endif
parseSectionOrderFile(argv[i+1], argv[i+2], argv[i+3]);
i += 3;
}
else if ( strcmp(arg, "-order_file") == 0 ) {
+#ifdef SUPPORT_SNAPSHOTS
snapshotFileArgIndex = 1;
+#endif
parseOrderFile(argv[++i], false);
}
else if ( strcmp(arg, "-order_file_statistics") == 0 ) {
@@ -2081,7 +2107,9 @@
else if ( (strcmp(arg, "-sectcreate") == 0) || (strcmp(arg, "-segcreate") == 0) ) {
if ( (argv[i+1]==NULL) || (argv[i+2]==NULL) || (argv[i+3]==NULL) )
throw "-sectcreate missing <segment> <section> <file-path>";
+#ifdef SUPPORT_SNAPSHOTS
snapshotFileArgIndex = 3;
+#endif
addSection(argv[i+1], argv[i+2], argv[i+3]);
i += 3;
}
@@ -2110,7 +2138,9 @@
}
// Same as -@ from the FSF linker.
else if ( strcmp(arg, "-filelist") == 0 ) {
+#ifdef SUPPORT_SNAPSHOTS
snapshotArgCount = 0;
+#endif
const char* path = argv[++i];
if ( (path == NULL) || (path[0] == '-') )
throw "-filelist missing <path>";
@@ -2137,7 +2167,9 @@
}
}
else if ( strcmp(arg, "-interposable_list") == 0 ) {
+#ifdef SUPPORT_SNAPSHOTS
snapshotFileArgIndex = 1;
+#endif
fInterposeMode = kInterposeSome;
loadExportFile(argv[++i], "-interposable_list", fInterposeList);
}
@@ -2146,14 +2178,18 @@
fInterposeMode = kInterposeNone;
}
else if ( strcmp(arg, "-exported_symbols_list") == 0 ) {
+#ifdef SUPPORT_SNAPSHOTS
snapshotFileArgIndex = 1;
+#endif
if ( fExportMode == kDontExportSome )
throw "can't use -exported_symbols_list and -unexported_symbols_list";
fExportMode = kExportSome;
loadExportFile(argv[++i], "-exported_symbols_list", fExportSymbols);
}
else if ( strcmp(arg, "-unexported_symbols_list") == 0 ) {
+#ifdef SUPPORT_SNAPSHOTS
snapshotFileArgIndex = 1;
+#endif
if ( fExportMode == kExportSome )
throw "can't use -unexported_symbols_list and -exported_symbols_list";
fExportMode = kDontExportSome;
@@ -2172,14 +2208,18 @@
fDontExportSymbols.insert(argv[++i]);
}
else if ( strcmp(arg, "-non_global_symbols_no_strip_list") == 0 ) {
+#ifdef SUPPORT_SNAPSHOTS
snapshotFileArgIndex = 1;
+#endif
if ( fLocalSymbolHandling == kLocalSymbolsSelectiveExclude )
throw "can't use -non_global_symbols_no_strip_list and -non_global_symbols_strip_list";
fLocalSymbolHandling = kLocalSymbolsSelectiveInclude;
loadExportFile(argv[++i], "-non_global_symbols_no_strip_list", fLocalSymbolsIncluded);
}
else if ( strcmp(arg, "-non_global_symbols_strip_list") == 0 ) {
+#ifdef SUPPORT_SNAPSHOTS
snapshotFileArgIndex = 1;
+#endif
if ( fLocalSymbolHandling == kLocalSymbolsSelectiveInclude )
throw "can't use -non_global_symbols_no_strip_list and -non_global_symbols_strip_list";
fLocalSymbolHandling = kLocalSymbolsSelectiveExclude;
@@ -2195,16 +2235,20 @@
}
// Similar to -weak-l but uses the absolute path name to the library.
else if ( strcmp(arg, "-weak_library") == 0 ) {
+#ifdef SUPPORT_SNAPSHOTS
// SNAPSHOT FIXME: what should we do for link snapshots? (ignore for now)
snapshotArgCount = 0;
+#endif
FileInfo info = findFile(argv[++i]);
info.options.fWeakImport = true;
info.ordinal = ld::File::Ordinal::makeArgOrdinal((uint16_t)i);
addLibrary(info);
}
else if ( strcmp(arg, "-lazy_library") == 0 ) {
+#ifdef SUPPORT_SNAPSHOTS
// SNAPSHOT FIXME: what should we do for link snapshots? (ignore for now)
snapshotArgCount = 0;
+#endif
FileInfo info = findFile(argv[++i]);
info.options.fLazyLoad = true;
info.ordinal = ld::File::Ordinal::makeArgOrdinal((uint16_t)i);
@@ -2212,22 +2256,28 @@
fUsingLazyDylibLinking = true;
}
else if ( strcmp(arg, "-framework") == 0 ) {
+#ifdef SUPPORT_SNAPSHOTS
snapshotArgCount = 0;
+#endif
FileInfo info = findFramework(argv[++i]);
info.ordinal = ld::File::Ordinal::makeArgOrdinal((uint16_t)i);
addLibrary(info);
}
else if ( strcmp(arg, "-weak_framework") == 0 ) {
+#ifdef SUPPORT_SNAPSHOTS
// SNAPSHOT FIXME: what should we do for link snapshots? (ignore for now)
snapshotArgCount = 0;
+#endif
FileInfo info = findFramework(argv[++i]);
info.options.fWeakImport = true;
info.ordinal = ld::File::Ordinal::makeArgOrdinal((uint16_t)i);
addLibrary(info);
}
else if ( strcmp(arg, "-lazy_framework") == 0 ) {
+#ifdef SUPPORT_SNAPSHOTS
// SNAPSHOT FIXME: what should we do for link snapshots? (ignore for now)
snapshotArgCount = 0;
+#endif
FileInfo info = findFramework(argv[++i]);
info.options.fLazyLoad = true;
info.ordinal = ld::File::Ordinal::makeArgOrdinal((uint16_t)i);
@@ -2305,8 +2355,10 @@
// This should probably be deprecated when we respect -L and -F
// when searching for libraries.
else if ( strcmp(arg, "-dylib_file") == 0 ) {
+#ifdef SUPPORT_SNAPSHOTS
// ignore for snapshot because a stub dylib will be created in the snapshot
snapshotArgCount = 0;
+#endif
addDylibOverride(argv[++i]);
}
// What to expand @executable_path to if found in dependent dylibs
@@ -2363,7 +2415,9 @@
}
// ??? Deprecate when we get rid of basing at build time.
else if ( strcmp(arg, "-seg_addr_table") == 0 ) {
+#ifdef SUPPORT_SNAPSHOTS
snapshotFileArgIndex = 1;
+#endif
const char* name = argv[++i];
if ( name == NULL )
throw "-seg_addr_table missing argument";
@@ -2427,7 +2481,9 @@
i += 2;
}
else if ( strcmp(arg, "-bundle_loader") == 0 ) {
+#ifdef SUPPORT_SNAPSHOTS
snapshotFileArgIndex = 1;
+#endif
fBundleLoader = argv[++i];
if ( (fBundleLoader == NULL) || (fBundleLoader[0] == '-') )
throw "-bundle_loader missing <path>";
@@ -2659,7 +2715,9 @@
// previously handled by buildSearchPaths()
}
else if ( strcmp(arg, "-syslibroot") == 0 ) {
+#ifdef SUPPORT_SNAPSHOTS
snapshotArgCount = 0;
+#endif
++i;
// previously handled by buildSearchPaths()
}
@@ -2670,7 +2728,9 @@
fUUIDMode = kUUIDRandom;
}
else if ( strcmp(arg, "-dtrace") == 0 ) {
+#ifdef SUPPORT_SNAPSHOTS
snapshotFileArgIndex = 1;
+#endif
const char* name = argv[++i];
if ( name == NULL )
throw "-dtrace missing argument";
@@ -2693,7 +2753,9 @@
fAliases.push_back(pair);
}
else if ( strcmp(arg, "-alias_list") == 0 ) {
+#ifdef SUPPORT_SNAPSHOTS
snapshotFileArgIndex = 1;
+#endif
parseAliasFile(argv[++i]);
}
else if ( strcmp(arg, "-save-temps") == 0 ) {
@@ -2724,48 +2786,60 @@
fDisablePositionIndependentExecutable = true;
}
else if ( strncmp(arg, "-reexport-l", 11) == 0 ) {
+#ifdef SUPPORT_SNAPSHOTS
// SNAPSHOT FIXME: what should we do for link snapshots? (ignore for now)
snapshotArgCount = 0;
+#endif
FileInfo info = findLibrary(&arg[11], true);
info.options.fReExport = true;
info.ordinal = ld::File::Ordinal::makeArgOrdinal((uint16_t)i);
addLibrary(info);
}
else if ( strcmp(arg, "-reexport_library") == 0 ) {
+#ifdef SUPPORT_SNAPSHOTS
// SNAPSHOT FIXME: what should we do for link snapshots? (ignore for now)
snapshotArgCount = 0;
+#endif
FileInfo info = findFile(argv[++i]);
info.options.fReExport = true;
info.ordinal = ld::File::Ordinal::makeArgOrdinal((uint16_t)i);
addLibrary(info);
}
else if ( strcmp(arg, "-reexport_framework") == 0 ) {
+#ifdef SUPPORT_SNAPSHOTS
// SNAPSHOT FIXME: what should we do for link snapshots? (ignore for now)
snapshotArgCount = 0;
+#endif
FileInfo info = findFramework(argv[++i]);
info.options.fReExport = true;
info.ordinal = ld::File::Ordinal::makeArgOrdinal((uint16_t)i);
addLibrary(info);
}
else if ( strncmp(arg, "-upward-l", 9) == 0 ) {
+#ifdef SUPPORT_SNAPSHOTS
// SNAPSHOT FIXME: what should we do for link snapshots? (ignore for now)
snapshotArgCount = 0;
+#endif
FileInfo info = findLibrary(&arg[9], true);
info.options.fUpward = true;
info.ordinal = ld::File::Ordinal::makeArgOrdinal((uint16_t)i);
addLibrary(info);
}
else if ( strcmp(arg, "-upward_library") == 0 ) {
+#ifdef SUPPORT_SNAPSHOTS
// SNAPSHOT FIXME: what should we do for link snapshots? (ignore for now)
snapshotArgCount = 0;
+#endif
FileInfo info = findFile(argv[++i]);
info.options.fUpward = true;
info.ordinal = ld::File::Ordinal::makeArgOrdinal((uint16_t)i);
addLibrary(info);
}
else if ( strcmp(arg, "-upward_framework") == 0 ) {
+#ifdef SUPPORT_SNAPSHOTS
// SNAPSHOT FIXME: what should we do for link snapshots? (ignore for now)
snapshotArgCount = 0;
+#endif
FileInfo info = findFramework(argv[++i]);
info.options.fUpward = true;
info.ordinal = ld::File::Ordinal::makeArgOrdinal((uint16_t)i);
@@ -2819,7 +2893,9 @@
fMarkDeadStrippableDylib = true;
}
else if ( strcmp(arg, "-exported_symbols_order") == 0 ) {
+#ifdef SUPPORT_SNAPSHOTS
snapshotFileArgIndex = 1;
+#endif
loadSymbolOrderFile(argv[++i], fExportSymbolsOrder);
}
else if ( strcmp(arg, "-no_compact_linkedit") == 0 ) {
@@ -2911,11 +2987,15 @@
fObjcCategoryMerging = false;
}
else if ( strcmp(arg, "-force_symbols_weak_list") == 0 ) {
+#ifdef SUPPORT_SNAPSHOTS
snapshotFileArgIndex = 1;
+#endif
loadExportFile(argv[++i], "-force_symbols_weak_list", fForceWeakSymbols);
}
else if ( strcmp(arg, "-force_symbols_not_weak_list") == 0 ) {
+#ifdef SUPPORT_SNAPSHOTS
snapshotFileArgIndex = 1;
+#endif
loadExportFile(argv[++i], "-force_symbols_not_weak_list", fForceNotWeakSymbols);
}
else if ( strcmp(arg, "-force_symbol_weak") == 0 ) {
@@ -2931,7 +3011,9 @@
fForceNotWeakSymbols.insert(symbol);
}
else if ( strcmp(arg, "-reexported_symbols_list") == 0 ) {
+#ifdef SUPPORT_SNAPSHOTS
snapshotFileArgIndex = 1;
+#endif
if ( fExportMode == kExportSome )
throw "can't use -exported_symbols_list and -reexported_symbols_list";
loadExportFile(argv[++i], "-reexported_symbols_list", fReExportSymbols);
@@ -2947,6 +3029,7 @@
else if ( strcmp(arg, "-page_align_data_atoms") == 0 ) {
fPageAlignDataAtoms = true;
}
+#ifdef SUPPORT_SNAPSHOTS
else if (strcmp(arg, "-debug_snapshot") == 0) {
fLinkSnapshot.setSnapshotMode(Snapshot::SNAPSHOT_DEBUG);
fSnapshotRequested = true;
@@ -2959,6 +3042,7 @@
fLinkSnapshot.setSnapshotPath(path);
fSnapshotRequested = true;
}
+#endif
else if ( strcmp(arg, "-new_main") == 0 ) {
fEntryPointLoadCommandForceOn = true;
}
@@ -2993,7 +3077,9 @@
fKextsUseStubs = true;
}
else if ( strcmp(argv[i], "-dependency_info") == 0 ) {
+#ifdef SUPPORT_SNAPSHOTS
snapshotArgCount = 0;
+#endif
++i;
// previously handled by buildSearchPaths()
}
@@ -3001,7 +3087,9 @@
fExportDynamic = true;
}
else if ( strcmp(arg, "-force_symbols_coalesce_list") == 0 ) {
+#ifdef SUPPORT_SNAPSHOTS
snapshotFileArgIndex = 1;
+#endif
loadExportFile(argv[++i], "-force_symbols_coalesce_list", fForceCoalesceSymbols);
}
else if ( strcmp(arg, "-add_linker_option") == 0 ) {
@@ -3158,10 +3246,12 @@
throwf("unknown option: %s", arg);
}
+#ifdef SUPPORT_SNAPSHOTS
if (snapshotArgCount == -1)
snapshotArgCount = i-snapshotArgIndex+1;
if (snapshotArgCount > 0)
fLinkSnapshot.addSnapshotLinkArg(snapshotArgIndex, snapshotArgCount, snapshotFileArgIndex);
+#endif
}
else {
FileInfo info = findFile(arg);
@@ -3180,8 +3270,10 @@
addLibrary(info);
}
+#ifdef SUPPORT_SNAPSHOTS
if (fSnapshotRequested)
fLinkSnapshot.createSnapshot();
+#endif
}
@@ -3452,6 +3544,7 @@
if ( customDyldPath != NULL )
fDyldInstallPath = customDyldPath;
+#ifdef SUPPORT_SNAPSHOTS
const char* debugArchivePath = getenv("LD_DEBUG_SNAPSHOT");
if (debugArchivePath != NULL) {
fLinkSnapshot.setSnapshotMode(Snapshot::SNAPSHOT_DEBUG);
@@ -3459,6 +3552,7 @@
fLinkSnapshot.setSnapshotPath(debugArchivePath);
fSnapshotRequested = true;
}
+#endif
const char* pipeFdString = getenv("LD_PIPELINE_FIFO");
if (pipeFdString != NULL) {
@@ -4351,7 +4445,9 @@
if ( strcmp(&lastSlash[1], subUmbrella) == 0 ) {
info.options.fReExport = true;
found = true;
+#ifdef SUPPORT_SNAPSHOTS
fLinkSnapshot.recordSubUmbrella(info.path);
+#endif
break;
}
}
@@ -4374,7 +4470,9 @@
if ( strncmp(&lastSlash[1], subLibrary, dot-lastSlash-1) == 0 ) {
info.options.fReExport = true;
found = true;
+#ifdef SUPPORT_SNAPSHOTS
fLinkSnapshot.recordSubLibrary(info.path);
+#endif
break;
}
}
--- ld64-241.9/src/ld/Options.h.orig 2015-01-16 15:26:32.000000000 -0800
+++ ld64-241.9/src/ld/Options.h 2015-01-16 15:26:54.000000000 -0800
@@ -48,7 +48,9 @@
extern void throwf (const char* format, ...) __attribute__ ((noreturn,format(printf, 1, 2)));
extern void warning(const char* format, ...) __attribute__((format(printf, 1, 2)));
+#ifdef SUPPORT_SNAPSHOTS
class Snapshot;
+#endif
class LibraryOptions
{
@@ -379,7 +381,9 @@
bool forceWeakNonWildCard(const char* symbolName) const;
bool forceNotWeakNonWildcard(const char* symbolName) const;
bool forceCoalesce(const char* symbolName) const;
+#ifdef SUPPORT_SNAPSHOTS
Snapshot& snapshot() const { return fLinkSnapshot; }
+#endif
bool errorBecauseOfWarnings() const;
bool needsThreadLoadCommand() const { return fNeedsThreadLoadCommand; }
bool needsEntryPointLoadCommand() const { return fEntryPointLoadCommand; }
@@ -677,8 +681,10 @@
std::vector<SymbolsMove> fSymbolsMovesCode;
std::vector<SymbolsMove> fSymbolsMovesZeroFill;
bool fSaveTempFiles;
+#ifdef SUPPORT_SNAPSHOTS
mutable Snapshot fLinkSnapshot;
bool fSnapshotRequested;
+#endif
const char* fPipelineFifo;
const char* fDependencyInfoPath;
mutable int fDependencyFileDescriptor;
--- ld64-241.9/src/ld/Snapshot.cpp.orig 2014-09-10 15:24:46.000000000 -0700
+++ ld64-241.9/src/ld/Snapshot.cpp 2015-01-16 15:26:54.000000000 -0800
@@ -6,6 +6,7 @@
// Copyright (c) 2011 Apple Inc. All rights reserved.
//
+#ifdef SUPPORT_SNAPSHOTS
#include <string.h>
#include <unistd.h>
#include <stdio.h>
@@ -536,3 +538,5 @@
}
}
}
+
+#endif /* SUPPORT_SNAPSHOTS */
--- ld64-236.3/src/ld/Snapshot.h.orig 2015-01-23 07:59:55.000000000 +0100
+++ ld64-236.3/src/ld/Snapshot.h 2015-01-23 07:58:14.000000000 +0100
@@ -8,6 +8,8 @@
#ifndef ld64_Snapshot_h
#define ld64_Snapshot_h
+
+#ifdef SUPPORT_SNAPSHOTS
#include <stdint.h>
#include <string.h>
#include <map>
@@ -151,3 +153,5 @@
};
#endif
+
+#endif