# HG changeset patch # User David Holsgrove # Date 1348552500 -36000 # Node ID 808c76db80990fd57284f9030dcce307a3f2f8ec # Parent 0e06812acc5cb5758dd4a03c7ed372724fd593f6 scripts/gcc.sh: Add copyheaders section for baremetal canadian Canadian Cross compile for baremetal fails with error; checking for the value of EOF... configure: error: computing EOF failed which is due to libstdc++ configure not being able to find stdio.h We can copy the required headers from the newlib source into the prefix include directory - to ensure both the final compiler for build and final compiler for host have access. Signed-off-by: "David Holsgrove" diff -r 0e06812acc5c -r 808c76db8099 scripts/build/cc/gcc.sh --- a/scripts/build/cc/gcc.sh Wed Sep 26 16:41:02 2012 +0200 +++ b/scripts/build/cc/gcc.sh Tue Sep 25 15:55:00 2012 +1000 @@ -207,7 +207,7 @@ extra_config+=("--with-newlib") extra_config+=("--enable-threads=no") extra_config+=("--disable-shared") - copy_headers=n + copy_headers=y ;; *) CT_Abort "Internal Error: 'mode' must be one of: 'static', 'shared' or 'baremetal', not '${mode:-(empty)}'" @@ -221,8 +221,13 @@ fi if [ "${copy_headers}" = "y" ]; then - CT_DoLog DEBUG "Copying headers to install area of bootstrap gcc, so it can build libgcc2" - CT_DoExecLog ALL cp -a "${CT_HEADERS_DIR}" "${prefix}/${CT_TARGET}/include" + if [ "${mode}" = "baremetal" ]; then + CT_DoLog DEBUG "Copying headers from newlib source to install area of bootstrap gcc, so it can build libstdc++" + CT_DoExecLog ALL cp -a "${CT_SRC_DIR}/newlib-${CT_LIBC_VERSION}/newlib/libc/include/." "${prefix}/${CT_TARGET}/include" + else + CT_DoLog DEBUG "Copying headers to install area of bootstrap gcc, so it can build libgcc2" + CT_DoExecLog ALL cp -a "${CT_HEADERS_DIR}" "${prefix}/${CT_TARGET}/include" + fi fi for tmp in ARCH ABI CPU TUNE FPU FLOAT; do