summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Hutchings <ben@decadent.org.uk>2020-08-20 21:48:07 +0100
committerBen Hutchings <ben@decadent.org.uk>2020-08-20 21:50:09 +0100
commit7752eb456addbd1973e9c6b609294ccef89a65a2 (patch)
treeefc8db82ff7ab96558065a9c0ec79bdff7243bc5
parentc1b82baa78dd67e05897cd53f082c64a9feba7d2 (diff)
downloadklibc-2.0.8.tar.gz
[klibc] klcc: Treat CC, LD, STRIP as multiple wordsklibc-2.0.8
LLVM cross-builds use the same front-end programs but with a "-target <triplet>" option. Add support for this. Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
-rw-r--r--klcc/klcc.in12
-rw-r--r--klcc/makeklcc.pl10
2 files changed, 11 insertions, 11 deletions
diff --git a/klcc/klcc.in b/klcc/klcc.in
index 43d0984a8dace..7b3b8f3b7d6b7 100644
--- a/klcc/klcc.in
+++ b/klcc/klcc.in
@@ -218,7 +218,7 @@ if ( $debugging ) {
if ( $operation ne '' ) {
# Just run gcc with the appropriate options
@outopt = ('-o', $output) if ( defined($output) );
- $rv = mysystem($CC, @ccopt, @outopt, files_with_lang(\@files, \%flang));
+ $rv = mysystem(@CC, @ccopt, @outopt, files_with_lang(\@files, \%flang));
} else {
if ( scalar(@files) == 0 ) {
die "$0: No input files!\n";
@@ -241,7 +241,7 @@ if ( $operation ne '' ) {
push(@objs, $fo);
push(@rmobjs, $fo) unless ( $save_temps );
- $rv = mysystem($CC, @ccopt, '-c', '-o', $fo, '-x', $flang{$f}, $f);
+ $rv = mysystem(@CC, @ccopt, '-c', '-o', $fo, '-x', $flang{$f}, $f);
if ( $rv ) {
unlink(@rmobjs);
@@ -251,18 +251,18 @@ if ( $operation ne '' ) {
}
# Get the libgcc pathname for the *current* gcc
- open(LIBGCC, '-|', $CC, @ccopt, '-print-libgcc-file-name')
+ 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,
+ $rv = mysystem(@LD, @LDFLAGS, @sharedopt, @ldopt, @outopt, @objs,
@libs, @stdlibpath, '--start-group', @sharedlib,
$libgcc, '--end-group');
} else {
- $rv = mysystem($LD, @LDFLAGS, @staticopt, @ldopt, @outopt, @objs,
+ $rv = mysystem(@LD, @LDFLAGS, @staticopt, @ldopt, @outopt, @objs,
@libs, @stdlibpath, '--start-group', @staticlib,
$libgcc, '--end-group');
}
@@ -270,7 +270,7 @@ if ( $operation ne '' ) {
unlink(@rmobjs);
if ( $strip && !$rv ) {
- $rv = mysystem($STRIP, @STRIPFLAGS, $output);
+ $rv = mysystem(@STRIP, @STRIPFLAGS, $output);
}
}
diff --git a/klcc/makeklcc.pl b/klcc/makeklcc.pl
index 5945eb1637bc6..41c5cf46dc6ca 100644
--- a/klcc/makeklcc.pl
+++ b/klcc/makeklcc.pl
@@ -34,21 +34,21 @@ while ( defined($l = <KLIBCCONF>) ) {
chomp $l;
if ( $l =~ /^([^=]+)\=\s*(.*)$/ ) {
$n = $1; $s = $2;
+ my @s = split(/\s+/, $s);
if ( $n eq 'CC' || $n eq 'LD' || $n eq 'STRIP' ) {
- $s1 = pathsearch($s);
+ $s1 = pathsearch($s[0]);
die "$0: Cannot find $n: $s\n" unless ( defined($s1) );
- $s = $s1;
+ $s[0] = $s1;
}
print "\$$n = \"\Q$s\E\";\n";
print "\$conf{\'\L$n\E\'} = \\\$$n;\n";
print "\@$n = ("; $sep = '';
- while ( $s =~ /^\s*(\S+)/ ) {
- print $sep, "\"\Q$1\E\"";
+ for (@s) {
+ print $sep, "\"\Q$_\E\"";
$sep = ', ';
- $s = "$'";
}
print ");\n";
}