I'm trying to build a NIOS2 toolchain using the procedure found
on the eCos web site. Everything builds fine under Linux, but
under Cygwin, I can't get gcc to build. Specifically, the
build of libstdc++ fails.
Here's how I'm building gcc:
TARGET=nios2-elf
DEST=/opt/gnu
rm -rf src
tar xjvf nios2_60_gnusrc_win.tar.bz2
function build-gcc
{
mv src/newlib/newlib src/gcc
mv src/newlib/libgloss src/gcc
cp src/gcc/newlib/configure.host.normalc src/gcc/newlib/configure.host
rm -rf gcc-build
mkdir gcc-build
pushd gcc-build
mkdir -p gcc/doc
cp -p ../src/gcc/gcc/doc/*.1 gcc/doc
../src/gcc/configure --target=$TARGET \
--prefix=$DEST --enable-languages=c,c++ \
--with-gnu-as --with-gnu-ld --with-newlib \
--with-gxx-include-dir=$DEST/$TARGET/include \
--disable-multilib
-v 2>&1 | tee configure.out
PATH=$PATH:$DEST/bin make -w all 2>&1 | tee make.out
PATH=$PATH:$DEST/bin make -w install 2>&1 | tee install.out
popd
}
build-gcc
[I had to disable multilib to get the make to run in a
reasonable amount of time. If I leave multilib enabled, it
takes about 30 hours for the build to get to the point where it
fails.]
During the "make -w", there's an internal compiler failure when
libstdc++ .h files are begin pre-compiled. Has anybody run
into a problem like this before? I looked at the line in the
.h file where gcc segfaults, and I don't see anything wrong.
make.out excerpt:
make: Entering directory `/home/Grant/nios/gcc-build'
Configuring in intl
creating cache ./config.cache
checking for GNU ld...
/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../i686-pc-cygwin/bin/ld.exe
[...]
make[1]: Entering directory
`/home/Grant/nios/gcc-build/nios2-elf/libstdc++-v3/include'
sed -e
'/^#/s/\([ABCDEFGHIJKLMNOPQRSTUVWXYZ_][ABCDEFGHIJKLMNOPQRSTUVWXYZ_]*\)/_GLIBCXX_\1/g'
\
-e 's/_GLIBCXX_SUPPORTS_WEAK/__GXX_WEAK__/g' \
-e 's,^#include "\(.*\)",#include <bits/\1>,g' \
< /home/Grant/nios/src/gcc/libstdc++-v3/../gcc/gthr.h >
nios2-elf/bits/gthr.h
sed -e 's/\(UNUSED\)/_GLIBCXX_\1/g' \
-e 's/\(GCC[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]*_H\)/_GLIBCXX_\1/g' \
< /home/Grant/nios/src/gcc/libstdc++-v3/../gcc/gthr-single.h >
nios2-elf/bits/gthr-single.h
sed -e 's/\(UNUSED\)/_GLIBCXX_\1/g' \
-e 's/\(GCC[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]*_H\)/_GLIBCXX_\1/g' \
-e 's/SUPPORTS_WEAK/__GXX_WEAK__/g' \
-e 's/\([ABCDEFGHIJKLMNOPQRSTUVWXYZ_]*USE_WEAK\)/_GLIBCXX_\1/g' \
< /home/Grant/nios/src/gcc/libstdc++-v3/../gcc/gthr-posix.h >
nios2-elf/bits/gthr-posix.h
sed -e 's/\(UNUSED\)/_GLIBCXX_\1/g' \
-e 's/\(GCC[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]*_H\)/_GLIBCXX_\1/g' \
-e 's/SUPPORTS_WEAK/__GXX_WEAK__/g' \
-e 's/\([ABCDEFGHIJKLMNOPQRSTUVWXYZ_]*USE_WEAK\)/_GLIBCXX_\1/g' \
-e 's,^#include "\(.*\)",#include <bits/\1>,g' \
< /home/Grant/nios/src/gcc/libstdc++-v3/../gcc/gthr-single.h >
nios2-elf/bits/gthr-default.h
touch ./nios2-elf/bits/stdc++.h; \
if [ ! -d "./nios2-elf/bits/stdc++.h.gch" ]; then \
mkdir -p ./nios2-elf/bits/stdc++.h.gch; \
fi; \
/home/Grant/nios/gcc-build/gcc/xgcc -shared-libgcc
-B/home/Grant/nios/gcc-build/gcc/ -nostdinc++
-L/home/Grant/nios/gcc-build/nios2-elf/libstdc++-v3/src
-L/home/Grant/nios/gcc-build/nios2-elf/libstdc++-v3/src/.libs -nostdinc
-B/home/Grant/nios/gcc-build/nios2-elf/newlib/ -isystem
/home/Grant/nios/gcc-build/nios2-elf/newlib/targ-include -isystem
/home/Grant/nios/src/gcc/newlib/libc/include -B/opt/gnu/nios2-elf/bin/
-B/opt/gnu/nios2-elf/lib/ -isystem /opt/gnu/nios2-elf/include -isystem
/opt/gnu/nios2-elf/sys-include -Winvalid-pch -Wno-deprecated -x c++-header -g
-O2 -I/home/Grant/nios/gcc-build/nios2-elf/libstdc++-v3/include/nios2-elf
-I/home/Grant/nios/gcc-build/nios2-elf/libstdc++-v3/include
-I/home/Grant/nios/src/gcc/libstdc++-v3/libsupc++
/home/Grant/nios/src/gcc/libstdc++-v3/include/stdc++.h -O0 -g -o
./nios2-elf/bits/stdc++.h.gch/O0g; \
/home/Grant/nios/gcc-build/gcc/xgcc -shared-libgcc
-B/home/Grant/nios/gcc-build/gcc/ -nostdinc++
-L/home/Grant/nios/gcc-build/nios2-elf/libstdc++-v3/src
-L/home/Grant/nios/gcc-build/nios2-elf/libstdc++-v3/src/.libs -nostdinc
-B/home/Grant/nios/gcc-build/nios2-elf/newlib/ -isystem
/home/Grant/nios/gcc-build/nios2-elf/newlib/targ-include -isystem
/home/Grant/nios/src/gcc/newlib/libc/include -B/opt/gnu/nios2-elf/bin/
-B/opt/gnu/nios2-elf/lib/ -isystem /opt/gnu/nios2-elf/include -isystem
/opt/gnu/nios2-elf/sys-include -Winvalid-pch -Wno-deprecated -x c++-header -g
-O2 -I/home/Grant/nios/gcc-build/nios2-elf/libstdc++-v3/include/nios2-elf
-I/home/Grant/nios/gcc-build/nios2-elf/libstdc++-v3/include
-I/home/Grant/nios/src/gcc/libstdc++-v3/libsupc++
/home/Grant/nios/src/gcc/libstdc++-v3/include/stdc++.h -O2 -g -o
./nios2-elf/bits/stdc++.h.gch/O2g;
/home/Grant/nios/src/gcc/libstdc++-v3/include/stdc++.h:82: internal compiler
error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://www.altera.com/mysupport> for instructions.
/home/Grant/nios/src/gcc/libstdc++-v3/include/stdc++.h:82: internal compiler
error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://www.altera.com/mysupport> for instructions.
make[1]: *** [nios2-elf/bits/stdc++.h] Error 1
make[1]: Leaving directory
`/home/Grant/nios/gcc-build/nios2-elf/libstdc++-v3/include'
[...]
--
Grant Edwards grante Yow! I have no actual
at hairline...
visi.com
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss