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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 18 Feb 2019 at 13:04, Jonathan Wakely <jwakely.gcc@xxxxxxxxx> wrote:
>
> On Mon, 18 Feb 2019 at 05:37, Dennis Clarke <dclarke@xxxxxxxxxxxxx> wrote:
> >
> > On 2/17/19 10:03 PM, Jonathan Wakely wrote:
> > > On Sun, 17 Feb 2019 at 06:47, Dennis Clarke <dclarke@xxxxxxxxxxxxx> wrote:
> > >> 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 :
> > >
> > > ... why?
> >
> > Let's set that aside as a moot point wherein we all know that they
> > should be in the tree.  Easy to put them back in :
> >
> > vesta_$ cd ../gcc-8.2.0
> > vesta_$ bzip2 -dc ../../src/gmp-6.1.2.tar.bz2 | tar -xf -
> > vesta_$ gzip -dc ../../src/mpfr-4.0.2.tar.gz | tar -xf -
> > vesta_$ gzip -dc ../../src/mpc-1.1.0.tar.gz | tar -xf -
> > vesta_$ ln -s ./gmp-6.1.2 ./gmp
> > vesta_$ ln -s ./mpfr-4.0.2 ./mpfr
> > vesta_$ ln -s ./mpc-1.1.0 ./mpc
> > vesta_$
>
> Yes, this is what I'd expect to work. And don't use --with-gmp,
> --with-mpc, --with-mpfr and LD_LIBRARY_PATH at all.
>
> > However if I do setup LD_LIBRARY_PATH to point into the target sysroot
>
> Wait, what? Why would you do that? The GCC you're building is a cross
> compiler, it doesn't run on the target, so it can't use target
> libraries.
>
> > then everything fails real real fast with :
> >
> > vesta_$
> > LD_LIBRARY_PATH=/riscv64/rootfs/usr/local/lib:/riscv64/rootfs/usr/lib:/riscv64/rootfs/lib:/usr/local/lib
> > vesta_$ export LD_LIBRARY_PATH
> > vesta_$
> >
> > then try configure and ka-boom :
> >
> > ld-elf.so.1: /riscv64/rootfs/lib/libc.so.7: unsupported machine
> >
> > So that isn't helping.
>
> Of course not. If you have them in-tree then you don't need to use
> LD_LIBRARY_PATH to find them at all, CERTAINLY not to find the ones
> built for the target architecture. As I said, the host binaries use
> them.
>
>
> > If I try to point to only the libs in the target /usr/local/lib then :
> >
> > vesta_$ LD_LIBRARY_PATH=/riscv64/rootfs/usr/local/lib
> > vesta_$ export LD_LIBRARY_PATH
> > vesta_$ CFLAGS=\--sysroot=/riscv64/rootfs\ \-L/riscv64/rootfs/lib\
> > \-L/riscv64/rootfs/usr/local/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\
> > \-L/riscv64/rootfs/usr/local/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 \
>
> Now you're setting --host as well, maybe stop changing multiple things
> at once. That makes it impossible to debug each step.
>
> Do you really want to build a native riscv64 compiler to run on the
> target, or are you trying to build a cross-compiler to run on x86_64
> and build binaries for riscv64?

OK, I missed this from your first mail among the tousands of lines of logs:

"I really just want a bare bones compiler that will run in that target
RISC-V rv64imafdc
target boxen"

So you do want a native risc64 compiler, sorry for misunderstanding that!

So the problem does seem to be that the in-tree gmp configuration is
detecting "none" as the target.



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux