[openfirmware] [commit] r1935 - cpu/arm/Linux cpu/x86/Linux forth/wrapper

repository service svn at openfirmware.info
Wed Aug 11 10:51:39 CEST 2010


Author: wmb
Date: Wed Aug 11 10:51:38 2010
New Revision: 1935
URL: http://tracker.coreboot.org/trac/openfirmware/changeset/1935

Log:
ARM - more cross-compile tweaks.

Modified:
   cpu/arm/Linux/armforth.static
   cpu/x86/Linux/armforth
   forth/wrapper/wrapper.c

Modified: cpu/arm/Linux/armforth.static
==============================================================================
Binary file (source and/or target). No diff available.

Modified: cpu/x86/Linux/armforth
==============================================================================
--- cpu/x86/Linux/armforth	Wed Aug 11 10:50:37 2010	(r1934)
+++ cpu/x86/Linux/armforth	Wed Aug 11 10:51:38 2010	(r1935)
@@ -1,2 +1,11 @@
 #!/bin/sh
-qemu-arm ${BP}/cpu/arm/Linux/armforth.static $*
+
+# The "-0 $0" below causes the wrapper to skip arguments
+# before the -0, so the program name appears to be the
+# name of this script ($0).  That makes the logger put the
+# this script name in the "command: " line, instead of
+# putting cpu/arm/Linux/armforth.static, which is not
+# directly executable in the cross environment, there.
+# That makes fast-rebuilds from the .log file work right.
+
+qemu-arm ${BP}/cpu/arm/Linux/armforth.static -0 $0 $*

Modified: forth/wrapper/wrapper.c
==============================================================================
--- forth/wrapper/wrapper.c	Wed Aug 11 10:50:37 2010	(r1934)
+++ forth/wrapper/wrapper.c	Wed Aug 11 10:51:38 2010	(r1935)
@@ -815,6 +815,20 @@
    	argc = ccommand(&argv);
 #endif
 
+	/*
+	 * This is a special accomodation for running the wrapper under an emulator
+	 * like QEMU.  You can make a shell script containing a line like:
+	 *   qemu-arm wrapper_name -0 script_name ...
+	 * The logger will then log the name of script instead of the actual wrapper.
+	 * An alternate would be to use Linux's binfmt_misc facility to bind the
+	 * emulator to the wrapper binary, but the problem with that is that it
+	 * requires root to register the binding every time you start the computer.
+	 */
+	if (argc > 1 && (0 == strcmp(argv[1], "-0"))) {
+		argv += 2;
+		argc -= 2;
+	}
+
 	progname = argv[0];
 
 	log_command_line(progname, dictfile, f, argc, argv);



More information about the openfirmware mailing list