bug#79648: configure.ac sets user-defined CFLAGS
Nikolaos Chatzikonstantinou <[email protected]> Sat, 18 Oct 2025 05:07:44 -0400
| Newsgroups | gmane.lisp.guile.bugs |
|---|---|
| Message-ID | <CAAQmekcCHxje7YE2c5gNn1Zu_kqqP6Z47rk83ntf0E2erjGUNA@mail.gmail.com> |
Hello list, The CFLAGS variable should not be set in configure.ac. Of course, it is fine to temporarily set it to a different value to test compilation, but it should not set "defaults" in CFLAGS, since that overrides whatever the user sets in the environment. For example, I compiled with CFLAGS='-O0 g3' to debug a (different) bug in Guile with gdb, and I did not have any access to macros. After a lot of head scratching I resorted to asking for help and https://sourceware.org/bugzilla/show_bug.cgi?id=32381 was pointed out to me. In short, Guile injected -flto which enables LTO and gdb cannot trace line numbers correctly. Instead, configure.ac should be setting defaults in AM_CFLAGS. I will send a patch moving -flto and -Werror=array-bounds from CFLAGS to AM_CFLAGS. Regards, Nikolaos Chatzikonstantinou