New Ld Error with libm -- attribute hidden

Joel Sherrill <[email protected]>
Newsgroups gmane.comp.lib.newlib
Message-ID <CAF9ehCVJteniKOgW3zktz0kYK_7zcpqueao-PtCnoFZkZ8QNQg@mail.gmail.com>
Hi

I am testing the git master of newlib and it looks like the recent which
added hidden math error handlers are causing a linking error for RTEMS
applications which use one of the libm methods calling the __math_XXX
methods.

Does it even make sense to make these symbols hidden on statically linked
systems? I suspect hidden should only be turned on explicitly on systems
which use newlib as a shared library. I believe this is by far the minority.

Here is a test case which fails with just "sparc-rtems5-gcc m1.c -lm"
=====================
sparc-rtems5-gcc  -mcpu=leon3 -O2 -g -ffunction-sections -fdata-sections
-Wall -Wmissing-prototypes -Wimplicit-function-declaration
-Wstrict-prototypes -Wnested-externs -B./../../lib/libbsp/sparc/leon3
-B/home/joel/rtems-work/rtems/bsps/sparc/leon3/start -specs bsp_specs
-qrtems -L./../../cpukit
-L/home/joel/rtems-work/rtems/bsps/sparc/shared/start -Wl,--wrap=printf
-Wl,--wrap=puts -Wl,--wrap=putchar -Wl,--gc-sections -o complex.exe
complex/complex-init.o complex/complex-docomplex.o
complex/complex-docomplexf.o complex/complex-docomplexl.o -lm
./../../lib/libbsp/sparc/leon3/librtemsbsp.a ./../../cpukit/librtemscpu.a
./../../cpukit/librtemstest.a
/data/home/joel/rtems-work/tools/5/bin/../lib/gcc/sparc-rtems5/7.4.1/../../../../sparc-rtems5/bin/ld:
/data/home/joel/rtems-work/tools/5/bin/../lib/gcc/sparc-rtems5/7.4.1/../../../../sparc-rtems5/lib/leon3/libm.a(lib_a-sf_expm1.o):
in function `expm1f':
/data/home/joel/rtems-work/rtems-source-builder/rtems/build/sparc-rtems5-gcc-fb371a33fa6-newlib-2232498-x86_64-linux-gnu-1/build/sparc-rtems5/leon3/newlib/libm/common/../../../../../../gnu-mirror-gcc-fb371a33fa6/newlib/libm/common/sf_expm1.c:64:
undefined reference to `__math_oflowf'
/data/home/joel/rtems-work/tools/5/bin/../lib/gcc/sparc-rtems5/7.4.1/../../../../sparc-rtems5/bin/ld:
complex.exe: hidden symbol `__math_oflowf' isn't defined
/data/home/joel/rtems-work/tools/5/bin/../lib/gcc/sparc-rtems5/7.4.1/../../../../sparc-rtems5/bin/ld:
final link failed: bad value
collect2: error: ld returned 1 exit status
=====================

Thanks.

--joel
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.