Merge pull request #1886 from avagin:arm64-travis-ci
PiperOrigin-RevId: 296975376
This commit is contained in:
commit
93626a28e4
19
.travis.yml
19
.travis.yml
|
@ -0,0 +1,19 @@
|
||||||
|
language: minimal
|
||||||
|
sudo: required
|
||||||
|
dist: xenial
|
||||||
|
cache:
|
||||||
|
directories:
|
||||||
|
- /home/travis/.cache/bazel/
|
||||||
|
services:
|
||||||
|
- docker
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- os: linux
|
||||||
|
arch: amd64
|
||||||
|
env: RUNSC_PATH=./bazel-bin/runsc/linux_amd64_pure_stripped/runsc
|
||||||
|
- os: linux
|
||||||
|
arch: arm64
|
||||||
|
env: RUNSC_PATH=./bazel-bin/runsc/linux_arm64_pure_stripped/runsc
|
||||||
|
script:
|
||||||
|
- uname -a
|
||||||
|
- make DOCKER_RUN_OPTIONS="" BAZEL_OPTIONS="build runsc:runsc" bazel && $RUNSC_PATH --alsologtostderr --network none --debug --TESTONLY-unsafe-nonroot=true --rootless do ls
|
11
Dockerfile
11
Dockerfile
|
@ -1,8 +1,9 @@
|
||||||
FROM ubuntu:bionic
|
FROM fedora:31
|
||||||
|
|
||||||
RUN apt-get update && apt-get install -y curl gnupg2 git python python3 python3-distutils python3-pip
|
RUN dnf install -y dnf-plugins-core && dnf copr enable -y vbatts/bazel
|
||||||
RUN echo "deb [arch=amd64] http://storage.googleapis.com/bazel-apt stable jdk1.8" | tee /etc/apt/sources.list.d/bazel.list && \
|
|
||||||
curl https://bazel.build/bazel-release.pub.gpg | apt-key add -
|
RUN dnf install -y bazel2 git gcc make golang gcc-c++ glibc-devel python3 which python3-pip python3-devel libffi-devel openssl-devel pkg-config glibc-static
|
||||||
RUN apt-get update && apt-get install -y bazel && apt-get clean
|
|
||||||
|
RUN pip install pycparser
|
||||||
|
|
||||||
WORKDIR /gvisor
|
WORKDIR /gvisor
|
||||||
|
|
5
Makefile
5
Makefile
|
@ -2,6 +2,9 @@ UID := $(shell id -u ${USER})
|
||||||
GID := $(shell id -g ${USER})
|
GID := $(shell id -g ${USER})
|
||||||
GVISOR_BAZEL_CACHE := $(shell readlink -f ~/.cache/bazel/)
|
GVISOR_BAZEL_CACHE := $(shell readlink -f ~/.cache/bazel/)
|
||||||
|
|
||||||
|
# The --privileged is required to run tests.
|
||||||
|
DOCKER_RUN_OPTIONS ?= --privileged
|
||||||
|
|
||||||
all: runsc
|
all: runsc
|
||||||
|
|
||||||
docker-build:
|
docker-build:
|
||||||
|
@ -19,7 +22,7 @@ bazel-server-start: docker-build
|
||||||
-v "$(CURDIR):$(CURDIR)" \
|
-v "$(CURDIR):$(CURDIR)" \
|
||||||
--workdir "$(CURDIR)" \
|
--workdir "$(CURDIR)" \
|
||||||
--tmpfs /tmp:rw,exec \
|
--tmpfs /tmp:rw,exec \
|
||||||
--privileged \
|
$(DOCKER_RUN_OPTIONS) \
|
||||||
gvisor-bazel \
|
gvisor-bazel \
|
||||||
sh -c "while :; do sleep 100; done" && \
|
sh -c "while :; do sleep 100; done" && \
|
||||||
docker exec --user 0:0 -i gvisor-bazel sh -c "groupadd --gid $(GID) --non-unique gvisor && useradd --uid $(UID) --non-unique --gid $(GID) -d $(HOME) gvisor"
|
docker exec --user 0:0 -i gvisor-bazel sh -c "groupadd --gid $(GID) --non-unique gvisor && useradd --uid $(UID) --non-unique --gid $(GID) -d $(HOME) gvisor"
|
||||||
|
|
|
@ -74,7 +74,7 @@ void ExitGroup32(const char instruction[2], int code) {
|
||||||
"int $3\n"
|
"int $3\n"
|
||||||
:
|
:
|
||||||
: [ code ] "m"(code), [ ip ] "d"(m.ptr())
|
: [ code ] "m"(code), [ ip ] "d"(m.ptr())
|
||||||
: "rax", "rbx", "rsp");
|
: "rax", "rbx");
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr int kExitCode = 42;
|
constexpr int kExitCode = 42;
|
||||||
|
|
|
@ -15,14 +15,9 @@
|
||||||
#ifndef GVISOR_TEST_SYSCALLS_LINUX_RSEQ_UAPI_H_
|
#ifndef GVISOR_TEST_SYSCALLS_LINUX_RSEQ_UAPI_H_
|
||||||
#define GVISOR_TEST_SYSCALLS_LINUX_RSEQ_UAPI_H_
|
#define GVISOR_TEST_SYSCALLS_LINUX_RSEQ_UAPI_H_
|
||||||
|
|
||||||
// User-kernel ABI for restartable sequences.
|
#include <stdint.h>
|
||||||
|
|
||||||
// Standard types.
|
// User-kernel ABI for restartable sequences.
|
||||||
//
|
|
||||||
// N.B. This header will be included in targets that do have the standard
|
|
||||||
// library, so we can't shadow the standard type names.
|
|
||||||
using __u32 = __UINT32_TYPE__;
|
|
||||||
using __u64 = __UINT64_TYPE__;
|
|
||||||
|
|
||||||
#ifdef __x86_64__
|
#ifdef __x86_64__
|
||||||
// Syscall numbers.
|
// Syscall numbers.
|
||||||
|
@ -32,20 +27,20 @@ constexpr int kRseqSyscall = 334;
|
||||||
#endif // __x86_64__
|
#endif // __x86_64__
|
||||||
|
|
||||||
struct rseq_cs {
|
struct rseq_cs {
|
||||||
__u32 version;
|
uint32_t version;
|
||||||
__u32 flags;
|
uint32_t flags;
|
||||||
__u64 start_ip;
|
uint64_t start_ip;
|
||||||
__u64 post_commit_offset;
|
uint64_t post_commit_offset;
|
||||||
__u64 abort_ip;
|
uint64_t abort_ip;
|
||||||
} __attribute__((aligned(4 * sizeof(__u64))));
|
} __attribute__((aligned(4 * sizeof(uint64_t))));
|
||||||
|
|
||||||
// N.B. alignment is enforced by the kernel.
|
// N.B. alignment is enforced by the kernel.
|
||||||
struct rseq {
|
struct rseq {
|
||||||
__u32 cpu_id_start;
|
uint32_t cpu_id_start;
|
||||||
__u32 cpu_id;
|
uint32_t cpu_id;
|
||||||
struct rseq_cs* rseq_cs;
|
struct rseq_cs* rseq_cs;
|
||||||
__u32 flags;
|
uint32_t flags;
|
||||||
} __attribute__((aligned(4 * sizeof(__u64))));
|
} __attribute__((aligned(4 * sizeof(uint64_t))));
|
||||||
|
|
||||||
constexpr int kRseqFlagUnregister = 1 << 0;
|
constexpr int kRseqFlagUnregister = 1 << 0;
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,10 @@
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
|
#ifndef SIOCGSTAMP
|
||||||
|
#include <linux/sockios.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "gtest/gtest.h"
|
#include "gtest/gtest.h"
|
||||||
#include "absl/base/macros.h"
|
#include "absl/base/macros.h"
|
||||||
#include "absl/time/clock.h"
|
#include "absl/time/clock.h"
|
||||||
|
|
Loading…
Reference in New Issue