[Prev][Next][Index][Thread]

Re: Putting files with $'s into the multiboot image



John Leuner wrote:
> How do I put files with '$' in the name into the multiboot image?

Here's a patch to mkmb2 to fix the problem.  You should be able to do:
	mkmb2 jvmimage */*.class 
and have it work even with inner classes.  (We ran into exactly the
same problem).

Note this patch is for the mkmb2.in file, but it should "just work" on 
the generated script.

BTW, what JVM are you using for this?

-Pat

----- ----- ---- ---  ---  --   -    -      -         -               -
Pat Tullmann                                       tullmann@cs.utah.edu
	   "I'd kill for a Nobel Peace Prize." -- S. Wright


Index: mkmb2.in
===================================================================
RCS file: /n/fast/usr/lsrc/flux/CVS/oskit/boot/multiboot/mkmb2.in,v
retrieving revision 1.2
retrieving revision 1.5
diff -u -r1.2 -r1.5
--- mkmb2.in	1999/01/29 20:10:22	1.2
+++ mkmb2.in	1999/08/17 22:04:38	1.5
@@ -61,20 +61,20 @@
 # Parse the command-line options
 while ($#ARGV >= 0) {
         if ($ARGV[0] eq "-x") { $bb = $ARGV[1]; shift @ARGV; }
-	elsif ($ARGV[0] eq "-o") { $bb = $ARGV[1]; shift @ARGV; }
+	elsif ($ARGV[0] eq "-o") { $outfile = $ARGV[1]; shift @ARGV; }
 	elsif ($ARGV[0] eq "-c") { $cmdline = $ARGV[1]; shift @ARGV; }
 	elsif ($ARGV[0] eq "-stdin") { $fromstdin = 1; }
 	elsif ($ARGV[0] eq "-save-temps") { $savetemps = 1; }
 	elsif ($ARGV[0] eq "-K") { $NOBIN{$ARGV[1]} = 1; }
-	else { push @modules, $ARGV[0]; }
+	else { push(@modules, $ARGV[0]); }
 	shift @ARGV;
 }
 
 # Add in anything from stdin if they've asked for it.
 if ($fromstdin) {
         while (<STDIN>) {
-	        chomp;
-		push @modules, $_;
+		@words = split;
+		push(@modules, @words);
 	}
 }
 
@@ -83,7 +83,7 @@
         open(CMD, ">$outfile.cmdline") || 
 	  die "could not open cmdline file: $!\n";
 	print CMD "$cmdline\n";
-	push @modules, ".${outfile}.cmdline:${cmdlinefile}";
+	push(@modules, ".${outfile}.cmdline:${cmdlinefile}");
 	close(CMD);
 }
 
@@ -109,7 +109,7 @@
 	if (!length($string)) { $string = $file; }
 	
 	if (!$FOUND{$file}) {	# Must be unique or we get linker probs
-	        push @files, $file; #This is where the shell script bogged down
+	        push(@files, $file); #This is where the shell script bogged down
 	      }
 	$FOUND{$file} = 1;
 
@@ -136,7 +136,7 @@
 $res = system("${cc} -c -o ${outfile}.mods.o ${outfile}.mods.S");
 if ($res) {
   &cleanup();
-  die "CC failed\n";
+  die "FATAL: C compiler ($cc) failed\n";
 }
 
 # Parse the file list, doing any necessary magic to the files.
@@ -144,6 +144,8 @@
 # linker args to try to get library files to load properly.
 $filelist = "";
 foreach $file (@files) {
+  ## Escape any '$' that occur in file names (happens a lot with Java classes)
+  $file =~ s/\$/\\\$/g;
   if ($NOBIN{$file}) {
     $filelist .= "$file ";
   } else {
@@ -158,7 +160,7 @@
 
 if ($res) {
   &cleanup();
-  die "LD failed\n";
+  die "FATAL: linker ($aoutld) failed: $res\n";
 }
 
 # Nuke our temp files, unless asked not to.

Follow-Ups: References: