There's a problem in klibc 1.0.12:
klcc -c t.c && klcc t.o && ./a.out
works, but
klcc t.c && ./a.out
fails because open3() wants to close its input,
and you can do that only once to STDIN.
Attached patch makes "klcc t.c" work again.
This might break the klcc from stdin option, but I can't
tell because I've got no idea how it's supposed to be invoked
and what gcc command line should result. If you can mail
a command line example I'll look for a cleaner solution.
-erik
Signed-off-by: Erik van Konijnenburg <ekonijn@xs4all.nl>
Index: klibc-1.0.12/klcc.in
==================================================================---
klibc-1.0.12.orig/klcc.in 2005-05-25 08:19:19.000000000 +0200
+++ klibc-1.0.12/klcc.in 2005-05-25 14:26:25.000000000 +0200
@@ -81,10 +81,7 @@
# Run a program; printing out the command line if $verbose is set
sub mysystem(@) {
print STDERR join(' ', @_), "\n" if ( $verbose );
- my $cmd = shift;
- my $childpid = open3("<&STDIN",
">&STDOUT", ">&STDERR", $cmd, @_);
- waitpid ($childpid, 0);
- return $?;
+ return system (@_);
}
#