This question may really be about where to get help, rather than help for the problem itself. Please forgive the wordiness!
I'm trying to build gcc to run on Win32 and produce code for AVR. I've started with the files used by the Arduino people to build their AVR tool chain.
Being on a windows machine, and that Atmel uses GCC 4.9.2 to build their current tool chain (which is then copied/patched) by the Arduino people, I've installed a MinGW system with a GCC at 4.9.2, downloaded the Arduino people's tool chain source and followed their directions (of course I've accidentally gotten something wrong, or somesuch?).
The ./configure
stage of autoconf (actually G:\GNU-GCC\toolchain-avr\gcc\libgcc\configure
) seems to successfully invoke a gcc several times, using a Win32 program called xgcc.exe that autoconf make placed in my gcc-build/gcc directory. The last successful run has -qversion
for the compiler options.
The next run is the exact same invocation except it uses -o conftest -g -w -O2 -g0 -DWIN32 conftest.c
as compiler options, and this time tries to fire off the compiler using exec -m
.
This doesn't work, because the bash exec command doesn't have a -m
option.
Note that xgcc.exe
is a real program (not a script), and is compiled by the autoconf make step. It may be the cross compiler, as it gets copied to gcc-cross.exe
. Therefore I assume that the autoconf launcher (M4 macro?) is causing the error.
Here's a part of config.log
: (Look for the lines starting exec: usage: exec [-cl] [-a name] file ...
gcc version 4.9.2 (GCC)
configure:3373: $? = 0
configure:3362: /g/gnu-gcc/toolchain-avr/gcc-build/./gcc/xgcc -B/g/gnu-gcc/toolchain-avr/gcc-build/./gcc/ -B/g/gnu-gcc/toolchain-avr/objdir/gcc/avr/bin/ -B/g/gnu-gcc/toolchain-avr/objdir/gcc/avr/lib/ -isystem /g/gnu-gcc/toolchain-avr/objdir/gcc/avr/include -isystem /g/gnu-gcc/toolchain-avr/objdir/gcc/avr/sys-include -V
xgcc.exe: error: unrecognized command line option '-V'
xgcc.exe: fatal error: no input files
compilation terminated.
configure:3373: $? = 1
configure:3362: /g/gnu-gcc/toolchain-avr/gcc-build/./gcc/xgcc -B/g/gnu-gcc/toolchain-avr/gcc-build/./gcc/ -B/g/gnu-gcc/toolchain-avr/objdir/gcc/avr/bin/ -B/g/gnu-gcc/toolchain-avr/objdir/gcc/avr/lib/ -isystem /g/gnu-gcc/toolchain-avr/objdir/gcc/avr/include -isystem /g/gnu-gcc/toolchain-avr/objdir/gcc/avr/sys-include -qversion
xgcc.exe: error: unrecognized command line option '-qversion'
xgcc.exe: fatal error: no input files
compilation terminated.
configure:3373: $? = 1
configure:3389: /g/gnu-gcc/toolchain-avr/gcc-build/./gcc/xgcc -B/g/gnu-gcc/toolchain-avr/gcc-build/./gcc/ -B/g/gnu-gcc/toolchain-avr/objdir/gcc/avr/bin/ -B/g/gnu-gcc/toolchain-avr/objdir/gcc/avr/lib/ -isystem /g/gnu-gcc/toolchain-avr/objdir/gcc/avr/include -isystem /g/gnu-gcc/toolchain-avr/objdir/gcc/avr/sys-include -o conftest -g -w -O2 -g0 -DWIN32 conftest.c
g:/gnu-gcc/toolchain-avr/gcc-build/gcc/as: line 106: exec: -m: invalid option
exec: usage: exec [-cl] [-a name] file [redirection ...]
configure:3392: $? = 1
configure:3580: checking for suffix of object files
configure:3602: /g/gnu-gcc/toolchain-avr/gcc-build/./gcc/xgcc -B/g/gnu-gcc/toolchain-avr/gcc-build/./gcc/ -B/g/gnu-gcc/toolchain-avr/objdir/gcc/avr/bin/ -B/g/gnu-gcc/toolchain-avr/objdir/gcc/avr/lib/ -isystem /g/gnu-gcc/toolchain-avr/objdir/gcc/avr/include -isystem /g/gnu-gcc/toolchain-avr/objdir/gcc/avr/sys-include -c -g -w -O2 -g0 -DWIN32 conftest.c
g:/gnu-gcc/toolchain-avr/gcc-build/gcc/as: line 106: exec: -m: invalid option
exec: usage: exec [-cl] [-a name] file [redirection ...]
Here's the section of gcc-build/gcc/libgcc/config that I believe produced the log.
# Provide some information about the compiler.
$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
set X $ac_compile
ac_compiler=$2
for ac_option in --version -v -V -qversion; do
{ { ac_try="$ac_compiler $ac_option >&5"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
(eval "$ac_compiler $ac_option >&5") 2>conftest.err
ac_status=$?
if test -s conftest.err; then
sed '10a\
... rest of stderr output deleted ...
10q' conftest.err >conftest.er1
cat conftest.er1 >&5
rm -f conftest.er1 conftest.err
fi
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
done
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
At this point, I'm not sure where to go for help. The Arduino people have been non-responsive, and I don't know enough about autoconf to look for a problem in an autoconf.ac file, or in the autoconf code which generates ./config for the application, or the MC macros.
A scan for "exec" in the automake tools directory gave a zillion hits, none of which looked like an option was being added to "exec somethings...". But I know NOTHING about M4, and dread learning how to debug .ac files.
Suggestions, please?