Projet

Général

Profil

Bug #11377

configure.ac hardcodes CFLAGS to empty string, fails to respect build environment

Ajouté par John Dennis il y a presque 8 ans. Mis à jour il y a presque 8 ans.

Statut:
Fermé
Priorité:
Normal
Assigné à:
-
Catégorie:
-
Version cible:
-
Début:
15 juin 2016
Echéance:
% réalisé:

0%

Temps estimé:
Patch proposed:
Non
Planning:

Description

CFLAGS is initialized to the empty string in configure.ac, this
effectively turned off user supplied values for CFLAGS preventing site
specific values from being used. A further complicating factor was of
all the user supplied values documented in Automake only CFLAGS was
disabled allowing all other user supplied variables to take
effect. Some variables must be coordinated (e.g. CFLAGS with LDFLAGS),
the fact LDFLAGS was picked up from the environment but CFLAGS was
discarded caused build failures due to incompatible combination of
compiler and linker options.

The problem was first introduced in commit: 73d9c98f "Reset CFLAGS
when --enable-debugging is used". This patch simply removes hardcoding
CFLAGS to the empty string and appends the debug options
(--enable-debugging) to the existing CFLAGS.

Proper use of the variables is described in the Automake documentation
in the section "Flag Variables Ordering"
https://www.gnu.org/software/automake/manual/html_node/Flag-Variables-Ordering.html


Fichiers

0001-enable-user-supplied-CFLAGS.patch (2,46 ko) 0001-enable-user-supplied-CFLAGS.patch git formatted patch to resolve issue John Dennis, 15 juin 2016 22:31

Historique

#2

Mis à jour par Benjamin Dauvergne il y a presque 8 ans

  • Statut changé de Nouveau à Fermé

Thanks.

commit ed74f24155635beeae2312fe589366e77827be94
Author: John Dennis <jdennis@redhat.com>
Date:   Wed Jun 15 11:50:24 2016 -0400

    enable user supplied CFLAGS

    CFLAGS is initialized to the empty string in configure.ac, this
    effectively turned off user supplied values for CFLAGS preventing site
    specific values from being used. A further complicating factor was of
    all the user supplied values documented in Automake only CFLAGS was
    disabled allowing all other user supplied variables to take
    effect. Some variables must be coordinated (e.g. CFLAGS with LDFLAGS),
    the fact LDFLAGS was picked up from the environment but CFLAGS was
    discarded caused build failures due to incompatible combination of
    compiler and linker options.

    The problem was first introduced in commit: 73d9c98f "Reset CFLAGS
    when --enable-debugging is used". This patch simply removes hardcoding
    CFLAGS to the empty string and appends the debug options
    (--enable-debugging) to the existing CFLAGS.

    Proper use of the variables is described in the Automake documentation
    in the section "Flag Variables Ordering" 
    https://www.gnu.org/software/automake/manual/html_node/Flag-Variables-Ordering.html

    Although the Automake documentation claims manipulating CFLAGS
    directly is improper use there are many examples of this in the
    existing configure.ac, this patch makes no attempt at addressing this
    issue, rather it makes existing usage consistent. In the particular
    case of debug flags appending to CFLAGS is probably the only valid
    solution because the debug flags must appear at the end of the list of
    flags in order to override earlier flags, CFLAGS always appears last
    in the Makefile (see above Automake doc).

    Signed-off-by: John Dennis <jdennis@redhat.com>
    License: MIT

Formats disponibles : Atom PDF