diff options
author | Mark Hatle <mark.hatle@windriver.com> | 2011-03-29 21:16:16 -0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-03-31 15:35:21 +0100 |
commit | b308149b4b7d2066390aa4eaa7364af3334f70f5 (patch) | |
tree | e3ddef3743530cf306049ca0138856bd2de63930 /meta/recipes-extended/libzypp/libzypp_git.bb | |
parent | b2996efc015bc5ae0b8246924083e76fb5129cea (diff) | |
download | openembedded-core-contrib-b308149b4b7d2066390aa4eaa7364af3334f70f5.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.
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Diffstat (limited to 'meta/recipes-extended/libzypp/libzypp_git.bb')
-rw-r--r-- | meta/recipes-extended/libzypp/libzypp_git.bb | 47 |
1 files changed, 37 insertions, 10 deletions
diff --git a/meta/recipes-extended/libzypp/libzypp_git.bb b/meta/recipes-extended/libzypp/libzypp_git.bb index 809c1877f5..b473b9ff96 100644 --- a/meta/recipes-extended/libzypp/libzypp_git.bb +++ b/meta/recipes-extended/libzypp/libzypp_git.bb @@ -25,6 +25,9 @@ SRC_URI = "git://gitorious.org/opensuse/libzypp.git;protocol=git \ SRC_URI_append_mips = " file://mips-workaround-gcc-tribool-error.patch" +# ARM specific global constructor workaround +SRC_URI_append_arm = " file://arm-workaround-global-constructor.patch" + FILES_${PN} += "${libdir}/zypp ${datadir}/zypp ${datadir}/icons" FILES_${PN}-dev += "${datadir}/cmake" @@ -32,27 +35,38 @@ EXTRA_OECMAKE += "-DLIB=lib" PACKAGE_ARCH = "${MACHINE_ARCH}" +AVOID_CONSTRUCTOR = "" + +# Due to an ARM specific compiler issue +AVOID_CONSTRUCTOR_arm = "true" + +# Due to a potential conflict with '_mips' being a define +AVOID_CONSTRUCTOR_mips = "true" + do_archgen () { # We need to dynamically generate our arch file based on the machine # configuration echo "/* Automatically generated by the libzypp recipes */" > zypp/poky-arch.h + echo "/* Avoid Constructor: ${AVOID_CONSTRUCTOR} */" >> zypp/poky-arch.h echo "" >> zypp/poky-arch.h echo "#ifndef POKY_ARCH_H" >> zypp/poky-arch.h echo "#define POKY_ARCH_H 1" >> zypp/poky-arch.h echo "#define Arch_machine Arch_${MACHINE_ARCH}" >> zypp/poky-arch.h echo "#endif /* POKY_ARCH_H */" >> zypp/poky-arch.h echo "" >> zypp/poky-arch.h - echo "#ifdef DEF_BUILTIN" >> zypp/poky-arch.h - echo "/* Specify builtin types */" >> zypp/poky-arch.h - for each_arch in ${PACKAGE_ARCHS} ; do + if [ "${AVOID_CONSTRUCTOR}" != "true" ]; then + echo "#ifdef DEF_BUILTIN" >> zypp/poky-arch.h + echo "/* Specify builtin types */" >> zypp/poky-arch.h + for each_arch in ${PACKAGE_ARCHS} ; do case "$each_arch" in all | any | noarch) continue;; esac echo " DEF_BUILTIN( ${each_arch} );" >> zypp/poky-arch.h - done - echo "#endif /* DEF_BUILTIN */" >> zypp/poky-arch.h - echo "" >> zypp/poky-arch.h + done + echo "#endif /* DEF_BUILTIN */" >> zypp/poky-arch.h + echo "" >> zypp/poky-arch.h + fi echo "#ifdef POKY_EXTERN_PROTO" >> zypp/poky-arch.h echo "/* Specify extern prototypes */" >> zypp/poky-arch.h for each_arch in ${PACKAGE_ARCHS} ; do @@ -71,7 +85,11 @@ do_archgen () { all | any | noarch) continue;; esac - echo " const Arch Arch_${each_arch} (_${each_arch});" >> zypp/poky-arch.h + if [ "${AVOID_CONSTRUCTOR}" != "true" ]; then + echo " const Arch Arch_${each_arch} (_${each_arch});" >> zypp/poky-arch.h + else + echo " const Arch Arch_${each_arch} ( IdString ( \"${each_arch}\" ) );" >> zypp/poky-arch.h + fi done echo "#endif /* POKY_PROTO */" >> zypp/poky-arch.h echo "" >> zypp/poky-arch.h @@ -89,14 +107,23 @@ do_archgen () { all | any | noarch) shift ; continue;; esac - ARCH=_"$1" + if [ "${AVOID_CONSTRUCTOR}" != "true" ]; then + ARCH="_$1" + else + ARCH="IdString(\"$1\")" + fi shift COMPAT="" for each_arch in "$@"; do + if [ -z "${AVOID_CONSTRUCTOR}" ]; then + arch_val="_${each_arch}" + else + arch_val="IdString(\"${each_arch}\")" + fi if [ -z "$COMPAT" ]; then - COMPAT=_"$each_arch" + COMPAT=${arch_val} else - COMPAT=_"$each_arch,$COMPAT" + COMPAT="${arch_val},$COMPAT" fi done COMPAT_WITH="${ARCH},${COMPAT} $COMPAT_WITH" |