Bug 2401434 - makefile: wrong flags
Summary: makefile: wrong flags
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: nawk
Version: rawhide
Hardware: All
OS: Linux
unspecified
low
Target Milestone: ---
Assignee: Mark McKinstry
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2025-10-04 10:13 UTC by Xose Vazquez Perez
Modified: 2026-01-15 00:52 UTC (History)
3 users (show)

Fixed In Version: nawk-20251225-2.fc42
Clone Of:
Environment:
Last Closed: 2026-01-15 00:52:01 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
use CC instead HOSTCC for maketab (1.94 KB, application/mbox)
2025-10-04 10:15 UTC, Xose Vazquez Perez
no flags Details
fix using the spec file (348 bytes, patch)
2025-10-05 23:09 UTC, Thomas E. Dickey
no flags Details | Diff

Description Xose Vazquez Perez 2025-10-04 10:13:55 UTC
maketab is compiled as:

cc -g -Wall -pedantic -Wcast-qual -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wno-complain-wrong-lang -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer maketab.c -o maketab

It is not built with the same local FLAGS as other files.

Reproducible: Always

Comment 1 Xose Vazquez Perez 2025-10-04 10:15:27 UTC
Created attachment 2108403 [details]
use CC instead HOSTCC for maketab

Comment 2 Xose Vazquez Perez 2025-10-04 10:16:20 UTC
Built with all Fedora local flags applied correctly:
"gcc" instead "cc". And "-g -Wall -pedantic -Wcast-qual" were removed.


before:
cc -g -Wall -pedantic -Wcast-qual -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wno-complain-wrong-lang -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer maketab.c -o maketab

after:
gcc -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wno-complain-wrong-lang -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer maketab.c -o maketab

Comment 3 Thomas E. Dickey 2025-10-04 10:47:27 UTC
That's because maketab is a build-time utility, and is used in cross-compiles.
I haven't seen that aspect addressed in the macros (perhaps some specific suggestion would help).

Comment 4 Thomas E. Dickey 2025-10-05 21:36:27 UTC
In any case, the proper fix for this would be in the spec file (not a patch),
because the configure script provides options which can be used to solve the problem.

configure --help shows this:

Cross-compiling
  --with-build-cc=XXX     the build C compiler ($BUILD_CC)
  --with-build-cpp=XXX    the build C preprocessor ($BUILD_CPP)
  --with-build-cflags=XXX the build C compiler-flags ($BUILD_CFLAGS)
  --with-build-cppflags=XXX the build C preprocessor-flags ($BUILD_CPPFLAGS)
  --with-build-ldflags=XXX the build linker-flags ($BUILD_LDFLAGS)
  --with-build-libs=XXX   the build libraries (${BUILD_LIBS})

Comment 5 Thomas E. Dickey 2025-10-05 21:40:15 UTC
(In reply to Thomas E. Dickey from comment #4)
> In any case, the proper fix for this would be in the spec file (not a patch),
> because the configure script provides options which can be used to solve the
> problem.
> 
> configure --help shows this:
> 
> Cross-compiling
>   --with-build-cc=XXX     the build C compiler ($BUILD_CC)
>   --with-build-cpp=XXX    the build C preprocessor ($BUILD_CPP)
>   --with-build-cflags=XXX the build C compiler-flags ($BUILD_CFLAGS)
>   --with-build-cppflags=XXX the build C preprocessor-flags ($BUILD_CPPFLAGS)
>   --with-build-ldflags=XXX the build linker-flags ($BUILD_LDFLAGS)
>   --with-build-libs=XXX   the build libraries (${BUILD_LIBS})

sorry - I read "nawk" as "mawk" :-(

Comment 6 Thomas E. Dickey 2025-10-05 23:09:45 UTC
Created attachment 2108718 [details]
fix using the spec file

trivial fixes in the spec-file are easier to maintain

Comment 7 Fedora Update System 2026-01-06 06:39:15 UTC
FEDORA-2026-1000f4ab4e (nawk-20251225-2.fc42) has been submitted as an update to Fedora 42.
https://bodhi.fedoraproject.org/updates/FEDORA-2026-1000f4ab4e

Comment 8 Mark McKinstry 2026-01-06 06:41:28 UTC
Thanks for the fix for this Thomas and thanks for reporting it Xose. I somehow missed this and only noticed this bug was open when I was upgrade to a new version of nawk. The new RPM has the fix for this in it.

Comment 9 Fedora Update System 2026-01-07 01:33:04 UTC
FEDORA-2026-1000f4ab4e has been pushed to the Fedora 42 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2026-1000f4ab4e`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2026-1000f4ab4e

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 10 Fedora Update System 2026-01-15 00:52:01 UTC
FEDORA-2026-1000f4ab4e (nawk-20251225-2.fc42) has been pushed to the Fedora 42 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.