Re: disable-newlib-io-long-double?

"chengzhiwei (C)" <[email protected]>
Newsgroups gmane.comp.lib.newlib
Message-ID <7D9266CBFB4E9A4B9C7B1D0341567D86017308D8@DGGEMI529-MBX.china.huawei.com>
Thanks! 
Check the file of vfprintf.c, I guess I found the reason:
# ifdef _NO_LONGDBL
			if (flags & LONGDBL) {
				_fpvalue = (double)GET_ARG (N, ap, _LONG_DOUBLE);
			} else {
				_fpvalue = GET_ARG (N, ap, double);
			}
There is an accuracy conversion step, but in my project, all of the long double symbols have been stripped away in libgcc.a, maybe I should patch the file of vfprintf.c.

zhiwei

-----邮件原件-----
发件人: Jim Wilson [mailto:[email protected]] 
发送时间: 2020年3月17日 4:51
收件人: chengzhiwei (C) <[email protected]>; [email protected]
主题: Re: disable-newlib-io-long-double?

On 3/16/20 4:37 AM, chengzhiwei (C) wrote:
> In my project, all of the quadrature symbols have been stripped away in libgcc.a, so when I built newlib toolchain based on riscv32 target, we used the option "--disable-newlib-io-long-double" to turn off the feature of long double. But when performing a floating-point calculation, the symbol "trunctfdf2" is not defined correctly:
> libc.a(lib_a-vfprintf.o): in function `.L60':vfprintf.c:(.text+0x3fe): undefined reference to `__trunctfdf2'

--disable-newlib-io-long-double is the default.  That configure option shouldn't do anything.

__trunctfdf2 comes from libgcc.  Are you linking with libgcc?

Of course, if you have long double disabled, it is odd that you get a call to trunctfdf2.  You should check how the vfprintf.c file was compiled.  There is a _NO_LONGDBL that should be defined by default, and should prevent any long double code from being enabled in that file.

Jim
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.