shithub: riscv

Download patch

ref: c8ed49da608c1c99ec6dab7a6e9bbc26f3f05277
parent: 07a776fad9c93ecc8b0635a9d96107b729ca0469
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Sun Dec 14 20:43:31 EST 2014

xen: fix cross build

--- a/sys/src/9/xen/mkfile
+++ b/sys/src/9/xen/mkfile
@@ -93,17 +93,17 @@
 PAE=`{echo $PAE | sed 's/yes/yes[extended-cr3]/'}
 XENELF='LOADER=generic,XEN_VER=xen-3.0,ELF_PADDR_OFFSET=0,VIRT_BASE='$KZERO',VIRT_ENTRY='$KTZERO',PAE='$PAE
 
-#$p$CONF:	$CONF.c $OBJ $LIB xenbin
+#$p$CONF:	$CONF.c $OBJ $LIB xenbin.$cputype
 #	$CC $CFLAGS '-DKERNDATE='`{date -n} $CONF.c
 #	$LD -o $target.tmp -T$KTZERO -l $OBJ $CONF.$O $LIB
-#	./xenbin <$target.tmp >$target
+#	./xenbin.$cputype <$target.tmp >$target
 #	rm $target.tmp
 #	size $target
 
-$p$CONF:	$CONF.c $OBJ $LIB xenelf
+$p$CONF:	$CONF.c $OBJ $LIB xenelf.$cputype
 	$CC $CFLAGS '-DKERNDATE='`{date -n} $CONF.c
 	$LD -o $target.elf -H5 -T$KTZERO -P$KPZERO -l $OBJ $CONF.$O $LIB
-	./xenelf $target.elf $target __xen_guest ''$XENELF''
+	./xenelf.$cputype $target.elf $target __xen_guest ''$XENELF''
 	size $target
 
 $p$CONF.gz: $p$CONF
@@ -176,13 +176,10 @@
 xenstore: xenstore.$O
 	$LD -o xenstore xenstore.$O
 
-# XXX this is wrong if we're cross-compiling
-xenbin:	xenbin.$O
-	$LD -o xenbin xenbin.$O
-xenelf: xenelf.$O
-	$LD -o xenelf xenelf.$O
+xenbin.$cputype xenelf.$cputype:	utilmkfile
+	mk -f utilmkfile $target
 
 %.clean:V:
-	rm -f $stem.c [9bz]$stem [9bz]$stem.gz 9$stem.elf boot$stem.* reboot.h init.h xendat.h xendefs.h $PCHEADERS dpart xenbin xenelf xenstore
+	rm -f $stem.c [9bz]$stem [9bz]$stem.gz 9$stem.elf boot$stem.* reboot.h init.h xendat.h xendefs.h $PCHEADERS dpart xenbin.$cputype xenelf.$cputype xenstore
 
 
--- /dev/null
+++ b/sys/src/9/xen/utilmkfile
@@ -1,0 +1,5 @@
+</$cputype/mkfile
+</sys/src/cmd/mkone
+
+%.$cputype:	%.$O
+	$LD -o $target $prereq