Skip to content

Commit 03e3ef8

Browse files
author
Octavian Purdila
committed
Merge pull request #88 from libos-nuse/arm-ci
[RFC] lkl: add arm-linux-androidabi- cross build
2 parents 65d870d + 023fa73 commit 03e3ef8

File tree

4 files changed

+20
-9
lines changed

4 files changed

+20
-9
lines changed

circle.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,17 @@ general:
55
machine:
66
# Add some environment variables
77
environment:
8-
CROSS_COMPILE: $([[ $CIRCLE_NODE_INDEX -eq 1 ]] && echo 'i686-w64-mingw32-')
8+
CROSS_COMPILE: $(case $CIRCLE_NODE_INDEX in 0) host='' ;; 1) host='i686-w64-mingw32-' ;; 2) host='arm-linux-androideabi-' ;; esac; echo $host)
9+
PATH: /home/ubuntu/android-toolchain/bin:${PATH}
910

1011
## Customize dependencies
1112
dependencies:
1213
pre:
13-
- sudo apt-get update; sudo apt-get install bc libfuse-dev libarchive-dev xfsprogs valgrind gcc-mingw-w64-i686 wine
14+
# required for 14.04 container
15+
# - sudo dpkg --add-architecture i386
16+
- sudo apt-get update; sudo apt-get install bc libfuse-dev libarchive-dev xfsprogs valgrind gcc-mingw-w64-i686 wine qemu-user-static
17+
- /usr/local/android-ndk/build/tools/make-standalone-toolchain.sh --platform=android-21 --install-dir=/home/ubuntu/android-toolchain --arch=arm
18+
1419

1520
test:
1621
pre:
@@ -22,8 +27,10 @@ test:
2227
parallel: true
2328
- cd tools/lkl && make -j8:
2429
parallel: true
25-
- cd tools/lkl && make test:
30+
- cd tools/lkl && if [ $CIRCLE_NODE_INDEX -eq 2 ] ; then make tests/boot-in.o; arm-linux-androideabi-gcc -o tests/boot tests/boot-in.o liblkl.a -static ; fi:
2631
parallel: true
32+
- cd tools/lkl && make test:
33+
parallel: true
2734

2835
- ? >
2936
if [ -n "${RUN_NIGHTLY_BUILD}" ]; then

tools/lkl/Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ $(TEST_TARGETS): tests/boot
9494

9595
# because of libdl, liblkl-hijack will not compile on windows
9696
# fortunately, the test target will handle a missing libhijack.so correctly
97-
ifeq (,$(filter $(OUTPUT_FORMAT),pe-i386))
97+
ifeq (,$(filter $(OUTPUT_FORMAT),pe-i386 elf32-littlearm))
9898
test: liblkl-hijack$(SOSUF)
9999
endif
100100

@@ -117,7 +117,8 @@ cpfromfs$(EXESUF): cptofs$(EXESUF)
117117

118118
# because of argp and fuse, none of the binaries will compile on windows
119119
# because of libdl, liblkl-hijack will not compile on windows
120-
ifneq (,$(filter $(OUTPUT_FORMAT),pe-i386))
120+
# arm-android neither for the moment
121+
ifneq (,$(filter $(OUTPUT_FORMAT),pe-i386 elf32-littlearm))
121122
all: $(filter-out liblkl-hijack$(SOSUF), $(ALL_LIBRARIES))
122123
else
123124
all: $(ALL_PROGRAMS) $(ALL_LIBRARIES)

tools/lkl/lib/posix-host.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ static void panic(void)
266266
assert(0);
267267
}
268268

269-
static long gettid(void)
269+
static long _gettid(void)
270270
{
271271
return syscall(SYS_gettid);
272272
}
@@ -298,7 +298,7 @@ struct lkl_host_operations lkl_host_ops = {
298298
.ioremap = lkl_ioremap,
299299
.iomem_access = lkl_iomem_access,
300300
.virtio_devices = lkl_virtio_devs,
301-
.gettid = gettid,
301+
.gettid = _gettid,
302302
};
303303

304304
static int fd_get_capacity(union lkl_disk disk, unsigned long long *res)

tools/lkl/tests/boot.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,13 @@ if [ -c /dev/net/tun ]; then
2424
fi;
2525

2626
if file ./boot | grep PE32; then
27-
WINE=wine
27+
WRAP=wine
28+
elif file ./boot | grep ARM; then
29+
WRAP=qemu-arm-static
2830
fi
2931

30-
${TEST_CMD} $WINE ./boot -d $file -t $fstype $tap_args $LKL_TEST_DEBUG $@ || err=$?
32+
33+
${TEST_CMD} $WRAP ./boot -d $file -t $fstype $tap_args $LKL_TEST_DEBUG $@ || err=$?
3134

3235
if [ -c /dev/net/tun ]; then
3336
sudo ip tuntap del dev lkl_boot mode tap || true

0 commit comments

Comments
 (0)