This patch gives OpenBIOS users the ability to specify
their own compiler prefix. It can be used by just adding
PREFIX=<your prefix> right before the switch-arch command.
Example: PREFIX=ppc-elf- ./switch-arch ppc
Signed-off-by: John Arbuckle <programmingkidx(a)gmail.com>
Index: config/scripts/switch-arch
===================================================================
--- config/scripts/switch-arch (revision 1335)
+++ config/scripts/switch-arch (working copy)
@@ -99,6 +99,13 @@
select_prefix()
{
+ # if the user specified the prefix like this: PREFIX=ppc-elf- ./switch-arch ppc
+ if [ $PREFIX ]
+ then
+ TARGET=$PREFIX
+ return
+ fi
+
for TARGET in ${1}-unknown-linux-gnu- ${1}-linux-gnu- ${1}-linux- ${1}-elf- ${1}-eabi-
do
if type ${TARGET}gcc > /dev/null 2>&1
This version of the patch just fixes up the comment to sound better.
Signed-off-by: John Arbuckle <programmingkidx(a)gmail.com>
Index: config/scripts/switch-arch
===================================================================
--- config/scripts/switch-arch (revision 1335)
+++ config/scripts/switch-arch (working copy)
@@ -99,7 +99,8 @@
select_prefix()
{
- for TARGET in ${1}-unknown-linux-gnu- ${1}-linux-gnu- ${1}-linux- ${1}-elf- ${1}-eabi-
+ # The user can specify the cross compiler like this: CROSS_COMPILER=ppc-elf- ./switch-arch ppc
+ for TARGET in ${1}-unknown-linux-gnu- ${1}-linux-gnu- ${1}-linux- ${1}-elf- ${1}-eabi- $CROSS_COMPILER
do
if type ${TARGET}gcc > /dev/null 2>&1
then
This version of the patch reduces the for loop and comments' line length.
It also has the loop test the CROSS_COMPILER variable first making things
a little more efficient.
Signed-off-by: John Arbuckle <programmingkidx(a)gmail.com>
Index: config/scripts/switch-arch
===================================================================
--- config/scripts/switch-arch (revision 1335)
+++ config/scripts/switch-arch (working copy)
@@ -99,7 +99,10 @@
select_prefix()
{
- for TARGET in ${1}-unknown-linux-gnu- ${1}-linux-gnu- ${1}-linux- ${1}-elf- ${1}-eabi-
+ # The user can specify the cross compiler like this:
+ # CROSS_COMPILER=ppc-elf- ./switch-arch ppc
+ for TARGET in $CROSS_COMPILER ${1}-unknown-linux-gnu- ${1}-linux-gnu- \
+ ${1}-linux- ${1}-elf- ${1}-eabi-
do
if type ${TARGET}gcc > /dev/null 2>&1
then
This simplifies the patch even more. The $PREFIX variable has been changed to
$CROSS_COMPILER. It is much more intuitive this way. Thank you Lennart for the
suggestion.
Signed-off-by: John Arbuckle <programmingkidx(a)gmail.com>
Index: config/scripts/switch-arch
===================================================================
--- config/scripts/switch-arch (revision 1335)
+++ config/scripts/switch-arch (working copy)
@@ -99,7 +99,8 @@
select_prefix()
{
- for TARGET in ${1}-unknown-linux-gnu- ${1}-linux-gnu- ${1}-linux- ${1}-elf- ${1}-eabi-
+ # if the user specified the cross compiler like this: CROSS_COMPILER=ppc-elf- ./switch-arch ppc
+ for TARGET in ${1}-unknown-linux-gnu- ${1}-linux-gnu- ${1}-linux- ${1}-elf- ${1}-eabi- $CROSS_COMPILER
do
if type ${TARGET}gcc > /dev/null 2>&1
then
Fixes printk function so it can print very large strings. This patch does allow me to see the full
bootscript in the serial console.
Signed-off-by: John Arbuckle <programmingkidx(a)gmail.com>
Index: arch/ppc/qemu/qemu.c
===================================================================
--- arch/ppc/qemu/qemu.c (revision 1335)
+++ arch/ppc/qemu/qemu.c (working copy)
@@ -56,7 +56,7 @@
int
printk( const char *fmt, ... )
{
- char *p, buf[1024];
+ char *p, buf[10024];
va_list args;
int i;
Hi Mark,
Does this ring a bell with you? I'm getting the error below with latest
QEMU+KVM on a G5.
Alex
2015-04-15 23:54:36: C>> annot manage 'ethernet controller' PCI device type 'network':
2015-04-15 23:54:36: >> 8086 100e (2 0 0)
2015-04-15 23:54:36:
2015-04-15 23:54:36: >> =============================================================
2015-04-15 23:54:36: >> OpenBIOS 1.1 [Mar 12 2015 08:09]
2015-04-15 23:54:36: >> Configuration device id QEMU version 1 machine id 1
2015-04-15 23:54:36: >> CPUs: 1
2015-04-15 23:54:36: >> Memory: 512M
2015-04-15 23:54:36: >> UUID: 00000000-0000-0000-0000-000000000000
2015-04-15 23:54:36: >> CPU type PowerPC,G4
2015-04-15 23:54:36: milliseconds isn't unique.
2015-04-16 00:06:57: (Process terminated with status 0)