summaryrefslogtreecommitdiffstats
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:00:16 +0100
commitfe1f675ea156722a3709b13cd751479c9528134d (patch)
tree0e12c1385552fefac503cfee7265606f8f7f2b23
parent8a2bfc9da626597e915b774e1dca95ae2929014f (diff)
downloadopenembedded-core-contrib-fe1f675ea156722a3709b13cd751479c9528134d.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. Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-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 @@
+#
+# SPDX-License-Identifier: MIT
+#
+
+import os.path
+from oeqa.sdk.case import OESDKTestCase
+
+class GccTests(OESDKTestCase):
+ def test_verify_specs(self):
+ """
+ Verify that the compiler has been relocated successfully and isn't
+ looking in the hard-coded prefix.
+ """
+ # Canonicalise the SDK root
+ sdk_base = os.path.realpath(self.tc.sdk_dir)
+ # Canonicalise the location of GCC
+ gcc_path = os.path.realpath(self._run("command -v gcc").strip())
+ # Skip the test if the GCC didn't come from the buildtools, as it only
+ # comes with buildtools-extended-tarball.
+ if os.path.commonprefix((sdk_base, gcc_path)) != sdk_base:
+ self.skipTest("Buildtools does not provide GCC")
+
+ # This is the prefix that GCC is build with, and should be replaced at
+ # installation time.
+ sdkpath = self.td.get("SDKPATH")
+ self.assertTrue(sdkpath)
+
+ for line in self._run('gcc -dumpspecs').splitlines():
+ self.assertNotIn(sdkpath, line)