Commit 66cdc699 authored by Russ Cox's avatar Russ Cox

arm: fix build on android

R=kaib
CC=golang-dev
https://golang.org/cl/206059
parent fb94be55
......@@ -232,10 +232,10 @@ enum as
#define D_SHIFT (D_NONE+19)
#define D_FPCR (D_NONE+20)
#define D_REGREG (D_NONE+21)
#define D_ADDR (D_NONE+22)
#define D_REGREG (D_NONE+21)
#define D_ADDR (D_NONE+22)
#define D_SBIG (D_NONE+23)
#define D_SBIG (D_NONE+23)
#define D_CONST2 (D_NONE+24)
/* name */
......@@ -244,6 +244,9 @@ enum as
#define D_AUTO (D_NONE+5)
#define D_PARAM (D_NONE+6)
/* internal only */
#define D_SIZE (D_NONE+40)
/*
* this is the ranlib header
*/
......
......@@ -9,6 +9,7 @@ TARG=\
OFILES=\
asm.$O\
elf.$O\
enam.$O\
lib.$O\
list.$O\
......@@ -24,6 +25,7 @@ OFILES=\
HFILES=\
l.h\
../5l/5.out.h\
../ld/elf.h\
$(TARG): $(OFILES)
$(LD) -o $(TARG) -L"$(GOROOT)"/lib $(OFILES) -lbio -l9
......
This diff is collapsed.
......@@ -127,6 +127,7 @@ struct Sym
uchar reachable;
int32 value;
int32 sig;
int32 size;
uchar used;
uchar thumb; // thumb code
uchar foreign; // called by arm if thumb, by thumb if arm
......@@ -470,13 +471,20 @@ int fninc(Sym *);
void thumbcount(void);
void reachable(void);
void fnptrs(void);
uint32 linuxheadr(void);
void linuxphdr(int type, int flags, vlong foff,
vlong vaddr, vlong paddr,
vlong filesize, vlong memsize, vlong align);
void linuxshdr(char *name, uint32 type, vlong flags, vlong addr, vlong off,
vlong size, uint32 link, uint32 info, vlong align, vlong entsize);
int linuxstrtable(void);
void doelf(void);
vlong addaddr(Sym *s, Sym *t);
vlong addsize(Sym *s, Sym *t);
vlong addstring(Sym *s, char *str);
vlong adduint16(Sym *s, uint16 v);
vlong adduint32(Sym *s, uint32 v);
vlong adduint64(Sym *s, uint64 v);
vlong adduint8(Sym *s, uint8 v);
vlong adduintxx(Sym *s, uint64 v, int wid);
/* Native is little-endian */
#define LPUT(a) lputl(a)
#define WPUT(a) wputl(a)
#define VPUT(a) abort()
#endif
......@@ -31,6 +31,7 @@
#define EXTERN
#include "l.h"
#include "../ld/lib.h"
#include "../ld/elf.h"
#include <ar.h>
#ifndef DEFAULT
......@@ -223,9 +224,11 @@ main(int argc, char *argv[])
INITRND = 1024;
break;
case 6: /* arm elf */
HEADR = linuxheadr();
debug['d'] = 1; // no dynamic linking
elfinit();
HEADR = ELFRESERVE;
if(INITTEXT == -1)
INITTEXT = 0x8000;
INITTEXT = 0x8000 + HEADR;
if(INITDAT == -1)
INITDAT = 0;
if(INITRND == -1)
......@@ -300,12 +303,15 @@ main(int argc, char *argv[])
doprof2();
if(debug['u'])
reachable();
doelf();
dodata();
if(seenthumb && debug['f'])
fnptrs();
follow();
if(firstp == P)
goto out;
if(firstp == P) {
diag("no code");
errorexit();
}
softfloat();
noops();
span();
......
......@@ -92,6 +92,7 @@ dodata(void)
}
while(v & 3)
v++;
s->size = v;
s->value = v;
if(v > MINSIZ)
continue;
......@@ -113,6 +114,7 @@ dodata(void)
continue;
}
v = s->value;
s->size = v;
s->value = orig;
orig += v;
}
......@@ -130,6 +132,7 @@ dodata(void)
if(s->type != SBSS)
continue;
v = s->value;
s->size = v;
s->value = orig;
orig += v;
}
......
......@@ -16,6 +16,7 @@
#define SYS_exit (SYS_BASE + 1)
#define SYS_write (SYS_BASE + 4)
#define SYS_gettimeofday (SYS_BASE + 78)
#define SYS_clone (SYS_BASE + 120)
#define SYS_mmap2 (SYS_BASE + 192)
#define SYS_gettid (SYS_BASE + 224)
......@@ -60,6 +61,33 @@ TEXT ·mmap(SB),7,$0
SWI $0
RET
TEXT gettime(SB),7,$32
/* dummy version - return 0,0 */
MOVW $0, R1
MOVW 0(FP), R0
MOVW R1, 0(R0)
MOVW R1, 4(R0)
MOVW 4(FP), R0
MOVW R1, 0(R0)
/*
attempt at real version - seg faults
MOVW $8(SP), R0
MOVW $0, R1
MOVW $SYS_gettimeofday, R7
SWI $0
MOVW 0(FP), R0 // sec
MOVW 8(SP), R1
MOVW R1, 0(R0)
MOVW 4(FP), R0 // usec
MOVW 12(SP), R1
MOVW R1, 0(R0)
*/
RET
// int32 futex(int32 *uaddr, int32 op, int32 val,
// struct timespec *timeout, int32 *uaddr2, int32 val2);
TEXT futex(SB),7,$0
......
......@@ -133,7 +133,6 @@ fixedbugs/bug120.go
fixedbugs/bug121.go
fixedbugs/bug122.go
fixedbugs/bug123.go
fixedbugs/bug125.go
fixedbugs/bug126.go
fixedbugs/bug127.go
fixedbugs/bug128.go
......@@ -171,7 +170,6 @@ fixedbugs/bug161.go
fixedbugs/bug163.go
fixedbugs/bug164.go
fixedbugs/bug165.go
fixedbugs/bug166.go
fixedbugs/bug167.go
fixedbugs/bug168.go
fixedbugs/bug169.go
......@@ -287,7 +285,6 @@ method3.go
named1.go
nil.go
parentype.go
peano.go
printbig.go
range.go
rename1.go
......@@ -304,4 +301,3 @@ turing.go
utf.go
varinit.go
vectors.go
x.go
=========== 64bit.go
BUG: 64bit
=========== chan/nonblock.go
PASS
=========== cmp2.go
comparing uncomparable type []int
throw: interface compare
panic PC=xxx
[1] Segmentation fault "${@}"
=========== cmp3.go
comparing uncomparable type []int
throw: interface compare
panic PC=xxx
[1] Segmentation fault "${@}"
=========== cmp4.go
hash of unhashable type []int
throw: interface hash
panic PC=xxx
[1] Segmentation fault "${@}"
=========== cmp5.go
hash of unhashable type []int
throw: interface hash
panic PC=xxx
[1] Segmentation fault "${@}"
=========== fixedbugs/bug016.go
fixedbugs/bug016.go:11: constant -3 overflows uint
=========== fixedbugs/bug027.go
hi
0 44444
1 3333
2 222
3 11
4 0
0 44444
1 3333
2 222
3 11
4 0
=========== fixedbugs/bug067.go
ok
=========== fixedbugs/bug070.go
outer loop top k 0
inner loop top i 0
do break
broke
=========== fixedbugs/bug081.go
fixedbugs/bug081.go:9: fatal error: typecheck loop
=========== fixedbugs/bug093.go
M
=========== fixedbugs/bug113.go
interface is int, not int32
throw: interface conversion
panic PC=xxx
[1] Segmentation fault "${@}"
=========== fixedbugs/bug120.go
Bad float64 const: 123.5 want 123.5 got %¤
[1] Segmentation fault "${@}"
BUG: bug120
=========== fixedbugs/bug148.go
2 3
interface is main.T, not main.T
throw: interface conversion
panic PC=xxx
[1] Segmentation fault "${@}"
=========== fixedbugs/bug154.go
??none??: $GOROOT/pkg/linux_arm/strconv.a: failed to load: os.ERANGE
BUG: should not panic
=========== fixedbugs/bug206.go
??none??: $GOROOT/pkg/linux_arm/strconv.a: failed to load: os.ERANGE
BUG: bug206
=========== helloworld.go
hello, world
=========== interface/fail.go
*main.S is not main.I: missing method Foo
throw: interface conversion
panic PC=xxx
[1] Segmentation fault "${@}"
=========== interface/returntype.go
*main.S is not main.I2: missing method Name
throw: interface conversion
panic PC=xxx
[1] Segmentation fault "${@}"
=========== ken/intervar.go
print 1 bio 2 file 3 -- abc
=========== ken/label.go
100
=========== ken/rob1.go
9876543210
=========== ken/rob2.go
(defn foo (add 12 34))
=========== ken/simpprint.go
hello world
=========== ken/simpswitch.go
0out01out12out2aout34out4fiveout56out6aout78out89out9
=========== ken/string.go
abcxyz-abcxyz-abcxyz-abcxyz-abcxyz-abcxyz-abcxyz
=========== printbig.go
-9223372036854775808
9223372036854775807
=========== sigchld.go
survived SIGCHLD
=========== turing.go
Hello World!
......@@ -89,10 +89,6 @@ done | # clean up some stack noise
/^\$RUNFILE: line 1: PID Trace\/breakpoint trap/d
/^qemu: uncaught target signal 11 (Segmentation fault) - exiting/d' > run.out
case $failed in
1)
echo FAIL
esac
rm -f $RUNFILE $TMP1FILE $TMP2FILE *.$A $A.out
diffmsg=""
if ! diff run.out golden.out
......@@ -106,4 +102,8 @@ inbugs=$(sed '1,/^== bugs/d' run.out | grep -c '^BUG')
echo 2>&1 $inbugs known bugs';' $notinbugs unexpected bugs$diffmsg
if [ "$failed" != "0" ]; then
echo FAILED
fi
exit $failed
......@@ -13,7 +13,7 @@ X386)
;;
Xarm)
export A=5
export E="qemu-arm -cpu cortex-a8 "
export E="${GORUN:-qemu-arm -cpu cortex-a8}"
;;
*)
echo 1>&2 run: unsupported '$GOARCH'
......@@ -42,20 +42,18 @@ do
dir=$(dirname $i)
export D=$dir
sed '/^\/\//!q' $i | sed 's@//@@; $d' |sed 's|./\$A.out|$E &|' >$RUNFILE
if ! sh $RUNFILE >$TMP1FILE 2>$TMP2FILE
if ! sh $RUNFILE >$TMP1FILE 2>&1
then
echo
echo "===========" $i
cat $TMP1FILE
cat $TMP2FILE
echo >&2 fail: $i
touch $FAILEDFILE
elif test -s $TMP1FILE || test -s $TMP2FILE
elif test -s $TMP1FILE
then
echo
echo "===========" $i
cat $TMP1FILE
cat $TMP2FILE
elif [ $dir = "bugs" ]
then
echo $i succeeded with no output.
......@@ -68,16 +66,27 @@ done | # clean up some stack noise
s/^pc: 0x[0-9a-f]*/pc: xxx/
/^Trace\/breakpoint trap/d
/^Trace\/BPT trap/d
s!'$GOROOT'!$GOROOT!g
/RUNFILE/ s/line 1: *[0-9]*/line 1: PID/
/^\$RUNFILE: line 1: PID Trace\/breakpoint trap/d
/^qemu: uncaught target signal 11 (Segmentation fault) - exiting/d' > run.out
failed=0
if test -f $FAILEDFILE; then
rm -f $RUNFILE $TMP1FILE $TMP2FILE *.$A $A.out
diffmsg=""
if ! diff run.out golden-arm.out
then
diffmsg="; test output differs"
failed=1
rm -f $FAILEDFILE
fi
rm -f $RUNFILE $TMP1FILE $TMP2FILE *.$A $A.out
notinbugs=$(sed '/^== bugs/q' run.out | grep -c '^BUG')
inbugs=$(sed '1,/^== bugs/d' run.out | grep -c '^BUG')
echo 2>&1 $inbugs known bugs';' $notinbugs unexpected bugs$diffmsg
if [ "$failed" != "0" ]; then
echo FAILED
fi
exit $failed
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment