nixpkgs/pkgs/os-specific/darwin/cctools-port/ld-ignore-rpath-link.patch
aszlig dd10bb3181
Add a cross-platform port of cctools.
This basically is binutils for Mac OS X, but ported to work on
(GNU/)Linux and FreeBSD.

And it's up-to-date as well! I'm mentioning this, because it was quite
hard to find a recent port of it and I just accidentally stumbled on it
while trying to do the port by myself.

So thanks to @tpoechtrager for doing this.

Also, I've added two more patches, which essentially are:

 * ld-rpath-nonfinal:
     This allows -rpath to be used for linking non-final builds, which
     was allowed for earlier versions of cctools and got a check for
     that in more recent versions.

 * ld-ignore-rpath-link:
     Ignores the -rpath-link option, because the cross-wrapper uses it
     in different places. Unfortunately, the cctools linker doesn't
     support it, so we might need to implement this later if it's
     possible (I'm not a Mach-O man^H^H^Hexpert).

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
2014-03-12 10:00:44 +01:00

17 lines
591 B
Diff

diff --git a/cctools/ld64/src/ld/Options.cpp b/cctools/ld64/src/ld/Options.cpp
index 2565518..9250016 100644
--- a/cctools/ld64/src/ld/Options.cpp
+++ b/cctools/ld64/src/ld/Options.cpp
@@ -2522,6 +2522,11 @@ void Options::parse(int argc, const char* argv[])
throw "missing argument to -rpath";
fRPaths.push_back(path);
}
+ else if ( strcmp(arg, "-rpath-link") == 0 ) {
+ const char* path = argv[++i];
+ if ( path == NULL )
+ throw "missing argument to -rpath-link";
+ }
else if ( strcmp(arg, "-read_only_stubs") == 0 ) {
fReadOnlyx86Stubs = true;
}