I did the following change:
--- config/acx.m4.old 2019-10-02 02:39:31.976773572 +0300
+++ config/acx.m4 2019-10-02 02:08:57.223563920 +0300
@@ -522,7 +522,7 @@
fi
else
ifelse([$4],,,
- [ok=yes
+ [ok=no
case " ${configdirs} " in
*" patsubst([$4], [/.*], []) "*) ;;
*) ok=no ;;
and now --with-build-time-tools= works properly
and finds all the needed build tools, including gcc and
g++. So there seem to be a bug somewhere here most
certainly.
Any ideas?
01.10.2019 13:31, stsp пишет:
Hello.
I am trying to build djgpp/cross-gcc with host's
gcc and pre-built (with host's prefix) djgpp.
First, I've tried the option --with-build-time-tools=.
It allowed to pick up the binutils part of host's
djgpp (as, ld etc), but it doesn't pick up host's
i586-pc-msdosdjgpp-gcc and i586-pc-msdosdjgpp-g++.
Then I've found the following env variables:
GCC_FOR_TARGET, CC_FOR_TARGET, CXX_FOR_TARGET.
Setting them to the appropriate host's djgpp
binaries allowed for a correct top-level configure
of gcc. The configure line was:
../gnu/gcc-9.2.0/configure --disable-plugin --enable-lto
--disable-libssp --
disable-nls --enable-libquadmath-support
--enable-version-specific-runtime-libs
--enable-fat --enable-libstdcxx-filesystem-ts
--target=i586-pc-msdosdjgpp --enab
le-languages=c,c++ --prefix=/usr/local/cross
--with-build-time-tools=/home/stas/
src/build-gcc/build/tmpinst/usr/local/cross
GCC_FOR_TARGET=/home/stas/src/build-
gcc/build/tmpinst/usr/local/cross/bin/i586-pc-msdosdjgpp-gcc
CC_FOR_TARGET=/home
/stas/src/build-gcc/build/tmpinst/usr/local/cross/bin/i586-pc-msdosdjgpp-gcc
CXX
_FOR_TARGET=/home/stas/src/build-gcc/build/tmpinst/usr/local/cross/bin/i586-pc-m
sdosdjgpp-g++
The problem is that these variables are not
passed down to the sub-project configures.
For example libstdc++ is now configured as:
/home/stas/src/build-gcc/build/djcross-gcc-9.2.0/gnu/gcc-9.2.0/libstdc++-v3/
configure --srcdir=../../../gnu/gcc-9.2.0/libstdc++-v3
--cache-file=./config.cac
he --enable-multilib --with-cross-host=x86_64-pc-linux-gnu
--disable-plugin --en
able-lto --disable-libssp --disable-nls --enable-libquadmath-support
--enable-ve
rsion-specific-runtime-libs --enable-fat
--enable-libstdcxx-filesystem-ts --pref
ix=/usr/local/cross
--with-build-time-tools=/home/stas/src/build-gcc/build/tmpin
st/usr/local/cross --enable-languages=c,c++,lto
--program-transform-name=s&^&i58
6-pc-msdosdjgpp-& --disable-option-checking
--with-target-subdir=i586-pc-msdosdj
gpp --build=x86_64-pc-linux-gnu --host=i586-pc-msdosdjgpp
--target=i586-pc-msdos
djgpp
Note that --with-build-time-tools= was correctly passed,
but the env vars are missing. I tried to export them in a
shell, but this has no effect. In fact, I can't even find the
handling of these vars in the configure.ac files of sub-projects:
it seems to be present only in the top-level configure.ac:
GCC_TARGET_TOOL(cc, CC_FOR_TARGET, CC, [gcc/xgcc
-B$$r/$(HOST_SUBDIR)/gcc/])
Such things are only in the top-level configure.ac.
As the result, the configure of libstdc++ is picking up the
xgcc from its source tree, rather than the one pre-built on
the host. Since the new xgcc has the target-specific prefix,
the configuration process fails:
configure:4517: checking for
/home/stas/src/build-gcc/build/djcross-gcc-9.2.0/dj
cross-stage2/./gcc/xgcc
-B/home/stas/src/build-gcc/build/djcross-gcc-9.2.0/djcro
ss-stage2/./gcc/ -B/usr/local/cross/i586-pc-msdosdjgpp/bin/
-B/usr/local/cross/i
586-pc-msdosdjgpp/lib/ -isystem
/usr/local/cross/i586-pc-msdosdjgpp/include -isy
stem /usr/local/cross/i586-pc-msdosdjgpp/sys-include option to
accept ISO C89
configure:4580:
/home/stas/src/build-gcc/build/djcross-gcc-9.2.0/djcross-stage2/
./gcc/xgcc
-B/home/stas/src/build-gcc/build/djcross-gcc-9.2.0/djcross-stage2/./g
cc/ -B/usr/local/cross/i586-pc-msdosdjgpp/bin/
-B/usr/local/cross/i586-pc-msdosd
jgpp/lib/ -isystem /usr/local/cross/i586-pc-msdosdjgpp/include
-isystem /usr/loc
al/cross/i586-pc-msdosdjgpp/sys-include -c -g -O2 conftest.c >&5
conftest.c:10:10: fatal error: stdio.h: No such file or directory
10 | #include <stdio.h>
Note that it took the ./gcc/xgcc instead of anything from host.
The questions are:
1. Why the env vars are not passed down to the sub-project
configures? Is it a bug in the gcc build system or its just me?
2. How can I convince the gcc build system to pick up the
host's pre-built djgpp for building the target libraries? It wants
to pick up the newly-built xgcc and I find no way of preventing
that.