Skip to content

Commit

Permalink
Disable the 'cross' build on AArch64
Browse files Browse the repository at this point in the history
AArch64 platform doesn't support the `build.all` command due to the
`hypriot/qemu-register` issue, so we disable this kind of 'cross' build
on AArch64 platform.

Signed-off-by: Dennis Chen <[email protected]>
  • Loading branch information
arm64b committed Apr 26, 2018
1 parent e11b3d8 commit 4679fe5
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 13 deletions.
26 changes: 13 additions & 13 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,19 @@ You can also run the build for all supported platforms:
make -j4 build.all
```

See instructions below for setting up the build environment to support `arm` and `arm64` platforms.
Currently, only `amd64` platform supports this kind of 'cross' build. In order to make `build.all` succeed, we need to follow the steps specified by the below section
`Building for other platforms` first.

We suggest to use native `build` to create the binaries and container images on `arm{32,64}` platform, but if you do want to build those `arm{32,64}` binaries and images
on `amd64` platform with `build.all` command, please make sure the multi-arch feature is supported. To test run the following:

```
> docker run --rm -ti arm32v7/ubuntu uname -a
Linux bad621a75757 4.8.0-58-generic #63~16.04.1-Ubuntu SMP Mon Jun 26 18:08:51 UTC 2017 armv7l armv7l armv7l GNU/Linux
> docker run --rm -ti arm64v8/ubuntu uname -a
Linux f51ea93e76a2 4.8.0-58-generic #63~16.04.1-Ubuntu SMP Mon Jun 26 18:08:51 UTC 2017 aarch64 aarch64 aarch64 GNU/Linux
```

Run `make help` for more options.

Expand Down Expand Up @@ -99,18 +111,6 @@ EOF
systemctl enable update-binfmt.service
```

### Checking if multi-arch is supported

To test run the following:

```
> docker run --rm -ti arm32v7/ubuntu uname -a
Linux bad621a75757 4.8.0-58-generic #63~16.04.1-Ubuntu SMP Mon Jun 26 18:08:51 UTC 2017 armv7l armv7l armv7l GNU/Linux
> docker run --rm -ti arm64v8/ubuntu uname -a
Linux f51ea93e76a2 4.8.0-58-generic #63~16.04.1-Ubuntu SMP Mon Jun 26 18:08:51 UTC 2017 aarch64 aarch64 aarch64 GNU/Linux
```

# Improving Build Speed

## Apt Package Caching
Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ endif
@$(MAKE) -C images PLATFORM=linux_$(GOHOSTARCH)

build.all: build.common
ifneq ($(GOHOSTARCH),amd64)
$(error cross platform image build only supported on amd64 host currently)
endif
@$(MAKE) do.build.parallel
@$(MAKE) -C images build.all

Expand Down
4 changes: 4 additions & 0 deletions build/run
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ if [ ! -z $DOCKER_HOST ]; then
fi

# build the the container if we've not done so already
if [ "`uname -m`" != "x86_64" ]; then
echo ERROR: we only support the cross container build on amd64 host.
exit 1
fi
echo ==== building the cross container \(this could take minutes the first time\)
make_cmd="make --no-print-directory -C ${scriptdir}/../images cross PULL=0"
make_output=$($make_cmd 2>&1) || {
Expand Down

0 comments on commit 4679fe5

Please sign in to comment.