Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 784866 - sys-libs/glibc: libnldbl_nonshared.a libc_nonshared.a still needed?
Summary: sys-libs/glibc: libnldbl_nonshared.a libc_nonshared.a still needed?
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-04-21 20:45 UTC by Joakim Tjernlund
Modified: 2021-04-22 19:50 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joakim Tjernlund 2021-04-21 20:45:57 UTC
I got this minimal system whare I build glibc with USE=-static-libs but I still got libnldbl_nonshared.a/libc_nonshared.s libs.
Are those just legacy or still needed for building apps?
Comment 1 Arfrever Frehtes Taifersar Arahesis 2021-04-21 20:55:56 UTC
*_nonshared.a libraries contain things which are only in static libraries and cannot be included in shared libraries.

https://gitweb.gentoo.org/repo/gentoo.git/tree/sys-libs/glibc/glibc-2.33.ebuild?id=12657ee8e74ae494ec94e054b157b1bf2c729e80#n1408
Comment 2 Sergei Trofimovich (RETIRED) gentoo-dev 2021-04-21 21:35:46 UTC
Yes, they are needed for code that has to be included into final binaries directly without library indirection.

As a learning exercise I suggest creating a chroot and trying to find out what breaks if you move these files away.

My guess is that you will first hit the:

$ cat /usr/lib64/libc.so
/* GNU ld script
   Use the shared library, but some functions are only in
   the static library, so try that secondarily.  */
OUTPUT_FORMAT(elf64-x86-64)
GROUP ( /lib64/libc.so.6 /usr/lib64/libc_nonshared.a  AS_NEEDED ( /lib64/ld-linux-x86-64.so.2 ) )

And later if you amend that you will get linker error for missing individual symbols that should get you a clue what is not implemented in crt*.o.

You can also inspect contents of the archives and try to find out if these symbols are still needed. For example:

  $ nm /usr/lib64/libc_nonshared.a
  elf-init.oS:
  0000000000000060 T __libc_csu_fini
  0000000000000000 T __libc_csu_init
  ...
Comment 3 SpanKY gentoo-dev 2021-04-22 19:42:53 UTC
questions like this are better handled on upstream's libc-help list:
https://www.gnu.org/software/libc/involved.html