On 2/18/19 1:31 AM, Paul Smith wrote: > On Mon, 2019-02-18 at 01:02 -0500, Dennis Clarke wrote: >> Now I see : > > It's helpful if you provide the exact commands you invoked to get here. Right ... sorry. I have been hacking away at this for a few days now and posted a few questions but am now getting to see the light at the end of a very long twisty dark tunnel. There appears to be two world to care for in the cross compile. Actually this may be worse than a cross compile. This is a criss-cross compile :-) I have fully nativ compilers on the system. Those are the HOST machine bits and they work great. They are in the usual places like /usr/local/bin and do what they are supposed to do. Then there is a cross-compiler that was built with the HOST tools. That stuff is located in /opt/tools and they do exactly what they are supposed to do and produce output assembly and object files for the TARGET machine. So the trick is to use the cross compiler tools in /opt/tools to build a fully native compiler for the target machine. To do that it seems clear now that one must have *both* the HOST compiler tools and the TARGET tools which are really the cross compiler and linker and assembler. There exists a slurry of environment variables to setup for this and greping into the configure file reveals them : vesta_$ env | sort | grep 'BUILD' AR_FOR_BUILD=/usr/local/bin/ar AS_FOR_BUILD=/usr/local/bin/as CC_FOR_BUILD=/usr/local/bin/gcc8 CXX_FOR_BUILD=/usr/local/bin/g++ LD_FOR_BUILD=/usr/local/bin/ld NM_FOR_BUILD=/usr/local/bin/nm -p RANLIB_FOR_BUILD=/usr/local/bin/ranlib Those things are all native to the HOST machine and they work great. vesta_$ env | sort | grep 'TARGET' AR_FOR_TARGET=/opt/tools/bin/riscv64-unknown-freebsd12.0-ar AS_FOR_TARGET=/opt/tools/bin/riscv64-unknown-freebsd12.0-as CC_FOR_TARGET=/opt/tools/bin/riscv64-unknown-freebsd12.0-gcc CFLAGS_FOR_TARGET=--sysroot=/riscv64/rootfs -L/riscv64/rootfs/lib -O0 -fno-builtin -march=rv64imafdc -mabi=lp64d -mpreferred-stack-boundary=4 -mstrict-align -mexplicit-relocs -g CXXFLAGS_FOR_TARGET=--sysroot=/riscv64/rootfs -L/riscv64/rootfs/lib -O0 -fno-builtin -march=rv64imafdc -mabi=lp64d -mpreferred-stack-boundary=4 -mstrict-align -mexplicit-relocs -g CXX_FOR_TARGET=/opt/tools/bin/riscv64-unknown-freebsd12.0-g++ LDFLAGS_FOR_TARGET=-L/riscv64/rootfs/usr/lib LD_FOR_TARGET=/opt/tools/bin/riscv64-unknown-freebsd12.0-ld NM_FOR_TARGET=/opt/tools/bin/riscv64-unknown-freebsd12.0-nm -p OBJCOPY_FOR_TARGET=/opt/tools/bin/riscv64-unknown-freebsd12.0-objcopy OBJDUMP_FOR_TARGET=/opt/tools/bin/riscv64-unknown-freebsd12.0-objdump RANLIB_FOR_TARGET=/opt/tools/bin/riscv64-unknown-freebsd12.0-ranlib READELF_FOR_TARGET=/opt/tools/bin/riscv64-unknown-freebsd12.0-readelf STRIP_FOR_TARGET=/opt/tools/bin/riscv64-unknown-freebsd12.0-strip vesta_$ Those things are all the cross compiler tools that should be used for creating the output objects for the TARGET machine. There also exists a full system root directory for the TARGET machine in a place called /riscv64/rootfs/ thus : vesta_$ ls -lapb /riscv64/rootfs/ total 95 drwxr-xr-x 18 root wheel 21 Feb 15 11:21 ./ drwxr-xr-x 3 root wheel 3 Feb 15 11:07 ../ -rw-r--r-- 2 root wheel 927 Feb 15 11:21 .cshrc -rw-r--r-- 2 root wheel 567 Feb 15 11:21 .profile -r--r--r-- 1 root wheel 6174 Feb 15 11:21 COPYRIGHT drwxr-xr-x 2 root wheel 46 Feb 15 11:08 bin/ drwxr-xr-x 9 root wheel 32 Feb 15 11:21 boot/ dr-xr-xr-x 2 root wheel 2 Feb 15 11:08 dev/ drwxr-xr-x 26 root wheel 101 Feb 15 11:22 etc/ drwxr-xr-x 5 root wheel 59 Feb 15 11:09 lib/ drwxr-xr-x 3 root wheel 4 Feb 15 11:08 libexec/ drwxr-xr-x 2 root wheel 2 Feb 15 11:08 media/ drwxr-xr-x 2 root wheel 2 Feb 15 11:08 mnt/ drwxr-xr-x 2 root wheel 2 Feb 15 11:08 net/ dr-xr-xr-x 2 root wheel 2 Feb 15 11:08 proc/ drwxr-xr-x 2 root wheel 147 Feb 15 11:08 rescue/ drwxr-xr-x 2 root wheel 7 Feb 15 11:21 root/ drwxr-xr-x 2 root wheel 134 Feb 15 11:09 sbin/ drwxrwxrwt 2 root wheel 2 Feb 15 11:08 tmp/ drwxr-xr-x 14 root wheel 14 Feb 18 05:47 usr/ drwxr-xr-x 24 root wheel 24 Feb 15 11:08 var/ vesta_$ Everything there is built for a RISC-V rv64imafdc architecture. There even exists a /usr/local there with gmp/mpfr/mpc all built and with headers and libs and all that goodness. So the tough part is to figure out when the HOST compiler wants things and from where and the TARGET compiler ( cross compiler ) wants things and from where. ALso there needs to exist separate LD stuff and include directories and such. Otherwise crt1.o and crtn.o and friends will never be found for the TARGET machine. So one must have settings in places unknown and mysterious for that information. Oh, also, lest I forget, one must have the gmp/mpfr/mpc sources inside the gcc 8.2.0 tree but ALSO the libs must exist somewhere and the headers also somewhere and that must means for both the HOST and the TARGET somehow. All very dark and mysterious why gmp.h has to be found somewhere on the build machine when the sources are in the tree. Magic? So then setup ALL that goodness all over the place and then : vesta_$ env | sort AR=/usr/local/bin/ar AR_FOR_BUILD=/usr/local/bin/ar AR_FOR_TARGET=/opt/tools/bin/riscv64-unknown-freebsd12.0-ar AS=/usr/local/bin/as AS_FOR_BUILD=/usr/local/bin/as AS_FOR_TARGET=/opt/tools/bin/riscv64-unknown-freebsd12.0-as AWK=/usr/local/bin/gawk BISON=/usr/local/bin/bison BLOCKSIZE=K CC_FOR_BUILD=/usr/local/bin/gcc8 CC_FOR_TARGET=/opt/tools/bin/riscv64-unknown-freebsd12.0-gcc CFLAGS=--sysroot=/riscv64/rootfs -L/riscv64/rootfs/lib -O0 -fno-builtin -march=rv64imafdc -mabi=lp64d -mpreferred-stack-boundary=4 -mstrict-align -mexplicit-relocs -g CFLAGS_FOR_TARGET=--sysroot=/riscv64/rootfs -L/riscv64/rootfs/lib -O0 -fno-builtin -march=rv64imafdc -mabi=lp64d -mpreferred-stack-boundary=4 -mstrict-align -mexplicit-relocs -g CXXFLAGS=--sysroot=/riscv64/rootfs -L/riscv64/rootfs/lib -O0 -fno-builtin -march=rv64imafdc -mabi=lp64d -mpreferred-stack-boundary=4 -mstrict-align -mexplicit-relocs -g CXXFLAGS_FOR_TARGET=--sysroot=/riscv64/rootfs -L/riscv64/rootfs/lib -O0 -fno-builtin -march=rv64imafdc -mabi=lp64d -mpreferred-stack-boundary=4 -mstrict-align -mexplicit-relocs -g CXX_FOR_BUILD=/usr/local/bin/g++ CXX_FOR_TARGET=/opt/tools/bin/riscv64-unknown-freebsd12.0-g++ DISPLAY=localhost:11.0 EDITOR=/usr/bin/vi ELFEDIT=/opt/tools/bin/riscv64-unknown-freebsd12.0-elfedit ENV=/home/dclarke/.shrc GREP=/usr/local/bin/grep HOME=/home/dclarke LANG=C LC_COLLATE=C LC_CTYPE=C LC_MESSAGES=C LC_MONETARY=C LC_NUMERIC=C LC_TIME=C LD=/usr/local/bin/ld LDFLAGS_FOR_TARGET=-L/riscv64/rootfs/usr/lib LD_FOR_BUILD=/usr/local/bin/ld LD_FOR_TARGET=/opt/tools/bin/riscv64-unknown-freebsd12.0-ld LD_LIBRARY_PATH=/riscv64/rootfs/usr/local/lib LOGNAME=dclarke M4=/usr/local/bin/gm4 MAIL=/var/mail/dclarke MAKE=/usr/local/bin/gmake NM_FOR_BUILD=/usr/local/bin/nm -p NM_FOR_TARGET=/opt/tools/bin/riscv64-unknown-freebsd12.0-nm -p OBJCOPY=/usr/local/bin/objcopy OBJCOPY_FOR_TARGET=/opt/tools/bin/riscv64-unknown-freebsd12.0-objcopy OBJDUMP=/usr/local/bin/objdump OBJDUMP_FOR_TARGET=/opt/tools/bin/riscv64-unknown-freebsd12.0-objdump OLDPWD=/home/dclarke/rv64g_local/build PAGER=/usr/bin/more PATH=/opt/tools/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/opt/schily/bin PREFIX=/opt/tools PWD=/home/dclarke/rv64g_local/build/gcc-8.2.0_rv64imafdc.007 RANLIB=/usr/local/bin/ranlib RANLIB_FOR_BUILD=/usr/local/bin/ranlib RANLIB_FOR_TARGET=/opt/tools/bin/riscv64-unknown-freebsd12.0-ranlib READELF=/usr/local/bin/readelf READELF_FOR_TARGET=/opt/tools/bin/riscv64-unknown-freebsd12.0-readelf SHELL=/bin/sh SIZE=/opt/tools/bin/riscv64-unknown-freebsd12.0-size SSH_CLIENT=172.16.35.3 58667 22 SSH_CONNECTION=172.16.35.3 58667 172.16.35.13 22 SSH_TTY=/dev/pts/1 STRINGS=/opt/tools/bin/riscv64-unknown-freebsd12.0-strings STRIP=/usr/local/bin/strip STRIP_FOR_TARGET=/opt/tools/bin/riscv64-unknown-freebsd12.0-strip TERM=vt100 TMPDIR=/var/tmp/dclarke USER=dclarke VISUAL=/usr/bin/vi XTERM_LOCALE=C vesta_$ Forgot to mention that the sysroot option must be specified for the TARGET machine or a whack of things won't get found. Let's run configure .... vesta_$ vesta_$ CFLAGS=\--sysroot=/riscv64/rootfs\ \ > \-L/riscv64/rootfs/lib\ \ > \-I/riscv64/rootfs/usr/local/include\ \ > \-O0\ \-fno-builtin\ \-march=rv64imafdc\ \-mabi=lp64d\ \ > \-mpreferred-stack-boundary=4\ \ > \-mstrict-align\ \-mexplicit-relocs\ \-g \ > CXXFLAGS=\--sysroot=/riscv64/rootfs\ \ > \-L/riscv64/rootfs/lib\ \ > \-I/riscv64/rootfs/usr/local/include\ \ > \-O0\ \-fno-builtin\ \-march=rv64imafdc\ \-mabi=lp64d\ \ > \-mpreferred-stack-boundary=4\ \ > \-mstrict-align\ \-mexplicit-relocs\ \-g \ > ../gcc-8.2.0/configure \ > --build=x86_64-unknown-freebsd12.0 \ > --host=riscv64-unknown-freebsd12.0 \ > --target=riscv64-unknown-freebsd12.0 \ > --with-sysroot=/riscv64/rootfs \ > --prefix=/usr/local/gcc8 --without-headers \ > --with-build-time-tools=/opt/tools/bin \ > --disable-multilib --enable-threads=posix \ > --enable-tls --disable-bootstrap --enable-languages=c,c++ \ > --disable-libquadmath --disable-libgomp --disable-libvtv \ > --enable-checking=all --disable-nls \ > --enable-decimal-float=no --with-diagnostics-color=never \ > --disable-lto --without-newlib --disable-werror \ > --disable-libatomic --disable-lib checking build system type... x86_64-unknown-freebsd12.0 checking host system type... riscv64-unknown-freebsd12.0 checking target system type... riscv64-unknown-freebsd12.0 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/local/bin/gsed checking for gawk... /usr/local/bin/gawk checking for libitm support... no checking for libsanitizer support... no checking for libmpx support... no checking for libhsail-rt support... no checking for riscv64-unknown-freebsd12.0-gcc... riscv64-unknown-freebsd12.0-gcc checking for C compiler default output file name... a.out checking whether the C compiler works... yes checking whether we are cross compiling... yes checking for suffix of executables... checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether riscv64-unknown-freebsd12.0-gcc accepts -g... yes checking for riscv64-unknown-freebsd12.0-gcc option to accept ISO C89... none needed checking for riscv64-unknown-freebsd12.0-g++... riscv64-unknown-freebsd12.0-g++ checking whether we are using the GNU C++ compiler... yes checking whether riscv64-unknown-freebsd12.0-g++ accepts -g... yes checking whether g++ accepts -static-libstdc++ -static-libgcc... yes checking for riscv64-unknown-freebsd12.0-gnatbind... no checking for gnatbind... no checking for riscv64-unknown-freebsd12.0-gnatmake... no checking for gnatmake... no checking whether compiler driver understands Ada... no checking how to compare bootstrapped objects... cmp $$f1 $$f2 16 16 checking for objdir... .libs 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: target-libquadmath target-libitm target-libsanitizer target-libmpx gnattools gotools target-libada target-libhsail-rt target-libgfortran target-libbacktrace target-libgo target-libffi target-libobjc target-libgomp target-liboffloadmic target-libatomic target-libvtv (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... /usr/local/bin/bison checking for gm4... /usr/local/bin/gm4 checking for flex... flex checking for flex... flex checking for makeinfo... makeinfo checking for expect... no checking for runtest... no checking for ar... (cached) /usr/local/bin/ar checking for riscv64-unknown-freebsd12.0-ar... (cached) /usr/local/bin/ar checking for as... (cached) /usr/local/bin/as checking for riscv64-unknown-freebsd12.0-as... (cached) /usr/local/bin/as checking for riscv64-unknown-freebsd12.0-dlltool... no checking for ld... (cached) /usr/local/bin/ld checking for riscv64-unknown-freebsd12.0-ld... (cached) /usr/local/bin/ld checking for riscv64-unknown-freebsd12.0-lipo... no checking for riscv64-unknown-freebsd12.0-nm... riscv64-unknown-freebsd12.0-nm checking for ranlib... (cached) /usr/local/bin/ranlib checking for riscv64-unknown-freebsd12.0-ranlib... (cached) /usr/local/bin/ranlib checking for strip... (cached) /usr/local/bin/strip checking for riscv64-unknown-freebsd12.0-strip... (cached) /usr/local/bin/strip checking for riscv64-unknown-freebsd12.0-windres... no checking for riscv64-unknown-freebsd12.0-windmc... no checking for objcopy... (cached) /usr/local/bin/objcopy checking for riscv64-unknown-freebsd12.0-objcopy... (cached) /usr/local/bin/objcopy checking for objdump... (cached) /usr/local/bin/objdump checking for riscv64-unknown-freebsd12.0-objdump... (cached) /usr/local/bin/objdump checking for readelf... (cached) /usr/local/bin/readelf checking for riscv64-unknown-freebsd12.0-readelf... (cached) /usr/local/bin/readelf checking for cc... (cached) /opt/tools/bin/riscv64-unknown-freebsd12.0-gcc checking for gcc... (cached) /opt/tools/bin/riscv64-unknown-freebsd12.0-gcc checking for c++... (cached) /opt/tools/bin/riscv64-unknown-freebsd12.0-g++ checking for g++... (cached) /opt/tools/bin/riscv64-unknown-freebsd12.0-g++ checking for cxx... (cached) /opt/tools/bin/riscv64-unknown-freebsd12.0-g++ checking for gxx... (cached) /opt/tools/bin/riscv64-unknown-freebsd12.0-g++ checking for gcc in /opt/tools/bin... no checking for riscv64-unknown-freebsd12.0-gcc... riscv64-unknown-freebsd12.0-gcc checking for gfortran in /opt/tools/bin... no checking for riscv64-unknown-freebsd12.0-gfortran... no checking for gccgo in /opt/tools/bin... no checking for riscv64-unknown-freebsd12.0-gccgo... no checking for ar in /opt/tools/bin... no checking for ar... (cached) /opt/tools/bin/riscv64-unknown-freebsd12.0-ar checking for as in /opt/tools/bin... no checking for as... (cached) /opt/tools/bin/riscv64-unknown-freebsd12.0-as checking for dlltool in /opt/tools/bin... no checking for dlltool in /opt/tools/bin... no checking for riscv64-unknown-freebsd12.0-dlltool... no checking for ld in /opt/tools/bin... no checking for ld... (cached) /opt/tools/bin/riscv64-unknown-freebsd12.0-ld checking for lipo in /opt/tools/bin... no checking for lipo in /opt/tools/bin... no checking for riscv64-unknown-freebsd12.0-lipo... no checking for nm in /opt/tools/bin... no checking for nm... (cached) /opt/tools/bin/riscv64-unknown-freebsd12.0-nm -p checking for objcopy in /opt/tools/bin... no checking for objcopy... (cached) /opt/tools/bin/riscv64-unknown-freebsd12.0-objcopy checking for objdump in /opt/tools/bin... no checking for objdump... (cached) /opt/tools/bin/riscv64-unknown-freebsd12.0-objdump checking for ranlib in /opt/tools/bin... no checking for ranlib... (cached) /opt/tools/bin/riscv64-unknown-freebsd12.0-ranlib checking for readelf in /opt/tools/bin... no checking for readelf... (cached) /opt/tools/bin/riscv64-unknown-freebsd12.0-readelf checking for strip in /opt/tools/bin... no checking for strip... (cached) /opt/tools/bin/riscv64-unknown-freebsd12.0-strip checking for windres in /opt/tools/bin... no checking for windres in /opt/tools/bin... no checking for riscv64-unknown-freebsd12.0-windres... no checking for windmc in /opt/tools/bin... no checking for windmc in /opt/tools/bin... no checking for riscv64-unknown-freebsd12.0-windmc... no checking where to find the target ar... pre-installed in /opt/tools/bin checking where to find the target as... pre-installed in /opt/tools/bin checking where to find the target cc... pre-installed in /opt/tools/bin checking where to find the target c++... pre-installed in /opt/tools/bin checking where to find the target c++ for libstdc++... pre-installed in /opt/tools/bin checking where to find the target dlltool... pre-installed checking where to find the target gcc... pre-installed checking where to find the target gfortran... pre-installed checking where to find the target gccgo... pre-installed checking where to find the target ld... pre-installed in /opt/tools/bin checking where to find the target lipo... pre-installed checking where to find the target nm... pre-installed in /opt/tools/bin . checking where to find the target objcopy... pre-installed in /opt/tools/bin checking where to find the target objdump... pre-installed in /opt/tools/bin checking where to find the target ranlib... pre-installed in /opt/tools/bin checking where to find the target readelf... pre-installed in /opt/tools/bin checking where to find the target strip... pre-installed in /opt/tools/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 vesta_$ Short and sweet. Running make looks fine well through gmp and once we hit mpfr ... . . . libtool: link: ( cd ".libs" && rm -f "libgmp.la" && ln -s "../libgmp.la" "libgmp.la" ) gmake[4]: Leaving directory '/usr/home/dclarke/rv64g_local/build/gcc-8.2.0_rv64imafdc.007/gmp' gmake[3]: Leaving directory '/usr/home/dclarke/rv64g_local/build/gcc-8.2.0_rv64imafdc.007/gmp' gmake[2]: Leaving directory '/usr/home/dclarke/rv64g_local/build/gcc-8.2.0_rv64imafdc.007/gmp' mkdir ./mpfr Configuring in ./mpfr configure: creating cache ./config.cache checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for riscv64-unknown-freebsd12.0-strip... /usr/local/bin/strip checking for a thread-safe mkdir -p... ../../gcc-8.2.0/mpfr/install-sh -c -d checking for gawk... /usr/local/bin/gawk checking whether /usr/local/bin/gmake sets $(MAKE)... yes checking whether /usr/local/bin/gmake supports nested variables... yes checking whether to enable maintainer-specific portions of Makefiles... yes checking build system type... x86_64-unknown-freebsd12.0 checking host system type... riscv64-unknown-freebsd12.0 checking for grep that handles long lines and -e... /usr/local/bin/grep checking for egrep... /usr/local/bin/grep -E checking for a sed that does not truncate output... /usr/local/bin/gsed checking whether configure options are compatible... yes checking for riscv64-unknown-freebsd12.0-gcc... riscv64-unknown-freebsd12.0-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... yes checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether riscv64-unknown-freebsd12.0-gcc accepts -g... yes checking for riscv64-unknown-freebsd12.0-gcc option to accept ISO C89... none needed checking whether riscv64-unknown-freebsd12.0-gcc understands -c and -o together... yes checking whether /usr/local/bin/gmake supports the include directive... yes (GNU style) checking dependency style of riscv64-unknown-freebsd12.0-gcc... gcc3 checking how to run the C preprocessor... riscv64-unknown-freebsd12.0-gcc -E checking for riscv64-unknown-freebsd12.0-ar... /usr/local/bin/ar checking the archiver (/usr/local/bin/ar) interface... ar checking how to print strings... printf checking for a sed that does not truncate output... (cached) /usr/local/bin/gsed checking for fgrep... /usr/local/bin/grep -F checking for ld used by riscv64-unknown-freebsd12.0-gcc... /usr/local/bin/ld checking if the linker (/usr/local/bin/ld) is GNU ld... yes checking for BSD- or MS-compatible name lister (nm)... riscv64-unknown-freebsd12.0-nm checking the name lister (riscv64-unknown-freebsd12.0-nm) interface... BSD nm checking whether ln -s works... yes checking the maximum length of command line arguments... 196608 checking how to convert x86_64-unknown-freebsd12.0 file names to riscv64-unknown-freebsd12.0 format... func_convert_file_noop checking how to convert x86_64-unknown-freebsd12.0 file names to toolchain format... func_convert_file_noop checking for /usr/local/bin/ld option to reload object files... -r checking for riscv64-unknown-freebsd12.0-objdump... /usr/local/bin/objdump checking how to recognize dependent libraries... pass_all checking for riscv64-unknown-freebsd12.0-dlltool... riscv64-unknown-freebsd12.0-dlltool checking how to associate runtime and link libraries... printf %s\n checking for riscv64-unknown-freebsd12.0-ar... (cached) /usr/local/bin/ar checking for archiver @FILE support... @ checking for riscv64-unknown-freebsd12.0-strip... (cached) /usr/local/bin/strip checking for riscv64-unknown-freebsd12.0-ranlib... /usr/local/bin/ranlib checking command to parse riscv64-unknown-freebsd12.0-nm output from riscv64-unknown-freebsd12.0-gcc object... ok checking for sysroot... /riscv64/rootfs checking for a working dd... /bin/dd checking how to truncate binary pipes... /bin/dd bs=4096 count=1 checking for riscv64-unknown-freebsd12.0-mt... no checking for mt... mt configure: WARNING: using cross tools not prefixed with host triplet checking if mt is a manifest tool... no checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking for dlfcn.h... yes checking for objdir... .libs checking if riscv64-unknown-freebsd12.0-gcc supports -fno-rtti -fno-exceptions... no checking for riscv64-unknown-freebsd12.0-gcc option to produce PIC... -fPIC -DPIC checking if riscv64-unknown-freebsd12.0-gcc PIC flag -fPIC -DPIC works... yes checking if riscv64-unknown-freebsd12.0-gcc static flag -static works... yes checking if riscv64-unknown-freebsd12.0-gcc supports -c -o file.o... yes checking if riscv64-unknown-freebsd12.0-gcc supports -c -o file.o... (cached) yes checking whether the riscv64-unknown-freebsd12.0-gcc linker (/usr/local/bin/ld) supports shared libraries... yes checking dynamic linker characteristics... freebsd12.0 ld.so checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... no checking whether to build static libraries... yes checking format of `double' floating point... configure: WARNING: format of `double' floating-point not recognized checking for ICC... no checking for an ANSI C-conforming const... yes checking for working volatile... yes checking whether byte ordering is bigendian... no checking for main in -lm... yes checking for main in -lquadmath... no checking whether time.h and sys/time.h may both be included... yes checking for size_t... yes checking limits.h usability... yes checking limits.h presence... yes checking for limits.h... yes checking float.h usability... yes checking float.h presence... yes checking for float.h... yes checking for string.h... (cached) yes checking locale.h usability... yes checking locale.h presence... yes checking for locale.h... yes checking wchar.h usability... yes checking wchar.h presence... yes checking for wchar.h... yes checking stdarg.h usability... yes checking stdarg.h presence... yes checking for stdarg.h... yes checking sys/time.h usability... yes checking sys/time.h presence... yes checking for sys/time.h... yes checking sys/fpu.h usability... no checking sys/fpu.h presence... no checking for sys/fpu.h... no checking for struct lconv.decimal_point... yes checking for struct lconv.thousands_sep... yes checking for working alloca.h... no checking for alloca... yes checking how to copy va_list... va_copy checking for memmove... yes checking for memset... yes checking for setlocale... yes checking for strtol... yes checking for gettimeofday... yes checking for signal... yes checking for sigaction and its associated structure... yes checking for long long int... yes checking for intmax_t... yes checking for working INTMAX_MAX... yes checking for working printf length modifier for intmax_t... j checking for union fpc_csr... no checking for _Noreturn... yes checking for __builtin_unreachable... yes checking for constructor and destructor attributes... yes checking for fesetround... yes checking for gcc float-conversion bug... cannot test, use -ffloat-store checking for subnormal double-precision numbers... cannot test, assume no checking for subnormal single-precision numbers... cannot test, assume no checking for signed zeros... cannot test, assume no checking if the FP division by 0 fails... cannot test, assume no checking if NAN == NAN... cannot test, assume no checking if charset has consecutive values... cannot test checking for math/round... yes checking for math/trunc... yes checking for math/floor... yes checking for math/ceil... yes checking for math/nearbyint... yes checking for _mulx_u64... cannot test, assume no checking for long double... yes checking format of `long double' floating point... IEEE quad, little endian checking for TLS support using C11... cannot test, assume no checking for TLS support... cannot test, assume no checking if __float128 with hex constants is supported... no checking for Static Assertion support... yes checking for library containing clock_gettime... none required checking for gmp.h... yes checking whether gcc __attribute__ ((mode (XX))) works... yes checking for recent GMP... yes checking usable gmp.h at link time... yes checking for GMP_NUMB_BITS and sizeof(mp_limb_t) consistency... cannot test checking for __gmpz_init in -lgmp... no configure: error: libgmp not found or uses a different ABI (including static vs shared). Please read the INSTALL file -- see "In case of problem". gmake[1]: *** [Makefile:5139: configure-mpfr] Error 1 gmake[1]: Leaving directory '/usr/home/dclarke/rv64g_local/build/gcc-8.2.0_rv64imafdc.007' gmake: *** [Makefile:906: all] Error 2 vesta_$ So there we see "libgmp not found" even though it exist everywhere and the sources are in the tree and the headers are on the native system and on the target system and the libs. Baffling. I think that the build process at this point must be running the CC_FOR_TARGET and somehow the wrong libs are being found ... even though .. they were just built a moment ago. Dennis