https://bugs.openldap.org/show_bug.cgi?id=9525
Issue ID: 9525 Summary: Fix contrib modules to properly honor build flags Product: OpenLDAP Version: 2.5 Hardware: All OS: All Status: UNCONFIRMED Severity: normal Priority: --- Component: contrib Assignee: bugs@openldap.org Reporter: quanah@openldap.org Target Milestone: ---
Currently the contrib makefiles use a variable "OPT", instead they should be fixed to correctly honor CFLAGS, CPPFLAGS, and LDFLAGS as appropriate
https://bugs.openldap.org/show_bug.cgi?id=9525
--- Comment #1 from Howard Chu hyc@openldap.org --- (In reply to Quanah Gibson-Mount from comment #0)
Currently the contrib makefiles use a variable "OPT", instead they should be fixed to correctly honor CFLAGS, CPPFLAGS, and LDFLAGS as appropriate
No.
CFLAGS / CPPFLAGS are to control non-optimization-related compilation flags. OPT is to control optimization only, without changing any other aspect of the build.
In particular, CFLAGS comprises the entire set of flags; overriding CFLAGS from the make commandline usually means you have to either redundantly specify a lot of important flags, or lose them in the process.
https://bugs.openldap.org/show_bug.cgi?id=9525
Howard Chu hyc@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |INVALID Status|UNCONFIRMED |RESOLVED
https://bugs.openldap.org/show_bug.cgi?id=9525
Quanah Gibson-Mount quanah@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 Status|RESOLVED |CONFIRMED Resolution|INVALID |---
--- Comment #2 from Quanah Gibson-Mount quanah@openldap.org --- Yes, it completely breaks setting consistent global flags to the build process. The use of OPT is problematic and should not be used.
https://bugs.openldap.org/show_bug.cgi?id=9525
--- Comment #3 from Quanah Gibson-Mount quanah@openldap.org --- (In reply to Howard Chu from comment #1)
(In reply to Quanah Gibson-Mount from comment #0)
Currently the contrib makefiles use a variable "OPT", instead they should be fixed to correctly honor CFLAGS, CPPFLAGS, and LDFLAGS as appropriate
No.
CFLAGS / CPPFLAGS are to control non-optimization-related compilation flags. OPT is to control optimization only, without changing any other aspect of the build.
In particular, CFLAGS comprises the entire set of flags; overriding CFLAGS from the make commandline usually means you have to either redundantly specify a lot of important flags, or lose them in the process.
Modern builds use tools to do the builds, which set up the CFLAGS, CPPFLAGS, and LFLAGS so that a consistent build can be obtained across the board. Tools such as these are used whether for distributions or general hobbyists. The use of OPT breaks the ability to explicitly set critical flags, for example around producing hardened builds, when building contrib overlays and modules that are *not* ignored when building the standard overlays and modules, creating inconsistent results and breaking expectations that build behavior should be consistent regardless of whether they are overlays shipped in the main portion of OpenLDAP or as contrib modules.
https://bugs.openldap.org/show_bug.cgi?id=9525
--- Comment #4 from Howard Chu hyc@openldap.org --- (In reply to Quanah Gibson-Mount from comment #3)
(In reply to Howard Chu from comment #1)
(In reply to Quanah Gibson-Mount from comment #0)
Currently the contrib makefiles use a variable "OPT", instead they should be fixed to correctly honor CFLAGS, CPPFLAGS, and LDFLAGS as appropriate
No.
CFLAGS / CPPFLAGS are to control non-optimization-related compilation flags. OPT is to control optimization only, without changing any other aspect of the build.
In particular, CFLAGS comprises the entire set of flags; overriding CFLAGS from the make commandline usually means you have to either redundantly specify a lot of important flags, or lose them in the process.
Modern builds use tools to do the builds, which set up the CFLAGS, CPPFLAGS, and LFLAGS so that a consistent build can be obtained across the board.
Sure, CFLAGS / CPPFLAGS / LDFLAGS should be used. But optimization flags should always be in the OPT variable, and CFLAGS can reference $(OPT) wherever it is used. The ability to do immediate rebuilds with different optimization, without changing any other build flags must be preserved.
https://bugs.openldap.org/show_bug.cgi?id=9525
Quanah Gibson-Mount quanah@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |2.5.4
https://bugs.openldap.org/show_bug.cgi?id=9525
Quanah Gibson-Mount quanah@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Assignee|bugs@openldap.org |quanah@openldap.org Status|CONFIRMED |IN_PROGRESS
https://bugs.openldap.org/show_bug.cgi?id=9525
Quanah Gibson-Mount quanah@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|IN_PROGRESS |RESOLVED
--- Comment #5 from Quanah Gibson-Mount quanah@openldap.org --- Commits: • c62d48ed by Quanah Gibson-Mount at 2021-04-19T16:57:10+00:00 ITS#9525 - Rework contrib module builds
https://bugs.openldap.org/show_bug.cgi?id=9525
Quanah Gibson-Mount quanah@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |VERIFIED