* [LTP] [RFC PATCH 0/2] travis: Cross-compile ARM builds
@ 2017-12-12 17:45 Petr Vorel
2017-12-12 17:45 ` [LTP] [RFC PATCH 1/2] build.sh: Add cross-compile build option Petr Vorel
2017-12-12 17:45 ` [LTP] [RFC PATCH 2/2] travis: Add 2x cross-compile ARM build Petr Vorel
0 siblings, 2 replies; 7+ messages in thread
From: Petr Vorel @ 2017-12-12 17:45 UTC (permalink / raw)
To: ltp
Hi,
last patch-set for travis, adding cross-compile ARM builds (32-bit and 64-bit).
Both builds are in-tree, as out-of-tree build is tested by 2 native builds.
NOTE: It might be possible to add foreign architecture to ubuntu and install
other libraries and headers to do build with full dependencies, but I haven't
tested it.
See the result:
https://travis-ci.org/pevik-travis/ltp/builds/315469420
Kind regards,
Petr
Petr Vorel (2):
build.sh: Add cross-compile build option
travis: Add 2x cross-compile ARM build
.travis.yml | 33 ++++++++++++++++-----------------
build.sh | 15 ++++++++++++++-
2 files changed, 30 insertions(+), 18 deletions(-)
--
2.15.0
^ permalink raw reply [flat|nested] 7+ messages in thread
* [LTP] [RFC PATCH 1/2] build.sh: Add cross-compile build option
2017-12-12 17:45 [LTP] [RFC PATCH 0/2] travis: Cross-compile ARM builds Petr Vorel
@ 2017-12-12 17:45 ` Petr Vorel
2017-12-12 17:45 ` [LTP] [RFC PATCH 2/2] travis: Add 2x cross-compile ARM build Petr Vorel
1 sibling, 0 replies; 7+ messages in thread
From: Petr Vorel @ 2017-12-12 17:45 UTC (permalink / raw)
To: ltp
It requires to set CROSS_COMPILE or CC variable.
Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
build.sh | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/build.sh b/build.sh
index b0d0fb156..29da4d29e 100755
--- a/build.sh
+++ b/build.sh
@@ -26,10 +26,21 @@ build_32()
build_native()
{
- echo "===== native in tree build into $PREFIX ====="
+ echo "===== native in-tree build into $PREFIX ====="
build_in_tree
}
+build_cross()
+{
+ local host="${CROSS_COMPILE%-}"
+ [ -n "$host" ] || host="${CC%-gcc}"
+ [ -n "$host" ] || \
+ { echo "Missing CROSS_COMPILE and CC variables. You need to set at least one" >&2; exit 1; }
+
+ echo "===== cross-compile ${host} in-tree build into $PREFIX ====="
+ build_in_tree "--host=$host" CROSS_COMPILE="${host}-"
+}
+
build_out_tree()
{
local tree="$PWD"
@@ -90,6 +101,7 @@ Options:
BUILD TYPES:
32 32-bit in-tree build
+cross cross-compile in-tree build (requires to set CROSS_COMPILE or CC variable)
native native in-tree build
out out-of-tree build
@@ -100,6 +112,7 @@ EOF
case "$1" in
-h|--help|help) usage; exit 0;;
32) build="build_32";;
+ cross) build="build_cross";;
out) build="build_out_tree";;
*) build="build_native";;
esac
--
2.15.0
^ permalink raw reply related [flat|nested] 7+ messages in thread* [LTP] [RFC PATCH 2/2] travis: Add 2x cross-compile ARM build
2017-12-12 17:45 [LTP] [RFC PATCH 0/2] travis: Cross-compile ARM builds Petr Vorel
2017-12-12 17:45 ` [LTP] [RFC PATCH 1/2] build.sh: Add cross-compile build option Petr Vorel
@ 2017-12-12 17:45 ` Petr Vorel
2017-12-13 13:58 ` Cyril Hrubis
1 sibling, 1 reply; 7+ messages in thread
From: Petr Vorel @ 2017-12-12 17:45 UTC (permalink / raw)
To: ltp
Use arm-linux-gnueabihf-gcc and aarch64-linux-gnu-gcc compilers.
Cross-compile builds have just minimal dependencies (kernel and glibc
headers).
Builds replace native gcc-4.9 and gcc-6 builds to keep max 10 build
jobs in travis.
Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
.travis.yml | 33 ++++++++++++++++-----------------
1 file changed, 16 insertions(+), 17 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index 2087e4174..74838be7c 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -4,14 +4,6 @@ matrix:
include:
# normal native in-tree builds
- - os: linux
- env: BUILD="native" INSTALL_PACKAGES="$BUILD"
- compiler: gcc-4.9
- addons:
- apt:
- sources: ['ubuntu-toolchain-r-test']
- packages: ['gcc-4.9']
-
- os: linux
env: BUILD="native" INSTALL_PACKAGES="$BUILD"
compiler: gcc-5
@@ -20,14 +12,6 @@ matrix:
sources: ['ubuntu-toolchain-r-test']
packages: ['gcc-5']
- - os: linux
- env: BUILD="native" INSTALL_PACKAGES="$BUILD"
- compiler: gcc-6
- addons:
- apt:
- sources: ['ubuntu-toolchain-r-test']
- packages: ['gcc-6']
-
- os: linux
env: BUILD="native" INSTALL_PACKAGES="$BUILD"
compiler: gcc-7
@@ -87,6 +71,21 @@ matrix:
sources: ['ubuntu-toolchain-r-test']
packages: ['gcc-7']
+ # cross-compile ARM builds
+ - os: linux
+ env: BUILD="cross" INSTALL_PACKAGES="$BUILD"
+ compiler: arm-linux-gnueabihf-gcc
+ addons:
+ apt:
+ packages: ['gcc-arm-linux-gnueabihf', 'libc6-dev-armhf-cross']
+
+ - os: linux
+ env: BUILD="cross" INSTALL_PACKAGES="$BUILD"
+ compiler: aarch64-linux-gnu-gcc
+ addons:
+ apt:
+ packages: ['gcc-aarch64-linux-gnu', 'libc6-dev-arm64-cross']
+
notifications:
email:
secure: "b/xcA/K5OyQvPPnd0PRahTH5LJu8lgz8goGHvhXpHo+ZPsPgTDXNFo5cX9fSOkMuFKeoW8iGl0wOgK2+ptc8mbYDw277K4RFIHRHeV/KIoE1EzjQnEFiL8J0oHCAvDj12o0AXeriTyY9gICXKbR31Br6Zh5eKViDJe2OAGeHeDU="
@@ -95,7 +94,7 @@ before_install:
# installing / removing dependencies
- if [ "$INSTALL_PACKAGES" = "" ]; then
sudo apt remove $(cat .travis.packages_native | grep -v -e 'libc6' -e 'libc6-dev' -e 'linux-libc-dev' -e 'libacl1')
- ; else
+ ; elif [ "$INSTALL_PACKAGES" != "cross" ]; then
sudo apt install -qq $(cat .travis.packages_native)
; fi
--
2.15.0
^ permalink raw reply related [flat|nested] 7+ messages in thread* [LTP] [RFC PATCH 2/2] travis: Add 2x cross-compile ARM build
2017-12-12 17:45 ` [LTP] [RFC PATCH 2/2] travis: Add 2x cross-compile ARM build Petr Vorel
@ 2017-12-13 13:58 ` Cyril Hrubis
2017-12-13 14:25 ` Petr Vorel
0 siblings, 1 reply; 7+ messages in thread
From: Cyril Hrubis @ 2017-12-13 13:58 UTC (permalink / raw)
To: ltp
Hi!
> Builds replace native gcc-4.9 and gcc-6 builds to keep max 10 build
> jobs in travis.
So the cross compilers are gcc-4.x and gcc-6.x? I ask since we just ask
for arm cross compilers without a version in the script below.
I that is true I suppose that the cross compiler versions may change
without us noticing, which is not that big deal but it may be better to
select specific version instead if possible.
--
Cyril Hrubis
chrubis@suse.cz
^ permalink raw reply [flat|nested] 7+ messages in thread
* [LTP] [RFC PATCH 2/2] travis: Add 2x cross-compile ARM build
2017-12-13 13:58 ` Cyril Hrubis
@ 2017-12-13 14:25 ` Petr Vorel
2017-12-13 16:06 ` Cyril Hrubis
0 siblings, 1 reply; 7+ messages in thread
From: Petr Vorel @ 2017-12-13 14:25 UTC (permalink / raw)
To: ltp
Hi Cyril,
> So the cross compilers are gcc-4.x and gcc-6.x? I ask since we just ask
> for arm cross compilers without a version in the script below.
Versions are 4.8.4 for both. It's actually visible in the log:
https://travis-ci.org/pevik-travis/ltp/jobs/315469429
$ arm-linux-gnueabihf-gcc --version
arm-linux-gnueabihf-gcc (Ubuntu/Linaro 4.8.4-2ubuntu1~14.04.1) 4.8.4
Copyright (C) 2013 Free Software Foundation, Inc.
https://travis-ci.org/pevik-travis/ltp/jobs/315469430
$ aarch64-linux-gnu-gcc --version
aarch64-linux-gnu-gcc (Ubuntu/Linaro 4.8.4-2ubuntu1~14.04.1) 4.8.4
> I that is true I suppose that the cross compiler versions may change
> without us noticing, which is not that big deal but it may be better to
> select specific version instead if possible.
The reason why it's not fixed is that it's possible only with special repository
ubuntu-toolchain-r-test, which is used for other jobs. AFAIK they don't provide arm
toolchain, that's why I used standard trusty repository for ARM.
So is that ok as it is?
Kind regards,
Petr
^ permalink raw reply [flat|nested] 7+ messages in thread
* [LTP] [RFC PATCH 2/2] travis: Add 2x cross-compile ARM build
2017-12-13 14:25 ` Petr Vorel
@ 2017-12-13 16:06 ` Cyril Hrubis
2017-12-14 19:04 ` Petr Vorel
0 siblings, 1 reply; 7+ messages in thread
From: Cyril Hrubis @ 2017-12-13 16:06 UTC (permalink / raw)
To: ltp
Hi!
> > So the cross compilers are gcc-4.x and gcc-6.x? I ask since we just ask
> > for arm cross compilers without a version in the script below.
> Versions are 4.8.4 for both. It's actually visible in the log:
>
> https://travis-ci.org/pevik-travis/ltp/jobs/315469429
> $ arm-linux-gnueabihf-gcc --version
> arm-linux-gnueabihf-gcc (Ubuntu/Linaro 4.8.4-2ubuntu1~14.04.1) 4.8.4
> Copyright (C) 2013 Free Software Foundation, Inc.
>
> https://travis-ci.org/pevik-travis/ltp/jobs/315469430
> $ aarch64-linux-gnu-gcc --version
> aarch64-linux-gnu-gcc (Ubuntu/Linaro 4.8.4-2ubuntu1~14.04.1) 4.8.4
>
> > I that is true I suppose that the cross compiler versions may change
> > without us noticing, which is not that big deal but it may be better to
> > select specific version instead if possible.
> The reason why it's not fixed is that it's possible only with special repository
> ubuntu-toolchain-r-test, which is used for other jobs. AFAIK they don't provide arm
> toolchain, that's why I used standard trusty repository for ARM.
>
> So is that ok as it is?
I guess so.
It's a smoke test so we have to keep the number of build reasonably
small and having arm builds is agruably more important than all possible
gcc flavors. Moreover we still run gcc-4.9 and gcc-6 for 32bit builds
right?
--
Cyril Hrubis
chrubis@suse.cz
^ permalink raw reply [flat|nested] 7+ messages in thread
* [LTP] [RFC PATCH 2/2] travis: Add 2x cross-compile ARM build
2017-12-13 16:06 ` Cyril Hrubis
@ 2017-12-14 19:04 ` Petr Vorel
0 siblings, 0 replies; 7+ messages in thread
From: Petr Vorel @ 2017-12-14 19:04 UTC (permalink / raw)
To: ltp
Hi!
> > > So the cross compilers are gcc-4.x and gcc-6.x? I ask since we just ask
> > > for arm cross compilers without a version in the script below.
> > Versions are 4.8.4 for both. It's actually visible in the log:
> > https://travis-ci.org/pevik-travis/ltp/jobs/315469429
> > $ arm-linux-gnueabihf-gcc --version
> > arm-linux-gnueabihf-gcc (Ubuntu/Linaro 4.8.4-2ubuntu1~14.04.1) 4.8.4
> > Copyright (C) 2013 Free Software Foundation, Inc.
> > https://travis-ci.org/pevik-travis/ltp/jobs/315469430
> > $ aarch64-linux-gnu-gcc --version
> > aarch64-linux-gnu-gcc (Ubuntu/Linaro 4.8.4-2ubuntu1~14.04.1) 4.8.4
> > > I that is true I suppose that the cross compiler versions may change
> > > without us noticing, which is not that big deal but it may be better to
> > > select specific version instead if possible.
> > The reason why it's not fixed is that it's possible only with special repository
> > ubuntu-toolchain-r-test, which is used for other jobs. AFAIK they don't provide arm
> > toolchain, that's why I used standard trusty repository for ARM.
> > So is that ok as it is?
> I guess so.
> It's a smoke test so we have to keep the number of build reasonably
> small and having arm builds is agruably more important than all possible
> gcc flavors. Moreover we still run gcc-4.9 and gcc-6 for 32bit builds
> right?
Yes, we do.
Kind regards,
Petr
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2017-12-14 19:04 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-12 17:45 [LTP] [RFC PATCH 0/2] travis: Cross-compile ARM builds Petr Vorel
2017-12-12 17:45 ` [LTP] [RFC PATCH 1/2] build.sh: Add cross-compile build option Petr Vorel
2017-12-12 17:45 ` [LTP] [RFC PATCH 2/2] travis: Add 2x cross-compile ARM build Petr Vorel
2017-12-13 13:58 ` Cyril Hrubis
2017-12-13 14:25 ` Petr Vorel
2017-12-13 16:06 ` Cyril Hrubis
2017-12-14 19:04 ` Petr Vorel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox