timbunce / devel-nytprof

Devel::NYTProf is a powerful feature-rich source code profiler for Perl. (Mostly in maintenance mode, so PRs are much more likely to be acted upon than Issues.)
http://blog.timbunce.org/tag/nytprof/
67 stars 51 forks source link

Makefile.PL Invokes `$Config{cpp}` instead of `$Config{cpprun}` #139

Closed kentfredric closed 3 years ago

kentfredric commented 4 years ago

See https://github.com/Perl/perl5/issues/17948

We've locally got perl configured with -Dcpp=$GCC -E, which is a perfectly valid C PreProcessor.

However, cpp only contains the "path" aspect of that, and strips the arguments.

https://github.com/Perl/perl5/blob/48a788454f1719093d08e80bbb70723ae345163a/Porting/Glossary#L315-L350

cpp (Loc.U):
    This variable is used internally by Configure to determine the
    full pathname (if any) of the cpp program.  After Configure runs,
    the value is reset to a plain "cpp" and is not useful.
...
cpprun (cppstdin.U):
    This variable contains the command which will invoke a C preprocessor
    on standard input and put the output to stdout. It is guaranteed not
    to be a wrapper and may be a null string if no preprocessor can be
    made directly available. This preprocessor might be different from the
    one used by the C compiler. Don't forget to append cpplast after the
preprocessor options.
#perl -V:cpp.*
cpp='x86_64-pc-linux-gnu-gcc';
cpp_stuff='42';
cppccsymbols='';
cppflags='-fwrapv -fno-strict-aliasing -pipe';
cpplast='-';
cppminus='-';
cpprun='x86_64-pc-linux-gnu-gcc  -E';
cppstdin='x86_64-pc-linux-gnu-gcc  -E';
cppsymbols='_FILE_OFFSET_BITS=64 _FORTIFY_SOURCE=2 _LARGEFILE_SOURCE=1 _LP64=1 _POSIX_C_SOURCE=200809L _POSIX_SOURCE=1 __BYTE_ORDER__=1234 __ELF__=1 __GLIBC_MINOR__=31 __GLIBC__=2 __GNUC_MINOR__=1 __GNUC__=10 __GNU_LIBRARY__=6 __LP64__=1 __PIC__=2 __STDC__=1 __USE_FILE_OFFSET64=1 __USE_LARGEFILE=1 __USE_MISC=1 __USE_POSIX199309=1 __USE_POSIX199506=1 __USE_POSIX2=1 __USE_POSIX=1 __amd64=1 __amd64__=1 __linux=1 __linux__=1 __pic__=2 __unix=1 __unix__=1 __x86_64=1 __x86_64__=1 linux=1 unix=1';
jkeenan commented 3 years ago

Addressed via https://github.com/timbunce/devel-nytprof/commit/07778bf984c7d2e2f9e801d371a8e31b64396deb. Closing ticket. Thank you very much.