Re: the cross compiler battle -- how to force host-triplet and target-triplet?

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

 



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.

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.
-- 
Xi Ruoyao <xry111@xxxxxxxxxxxxxxxx>
School of Aerospace Science and Technology, Xidian University




[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