Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 919975 - sys-apps/busybox: does not fully respect CFLAGS by appending -Oz after user flags
Summary: sys-apps/busybox: does not fully respect CFLAGS by appending -Oz after user f...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Embedded Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: cflags
  Show dependency tree
 
Reported: 2023-12-15 06:45 UTC by Sam James
Modified: 2023-12-16 10:40 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 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-12-15 06:45:16 UTC
See e.g.
```
  aarch64-unknown-linux-gnu-gcc -Wp,-MD,shell/.ash.o.d  -std=gnu99 -Iinclude -Ilibbb  -include include/autoconf.h -D_GNU_SOURCE -DNDEBUG -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -DBB_VER='"1.36.1"' -O3 -pipe -mcpu=native -fdiagnostics-color=always -ggdb3 -fno-strict-aliasing -Wall -Wshadow -Wwrite-strings -Wundef -Wstrict-prototypes -Wunused -Wunused-parameter -Wunused-function -Wunused-value -Wmissing-prototypes -Wmissing-declarations -Wno-format-security -Wdeclaration-after-statement -Wold-style-definition -finline-limit=0 -fno-builtin-strlen -ffunction-sections -fdata-sections -fno-guess-branch-probability -funsigned-char -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-builtin-printf -Oz    -DKBUILD_BASENAME='"ash"'  -DKBUILD_MODNAME='"ash"' -c -o shell/ash.o shell/ash.c
```

from building 1.36.1.
Comment 1 Viorel Munteanu gentoo-dev 2023-12-15 07:58:29 UTC
It's true, but I wouldn't drop -Oz either.  Most people have -O2 in CFLAGS.  Maybe add a USE flag?
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-12-15 08:00:28 UTC
On the other hand, people are free to add -Os/-Oz to stuff likely to be in their initramfs if they want...

My hope is to avoid the USE=custom-cflags deal here as it feels kind of icky and not really well-defined for when it should be used anyway.

Perhaps we could compromise with something like an einfo or ewarn on first install or upgrade from $first_version_before_fixed if not using -Oz to let users know they can do it if they want.
Comment 3 Viorel Munteanu gentoo-dev 2023-12-15 08:54:47 UTC
Sounds good.
Comment 4 Larry the Git Cow gentoo-dev 2023-12-16 10:25:42 UTC
The bug has been closed via the following commit(s):

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

commit a9cfecde4ffda1b5e7c9af6d3337604038663298
Author:     Viorel Munteanu <ceamac@gentoo.org>
AuthorDate: 2023-12-16 10:23:14 +0000
Commit:     Viorel Munteanu <ceamac@gentoo.org>
CommitDate: 2023-12-16 10:25:23 +0000

    sys-apps/busybox: respect CFLAGS
    
    Don't force -Oz, but add a small message the first time it's missing, in
    case anyone was counting on it.
    
    Closes: https://bugs.gentoo.org/919975
    Signed-off-by: Viorel Munteanu <ceamac@gentoo.org>

 sys-apps/busybox/busybox-1.36.1-r1.ebuild | 379 ++++++++++++++++++++++++++++++
 1 file changed, 379 insertions(+)
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-12-16 10:32:27 UTC
Thank you! Sync live too?
Comment 6 Viorel Munteanu gentoo-dev 2023-12-16 10:40:13 UTC
Done.  Thanks!