New submission from STINNER Victor <[email protected]>:
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
<https://bugs.python.org/issue35499>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com