summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/libzypp/libzypp
diff options
context:
space:
mode:
authorMark Hatle <mark.hatle@windriver.com>2011-03-29 21:16:16 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-03-31 22:02:47 +0100
commit37f3ef2cfd385f4481b250e00fa74ca9104c1da4 (patch)
tree0aae0a0d155968973280dfee2bf1c7044900e9c0 /meta/recipes-extended/libzypp/libzypp
parent41efbe13cb2f8b4b78c6049446cd14f9b086520d (diff)
downloadast2050-yocto-poky-37f3ef2cfd385f4481b250e00fa74ca9104c1da4.zip
ast2050-yocto-poky-37f3ef2cfd385f4481b250e00fa74ca9104c1da4.tar.gz
Workaround for Global C++ Constructor problem on ARM
[YOCTO #938] Workaround for a problem with the order of the global C++ constructors on ARM. The workaround is simply to avoid defining the ID numbers outside of the usage of the ID's. This also has the effect of fixing a problem on MIPS, where "_mips" is a defined symbol and unavailable on the system for a variable name. (From OE-Core rev: b308149b4b7d2066390aa4eaa7364af3334f70f5) Signed-off-by: Mark Hatle <mark.hatle@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-extended/libzypp/libzypp')
-rw-r--r--meta/recipes-extended/libzypp/libzypp/arm-workaround-global-constructor.patch68
1 files changed, 68 insertions, 0 deletions
diff --git a/meta/recipes-extended/libzypp/libzypp/arm-workaround-global-constructor.patch b/meta/recipes-extended/libzypp/libzypp/arm-workaround-global-constructor.patch
new file mode 100644
index 0000000..efcadc9
--- /dev/null
+++ b/meta/recipes-extended/libzypp/libzypp/arm-workaround-global-constructor.patch
@@ -0,0 +1,68 @@
+Workaround a problem with the C++ global constructors on ARM.
+
+As documented in the Yocto Bugzilla bug 938, the global constructors
+that define DEF_BUILTIN [const IdString _foo ( "foo" );] are not running
+before the usage of _foo during the initialization of the compatibility
+table.
+
+The patch, along with a similar change to the recipe generation of the
+poky-arch.h file, remove the DEF_BUILTIN globals and replace them with
+immediate strings wherever they are used.
+
+Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
+
+diff -ur git.orig/zypp/Arch.cc git/zypp/Arch.cc
+--- git.orig/zypp/Arch.cc 2011-03-29 14:15:32.695079271 -0500
++++ git/zypp/Arch.cc 2011-03-29 14:17:22.680910025 -0500
+@@ -152,13 +152,10 @@
+ // NOTE: Thake care CompatBits::IntT is able to provide one
+ // bit for each architecture.
+ //
+-#define DEF_BUILTIN(A) const IdString _##A( #A );
+- DEF_BUILTIN( all );
+- DEF_BUILTIN( any );
+- DEF_BUILTIN( noarch );
+
+-#include "poky-arch.h"
+-#undef DEF_BUILTIN
++/* Global constructors are not working properly on ARM, avoid the
++ * known bad case and merge constructors in with the usages
++ */
+
+ ///////////////////////////////////////////////////////////////////
+ //
+@@ -227,9 +224,9 @@
+ // _noarch must have _idBit 0.
+ // Other builtins have 1-bit set
+ // and are initialized done on the fly.
+- _compatSet.insert( Arch::CompatEntry( _all, 0 ) );
+- _compatSet.insert( Arch::CompatEntry( _any, 0 ) );
+- _compatSet.insert( Arch::CompatEntry( _noarch, 0 ) );
++ _compatSet.insert( Arch::CompatEntry( IdString ( "all" ), 0 ) );
++ _compatSet.insert( Arch::CompatEntry( IdString ( "any" ), 0 ) );
++ _compatSet.insert( Arch::CompatEntry( IdString ( "noarch" ), 0 ) );
+ ///////////////////////////////////////////////////////////////////
+ // Define the CompatibleWith relation:
+ //
+@@ -305,9 +302,9 @@
+ ///////////////////////////////////////////////////////////////////
+
+ const Arch Arch_empty ( IdString::Empty );
+- const Arch Arch_all( _all );
+- const Arch Arch_any( _any );
+- const Arch Arch_noarch( _noarch );
++ const Arch Arch_all( IdString ( "all" ) );
++ const Arch Arch_any( IdString ( "any" ) );
++ const Arch Arch_noarch( IdString ( "noarch" ) );
+
+ #define POKY_PROTO 1
+ #include "poky-arch.h"
+@@ -316,7 +316,7 @@
+ // METHOD TYPE : Ctor
+ //
+ Arch::Arch()
+- : _entry( &ArchCompatSet::instance().assertDef( _noarch ) )
++ : _entry( &ArchCompatSet::instance().assertDef( IdString ( "noarch" ) ) )
+ {}
+
+ Arch::Arch( IdString::IdType id_r )
OpenPOWER on IntegriCloud