YACCQ : Yet Another Cross Compiler Question ... cannot compute suffix of object files

Dennis Clarke dclarke@blastwave.org
Sun Feb 17 06:47:00 GMT 2019


This is a puzzler but then again just about any time a cross
compile happens there always seems to be a puzzle.

So long story short I built a target output system file structure
on a FreeBSD 12 x86_64 box wherein the output is a RISC-V rv64gc
type unit.[1]  It is the sort of thing where the kernel build and
all the usual goodness builds fine and drops into the target
file structure at /riscv64/rootfs perfectly :

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 15 11:08 usr/
drwxr-xr-x  24 root  wheel    24 Feb 15 11:08 var/
vesta_$

Stuff there looks fine :

vesta_$
vesta_$ file /riscv64/rootfs/usr/lib/crt1.o
/riscv64/rootfs/usr/lib/crt1.o: ELF 64-bit LSB relocatable, UCB RISC-V,
version 1 (SYSV), FreeBSD-style, for FreeBSD 13.0 (1300012), with
debug_info, not stripped
vesta_$

Also I have a cross compiler that I used for all this from the RISC-V
project and I built it from sources and it works neatly :


vesta_$ /usr/bin/printf "#include <stdio.h>\nint main()\n{\n
printf(\"foo.\");\n    return (0);\n}\n" > foo.c

vesta_$ cat foo.c
#include <stdio.h>
int main()
{
    printf("foo.");
    return (0);
}

vesta_$ $CC --sysroot=/riscv64/rootfs -v \
                                                            -O0
-fno-builtin -march=rv64imafdc -mabi=lp64d \

-mpreferred-stack-boundary=4 -mstrict-align \

-mexplicit-relocs -L/riscv64/rootfs/lib \
                                                            -o foo foo.c
Using built-in specs.
COLLECT_GCC=/opt/tools/bin/riscv64-unknown-freebsd12.0-gcc
COLLECT_LTO_WRAPPER=/opt/tools/libexec/gcc/riscv64-unknown-freebsd12.0/8.2.0/lto-wrapper
Target: riscv64-unknown-freebsd12.0
Configured with:
/opt/tools/build/riscv-gnu-toolchain/riscv-gcc/configure
--target=riscv64-unknown-freebsd12.0 --prefix=/opt/tools
--with-sysroot=/opt/tools/sysroot
--with-gxx-include-dir=/usr/include/c++/v1/ --without-newlib
--without-headers --disable-werror --enable-threads --enable-tls
--enable-languages=c,c++ --with-gmp=/usr/local --with-mpfr=/usr/local
--with-mpc=/usr/local --disable-libatomic --disable-libmudflap
--disable-libssp --disable-libquadmath --disable-libgomp --disable-nls
--disable-bootstrap --disable-multilib --with-arch=rv64imafdc
Thread model: posix
gcc version 8.2.0 (GCC)
COLLECT_GCC_OPTIONS='-v' '-O0' '-fno-builtin' '-march=rv64imafdc'
'-mabi=lp64d' '-mpreferred-stack-boundary=4' '-mstrict-align'
'-mexplicit-relocs' '-L/riscv64/rootfs/lib' '-o' 'foo'
 /opt/tools/libexec/gcc/riscv64-unknown-freebsd12.0/8.2.0/cc1 -quiet -v
-isysroot /riscv64/rootfs foo.c -quiet -dumpbase foo.c -march=rv64imafdc
-mabi=lp64d -mpreferred-stack-boundary=4 -mstrict-align
-mexplicit-relocs -auxbase foo -O0 -version -fno-builtin -o
/var/tmp/dclarke/ccZ25Ns0.s
GNU C17 (GCC) version 8.2.0 (riscv64-unknown-freebsd12.0)
        compiled by GNU C version 4.2.1 Compatible FreeBSD Clang 6.0.1
(tags/RELEASE_601/final 335540), GMP version 6.1.2, MPFR version
4.0.1-p13, MPC version 1.1.0, isl version none
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory
"/opt/tools/lib/gcc/riscv64-unknown-freebsd12.0/8.2.0/include-fixed"
ignoring nonexistent directory
"/opt/tools/lib/gcc/riscv64-unknown-freebsd12.0/8.2.0/../../../../riscv64-unknown-freebsd12.0/include"
#include "..." search starts here:
#include <...> search starts here:
 /opt/tools/lib/gcc/riscv64-unknown-freebsd12.0/8.2.0/include
 /riscv64/rootfs/usr/include
End of search list.
GNU C17 (GCC) version 8.2.0 (riscv64-unknown-freebsd12.0)
        compiled by GNU C version 4.2.1 Compatible FreeBSD Clang 6.0.1
(tags/RELEASE_601/final 335540), GMP version 6.1.2, MPFR version
4.0.1-p13, MPC version 1.1.0, isl version none
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 6a230bf9178ca263fcc69998a254977a
COLLECT_GCC_OPTIONS='-v' '-O0' '-fno-builtin' '-march=rv64imafdc'
'-mabi=lp64d' '-mpreferred-stack-boundary=4' '-mstrict-align'
'-mexplicit-relocs' '-L/riscv64/rootfs/lib' '-o' 'foo'
 /opt/tools/lib/gcc/riscv64-unknown-freebsd12.0/8.2.0/../../../../riscv64-unknown-freebsd12.0/bin/as -v --traditional-format -march=rv64imafdc -mabi=lp64d -o /var/tmp/dclarke/ccFmawkF.o /var/tmp/dclarke/ccZ25Ns0.s
GNU assembler version 2.31.1 (riscv64-unknown-freebsd12.0) using BFD
version (GNU Binutils) 2.31.1
COMPILER_PATH=/opt/tools/libexec/gcc/riscv64-unknown-freebsd12.0/8.2.0/:/opt/tools/libexec/gcc/riscv64-unknown-freebsd12.0/8.2.0/:/opt/tools/libexec/gcc/riscv64-unknown-freebsd12.0/:/opt/tools/lib/gcc/riscv64-unknown-freebsd12.0/8.2.0/:/opt/tools/lib/gcc/riscv64-unknown-freebsd12.0/:/opt/tools/lib/gcc/riscv64-unknown-freebsd12.0/8.2.0/../../../../riscv64-unknown-freebsd12.0/bin/
LIBRARY_PATH=/opt/tools/lib/gcc/riscv64-unknown-freebsd12.0/8.2.0/:/opt/tools/lib/gcc/riscv64-unknown-freebsd12.0/8.2.0/../../../../riscv64-unknown-freebsd12.0/lib/:/riscv64/rootfs/lib/:/riscv64/rootfs/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-O0' '-fno-builtin' '-march=rv64imafdc'
'-mabi=lp64d' '-mpreferred-stack-boundary=4' '-mstrict-align'
'-mexplicit-relocs' '-L/riscv64/rootfs/lib' '-o' 'foo'
 /opt/tools/libexec/gcc/riscv64-unknown-freebsd12.0/8.2.0/collect2
-plugin
/opt/tools/libexec/gcc/riscv64-unknown-freebsd12.0/8.2.0/liblto_plugin.so -plugin-opt=/opt/tools/libexec/gcc/riscv64-unknown-freebsd12.0/8.2.0/lto-wrapper
-plugin-opt=-fresolution=/var/tmp/dclarke/ccQq12nl.res
-plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s
-plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc
-plugin-opt=-pass-through=-lgcc_s --sysroot=/riscv64/rootfs
--eh-frame-hdr -melf64lriscv -V -dynamic-linker /libexec/ld-elf.so.1 -o
foo /riscv64/rootfs/usr/lib/crt1.o /riscv64/rootfs/usr/lib/crti.o
/riscv64/rootfs/usr/lib/crtbegin.o -L/riscv64/rootfs/lib
-L/opt/tools/lib/gcc/riscv64-unknown-freebsd12.0/8.2.0
-L/opt/tools/lib/gcc/riscv64-unknown-freebsd12.0/8.2.0/../../../../riscv64-unknown-freebsd12.0/lib
-L/riscv64/rootfs/lib -L/riscv64/rootfs/usr/lib
/var/tmp/dclarke/ccFmawkF.o -lgcc --as-needed -lgcc_s --no-as-needed -lc
-lgcc --as-needed -lgcc_s --no-as-needed
/riscv64/rootfs/usr/lib/crtend.o /riscv64/rootfs/usr/lib/crtn.o
GNU ld (GNU Binutils) 2.31.1
  Supported emulations:
   elf64lriscv
   elf32lriscv
COLLECT_GCC_OPTIONS='-v' '-O0' '-fno-builtin' '-march=rv64imafdc'
'-mabi=lp64d' '-mpreferred-stack-boundary=4' '-mstrict-align'
'-mexplicit-relocs' '-L/riscv64/rootfs/lib' '-o' 'foo'
vesta_$

Neat.  See https://riscv.org/software-tools/risc-v-gnu-compiler-toolchain/

I even built libgmp and libmpfr and libmpc with that cross compiler
tool set and dropped the results into the target RISC-V boxen
rootfs /usr/local/lib area :

vesta_$ ls -lapb /riscv64/rootfs/usr/local/lib
total 10804
drwxr-xr-x  3 root  wheel        23 Feb 17 04:29 ./
drwxr-xr-x  5 root  wheel         5 Feb 17 03:04 ../
-rw-r--r--  1 root  wheel  10237428 Feb 16 23:32 libgmp.a
-rwxr-xr-x  1 root  wheel       931 Feb 17 03:07 libgmp.la
lrwxr-xr-x  1 root  wheel        16 Feb 16 23:32 libgmp.so ->
libgmp.so.10.3.2
lrwxr-xr-x  1 root  wheel        16 Feb 16 23:32 libgmp.so.10 ->
libgmp.so.10.3.2
-rwxr-xr-x  1 root  wheel   2348632 Feb 16 23:32 libgmp.so.10.3.2
-rw-r--r--  1 root  wheel   1755094 Feb 16 23:32 libgmpxx.a
-rwxr-xr-x  1 root  wheel       965 Feb 17 03:07 libgmpxx.la
lrwxr-xr-x  1 root  wheel        17 Feb 16 23:32 libgmpxx.so ->
libgmpxx.so.4.5.2
lrwxr-xr-x  1 root  wheel        17 Feb 16 23:32 libgmpxx.so.4 ->
libgmpxx.so.4.5.2
-rwxr-xr-x  1 root  wheel    506752 Feb 16 23:32 libgmpxx.so.4.5.2
-rw-r--r--  1 root  wheel   1638186 Feb 17 04:24 libmpc.a
-rwxr-xr-x  1 root  wheel      1006 Feb 17 04:35 libmpc.la
lrwxr-xr-x  1 root  wheel        15 Feb 17 04:29 libmpc.so ->
libmpc.so.3.1.0
lrwxr-xr-x  1 root  wheel        15 Feb 17 04:29 libmpc.so.3 ->
libmpc.so.3.1.0
-rwxr-xr-x  1 root  wheel    368248 Feb 17 04:24 libmpc.so.3.1.0
-rw-r--r--  1 root  wheel   8599042 Feb 17 03:43 libmpfr.a
-rwxr-xr-x  1 root  wheel       980 Feb 17 03:48 libmpfr.la
lrwxr-xr-x  1 root  wheel        16 Feb 17 03:46 libmpfr.so ->
libmpfr.so.6.0.2
lrwxr-xr-x  1 root  wheel        16 Feb 17 03:46 libmpfr.so.6 ->
libmpfr.so.6.0.2
-rwxr-xr-x  1 root  wheel   1850880 Feb 17 03:43 libmpfr.so.6.0.2
drwxr-xr-x  2 root  wheel         3 Feb 17 03:43 pkgconfig/
vesta_$

So the cross compiler seems to work just fine.  Looks pretty too :

vesta_$
vesta_$ echo $CC
/opt/tools/bin/riscv64-unknown-freebsd12.0-gcc

vesta_$ $CC --version
riscv64-unknown-freebsd12.0-gcc (GCC) 8.2.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

vesta_$ $CC -v
Using built-in specs.
COLLECT_GCC=/opt/tools/bin/riscv64-unknown-freebsd12.0-gcc
COLLECT_LTO_WRAPPER=/opt/tools/libexec/gcc/riscv64-unknown-freebsd12.0/8.2.0/lto-wrapper
Target: riscv64-unknown-freebsd12.0
Configured with:
/opt/tools/build/riscv-gnu-toolchain/riscv-gcc/configure
--target=riscv64-unknown-freebsd12.0 --prefix=/opt/tools
--with-sysroot=/opt/tools/sysroot
--with-gxx-include-dir=/usr/include/c++/v1/ --without-newlib
--without-headers --disable-werror --enable-threads --enable-tls
--enable-languages=c,c++ --with-gmp=/usr/local --with-mpfr=/usr/local
--with-mpc=/usr/local --disable-libatomic --disable-libmudflap
--disable-libssp --disable-libquadmath --disable-libgomp --disable-nls
--disable-bootstrap --disable-multilib --with-arch=rv64imafdc
Thread model: posix
gcc version 8.2.0 (GCC)
vesta_$

This brings me to the configure of gcc 8.2.0 where I really just want a
bare bones compiler that will run in that target RISC-V rv64imafdc
target boxen and maybe even compile "hello foo" with it.  After a lot of
words of prayer over the not-nearly-verbose-enough configure page at
https://gcc.gnu.org/install/configure.html this is the magic I uttered :

vesta_$ CFLAGS='--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' \
> ../gcc-8.2.0/configure \
> --build=x86_64-unknown-freebsd12.0 \
> --host=riscv64-unknown-freebsd12.0 \
> --with-sysroot=/riscv64/rootfs \
> --prefix=/usr/local/gcc8 --without-headers \
> --with-build-time-tools=/opt/tools/bin \
> --with-as=/opt/tools/bin/riscv64-unknown-freebsd12.0-as \
> --with-ld=/opt/tools/bin/riscv64-unknown-freebsd12.0-ld \
> --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-libmudflap --disable-libssp \
> --with-gmp=/riscv64/rootfs/usr/local \
> --with-mpfr=/riscv64/rootfs/usr/local \
> --with-mpc=/riscv64/rootfs/usr/local
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...
/opt/tools/bin/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 /opt/tools/bin/riscv64-unknown-freebsd12.0-gcc accepts
-g... yes
checking for /opt/tools/bin/riscv64-unknown-freebsd12.0-gcc option to
accept ISO C89... none needed
checking whether we are using the GNU C++ compiler... yes
checking whether /opt/tools/bin/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 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:
     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
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... /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) /opt/tools/bin/riscv64-unknown-freebsd12.0-ar
checking for riscv64-unknown-freebsd12.0-ar... (cached)
/opt/tools/bin/riscv64-unknown-freebsd12.0-ar
checking for as... (cached) /opt/tools/bin/riscv64-unknown-freebsd12.0-as
checking for riscv64-unknown-freebsd12.0-as... (cached)
/opt/tools/bin/riscv64-unknown-freebsd12.0-as
checking for riscv64-unknown-freebsd12.0-dlltool... no
checking for ld... (cached) /opt/tools/bin/riscv64-unknown-freebsd12.0-ld
checking for riscv64-unknown-freebsd12.0-ld... (cached)
/opt/tools/bin/riscv64-unknown-freebsd12.0-ld
checking for riscv64-unknown-freebsd12.0-lipo... no
checking for nm... (cached) /opt/tools/bin/riscv64-unknown-freebsd12.0-nm -p
checking for riscv64-unknown-freebsd12.0-nm... (cached)
/opt/tools/bin/riscv64-unknown-freebsd12.0-nm -p
checking for ranlib... (cached)
/opt/tools/bin/riscv64-unknown-freebsd12.0-ranlib
checking for riscv64-unknown-freebsd12.0-ranlib... (cached)
/opt/tools/bin/riscv64-unknown-freebsd12.0-ranlib
checking for strip... (cached)
/opt/tools/bin/riscv64-unknown-freebsd12.0-strip
checking for riscv64-unknown-freebsd12.0-strip... (cached)
/opt/tools/bin/riscv64-unknown-freebsd12.0-strip
checking for riscv64-unknown-freebsd12.0-windres... no
checking for riscv64-unknown-freebsd12.0-windmc... no
checking for objcopy... (cached)
/opt/tools/bin/riscv64-unknown-freebsd12.0-objcopy
checking for riscv64-unknown-freebsd12.0-objcopy... (cached)
/opt/tools/bin/riscv64-unknown-freebsd12.0-objcopy
checking for objdump... (cached) /usr/bin/objdump
checking for riscv64-unknown-freebsd12.0-objdump... (cached)
/usr/bin/objdump
checking for readelf... (cached)
/opt/tools/bin/riscv64-unknown-freebsd12.0-readelf
checking for riscv64-unknown-freebsd12.0-readelf... (cached)
/opt/tools/bin/riscv64-unknown-freebsd12.0-readelf
checking for cc in /opt/tools/bin... no
checking for gcc in /opt/tools/bin... no
checking for c++ in /opt/tools/bin... no
checking for g++ in /opt/tools/bin... no
checking for cxx in /opt/tools/bin... no
checking for gxx in /opt/tools/bin... no
checking for gcc in /opt/tools/bin... no
checking for gfortran in /opt/tools/bin... no
checking for gccgo in /opt/tools/bin... no
checking for ar in /opt/tools/bin... no
checking for ar in /opt/tools/bin... no
checking for as in /opt/tools/bin... no
checking for as in /opt/tools/bin... no
checking for dlltool in /opt/tools/bin... no
checking for dlltool in /opt/tools/bin... no
checking for ld in /opt/tools/bin... no
checking for ld in /opt/tools/bin... no
checking for lipo in /opt/tools/bin... no
checking for lipo in /opt/tools/bin... no
checking for nm in /opt/tools/bin... no
checking for nm in /opt/tools/bin... no
checking for objcopy in /opt/tools/bin... no
checking for objcopy in /opt/tools/bin... no
checking for objdump in /opt/tools/bin... no
checking for objdump in /opt/tools/bin... no
checking for ranlib in /opt/tools/bin... no
checking for ranlib in /opt/tools/bin... no
checking for readelf in /opt/tools/bin... no
checking for readelf in /opt/tools/bin... no
checking for strip in /opt/tools/bin... no
checking for strip in /opt/tools/bin... no
checking for windres in /opt/tools/bin... no
checking for windres in /opt/tools/bin... no
checking for windmc in /opt/tools/bin... no
checking for windmc in /opt/tools/bin... no
checking where to find the target ar... pre-installed
checking where to find the target as... pre-installed
checking where to find the target cc... pre-installed
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... 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
checking where to find the target lipo... pre-installed
checking where to find the target nm... pre-installed
checking where to find the target objcopy... pre-installed
checking where to find the target objdump... pre-installed
checking where to find the target ranlib... pre-installed
checking where to find the target readelf... pre-installed
checking where to find the target strip... pre-installed
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_$

That looks very nice.  However about a few minutes into the process
I run into this :

.
.
.
Using `../../gcc-8.2.0/gcc/config/riscv/riscv.c' for machine-specific logic.
Using `../../gcc-8.2.0/gcc/config/riscv/riscv.md' as machine description
file.
Using the following target machine macro files:
        ../../gcc-8.2.0/gcc/config/riscv/riscv.h
        ../../gcc-8.2.0/gcc/config/elfos.h
        ../../gcc-8.2.0/gcc/config/freebsd-spec.h
        ../../gcc-8.2.0/gcc/config/freebsd.h
        ../../gcc-8.2.0/gcc/config/freebsd-stdint.h
        ../../gcc-8.2.0/gcc/config/riscv/freebsd.h
        ../../gcc-8.2.0/gcc/config/initfini-array.h
Using host-default.o for host machine hooks.
checking for __cxa_atexit... yes
checking build system type... x86_64-unknown-freebsd12.0
checking host system type... x86_64-unknown-freebsd12.0
checking target system type... riscv64-unknown-freebsd12.0
checking LIBRARY_PATH variable... ok
checking GCC_EXEC_PREFIX variable... ok
checking whether to place generated files in the source directory... no
checking whether a default linker was specified... no
checking whether a default assembler was specified... no
checking for x86_64-unknown-freebsd12.0-gcc... gcc
checking for C compiler default output file name...
configure: error: in
`/home/dclarke/rv64g_local/build/gcc-8.2.0_rv64imafdc.001/gcc/build.85496':
configure: error: C compiler cannot create executables
See `config.log' for more details.
mv: rename auto-host.h to ../auto-build.h: No such file or directory
checking whether NLS is requested... no
checking how to print strings... printf
checking for a sed that does not truncate output... /usr/local/bin/gsed
checking for fgrep... /usr/local/bin/grep -F
checking for ld used by
/opt/tools/bin/riscv64-unknown-freebsd12.0-gcc...
/opt/tools/bin/riscv64-unknown-freebsd12.0-ld
checking if the linker (/opt/tools/bin/riscv64-unknown-freebsd12.0-ld)
is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)...
/opt/tools/bin/riscv64-unknown-freebsd12.0-nm -p
checking the name lister (/opt/tools/bin/riscv64-unknown-freebsd12.0-nm
-p) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 196608
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... no
checking for /opt/tools/bin/riscv64-unknown-freebsd12.0-ld option to
reload object files... -r
checking for riscv64-unknown-freebsd12.0-objdump... /usr/bin/objdump
checking how to recognize dependent libraries... pass_all
checking for riscv64-unknown-freebsd12.0-ar... (cached)
/opt/tools/bin/riscv64-unknown-freebsd12.0-ar
checking for riscv64-unknown-freebsd12.0-strip...
/opt/tools/bin/riscv64-unknown-freebsd12.0-strip
checking for riscv64-unknown-freebsd12.0-ranlib... (cached)
/opt/tools/bin/riscv64-unknown-freebsd12.0-ranlib
checking command to parse /opt/tools/bin/riscv64-unknown-freebsd12.0-nm
-p output from /opt/tools/bin/riscv64-unknown-freebsd12.0-gcc object... ok
checking for dlfcn.h... yes
checking for objdir... .libs
checking if /opt/tools/bin/riscv64-unknown-freebsd12.0-gcc supports
-fno-rtti -fno-exceptions... no
checking for /opt/tools/bin/riscv64-unknown-freebsd12.0-gcc option to
produce PIC... -fPIC -DPIC
checking if /opt/tools/bin/riscv64-unknown-freebsd12.0-gcc PIC flag
-fPIC -DPIC works... yes
checking if /opt/tools/bin/riscv64-unknown-freebsd12.0-gcc static flag
-static works... yes
checking if /opt/tools/bin/riscv64-unknown-freebsd12.0-gcc supports -c
-o file.o... yes
checking if /opt/tools/bin/riscv64-unknown-freebsd12.0-gcc supports -c
-o file.o... (cached) yes
checking whether the /opt/tools/bin/riscv64-unknown-freebsd12.0-gcc
linker (/opt/tools/bin/riscv64-unknown-freebsd12.0-ld) supports shared
libraries... yes
checking whether -lc should be explicitly linked in... no
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... yes
checking whether to build static libraries... yes
checking how to run the C++ preprocessor...
/opt/tools/bin/riscv64-unknown-freebsd12.0-g++ -E
checking for ld used by
/opt/tools/bin/riscv64-unknown-freebsd12.0-g++...
/opt/tools/bin/riscv64-unknown-freebsd12.0-ld
checking if the linker (/opt/tools/bin/riscv64-unknown-freebsd12.0-ld)
is GNU ld... yes
checking whether the /opt/tools/bin/riscv64-unknown-freebsd12.0-g++
linker (/opt/tools/bin/riscv64-unknown-freebsd12.0-ld) supports shared
libraries... yes
checking for /opt/tools/bin/riscv64-unknown-freebsd12.0-g++ option to
produce PIC... -fPIC -DPIC
checking if /opt/tools/bin/riscv64-unknown-freebsd12.0-g++ PIC flag
-fPIC -DPIC works... yes
checking if /opt/tools/bin/riscv64-unknown-freebsd12.0-g++ static flag
-static works... yes
checking if /opt/tools/bin/riscv64-unknown-freebsd12.0-g++ supports -c
-o file.o... yes
checking if /opt/tools/bin/riscv64-unknown-freebsd12.0-g++ supports -c
-o file.o... (cached) yes
checking whether the /opt/tools/bin/riscv64-unknown-freebsd12.0-g++
linker (/opt/tools/bin/riscv64-unknown-freebsd12.0-ld) supports shared
libraries... yes
checking dynamic linker characteristics... freebsd12.0 ld.so
checking how to hardcode library paths into programs... immediate
checking what assembler to use...
/opt/tools/bin/riscv64-unknown-freebsd12.0-as
checking whether we are using gold... no
checking gold linker with split stack support as non default...
checking what linker to use... /opt/tools/bin/riscv64-unknown-freebsd12.0-ld
checking for nm... /usr/local/bin/nm
checking what nm to use... /usr/local/bin/nm
checking for objdump... /usr/local/bin/objdump
checking what objdump to use... /usr/local/bin/objdump
checking for readelf... /usr/local/bin/readelf
checking what readelf to use... /usr/local/bin/readelf
checking assembler flags...
checking assembler for .balign and .p2align... yes
checking assembler for .p2align with maximum skip... yes
checking assembler for .literal16... no
checking assembler for working .subsection -1... yes
checking assembler for .weak... yes
checking assembler for .weakref... yes
checking assembler for .nsubspa comdat... no
checking assembler for .hidden... yes
checking linker for .hidden support... yes
checking linker read-only and read-write section mixing... read-write
checking for .preinit_array/.init_array/.fini_array support... (cached) yes
checking assembler for .sleb128 and .uleb128... no
checking assembler for cfi directives... yes
checking assembler for working cfi advance... yes
checking assembler for cfi personality directive... yes
checking assembler for cfi sections directive... yes
checking assembler for eh_frame optimization... buggy
checking assembler for section merging support... yes
checking assembler for stabs directive... yes
checking assembler for COMDAT group support (GNU as)... yes
checking assembler for line table discriminator support... yes
checking linker -Bstatic/-Bdynamic option... yes
checking linker --version-script option... yes
checking linker soname option... yes
checking linker --demangle support... yes
checking linker plugin support... 0
checking assembler for dwarf2 debug_line support... yes
checking assembler for buggy dwarf2 .file directive... no
checking assembler for --gdwarf2 option... yes
checking assembler for --gstabs option... yes
checking assembler for --debug-prefix-map option... yes
checking assembler for compressed debug sections... 2
checking assembler for .lcomm with alignment... no
checking for target glibc version... 0.0
checking assembler for gnu_unique_object... yes
checking assembler for tolerance to line number 0... yes
checking support for thin archives... yes
checking linker PT_GNU_EH_FRAME support... yes
checking linker CIEv3 in .eh_frame support... yes
checking linker position independent executable support... yes
checking linker PIE support with copy reloc... no
checking linker EH-compatible garbage collection of sections... yes
checking linker EH garbage collection of sections bug... no
checking linker for compressed debug sections... 3
checking linker --as-needed support... yes
checking linker mapfile support for clearing hardware capabilities... no
checking linker --build-id support... yes
checking linker *_sol2 emulation support... no
checking linker --sysroot support... yes
checking __stack_chk_fail in target C library... yes
checking sys/sdt.h in the target C library... yes
checking dl_iterate_phdr in target C library... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking whether to avoid linking multiple front-ends at once... no
Links are now set up to build (on x86_64-unknown-freebsd12.0) a native
compiler
 for riscv64-unknown-freebsd12.0.
checking for exported symbols... yes
checking for -rdynamic... yes
checking for library containing dlopen... none required
checking for -fPIC -shared... yes
gcc_driver_version: 8.2.0
checking for -fno-PIE option... yes
checking for -no-pie option... yes
checking linker -z bndplt option... no
checking linker --push-state/--pop-state options... yes
configure: updating cache ./config.cache
configure: creating ./config.status
config.status: creating as
config.status: creating collect-ld
config.status: creating nm
config.status: creating Makefile
config.status: creating ada/gcc-interface/Makefile
config.status: creating ada/Makefile
config.status: creating auto-host.h
config.status: executing depdir commands
mkdir .deps
config.status: executing gccdepdir commands
mkdir build
mkdir build/.deps
mkdir ada/.deps
mkdir brig
mkdir brig/.deps
mkdir c
mkdir c/.deps
mkdir cp
mkdir cp/.deps
mkdir fortran
mkdir fortran/.deps
mkdir go
mkdir go/.deps
mkdir jit
mkdir jit/.deps
mkdir lto
mkdir lto/.deps
mkdir objc
mkdir objc/.deps
mkdir objcp
mkdir objcp/.deps
mkdir c-family
mkdir c-family/.deps
mkdir common
mkdir common/.deps
config.status: executing default commands
gmake[2]: Entering directory
'/usr/home/dclarke/rv64g_local/build/gcc-8.2.0_rv64imafdc.001/intl'
gmake[2]: Nothing to be done for 'all'.
gmake[2]: Leaving directory
'/usr/home/dclarke/rv64g_local/build/gcc-8.2.0_rv64imafdc.001/intl'
mkdir build-x86_64-unknown-freebsd12.0
mkdir build-x86_64-unknown-freebsd12.0/libiberty
Configuring in build-x86_64-unknown-freebsd12.0/libiberty
configure: creating cache ./config.cache
checking whether to enable maintainer-specific portions of Makefiles... no
checking for makeinfo... makeinfo --split-size=5000000
checking for perl... perl
checking build system type... x86_64-unknown-freebsd12.0
checking host system type... x86_64-unknown-freebsd12.0
checking for x86_64-unknown-freebsd12.0-ar... ar
checking for x86_64-unknown-freebsd12.0-ranlib... ranlib
checking whether to install libiberty headers and static library... no
configure: target_header_dir =
checking for x86_64-unknown-freebsd12.0-gcc... gcc
checking for suffix of object files... configure: error: in
`/home/dclarke/rv64g_local/build/gcc-8.2.0_rv64imafdc.001/build-x86_64-unknown-freebsd12.0/libiberty':
configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details.
gmake[1]: *** [Makefile:2558: configure-build-libiberty] Error 1
gmake[1]: Leaving directory
'/usr/home/dclarke/rv64g_local/build/gcc-8.2.0_rv64imafdc.001'
gmake: *** [Makefile:899: all] Error 2

OKay so that stops progress.

Feels like a Makefile somewhere isn't quite getting all that it needs.

Any thoughts would be welcome from ye grand gcc wizards :-)


-- 
Dennis Clarke
RISC-V/SPARC/PPC/ARM/CISC
UNIX and Linux spoken
GreyBeard and suspenders optional


[1] the RISC-V FreeBSD boxen boots and runs in the Qemu/SPIKE simulator
just fine



More information about the Gcc-help mailing list