summaryrefslogtreecommitdiffstats
path: root/src/main/java/net/sf/antcontrib/cpptasks/gcc/AbstractLdLinker.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/net/sf/antcontrib/cpptasks/gcc/AbstractLdLinker.java')
-rw-r--r--src/main/java/net/sf/antcontrib/cpptasks/gcc/AbstractLdLinker.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/main/java/net/sf/antcontrib/cpptasks/gcc/AbstractLdLinker.java b/src/main/java/net/sf/antcontrib/cpptasks/gcc/AbstractLdLinker.java
index d70feaf..9b17bbb 100644
--- a/src/main/java/net/sf/antcontrib/cpptasks/gcc/AbstractLdLinker.java
+++ b/src/main/java/net/sf/antcontrib/cpptasks/gcc/AbstractLdLinker.java
@@ -59,8 +59,11 @@ public abstract class AbstractLdLinker extends CommandLineLinker {
args.addElement("-g");
}
if (isDarwin()) {
- if (linkType.isStaticRuntime() || linkType.isStaticLibrary()) {
+ if (linkType.isStaticRuntime() ) {
args.addElement("-static");
+ }
+ if (linkType.isStaticLibrary()) {
+ args.addElement("-r"); // reloctable or incremental linker
} else if (linkType.isPluginModule()) {
args.addElement("-bundle");
} else if (linkType.isSharedLibrary()) {
@@ -68,8 +71,11 @@ public abstract class AbstractLdLinker extends CommandLineLinker {
args.addElement("-dynamic");
}
} else {
- if (linkType.isStaticRuntime() || linkType.isStaticLibrary()) {
+ if (linkType.isStaticRuntime() ) {
args.addElement("-static");
+ }
+ if (linkType.isStaticLibrary()) {
+ args.addElement("-r"); // reloctable or incremental linker
} else if (linkType.isPluginModule()) {
args.addElement("-shared");
} else if (linkType.isSharedLibrary()) {