Skip to content
Commit 4898d971 authored by Siddhesh Poyarekar's avatar Siddhesh Poyarekar
Browse files

Avoid adding duplicated symbols into static libraries



Some math functions (such as __isnan*) are built into both libm and
libc because they are needed in libc.  The symbol gets exported from
libc.so and not libm.so, because of which dynamic linking works fine;
the symbols are always resolved from libc.so and libm.so uses its
internal copy of the same function if needed.

When linking statically though, the libm variants get used throughout
because the symbols are exported in both archives and libm.a is
searched first.

This patch removes these duplicate objects from the libm.a archive so
that programs always link to libc in both, the static and dynamic
case.  The difference this will cause is that libm uses of these
functions will start using the libc versions in the !SHARED case.
This is harmless at the moment because the objects are identical
except for their names.

Some of these duplicates could be removed from libm.so too, but I
avoided that in the interest of retaining an internal reference if at
all those functions get used within libm in future.

Reviewed-by: default avatarPaul Zimmermann <Paul.Zimmermann@inria.fr>
parent abadbef5
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment