On 2/19/19 1:32 AM, Xi Ruoyao wrote: > On 2019-02-19 00:58 -0500, Dennis Clarke wrote: >> >> After many many many experiments I am seeing that host and target data >> is not being passed down into the build of gmp after configure. I took >> a look into the gmp sources and multiple Makefile.in and see : >> >> host = @host@ >> host_alias = @host_alias@ >> host_cpu = @host_cpu@ >> host_os = @host_os@ >> host_vendor = @host_vendor@ >> >> Well what should those really be? >> >> I am trying to force this : >> >> vesta_$ grep 'triplet' ./gmp-6.1.2/Makefile.in >> build_triplet = x86_64-unknown-freebsd12.0 >> host_triplet = riscv64-unknown-freebsd12.0 >> vesta_$ >> >> No amount of finangle of configure options seems to be able to tell the >> gmp build that the local host is x86_64-unknown-freebsd12.0 and that the >> target should be a RISC-V rv64imafdc architecture. The actual triplet >> for the target should be riscv64-unknown-freebsd12.0 however what I am >> actually seeing is : >> >> >> configure: summary of build options: >> >> Version: GNU MP 6.1.2 >> Host type: none-unknown-freebsd12.0 >> ABI: standard >> Install prefix: /usr/local/gcc8 >> Compiler: riscv64-unknown-freebsd12.0-gcc >> Static libraries: yes >> Shared libraries: no >> >> >> That is wrong. > > I think that is correct. GMP uses some machine-dependent code to run faster. A > "none-*-*" triplet just tell GMP to use portable code, instead of any machine- > dependent code. OKay this is good input. I simply am confused as to why the "none" is there and I guess you explain it well. > > Please note that GMP's triplet is not GNU triplet. For example GMP said my > machine is "ivybridge-pc-linux-gnu", but its GNU triplet should be "x86_64-pc- > linux-gnu" or "i686-pc-linux-gnu". > > I configured a GMP with --host=none-linux-gnu on my machine and it built fine. > > And it seems "none" is hard-coded by GCC building system (deliberately) to make > GCC executables portable. See makefile.in:12464 in gcc-8.2.0. > >> What I should see is this : >> >> configure: summary of build options: >> >> Version: GNU MP 6.1.2 >> Host type: riscv64-unknown-freebsd12.0 >> ABI: standard >> Install prefix: /usr/local/gcc8 >> Compiler: /opt/tools/bin/riscv64-unknown-freebsd12.0-gcc >> Static libraries: yes >> Shared libraries: yes > > That's useless. GMP doesn't know what <del>the hell</del> is a RISCV so it will > still use portable code only. > OKay! Good to know. So the real question then is why the mpfr stage fails with a complaint about the ABI or "machine type" of libgmp? The actual archive has been completed in the gmp stage and now mpfr will need that as a dependency but the process breaks down and fails with : 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_$ All of this is fully laid out in : https://gcc.gnu.org/ml/gcc-help/2019-02/msg00068.html So I am quite stuck at this point and wondering how to build a native RISC-V compiler for a native RISC-V target system? There must be some configure "magic" but I have yet to discover it. Dennis