This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients vstinner
Date 2018-12-14.18:25:56
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1544811957.28.0.788709270274.issue35499@psf.upfronthosting.co.za>
In-reply-to
Content
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@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@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".
History
Date User Action Args
2018-12-14 18:25:57vstinnersetrecipients: + vstinner
2018-12-14 18:25:57vstinnersetmessageid: <1544811957.28.0.788709270274.issue35499@psf.upfronthosting.co.za>
2018-12-14 18:25:57vstinnerlinkissue35499 messages
2018-12-14 18:25:56vstinnercreate