Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 898098 - sys-libs/glibc-2.36-r5 - build failure with full debug CFLAGS non-optimized
Summary: sys-libs/glibc-2.36-r5 - build failure with full debug CFLAGS non-optimized
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: Sparc64 Linux
: Normal major (vote)
Assignee: Gentoo Toolchain Maintainers
URL: https://genunix.com/dclarke/linux/gen...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-02-27 09:55 UTC by Dennis Clarke
Modified: 2023-04-01 16: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 Dennis Clarke 2023-02-27 09:55:25 UTC
While running "emerge -e --with-bdeps=y @world" fails
 at Emerging (152 of 266) sys-libs/glibc-2.36-r5::gentoo

Does glibc need a special make.conf that overrides the general portage one?

Reproducible: Always
Comment 1 Dennis Clarke 2023-02-27 09:57:03 UTC
I can not post what I see on the xterm because the test is too long. 

see https://genunix.com/dclarke/linux/gentoo_sparcv9/202302270930.txt
Comment 2 Dennis Clarke 2023-02-27 17:47:02 UTC
The problem was the make.conf for portage wherein I wanted
non-optimized binaries with debugging information and not
stripped after the fact.

When running "emerge -e --with-bdeps=y @world" the glibc
build fails as it seems to need some gcc builtin stuff.

Maybe. I will ask the sourceware people.

The solution is to change the make.conf slightly : 

gentoo_cdrom# cat  /mnt/gentoo/etc/portage/make.conf
# These settings were set by the catalyst build script that automatically
# built this stage.
# Please consult /usr/share/portage/config/make.conf.example for a more
# detailed example.
#
#  glibc blows up with these flags
# COMMON_FLAGS= -m64 -g -O0 -fno-builtin -fno-fast-math
#         -mno-app-regs -mcpu=ultrasparc -mtune=ultrasparc -mno-vis -pipe
# FEATURES="nostrip"
COMMON_FLAGS="-m64 -g -O0 -mcpu=ultrasparc -mtune=ultrasparc -mno-vis -pipe"
ACCEPT_LICENSE="* -@EULA"
CFLAGS="${COMMON_FLAGS}"
CXXFLAGS="${COMMON_FLAGS}"
FCFLAGS="${COMMON_FLAGS}"
FFLAGS="${COMMON_FLAGS}"
# WARNING: Changing your CHOST is not something that should be done lightly.
# Please consult https://wiki.gentoo.org/wiki/Changing_the_CHOST_variable before changing.
CHOST="sparc64-unknown-linux-gnu"

# NOTE: This stage was built with the bindist Use flag enabled

# This sets the language of build output to English.
# Please keep this setting intact when reporting bugs.
LC_MESSAGES=C
# University of Waterloo
GENTOO_MIRRORS="https://mirror.csclub.uwaterloo.ca/gentoo-distfiles/"
gentoo_cdrom# 

That allows glibc to compile.

After glibc is done I guess I can go back to the non-optimized CFLAGS
with debug information.
Comment 3 Mike Gilbert gentoo-dev 2023-02-27 19:34:27 UTC
Please attach a build log and provide emerge --info.
Change the bug status back to UNCONFIRMED once this has been provided.
Comment 4 Dennis Clarke 2023-02-27 20:30:31 UTC
(In reply to Mike Gilbert from comment #3)
> Please attach a build log and provide emerge --info.
> Change the bug status back to UNCONFIRMED once this has been provided.

Sorry but this "build log" ? where would that be ? in /var/log somewhere ?
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-02-27 20:37:33 UTC
The error message tells you where it is, it's in /var/tmp/portage/sys-libs/glibc*/temp/build.log.

Also, -fno-builtin is dangerous, NOT an optimisation, and not sommething you should build glibc with.
Comment 6 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-02-27 20:37:53 UTC
(In reply to Sam James from comment #5)
> The error message tells you where it is, it's in
> /var/tmp/portage/sys-libs/glibc*/temp/build.log.
> 
> Also, -fno-builtin is dangerous, NOT an optimisation, and not sommething you
> should build glibc with.

Your log (.txt) from xterm says:
```
 * If you need support, post the output of `emerge --info '=sys-libs/glibc-2.36-r5::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=sys-libs/glibc-2.36-r5::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/sys-libs/glibc-2.36-r5/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/sys-libs/glibc-2.36-r5/temp/environment'.
 * Working directory: '/var/tmp/portage/sys-libs/glibc-2.36-r5/work/build-sparc64-sparc64-unknown-linux-gnu-nptl'
 * S: '/var/tmp/portage/sys-libs/glibc-2.36-r5/work/glibc-2.36'
```
Comment 7 Arsen Arsenović gentoo-dev 2023-02-27 20:50:17 UTC
-O0 already disables optimizations, any flags you add on top of that are either redundant or dangerous.

glibc cannot be built without optimizations and the ebuild will bump the opt level to 1 in that case.

your best bet for debugging is -Og -ggdb3.
Comment 8 Larry the Git Cow gentoo-dev 2023-02-28 03:33:47 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f7386333115feaee9a8bf6ab314b0106ba77f196

commit f7386333115feaee9a8bf6ab314b0106ba77f196
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2023-02-28 03:33:23 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-02-28 03:33:23 +0000

    sys-libs/glibc: filter -fno-builtin
    
    Makes no sense for glibc, as it's the thing providing the non-builtins.
    
    Closes: https://bugs.gentoo.org/898098
    Signed-off-by: Sam James <sam@gentoo.org>

 sys-libs/glibc/glibc-2.36-r7.ebuild | 3 +++
 sys-libs/glibc/glibc-2.37.ebuild    | 3 +++
 sys-libs/glibc/glibc-9999.ebuild    | 3 +++
 3 files changed, 9 insertions(+)