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)
downloadpoky-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 0000000000..efcadc94c4
--- /dev/null
+++ b/meta/recipes-extended/libzypp/libzypp/arm-workaround-global-constructor.patch
@@ -0,0 +1,68 @@
1Workaround a problem with the C++ global constructors on ARM.
2
3As documented in the Yocto Bugzilla bug 938, the global constructors
4that define DEF_BUILTIN [const IdString _foo ( "foo" );] are not running
5before the usage of _foo during the initialization of the compatibility
6table.
7
8The patch, along with a similar change to the recipe generation of the
9poky-arch.h file, remove the DEF_BUILTIN globals and replace them with
10immediate strings wherever they are used.
11
12Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
13
14diff -ur git.orig/zypp/Arch.cc git/zypp/Arch.cc
15--- git.orig/zypp/Arch.cc 2011-03-29 14:15:32.695079271 -0500
16+++ git/zypp/Arch.cc 2011-03-29 14:17:22.680910025 -0500
17@@ -152,13 +152,10 @@
18 // NOTE: Thake care CompatBits::IntT is able to provide one
19 // bit for each architecture.
20 //
21-#define DEF_BUILTIN(A) const IdString _##A( #A );
22- DEF_BUILTIN( all );
23- DEF_BUILTIN( any );
24- DEF_BUILTIN( noarch );
25
26-#include "poky-arch.h"
27-#undef DEF_BUILTIN
28+/* Global constructors are not working properly on ARM, avoid the
29+ * known bad case and merge constructors in with the usages
30+ */
31
32 ///////////////////////////////////////////////////////////////////
33 //
34@@ -227,9 +224,9 @@
35 // _noarch must have _idBit 0.
36 // Other builtins have 1-bit set
37 // and are initialized done on the fly.
38- _compatSet.insert( Arch::CompatEntry( _all, 0 ) );
39- _compatSet.insert( Arch::CompatEntry( _any, 0 ) );
40- _compatSet.insert( Arch::CompatEntry( _noarch, 0 ) );
41+ _compatSet.insert( Arch::CompatEntry( IdString ( "all" ), 0 ) );
42+ _compatSet.insert( Arch::CompatEntry( IdString ( "any" ), 0 ) );
43+ _compatSet.insert( Arch::CompatEntry( IdString ( "noarch" ), 0 ) );
44 ///////////////////////////////////////////////////////////////////
45 // Define the CompatibleWith relation:
46 //
47@@ -305,9 +302,9 @@
48 ///////////////////////////////////////////////////////////////////
49
50 const Arch Arch_empty ( IdString::Empty );
51- const Arch Arch_all( _all );
52- const Arch Arch_any( _any );
53- const Arch Arch_noarch( _noarch );
54+ const Arch Arch_all( IdString ( "all" ) );
55+ const Arch Arch_any( IdString ( "any" ) );
56+ const Arch Arch_noarch( IdString ( "noarch" ) );
57
58 #define POKY_PROTO 1
59 #include "poky-arch.h"
60@@ -316,7 +316,7 @@
61 // METHOD TYPE : Ctor
62 //
63 Arch::Arch()
64- : _entry( &ArchCompatSet::instance().assertDef( _noarch ) )
65+ : _entry( &ArchCompatSet::instance().assertDef( IdString ( "noarch" ) ) )
66 {}
67
68 Arch::Arch( IdString::IdType id_r )