[OE-core] [PATCH 1/30] gcc-configure-common.inc: Change 'initfini-array' to PACKAGECONFIG

Nathan Rossi nathan at nathanrossi.com
Mon Jan 16 14:15:10 UTC 2017


Change the '--enable-initfini-array' default config to a PACKAGECONFIG
so that it can be disabled (e.g. for mingw32).

The 'initfini-array' option works only for Linux so disable it for
mingw32. Otherwise eventually the build will encounter errors like
(gcc-crosssdk):

    multiple definition of `__do_global_dtors'

Or errors like (gcc-crosssdk-initial):

    Assembler messages:
    Error: invalid instruction suffix for `push'
    Error: invalid instruction suffix for `pop'

Signed-off-by: Nathan Rossi <nathan at nathanrossi.com>
---

This patch uses PACKAGECONFIG as suggested by Khem on an existing
meta-mingw series by Juro.

https://lists.yoctoproject.org/pipermail/yocto/2016-October/032310.html

This patch also consolidates the two patches in the mentioned series
such that initfini-array is disabled for any gcc build that is targeting
mingw32.

https://lists.yoctoproject.org/pipermail/yocto/2016-October/032305.html
https://lists.yoctoproject.org/pipermail/yocto/2016-October/032307.html
---
 meta/recipes-devtools/gcc/gcc-configure-common.inc | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/meta/recipes-devtools/gcc/gcc-configure-common.inc b/meta/recipes-devtools/gcc/gcc-configure-common.inc
index 00ef89ec57..cec17064fe 100644
--- a/meta/recipes-devtools/gcc/gcc-configure-common.inc
+++ b/meta/recipes-devtools/gcc/gcc-configure-common.inc
@@ -15,6 +15,9 @@ JAVA_sh3 ?= ""
 FORTRAN ?= ",f77"
 LANGUAGES ?= "c,c++${FORTRAN}${JAVA}"
 
+PACKAGECONFIG ?= "initfini-array"
+PACKAGECONFIG_remove_mingw32 = "initfini-array"
+
 EXTRA_OECONF_BASE ?= ""
 EXTRA_OECONF_PATHS ?= ""
 EXTRA_OECONF_INITIAL ?= ""
@@ -44,9 +47,8 @@ EXTRA_OECONF = "\
     ${@get_gcc_multiarch_setting(bb, d)} \
 "
 
-# Set this here since GCC configure won't auto-detect and enable
-# initfini-arry when cross compiling.
-EXTRA_OECONF_append = " --enable-initfini-array"
+# GCC does not auto-detect initfini-array when cross compiling
+PACKAGECONFIG[initfini-array] = "--enable-initfini-array,--disable-initfini-array"
 
 export gcc_cv_collect2_libs = 'none required'
 # We need to set gcc_cv_collect2_libs else there is cross-compilation badness
-- 
2.11.0




More information about the Openembedded-core mailing list