[New-bugs-announce] [issue35499] "make profile-opt" overrides CFLAGS_NODIST

STINNER Victor report at bugs.python.org
Fri Dec 14 13:25:57 EST 2018


New submission from STINNER Victor <vstinner at redhat.com>:

Makefile.pre.in contains the rule:

build_all_generate_profile:
	$(MAKE) @DEF_MAKE_RULE@ CFLAGS_NODIST="$(CFLAGS) $(PGO_PROF_GEN_FLAG)" LDFLAGS="$(LDFLAGS) $(PGO_PROF_GEN_FLAG)" LIBS="$(LIBS)"

I'm not sure that CFLAGS_NODIST="$(CFLAGS) $(PGO_PROF_GEN_FLAG)" is correct: it overrides user $CFLAGS_NODIST variable. I suggest to replace it with CFLAGS_NODIST="$(CFLAGS_NODIST) $(PGO_PROF_GEN_FLAG)": add $(PGO_PROF_GEN_FLAG) to CFLAGS_NODIST, don't copy $CFLAGS to $CFLAGS_NODIST (and add $(PGO_PROF_GEN_FLAG)).

The code comes from bpo-23390:

commit 2f90aa63666308e7a9b2d0a89110e0be445a393a
Author: Gregory P. Smith <greg at krypto.org>
Date:   Wed Feb 4 02:11:56 2015 -0800

    Fixes issue23390: make profile-opt causes -fprofile-generate and related flags
    to end up in distutils CFLAGS.

(...)
 build_all_generate_profile:
-       $(MAKE) all CFLAGS="$(CFLAGS) -fprofile-generate" LIBS="$(LIBS) -lgcov"
+       $(MAKE) all CFLAGS_NODIST="$(CFLAGS) -fprofile-generate" LDFLAGS="-fprofile-generate" LIBS="$(LIBS) -lgcov"
(...)


CFLAGS_NODIST has been added by bpo-21121:

commit acb8c5234302f8057b331abaafb2cc8697daf58f
Author: Benjamin Peterson <benjamin at python.org>
Date:   Sat Aug 9 20:01:49 2014 -0700

    add -Werror=declaration-after-statement only to stdlib extension modules (closes #21121)
    
    Patch from Stefan Krah.


This issue is related to bpo-35257: "Avoid leaking linker flags into distutils: add PY_LDFLAGS_NODIST".

----------
components: Build
messages: 331847
nosy: vstinner
priority: normal
severity: normal
status: open
title: "make profile-opt" overrides CFLAGS_NODIST
versions: Python 3.6, Python 3.7, Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue35499>
_______________________________________


More information about the New-bugs-announce mailing list