summaryrefslogtreecommitdiff
path: root/klibc/klcc.in
diff options
context:
space:
mode:
Diffstat (limited to 'klibc/klcc.in')
-rw-r--r--klibc/klcc.in16
1 files changed, 14 insertions, 2 deletions
diff --git a/klibc/klcc.in b/klibc/klcc.in
index bdd03e73b3..d8721c9a6b 100644
--- a/klibc/klcc.in
+++ b/klibc/klcc.in
@@ -78,6 +78,11 @@ sub mysystem(@) {
}
#
+# Initialization
+#
+open(NULL, '+<', '/dev/null') or die "$0: cannot open /dev/null\n";
+
+#
# Begin parsing options.
#
@@ -191,10 +196,17 @@ if ( $operation ne '' ) {
}
}
+ # Get the libgcc pathname for the *current* gcc
+ open(LIBGCC, '-|', $CC, @ccopt, '-print-libgcc-file-name')
+ or die "$0: cannot get libgcc filename\n";
+ $libgcc = <LIBGCC>;
+ chomp $libgcc;
+ close(LIBGCC);
+
if ( $shared ) {
- $rv = mysystem($LD, @LDFLAGS, @sharedopt, @ldopt, @outopt, @objs, @sharedlib);
+ $rv = mysystem($LD, @LDFLAGS, @sharedopt, @ldopt, @outopt, @objs, @sharedlib, $libgcc);
} else {
- $rv = mysystem($LD, @LDFLAGS, @staticopt, @ldopt, @outopt, @objs, @staticlib);
+ $rv = mysystem($LD, @LDFLAGS, @staticopt, @ldopt, @outopt, @objs, @staticlib, $libgcc);
}
unlink(@rmobjs);