summaryrefslogtreecommitdiffstats
path: root/meta/lib/oeqa/sdk
diff options
context:
space:
mode:
authorRoss Burton <ross@burtonini.com>2021-08-17 23:37:55 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-08-18 17:01:06 +0100
commit8ab0f43fdac1210dd216f1564721278113faec7f (patch)
tree601088fd27482dfb4ab4fb6284270df82aa63b0f /meta/lib/oeqa/sdk
parent33cb14f6a0dbaf81baf97d2b321474f6e8cbf1e1 (diff)
downloadpoky-8ab0f43fdac1210dd216f1564721278113faec7f.tar.gz
oeqa/sdk: add relocation test for buildtools
The buildtools-extended tarball includes GCC, which relies on being relocated correctly to work. Add a test case that verifies that the loader paths have all been relocated, as otherwise there are hard-to-debug errors at build time. (From OE-Core rev: fe1f675ea156722a3709b13cd751479c9528134d) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/sdk')
-rw-r--r--meta/lib/oeqa/sdk/buildtools-cases/gcc.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/meta/lib/oeqa/sdk/buildtools-cases/gcc.py b/meta/lib/oeqa/sdk/buildtools-cases/gcc.py
new file mode 100644
index 0000000000..36ba15b134
--- /dev/null
+++ b/meta/lib/oeqa/sdk/buildtools-cases/gcc.py
@@ -0,0 +1,29 @@
1#
2# SPDX-License-Identifier: MIT
3#
4
5import os.path
6from oeqa.sdk.case import OESDKTestCase
7
8class GccTests(OESDKTestCase):
9 def test_verify_specs(self):
10 """
11 Verify that the compiler has been relocated successfully and isn't
12 looking in the hard-coded prefix.
13 """
14 # Canonicalise the SDK root
15 sdk_base = os.path.realpath(self.tc.sdk_dir)
16 # Canonicalise the location of GCC
17 gcc_path = os.path.realpath(self._run("command -v gcc").strip())
18 # Skip the test if the GCC didn't come from the buildtools, as it only
19 # comes with buildtools-extended-tarball.
20 if os.path.commonprefix((sdk_base, gcc_path)) != sdk_base:
21 self.skipTest("Buildtools does not provide GCC")
22
23 # This is the prefix that GCC is build with, and should be replaced at
24 # installation time.
25 sdkpath = self.td.get("SDKPATH")
26 self.assertTrue(sdkpath)
27
28 for line in self._run('gcc -dumpspecs').splitlines():
29 self.assertNotIn(sdkpath, line)