Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH 1/2] insane.bbclass: Add test for static .a libraries in non-staticdev packages
@ 2012-01-25  1:49 Saul Wold
  2012-01-25 15:44 ` Richard Purdie
  0 siblings, 1 reply; 2+ messages in thread
From: Saul Wold @ 2012-01-25  1:49 UTC (permalink / raw)
  To: openembedded-core

This check verifies that non staticdev and non pic packages do not
have static libraries in them. There are a few exceptions for the
libgcc-dev and libgcov-dev packages which are whitelisted, also the
*_nonshared.a need to be part of their respective -dev packages.

This is currently a warning to work out any other issues in the upper
layers but will be moved to ERROR at somepoint in the future.

[YOCTO #663]

Signed-off-by: Saul Wold <sgw@linux.intel.com>
---
 meta/classes/insane.bbclass |   20 +++++++++++++++++++-
 1 files changed, 19 insertions(+), 1 deletions(-)

diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass
index ce21496..7aea73b 100644
--- a/meta/classes/insane.bbclass
+++ b/meta/classes/insane.bbclass
@@ -109,7 +109,7 @@ def package_qa_get_machine_dict():
 
 
 # Currently not being used by default "desktop"
-WARN_QA ?= "ldflags useless-rpaths rpaths unsafe-references-in-binaries unsafe-references-in-scripts"
+WARN_QA ?= "ldflags useless-rpaths rpaths unsafe-references-in-binaries unsafe-references-in-scripts staticdev"
 ERROR_QA ?= "dev-so debug-deps dev-deps debug-files arch la2 pkgconfig la perms"
 
 def package_qa_clean_path(path,d):
@@ -192,6 +192,24 @@ def package_qa_check_dev(path, name, d, elf, messages):
         messages.append("non -dev/-dbg/-nativesdk package contains symlink .so: %s path '%s'" % \
                  (name, package_qa_clean_path(path,d)))
 
+QAPATHTEST[staticdev] = "package_qa_check_staticdev"
+
+# These 2 packages contain archive libraries that need to be in -dev
+STATICDEV_WHITELIST = "libgcc-dev libgcov-dev"
+def package_qa_check_staticdev(path, name, d, elf, messages):
+    """
+    Check for ".a" library in non-staticdev packages, use a STATICDEV_WHITELIST
+    for exceptions
+    """
+
+    import re
+    staticdev_whitelist = d.getVar('STATICDEV_WHITELIST', True)
+    if (staticdev_whitelist.find(name) != -1):
+        return
+    if not name.endswith("-pic") and not name.endswith("-staticdev") and path.endswith(".a") and not path.endswith("_nonshared.a"):
+        messages.append("non -staticdev package contains static .a library: %s path '%s'" % \
+                 (name, package_qa_clean_path(path,d)))
+
 QAPATHTEST[debug-files] = "package_qa_check_dbg"
 def package_qa_check_dbg(path, name, d, elf, messages):
     """
-- 
1.7.6.5




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

end of thread, other threads:[~2012-01-25 15:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-25  1:49 [PATCH 1/2] insane.bbclass: Add test for static .a libraries in non-staticdev packages Saul Wold
2012-01-25 15:44 ` Richard Purdie

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