X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f X-Received: by 2002:a37:d13:: with SMTP id 19mr8834928qkn.367.1610200712702; Sat, 09 Jan 2021 05:58:32 -0800 (PST) X-Received: by 2002:a25:ce87:: with SMTP id x129mr12414692ybe.218.1610200712450; Sat, 09 Jan 2021 05:58:32 -0800 (PST) Newsgroups: comp.os.msdos.djgpp Date: Sat, 9 Jan 2021 05:58:32 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse AT google DOT com Injection-Info: google-groups.googlegroups.com; posting-host=2a02:168:2000:5b:ba6d:8e5d:511e:5578; posting-account=JiCFPAoAAABE70raUeCRsH2gj1plDvK- NNTP-Posting-Host: 2a02:168:2000:5b:ba6d:8e5d:511e:5578 References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <92b10093-b718-498d-bba7-e7f65f4513bcn@googlegroups.com> Subject: Re: Issue building cross-compiler From: "Witold Baryluk (witold DOT baryluk AT gmail DOT com) [via djgpp AT delorie DOT com]" Injection-Date: Sat, 09 Jan 2021 13:58:32 +0000 Content-Type: text/plain; charset="UTF-8" Bytes: 15630 Lines: 291 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id 109EFGjL027020 Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Saturday, January 9, 2021 at 12:09:39 PM UTC, Witold Baryluk wrote: > Hi, > > I am trying to build gcc 10.2.0 on Linux targeting i486 dos. > > I am using Debian testing, on amd64. > > My host compiler is gcc 10.2.1 > > I did install binutils-djgpp 2.34 from Debian, but I also successfully compiled binutils djgpp 2.35 from upstream, using ./configure --target=i486-pc-msdosdjgpp --program-prefix=i486-pc-msdosdjgpp- && make -j32 && sudo make install > > Configuring gcc went fine: > > > ./configure --target=i486-pc-msdosdjgpp --program-prefix=i486-pc-msdosdjgpp- --disable-lto --disable-libstdcxx --disable-libada --disable-libquadmath --enable-serial-configure --disable-objc-gc --disable-libgomp --disable-libssp --disable-libatomic --disable-libsanitizer --disable-libquadmath-support --with-system-zlib --disable-libphobos --enable-languages=c --disable-libstdcxx-pch --disable-nls --disable-decimal-float --disable-libhsail-rt --disable-gcov --disable-tls > > checking build system type... x86_64-pc-linux-gnu > checking host system type... x86_64-pc-linux-gnu > checking target system type... i486-pc-msdosdjgpp > checking for a BSD-compatible install... /usr/bin/install -c > checking whether ln works... yes > checking whether ln -s works... yes > checking for a sed that does not truncate output... /usr/bin/sed > checking for gawk... gawk > checking for libitm support... no > checking for libvtv support... no > checking for gcc... gcc > checking whether the C compiler works... yes > checking for C compiler default output file name... a.out > checking for suffix of executables... > checking whether we are cross compiling... no > checking for suffix of object files... o > checking whether we are using the GNU C compiler... yes > checking whether gcc accepts -g... yes > checking for gcc option to accept ISO C89... none needed > checking for g++... g++ > checking whether we are using the GNU C++ compiler... yes > checking whether g++ accepts -g... yes > checking whether g++ accepts -static-libstdc++ -static-libgcc... yes > checking for gnatbind... no > checking for gnatmake... no > checking whether compiler driver understands Ada... no > checking how to compare bootstrapped objects... cmp --ignore-initial=16 $$f1 $$f2 > checking for objdir... .libs > checking for the correct version of gmp.h... yes > checking for the correct version of mpfr.h... yes > checking for the correct version of mpc.h... yes > checking for the correct version of the gmp/mpfr/mpc libraries... yes > checking for isl 0.15 or later... no > required isl version is 0.15 or later > *** This configuration is not supported in the following subdirectories: > zlib target-libquadmath gnattools target-libstdc++-v3 target-libitm target-libvtv gotools target-libada target-libhsail-rt target-libphobos target-zlib target-libbacktrace target-libgfortran target-libgo target-libffi target-libobjc target-libgomp target-liboffloadmic target-libatomic target-libsanitizer target-libssp > (Any other directories should still work fine.) > checking for default BUILD_CONFIG... > checking for --enable-vtable-verify... no > checking for bison... bison -y > checking for bison... bison > checking for gm4... no > checking for gnum4... no > checking for m4... m4 > checking for flex... flex > checking for flex... flex > checking for makeinfo... makeinfo > checking for expect... expect > checking for runtest... no > checking for ar... ar > checking for as... as > checking for dlltool... no > checking for ld... ld > checking for lipo... no > checking for nm... nm > checking for ranlib... ranlib > checking for strip... strip > checking for windres... no > checking for windmc... no > checking for objcopy... objcopy > checking for objdump... objdump > checking for otool... no > checking for readelf... readelf > checking for i486-pc-msdosdjgpp-cc... no > checking for i486-pc-msdosdjgpp-gcc... no > checking for i486-pc-msdosdjgpp-c++... no > checking for i486-pc-msdosdjgpp-g++... no > checking for i486-pc-msdosdjgpp-cxx... no > checking for i486-pc-msdosdjgpp-gxx... no > checking for i486-pc-msdosdjgpp-gcc... no > checking for i486-pc-msdosdjgpp-gfortran... no > checking for i486-pc-msdosdjgpp-gccgo... no > checking for i486-pc-msdosdjgpp-gdc... no > checking for ar... /usr/local/i486-pc-msdosdjgpp/bin/ar > checking for as... /usr/local/i486-pc-msdosdjgpp/bin/as > checking for dlltool... no > checking for i486-pc-msdosdjgpp-dlltool... no > checking for ld... /usr/local/i486-pc-msdosdjgpp/bin/ld > checking for lipo... no > checking for i486-pc-msdosdjgpp-lipo... no > checking for nm... /usr/local/i486-pc-msdosdjgpp/bin/nm > checking for objcopy... /usr/local/i486-pc-msdosdjgpp/bin/objcopy > checking for objdump... /usr/local/i486-pc-msdosdjgpp/bin/objdump > checking for otool... no > checking for i486-pc-msdosdjgpp-otool... no > checking for ranlib... /usr/local/i486-pc-msdosdjgpp/bin/ranlib > checking for readelf... /usr/local/i486-pc-msdosdjgpp/bin/readelf > checking for strip... /usr/local/i486-pc-msdosdjgpp/bin/strip > checking for windres... no > checking for i486-pc-msdosdjgpp-windres... no > checking for windmc... no > checking for i486-pc-msdosdjgpp-windmc... no > checking where to find the target ar... pre-installed in /usr/local/i486-pc-msdosdjgpp/bin > checking where to find the target as... pre-installed in /usr/local/i486-pc-msdosdjgpp/bin > checking where to find the target cc... just compiled > checking where to find the target c++... pre-installed > checking where to find the target c++ for libstdc++... pre-installed > checking where to find the target dlltool... pre-installed > checking where to find the target gcc... just compiled > checking where to find the target gfortran... pre-installed > checking where to find the target gccgo... pre-installed > checking where to find the target gdc... pre-installed > checking where to find the target ld... pre-installed in /usr/local/i486-pc-msdosdjgpp/bin > checking where to find the target lipo... pre-installed > checking where to find the target nm... pre-installed in /usr/local/i486-pc-msdosdjgpp/bin > checking where to find the target objcopy... pre-installed in /usr/local/i486-pc-msdosdjgpp/bin > checking where to find the target objdump... pre-installed in /usr/local/i486-pc-msdosdjgpp/bin > checking where to find the target otool... pre-installed > checking where to find the target ranlib... pre-installed in /usr/local/i486-pc-msdosdjgpp/bin > checking where to find the target readelf... pre-installed in /usr/local/i486-pc-msdosdjgpp/bin > checking where to find the target strip... pre-installed in /usr/local/i486-pc-msdosdjgpp/bin > checking where to find the target windres... pre-installed > checking where to find the target windmc... pre-installed > checking whether to enable maintainer-specific portions of Makefiles... no > configure: creating ./config.status > config.status: creating Makefile > > > Then make -j32, > > and after a bit it fails: > > > ... > checking for init priority support... yes > configure: updating cache ./config.cache > configure: creating ./config.status > config.status: creating Makefile > config.status: creating auto-target.h > mv -f .deps/libcp1.Tpo .deps/libcp1.Plo > config.status: executing default commands > /bin/bash ./libtool --tag=CXX --mode=link g++ -W -Wall -fvisibility=hidden -g -O2 -module -export-symbols ../.././libcc1/libcc1.sym -Xcompiler '-static-libstdc++' -Xcompiler '-static-libgcc' -o libcc1.la -rpath /usr/local/lib/../lib findcomp.lo libcc1.lo libcp1.lo names.lo callbacks.lo connection.lo marshall.lo -Wc,../libiberty/pic/libiberty.a > mv -f .deps/libcc1plugin.Tpo .deps/libcc1plugin.Plo > /bin/bash ./libtool --tag=CXX --mode=link g++ -W -Wall -fvisibility=hidden -g -O2 -module -export-symbols ../.././libcc1/libcc1plugin.sym -Xcompiler '-static-libstdc++' -Xcompiler '-static-libgcc' -o libcc1plugin.la -rpath /usr/local/lib/gcc/i486-pc-msdosdjgpp/10.2.0/plugin libcc1plugin.lo callbacks.lo connection.lo marshall.lo -Wc,../libiberty/pic/libiberty.a > libtool: link: g++ -fPIC -DPIC -shared -nostdlib /usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/10/crtbeginS.o .libs/findcomp.o .libs/libcc1.o .libs/libcp1.o .libs/names.o .libs/callbacks.o .libs/connection.o .libs/marshall.o -L/usr/lib/gcc/x86_64-linux-gnu/10 -L/usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/10/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/10/../../.. -lstdc++ -lm -lc -lgcc_s /usr/lib/gcc/x86_64-linux-gnu/10/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu/crtn.o -static-libstdc++ -static-libgcc ../libiberty/pic/libiberty.a -Wl,-soname -Wl,libcc1.so.0 -Wl,-retain-symbols-file -Wl,../.././libcc1/libcc1.sym -o .libs/libcc1.so.0.0.0 > libtool: link: g++ -fPIC -DPIC -shared -nostdlib /usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/10/crtbeginS.o .libs/libcc1plugin.o .libs/callbacks.o .libs/connection.o .libs/marshall.o -L/usr/lib/gcc/x86_64-linux-gnu/10 -L/usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/10/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/10/../../.. -lstdc++ -lm -lc -lgcc_s /usr/lib/gcc/x86_64-linux-gnu/10/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu/crtn.o -static-libstdc++ -static-libgcc ../libiberty/pic/libiberty.a -Wl,-soname -Wl,libcc1plugin.so.0 -Wl,-retain-symbols-file -Wl,../.././libcc1/libcc1plugin.sym -o .libs/libcc1plugin.so.0.0.0 > Adding multilib support to Makefile in ../.././libgcc > multidirs= > with_multisubdir= > make[2]: Entering directory '/home/user/gcc-10/gcc-10.2.0/i486-pc-msdosdjgpp/libgcc' > Makefile:183: ../.././gcc/libgcc.mvars: No such file or directory > make[2]: *** No rule to make target '../.././gcc/libgcc.mvars'. Stop. > make[2]: Leaving directory '/home/user/gcc-10/gcc-10.2.0/i486-pc-msdosdjgpp/libgcc' > make[1]: *** [Makefile:11367: all-target-libgcc] Error 2 > make[1]: *** Waiting for unfinished jobs.... > libtool: link: (cd ".libs" && rm -f "libcc1plugin.so.0" && ln -s "libcc1plugin.so.0.0.0" "libcc1plugin.so.0") > libtool: link: (cd ".libs" && rm -f "libcc1.so.0" && ln -s "libcc1.so.0.0.0" "libcc1.so.0") > libtool: link: (cd ".libs" && rm -f "libcc1plugin.so" && ln -s "libcc1plugin.so.0.0.0" "libcc1plugin.so") > libtool: link: (cd ".libs" && rm -f "libcc1.so" && ln -s "libcc1.so.0.0.0" "libcc1.so") > libtool: link: ( cd ".libs" && rm -f "libcc1.la" && ln -s "../libcc1.la" "libcc1.la" ) > libtool: link: ( cd ".libs" && rm -f "libcc1plugin.la" && ln -s "../libcc1plugin.la" "libcc1plugin.la" ) > mv -f .deps/libcp1plugin.Tpo .deps/libcp1plugin.Plo > /bin/bash ./libtool --tag=CXX --mode=link g++ -W -Wall -fvisibility=hidden -g -O2 -module -export-symbols ../.././libcc1/libcp1plugin.sym -Xcompiler '-static-libstdc++' -Xcompiler '-static-libgcc' -o libcp1plugin.la -rpath /usr/local/lib/gcc/i486-pc-msdosdjgpp/10.2.0/plugin libcp1plugin.lo callbacks.lo connection.lo marshall.lo -Wc,../libiberty/pic/libiberty.a > libtool: link: g++ -fPIC -DPIC -shared -nostdlib /usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/10/crtbeginS.o .libs/libcp1plugin.o .libs/callbacks.o .libs/connection.o .libs/marshall.o -L/usr/lib/gcc/x86_64-linux-gnu/10 -L/usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/10/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/10/../../.. -lstdc++ -lm -lc -lgcc_s /usr/lib/gcc/x86_64-linux-gnu/10/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu/crtn.o -static-libstdc++ -static-libgcc ../libiberty/pic/libiberty.a -Wl,-soname -Wl,libcp1plugin.so.0 -Wl,-retain-symbols-file -Wl,../.././libcc1/libcp1plugin.sym -o .libs/libcp1plugin.so.0.0.0 > libtool: link: (cd ".libs" && rm -f "libcp1plugin.so.0" && ln -s "libcp1plugin.so.0.0.0" "libcp1plugin.so.0") > libtool: link: (cd ".libs" && rm -f "libcp1plugin.so" && ln -s "libcp1plugin.so.0.0.0" "libcp1plugin.so") > libtool: link: ( cd ".libs" && rm -f "libcp1plugin.la" && ln -s "../libcp1plugin.la" "libcp1plugin.la" ) > make[3]: Leaving directory '/home/user/gcc-10/gcc-10.2.0/host-x86_64-pc-linux-gnu/libcc1' > make[2]: Leaving directory '/home/user/gcc-10/gcc-10.2.0/host-x86_64-pc-linux-gnu/libcc1' > make[1]: Leaving directory '/home/user/gcc-10/gcc-10.2.0' > make: *** [Makefile:938: all] Error 2 > > real 1m58.747s > user 23m34.388s > sys 1m30.904s > user AT debian:~/gcc-10/gcc-10.2.0$ > > > > I tried, also --disable-shared, not change. > Any help? > > Thanks in advance. I found the issue. You need to done configure and build in a separate directory (i.e. build). Building in the top level directory is not supported. So: mkdir build && cd build && ../configure ...... && make && sudo make install This makes gcc happy. Still a bunch of options are needed. I did manage to convince and use djgpp libraryes to link (-Iinclude/ -Llib/ -Blib/), and run under dosbox, with `cwsdpmi.exe -p` started first, and even use some IO in hello world program. Nice.