Patchwork gcc: Clean up configure_prepend and fix for mingw

login
register
mail settings
Submitter Richard Purdie
Date May 30, 2014, 12:32 p.m.
Message ID <1401453174.31309.29.camel@ted>
Download mbox | patch
Permalink /patch/73003/
State Accepted
Commit fe5bc386f6f6d5dabc40ccdb0de0f6ef8c9f6b9d
Headers show

Comments

Richard Purdie - May 30, 2014, 12:32 p.m.
The do_configure_prepend was duplicated in gcc-4.X.inc and
gcc-configure-common.inc leading to confusion when reading the resulting
do_configure task where the file was processed twice.

The only difference was the removal of the include line for gcc 4.8/4.9.

On mingw were were seeing two issues, firstly that the if statements meant
the values we wanted weren't being set, the second that the include
paths were still wrong as there was no header path set.

To fix the first issue, the #ifdef conditionals were removed, we want
to set these things unconditionally. The second issue is addressed by
setting the NATIVE_SYSTEM_HEADER_DIR variable here (it was already
set in t-oe).

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>

Patch

diff --git a/meta/recipes-devtools/gcc/gcc-4.8.inc b/meta/recipes-devtools/gcc/gcc-4.8.inc
index aa822cf..9f2928b 100644
--- a/meta/recipes-devtools/gcc/gcc-4.8.inc
+++ b/meta/recipes-devtools/gcc/gcc-4.8.inc
@@ -119,21 +119,4 @@  EXTRA_OECONF_PATHS = " \
                       --with-sysroot=${STAGING_DIR_TARGET} \ 
                       --with-build-sysroot=${STAGING_DIR_TARGET}"
 
-do_configure_prepend () {
-        # teach gcc to find correct target includedir when checking libc ssp support
-        mkdir -p ${B}/gcc
-        echo "NATIVE_SYSTEM_HEADER_DIR = ${SYSTEMHEADERS}" > ${B}/gcc/t-oe
-        cat ${S}/gcc/defaults.h | grep -v "\#endif.*GCC_DEFAULTS_H" > ${B}/gcc/defaults.h.new
-        cat >>${B}/gcc/defaults.h.new <<_EOF
-#ifndef STANDARD_STARTFILE_PREFIX_1
-#define STANDARD_STARTFILE_PREFIX_1 "${SYSTEMLIBS}"
-#endif
-#ifndef STANDARD_STARTFILE_PREFIX_2
-#define STANDARD_STARTFILE_PREFIX_2 "${SYSTEMLIBS1}"
-#endif
-#define SYSTEMLIBS_DIR "${SYSTEMLIBS}"
-#endif /* ! GCC_DEFAULTS_H */
-_EOF
-        mv ${B}/gcc/defaults.h.new ${B}/gcc/defaults.h
-}
 
diff --git a/meta/recipes-devtools/gcc/gcc-4.9.inc b/meta/recipes-devtools/gcc/gcc-4.9.inc
index a409430..155be14 100644
--- a/meta/recipes-devtools/gcc/gcc-4.9.inc
+++ b/meta/recipes-devtools/gcc/gcc-4.9.inc
@@ -114,21 +114,4 @@  EXTRA_OECONF_PATHS = " \
                       --with-sysroot=${STAGING_DIR_TARGET} \ 
                       --with-build-sysroot=${STAGING_DIR_TARGET}"
 
-do_configure_prepend () {
-        # teach gcc to find correct target includedir when checking libc ssp support
-        mkdir -p ${B}/gcc
-        echo "NATIVE_SYSTEM_HEADER_DIR = ${SYSTEMHEADERS}" > ${B}/gcc/t-oe
-        cat ${S}/gcc/defaults.h | grep -v "\#endif.*GCC_DEFAULTS_H" > ${B}/gcc/defaults.h.new
-        cat >>${B}/gcc/defaults.h.new <<_EOF
-#ifndef STANDARD_STARTFILE_PREFIX_1
-#define STANDARD_STARTFILE_PREFIX_1 "${SYSTEMLIBS}"
-#endif
-#ifndef STANDARD_STARTFILE_PREFIX_2
-#define STANDARD_STARTFILE_PREFIX_2 "${SYSTEMLIBS1}"
-#endif
-#define SYSTEMLIBS_DIR "${SYSTEMLIBS}"
-#endif /* ! GCC_DEFAULTS_H */
-_EOF
-        mv ${B}/gcc/defaults.h.new ${B}/gcc/defaults.h
-}
 
diff --git a/meta/recipes-devtools/gcc/gcc-configure-common.inc b/meta/recipes-devtools/gcc/gcc-configure-common.inc
index 31e3cc4..4a10554 100644
--- a/meta/recipes-devtools/gcc/gcc-configure-common.inc
+++ b/meta/recipes-devtools/gcc/gcc-configure-common.inc
@@ -78,15 +78,9 @@  do_configure_prepend () {
 	echo "NATIVE_SYSTEM_HEADER_DIR = ${SYSTEMHEADERS}" > ${B}/gcc/t-oe
 	cat ${S}/gcc/defaults.h | grep -v "\#endif.*GCC_DEFAULTS_H" > ${B}/gcc/defaults.h.new
 	cat >>${B}/gcc/defaults.h.new <<_EOF
-#ifndef STANDARD_INCLUDE_DIR
-#define STANDARD_INCLUDE_DIR "${SYSTEMHEADERS}"
-#endif
-#ifndef STANDARD_STARTFILE_PREFIX_1
+#define NATIVE_SYSTEM_HEADER_DIR "${SYSTEMHEADERS}"
 #define STANDARD_STARTFILE_PREFIX_1 "${SYSTEMLIBS}"
-#endif
-#ifndef STANDARD_STARTFILE_PREFIX_2
 #define STANDARD_STARTFILE_PREFIX_2 "${SYSTEMLIBS1}"
-#endif
 #define SYSTEMLIBS_DIR "${SYSTEMLIBS}"
 #endif /* ! GCC_DEFAULTS_H */
 _EOF