libstdc++ configuration error, ct-ng v1.16.0

David Holsgrove david.holsgrove@xilinx.com
Thu Oct 4 06:18:00 GMT 2012


Hi Mike, All

On 2 September 2012 03:05, Michael Franklin <mfranklin@comfile.co.kr> wrote:
> Hello,
>
> I'm having trouble understanding an error I'm receiving in the 'Installing
> final compiler for build' stage.  It occurs when configuring libstdc++.  I'm
> hoping one of you swell folks would be willing to help me decipher it and
> maybe suggest a solution.  (See build log below)
>
> I'm trying a Canadian Cross, and here's my setup
> Build machine:  Linux Mint 64 (resident GCC)
> Host: x86_64-w64-mingw32 (mingw-w64 packages installed with Synaptic Package
> Manager)
> Target: arm-none-eabi
>
> I've installed just about all packages with mingw and w64 in the name, so I
> think I have all the necessary tools, headers, and libraries.  Also I've
> already built an arm-none-eabi Linux Mint compiler without any trouble
> (Thanks to the crosstools-ng community for making it so easy)
>
> It appears to me I'm missing some headers, but I think the headers just
> can't be found.  Maybe one of you can help me understand a little better.
>
> Thanks,
> Mike
>
>
> Here's out output from the build.log.
> **************************************************************************
[SNIP]
> [ERROR]    checking for the value of EOF... configure: error: computing EOF
> failed
> [ERROR]    make[1]: *** [configure-target-libstdc++-v3] Error 1

I recently ran into the same error, with a similar canadian cross
setup with a baremetal target.

I hacked / worked around it with the patch below - I'd be interested
to see if this is roughly the right approach, and if it's something we
can include in CT-NG?

thanks,
David


# HG changeset patch
# User David Holsgrove <david.holsgrove@xilinx.com>
# Date 1348552500 -36000
# Node ID 2df8f5a184b721e66a24db1aef61529691195393
# Parent  43ace4bb005eef085437e3d4fbaef528ef0ef005
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" <david.holsgrove@xilinx.com>

diff -r 43ace4bb005e -r 2df8f5a184b7 scripts/build/cc/gcc.sh
--- a/scripts/build/cc/gcc.sh	Wed Sep 26 16:37:31 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

--
For unsubscribe information see http://sourceware.org/lists.html#faq



More information about the crossgcc mailing list