RISC-V: Use newlib nano specific libm.

Message ID 20200129224617.14207-1-jimw@sifive.com
State Accepted
Commit 8ef32f2dcfe48b540e64a4ec3ce0dcba5d3b70ce
Headers show
Series
  • RISC-V: Use newlib nano specific libm.
Related show

Commit Message

Jim Wilson Jan. 29, 2020, 10:46 p.m.
The libm gamma functions use the _gamma_signgam field of the reentrant
structure, which changes offset with the --enable-newlib-reent-small
configure option, which means we need to use a newlib nano specific
version of libm in addition to libc in the nano.specs file.  Reported
by Keith Packard.  There is a riscv-gnu-toolchain patch that goes
along with this to create the new libm_nano.a file.

Signed-off-by: Jim Wilson <jimw@sifive.com>

---
 libgloss/riscv/nano.specs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.17.1

Comments

Corinna Vinschen Jan. 31, 2020, 11:42 a.m. | #1
On Jan 29 14:46, Jim Wilson wrote:
> The libm gamma functions use the _gamma_signgam field of the reentrant

> structure, which changes offset with the --enable-newlib-reent-small

> configure option, which means we need to use a newlib nano specific

> version of libm in addition to libc in the nano.specs file.  Reported

> by Keith Packard.  There is a riscv-gnu-toolchain patch that goes

> along with this to create the new libm_nano.a file.

> 

> Signed-off-by: Jim Wilson <jimw@sifive.com>

> ---

>  libgloss/riscv/nano.specs | 2 +-

>  1 file changed, 1 insertion(+), 1 deletion(-)

> 

> diff --git a/libgloss/riscv/nano.specs b/libgloss/riscv/nano.specs

> index 89fd23176..e12e31384 100644

> --- a/libgloss/riscv/nano.specs

> +++ b/libgloss/riscv/nano.specs

> @@ -15,7 +15,7 @@

>  %(nano_link_gcc_c_sequence) --start-group %G %(nano_libc) %(nano_libgloss) --end-group

>  

>  *link:

> -%(nano_link) %:replace-outfile(-lc -lc_nano) %:replace-outfile(-lg -lg_nano)

> +%(nano_link) %:replace-outfile(-lc -lc_nano) %:replace-outfile(-lg -lg_nano) %:replace-outfile(-lm -lm_nano)

>  

>  *lib:

>  %{!shared:%{g*:-lg_nano} %{!p:%{!pg:-lc_nano}}%{p:-lc_p}%{pg:-lc_p}}

> -- 

> 2.17.1


Pushed.


Thanks,
Corinna

-- 
Corinna Vinschen
Cygwin Maintainer
Red Hat

Patch

diff --git a/libgloss/riscv/nano.specs b/libgloss/riscv/nano.specs
index 89fd23176..e12e31384 100644
--- a/libgloss/riscv/nano.specs
+++ b/libgloss/riscv/nano.specs
@@ -15,7 +15,7 @@ 
 %(nano_link_gcc_c_sequence) --start-group %G %(nano_libc) %(nano_libgloss) --end-group
 
 *link:
-%(nano_link) %:replace-outfile(-lc -lc_nano) %:replace-outfile(-lg -lg_nano)
+%(nano_link) %:replace-outfile(-lc -lc_nano) %:replace-outfile(-lg -lg_nano) %:replace-outfile(-lm -lm_nano)
 
 *lib:
 %{!shared:%{g*:-lg_nano} %{!p:%{!pg:-lc_nano}}%{p:-lc_p}%{pg:-lc_p}}