Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH 0/3] Misc toolchain patches
@ 2014-07-31  1:16 Mark Hatle
  2014-07-31  1:16 ` [PATCH 1/3] gcc: Fix gcc-multilib-config comparison Mark Hatle
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Mark Hatle @ 2014-07-31  1:16 UTC (permalink / raw)
  To: openembedded-core

A few misc toolchain fixes/patches.  This serials corrects a couple of issues
noticed when working with an external binary toolchain, as well as when
generating an SDK.

The following changes since commit 7986adeac16550b33f65fded39a55f668e0e543f:

  populate_sdk_base: Fix grep command usage on old hosts (2014-07-29 09:57:54 +0100)

are available in the git repository at:

  git://git.yoctoproject.org/poky-contrib mhatle/tc
  http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=mhatle/tc

Mark Hatle (3):
  gcc: Fix gcc-multilib-config comparison
  tune-mips*: Ensure tunes are inherited in order
  sanity.bbclass: Add ability to verify toolchain flags

 meta/classes/sanity.bbclass                       | 52 ++++++++++++++++++++---
 meta/conf/machine/include/tune-mips32r2.inc       |  2 +-
 meta/conf/machine/include/tune-mips64.inc         |  2 +-
 meta/recipes-devtools/gcc/gcc-multilib-config.inc |  2 +-
 4 files changed, 49 insertions(+), 9 deletions(-)

-- 
1.9.3



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 1/3] gcc: Fix gcc-multilib-config comparison
  2014-07-31  1:16 [PATCH 0/3] Misc toolchain patches Mark Hatle
@ 2014-07-31  1:16 ` Mark Hatle
  2014-07-31  1:16 ` [PATCH 2/3] tune-mips*: Ensure tunes are inherited in order Mark Hatle
  2014-07-31  1:16 ` [PATCH 3/3] sanity.bbclass: Add ability to verify toolchain flags Mark Hatle
  2 siblings, 0 replies; 4+ messages in thread
From: Mark Hatle @ 2014-07-31  1:16 UTC (permalink / raw)
  To: openembedded-core

Fix an issue on a multilib configuration that contains more then 1 multilib.

I.e. on MIPS64:

DEFAULTTUNE = "mips64"
MULTILIBS = "lib32n:mips64_n32 lib32:mips32"

While normally you'd use 'libn32', the above is legal.

With the startswith code, the system will look to expand the 'lib32' element
and find the 'lib32n' instead, and will result in a warning:

lib32 doesn't have a corresponding tune. Skipping...

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
---
 meta/recipes-devtools/gcc/gcc-multilib-config.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/recipes-devtools/gcc/gcc-multilib-config.inc b/meta/recipes-devtools/gcc/gcc-multilib-config.inc
index b8c705a..6134097 100644
--- a/meta/recipes-devtools/gcc/gcc-multilib-config.inc
+++ b/meta/recipes-devtools/gcc/gcc-multilib-config.inc
@@ -152,7 +152,7 @@ python gcc_multilib_setup() {
     if mlprefix:
         mlindex = 0
         for ml in multilibs:
-            if mlprefix.startswith(ml):
+            if mlprefix == ml + '-':
                 break
             mlindex += 1
 
-- 
1.9.3



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/3] tune-mips*: Ensure tunes are inherited in order
  2014-07-31  1:16 [PATCH 0/3] Misc toolchain patches Mark Hatle
  2014-07-31  1:16 ` [PATCH 1/3] gcc: Fix gcc-multilib-config comparison Mark Hatle
@ 2014-07-31  1:16 ` Mark Hatle
  2014-07-31  1:16 ` [PATCH 3/3] sanity.bbclass: Add ability to verify toolchain flags Mark Hatle
  2 siblings, 0 replies; 4+ messages in thread
From: Mark Hatle @ 2014-07-31  1:16 UTC (permalink / raw)
  To: openembedded-core

Without this, you are not able to use mips32r2 on a mips64 based tune.

We want to be able to do a tri-lib system of mips64, mips64-n32 and mips32r2.

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
---
 meta/conf/machine/include/tune-mips32r2.inc | 2 +-
 meta/conf/machine/include/tune-mips64.inc   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/meta/conf/machine/include/tune-mips32r2.inc b/meta/conf/machine/include/tune-mips32r2.inc
index fb60592..c9deff8 100644
--- a/meta/conf/machine/include/tune-mips32r2.inc
+++ b/meta/conf/machine/include/tune-mips32r2.inc
@@ -1,6 +1,6 @@
 DEFAULTTUNE ?= "mips32r2"
 
-require conf/machine/include/mips/arch-mips.inc
+require conf/machine/include/tune-mips32.inc
 
 TUNEVALID[mips32r2] = "Enable mips32r2 specific processor optimizations"
 TUNECONFLICTS[mips32r2] = "n64 n32"
diff --git a/meta/conf/machine/include/tune-mips64.inc b/meta/conf/machine/include/tune-mips64.inc
index ba79e2b..9be0e0f 100644
--- a/meta/conf/machine/include/tune-mips64.inc
+++ b/meta/conf/machine/include/tune-mips64.inc
@@ -1,3 +1,3 @@
 DEFAULTTUNE ?= "mips64"
 
-require conf/machine/include/mips/arch-mips.inc
+require conf/machine/include/tune-mips32r2.inc
-- 
1.9.3



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 3/3] sanity.bbclass: Add ability to verify toolchain flags
  2014-07-31  1:16 [PATCH 0/3] Misc toolchain patches Mark Hatle
  2014-07-31  1:16 ` [PATCH 1/3] gcc: Fix gcc-multilib-config comparison Mark Hatle
  2014-07-31  1:16 ` [PATCH 2/3] tune-mips*: Ensure tunes are inherited in order Mark Hatle
@ 2014-07-31  1:16 ` Mark Hatle
  2 siblings, 0 replies; 4+ messages in thread
From: Mark Hatle @ 2014-07-31  1:16 UTC (permalink / raw)
  To: openembedded-core

When attempting to use a binary toolchain, such as meta-mentor,
we want the ability to verify that the CCARGS, ASARGS and LDARGS
contain the necessary and appropriate flags.

This change specifically verifies, if set:
   TUNEABI_REQUIRED_CCARGS_tune-<tune>
   TUNEABI_REQUIRED_ASARGS_tune-<tune>
   TUNEABI_REQUIRED_LDARGS_tune-<tune>

Each of these, will be processed by the class and verified that the
selected tune's CCARGS, ASARGS, and LDARGS contains the listed item.  This
can be used to validate that the user has not accidently or otherwise
missed an argument.  Note, conflicting arguments are not verified.

Without verification it's possible for a misconfiguration to go
undetected, presenting runtime and debugging errors.

Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
---
 meta/classes/sanity.bbclass | 52 +++++++++++++++++++++++++++++++++++++++------
 1 file changed, 46 insertions(+), 6 deletions(-)

diff --git a/meta/classes/sanity.bbclass b/meta/classes/sanity.bbclass
index 1ad663a..b5fab6a 100644
--- a/meta/classes/sanity.bbclass
+++ b/meta/classes/sanity.bbclass
@@ -87,17 +87,54 @@ def raise_sanity_error(msg, d, network_error=False):
     
     %s""" % msg)
 
+# Check flags associated with a tuning.
+def check_toolchain_tune_args(data, tune, multilib, errs):
+    found_errors = False
+    if check_toolchain_args_present(data, tune, multilib, errs, 'CCARGS'):
+        found_errors = True
+    if check_toolchain_args_present(data, tune, multilib, errs, 'ASARGS'):
+        found_errors = True
+    if check_toolchain_args_present(data, tune, multilib, errs, 'LDARGS'):
+        found_errors = True
+
+    return found_errors
+
+def check_toolchain_args_present(data, tune, multilib, tune_errors, which):
+    args_set = (data.getVar("TUNE_%s" % which, True) or "").split()
+    args_wanted = (data.getVar("TUNEABI_REQUIRED_%s_tune-%s" % (which, tune), True) or "").split()
+    args_missing = []
+
+    # If no args are listed/required, we are done.
+    if not args_wanted:
+        return
+    for arg in args_wanted:
+        if arg not in args_set:
+            args_missing.append(arg)
+
+    found_errors = False
+    if args_missing:
+        found_errors = True
+        tune_errors.append("TUNEABI for %s requires '%s' in TUNE_%s (%s)." %
+                       (tune, ' '.join(args_missing), which, ' '.join(args_set)))
+    return found_errors
+
 # Check a single tune for validity.
 def check_toolchain_tune(data, tune, multilib):
     tune_errors = []
     if not tune:
         return "No tuning found for %s multilib." % multilib
+    localdata = bb.data.createCopy(data)
+    if multilib != "default":
+        # Apply the overrides so we can look at the details.
+        overrides = localdata.getVar("OVERRIDES", False) + ":virtclass-multilib-" + multilib
+        localdata.setVar("OVERRIDES", overrides)
+    bb.data.update_data(localdata)
     bb.debug(2, "Sanity-checking tuning '%s' (%s) features:" % (tune, multilib))
-    features = (data.getVar("TUNE_FEATURES_tune-%s" % tune, True) or "").split()
+    features = (localdata.getVar("TUNE_FEATURES_tune-%s" % tune, True) or "").split()
     if not features:
         return "Tuning '%s' has no defined features, and cannot be used." % tune
-    valid_tunes = data.getVarFlags('TUNEVALID') or {}
-    conflicts = data.getVarFlags('TUNECONFLICTS') or {}
+    valid_tunes = localdata.getVarFlags('TUNEVALID') or {}
+    conflicts = localdata.getVarFlags('TUNECONFLICTS') or {}
     # [doc] is the documentation for the variable, not a real feature
     if 'doc' in valid_tunes:
         del valid_tunes['doc']
@@ -113,15 +150,18 @@ def check_toolchain_tune(data, tune, multilib):
             bb.debug(2, "  %s: %s" % (feature, valid_tunes[feature]))
         else:
             tune_errors.append("Feature '%s' is not defined." % feature)
-    whitelist = data.getVar("TUNEABI_WHITELIST", True) or ''
-    override = data.getVar("TUNEABI_OVERRIDE", True) or ''
+    whitelist = localdata.getVar("TUNEABI_WHITELIST", True) or ''
+    override = localdata.getVar("TUNEABI_OVERRIDE", True) or ''
     if whitelist:
-        tuneabi = data.getVar("TUNEABI_tune-%s" % tune, True) or ''
+        tuneabi = localdata.getVar("TUNEABI_tune-%s" % tune, True) or ''
         if not tuneabi:
             tuneabi = tune
         if True not in [x in whitelist.split() for x in tuneabi.split()]:
             tune_errors.append("Tuning '%s' (%s) cannot be used with any supported tuning/ABI." %
                 (tune, tuneabi))
+        else:
+            if not check_toolchain_tune_args(localdata, tuneabi, multilib, tune_errors):
+                bb.debug(2, "Sanity check: Compiler args OK for %s." % tune)
     if tune_errors:
         return "Tuning '%s' has the following errors:\n" % tune + '\n'.join(tune_errors)
 
-- 
1.9.3



^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-07-31  1:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-31  1:16 [PATCH 0/3] Misc toolchain patches Mark Hatle
2014-07-31  1:16 ` [PATCH 1/3] gcc: Fix gcc-multilib-config comparison Mark Hatle
2014-07-31  1:16 ` [PATCH 2/3] tune-mips*: Ensure tunes are inherited in order Mark Hatle
2014-07-31  1:16 ` [PATCH 3/3] sanity.bbclass: Add ability to verify toolchain flags Mark Hatle

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox