Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 784794 - sys-libs/glibc-2.32-r6: binary merge without binutils fails (No __thread support in gcc!)
Summary: sys-libs/glibc-2.32-r6: binary merge without binutils fails (No __thread supp...
Status: RESOLVED DUPLICATE of bug 786570
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 13:03 UTC by Joakim Tjernlund
Modified: 2021-08-06 21:53 UTC (History)
3 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 13:03:16 UTC
On a system without binutils installed, binary glibc merge fails:
emerge -1a -k y sys-libs/glibc

These are the packages that would be merged, in order:

Calculating dependencies... done!
[binary   R    ] sys-libs/glibc-2.32-r6 

Would you like to merge these packages? [Yes/No] 
>>> Running pre-merge checks for sys-libs/glibc-2.32-r6
 * Checking general environment sanity.
 * Checking gcc for __thread support ...                                                                                                     [ !! ]

 * Could not find a gcc that supports the __thread directive!
 * Please update your binutils/gcc and try again.
 * ERROR: sys-libs/glibc-2.32-r6::gentoo failed (pretend phase):
 *   No __thread support in gcc!
 * 
 * Call stack:
 *     ebuild.sh, line  125:  Called pkg_pretend
 *   environment, line 2668:  Called sanity_prechecks
 *   environment, line 3293:  Called die
 * The specific snippet of code:
 *               die "No __thread support in gcc!";


Also, I figure binary glibc merge also fails without gcc installed?
gcc is a big pkg and I would like to remove it from binary only systems.

I guess then need a gcc-libs pkg? Has this been discussed before?
Comment 1 Ionen Wolkens gentoo-dev 2021-04-22 11:06:15 UTC
Considering gcc also provides some shared libraries (needed at runtime), you'll have trouble removing it

binutils' varied tools also get used for things other than building/linking, you are also losing things like bin/strings and bin/ar with other uses.

That aside, ebuilds should still try to avoid compiler tests if MERGE_TYPE == binary. glibc already makes most of these non-fatal for binpkgs but running tc-has-tls appears to be an oversight.
Comment 2 Joakim Tjernlund 2021-04-22 11:49:48 UTC
(In reply to Ionen Wolkens from comment #1)
> Considering gcc also provides some shared libraries (needed at runtime),
> you'll have trouble removing it

Yes, I am hoping for a gcc-libs package

> 
> binutils' varied tools also get used for things other than building/linking,
> you are also losing things like bin/strings and bin/ar with other uses.
Didn't know that:
 ls /usr/x86_64-pc-linux-gnu/binutils-bin/2.35.2/
  addr2line*  as*   dwp*  gprof*  ld.bfd*   nm* objdump*  readelf*  strings*
  ar* c++filt*  elfedit*  ld*  ld.gold*  objcopy*  ranlib*   size*     strip*

Some of these are useful, what to do ...?

> 
> That aside, ebuilds should still try to avoid compiler tests if MERGE_TYPE
> == binary. glibc already makes most of these non-fatal for binpkgs but
> running tc-has-tls appears to be an oversight.

Thanks
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-04-28 21:28:10 UTC
I hit this with binpkgs while recovering from a broken gcc/glibc too. Could the check for merge type please be added?
Comment 4 Joakim Tjernlund 2021-06-01 15:14:54 UTC
ping?
Comment 5 Sergei Trofimovich (RETIRED) gentoo-dev 2021-06-01 21:14:05 UTC
The check happens in https://gitweb.gentoo.org/repo/gentoo.git/tree/sys-libs/glibc/glibc-9999.ebuild#n676

	# When we actually have to compile something...
	if ! just_headers ; then
		ebegin "Checking gcc for __thread support"
		if ! eend $(want__thread ; echo $?) ; then
			echo
			eerror "Could not find a gcc that supports the __thread directive!"
			eerror "Please update your binutils/gcc and try again."
			die "No __thread support in gcc!"
		fi

A few lines above similar compiler check is avoided with `[[ ${MERGE_TYPE} != "binary" ]]`.

You can double-check what minimal subset of checks could be safely bypassed in binary-only merge and attach the patch. That should speed the review up.
Comment 6 Marco Scardovi (scardracs) 2021-06-13 20:26:06 UTC
Same problem here with arm64
Comment 7 Marco Scardovi (scardracs) 2021-06-13 20:37:29 UTC Comment hidden (obsolete)
Comment 8 Marco Scardovi (scardracs) 2021-06-13 20:41:19 UTC Comment hidden (obsolete)
Comment 9 Joakim Tjernlund 2021-06-17 21:23:04 UTC
Set thin in your portage make.conf:
WANT__THREAD=0
Comment 10 Andreas K. Hüttel archtester gentoo-dev 2021-08-06 21:53:59 UTC

*** This bug has been marked as a duplicate of bug 786570 ***