Skip Menu |

This queue is for tickets about the Devel-CallChecker CPAN distribution.

Report information
The Basics
Id: 93238
Status: open
Priority: 0/
Queue: Devel-CallChecker

People
Owner: Nobody in particular
Requestors: desmond.daignault [...] oneil.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Error when compiling with VS2010
Date: Fri, 21 Feb 2014 19:38:53 +0000
To: "bug-Devel-CallChecker [...] rt.cpan.org" <bug-Devel-CallChecker [...] rt.cpan.org>
From: Desmond Daignault <desmond.daignault [...] oneil.com>
Tried compiling all versions from 0.2 forward, all give similar errors. What else can I provide to help debug this? C:\third_party\build\sandbox\Devel-CallChecker-0.006>perl Build Building Devel-CallChecker Generating script 'lib\Devel\CallChecker.ccs' cl -nologo -c @"lib\Devel\CallChecker.ccs" -Fo"lib\Devel\CallChecker.obj" "lib\Devel\CallChecker.c" CallChecker.c lib\\Devel\\CallChecker.xs(473) : error C2121: '#' : invalid character : possibly the result of a macro expansion lib\\Devel\\CallChecker.xs(473) : error C2143: syntax error : missing ')' before 'if' lib\\Devel\\CallChecker.xs(473) : error C2121: '#' : invalid character : possibly the result of a macro expansion lib\\Devel\\CallChecker.xs(473) : error C2121: '#' : invalid character : possibly the result of a macro expansion lib\\Devel\\CallChecker.xs(473) : error C2121: '#' : invalid character : possibly the result of a macro expansion lib\\Devel\\CallChecker.xs(473) : error C2121: '#' : invalid character : possibly the result of a macro expansion lib\\Devel\\CallChecker.xs(473) : error C2121: '#' : invalid character : possibly the result of a macro expansion lib\\Devel\\CallChecker.xs(473) : error C2121: '#' : invalid character : possibly the result of a macro expansion lib\\Devel\\CallChecker.xs(473) : error C2121: '#' : invalid character : possibly the result of a macro expansion lib\\Devel\\CallChecker.xs(473) : error C2121: '#' : invalid character : possibly the result of a macro expansion lib\\Devel\\CallChecker.xs(473) : error C2121: '#' : invalid character : possibly the result of a macro expansion lib\\Devel\\CallChecker.xs(473) : error C2121: '#' : invalid character : possibly the result of a macro expansion lib\\Devel\\CallChecker.xs(473) : error C2121: '#' : invalid character : possibly the result of a macro expansion lib\\Devel\\CallChecker.xs(473) : error C2121: '#' : invalid character : possibly the result of a macro expansion lib\\Devel\\CallChecker.xs(473) : error C2121: '#' : invalid character : possibly the result of a macro expansion lib\\Devel\\CallChecker.xs(473) : error C2121: '#' : invalid character : possibly the result of a macro expansion lib\\Devel\\CallChecker.xs(473) : error C2121: '#' : invalid character : possibly the result of a macro expansion lib\\Devel\\CallChecker.xs(473) : error C2121: '#' : invalid character : possibly the result of a macro expansion lib\\Devel\\CallChecker.xs(473) : error C2121: '#' : invalid character : possibly the result of a macro expansion lib\\Devel\\CallChecker.xs(473) : error C2121: '#' : invalid character : possibly the result of a macro expansion lib\\Devel\\CallChecker.xs(473) : error C2121: '#' : invalid character : possibly the result of a macro expansion lib\\Devel\\CallChecker.xs(473) : error C2121: '#' : invalid character : possibly the result of a macro expansion lib\\Devel\\CallChecker.xs(473) : error C2121: '#' : invalid character : possibly the result of a macro expansion error building dll file from 'lib\Devel\CallChecker.c' at C:/third_party/build/win32/install/perl/site/lib/ExtUtils/CBuilder/Platform/Windows.pm line 130. results of perl -V Summary of my perl5 (revision 5 version 18 subversion 2) configuration: Platform: osname=MSWin32, osvers=6.1, archname=MSWin32-x86-multi-thread uname='' config_args='undef' hint=recommended, useposix=true, d_sigaction=undef useithreads=define, usemultiplicity=define useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef use64bitint=undef, use64bitall=undef, uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cl', ccflags ='-nologo -GF -W3 -O1 -MD -Zi -DNDEBUG -DWIN32 -D_CONSOLE -DNO_STRICT -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DPERL_TEXTMODE_SCRIPTS -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO', optimize='-O1 -MD -Zi -DNDEBUG', cppflags='-DWIN32' ccversion='16.00.40219.01', gccversion='', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234 d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=8 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='__int64', lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='link', ldflags ='-nologo -nodefaultlib -debug -opt:ref,icf -libpath:"C:\third_party\build\win32\install\perl\lib\CORE" -machine:x86 "/manifestdependency:type='Win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'"' libpth=\lib libs=oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib netapi32.lib uuid.lib ws2_32.lib mpr.lib winmm.lib version.lib odbc32.lib odbccp32.lib comctl32.lib msvcrt.lib perllibs=oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib netapi32.lib uuid.lib ws2_32.lib mpr.lib winmm.lib version.lib odbc32.lib odbccp32.lib comctl32.lib msvcrt.lib libc=msvcrt.lib, so=dll, useshrplib=true, libperl=perl518.lib gnulibc_version='' Dynamic Linking: dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' ' cccdlflags=' ', lddlflags='-dll -nologo -nodefaultlib -debug -opt:ref,icf -libpath:"C:\third_party\build\win32\install\perl\lib\CORE" -machine:x86 "/manifestdependency:type='Win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'"' Characteristics of this binary (from libperl): Compile-time options: HAS_TIMES HAVE_INTERP_INTERN MULTIPLICITY PERLIO_LAYERS PERL_DONT_CREATE_GVSV PERL_HASH_FUNC_ONE_AT_A_TIME_HARD PERL_IMPLICIT_CONTEXT PERL_IMPLICIT_SYS PERL_MALLOC_WRAP PERL_PRESERVE_IVUV PERL_SAWAMPERSAND USE_ITHREADS USE_LARGE_FILES USE_LOCALE USE_LOCALE_COLLATE USE_LOCALE_CTYPE USE_LOCALE_NUMERIC USE_PERLIO USE_PERL_ATOF Built under MSWin32 Compiled at Feb 20 2014 14:33:57 @INC: C:/third_party/build/win32/install/perl/site/lib C:/third_party/build/win32/install/perl/lib . -- Sincerely, Desmond Daignault Senior Software Engineer O'Neil & Associates, Inc. ********************************************************************** Confidentiality Notice The information contained in this e-mail is confidential and intended for use only by the person(s) or organization listed in the address. If you have received this communication in error, please contact the sender at O'Neil & Associates, Inc., immediately. Any copying, dissemination, or distribution of this communication, other than by the intended recipient, is strictly prohibited. **********************************************************************
The patch attached is adressing the issue with cl compiler. Works for me, with both gcc/g++ and cl. Not tested on any other platform but Windows.
Subject: Devel-CallChecker-0.007.patch
diff -Naur Devel-CallChecker-0.007.orig/Build.PL Devel-CallChecker-0.007.new/Build.PL --- Devel-CallChecker-0.007.orig/Build.PL 2015-03-21 13:06:38.000000000 +0100 +++ Devel-CallChecker-0.007.new/Build.PL 2015-04-07 15:53:54.114628400 +0200 @@ -5,6 +5,9 @@ use Module::Build; Module::Build->subclass(code => q{ + use File::Spec; + use File::Basename; + use File::Copy qw/cp/; unless(__PACKAGE__->can("cbuilder")) { *cbuilder = sub { $_[0]->_cbuilder or die "no C support" }; } @@ -41,12 +44,14 @@ @_ = ($self, %args); goto &$orig_cb_prelink; }; - my($libfile, $impfile); + my($libfile, $impfile, $objfile); if($^O eq "MSWin32") { my $dlext = $cb->{config}->{dlext}; my $libext = $cb->{config}->{lib_ext}; + my $objext = $cb->{config}->{obj_ext}; $libfile = $spec->{lib_file}; - ($impfile = $libfile) =~ s/\.\Q$dlext\E\z/$libext/ + $objfile = $spec->{obj_file}; + ($impfile = $objfile) =~ s/\Q$objext\E\z/$libext/ or die "can't generate import library name"; unlink $libfile, $impfile unless $self->up_to_date($libfile, $impfile); @@ -72,9 +77,14 @@ } if $cb->isa("ExtUtils::CBuilder::Platform::Windows::GCC"); $self->SUPER::link_c($spec); if($^O eq "MSWin32") { - die "failed to generate import library" + die "failed to generate import library $impfile" unless -e $impfile; - $self->add_to_cleanup($impfile); + my $impfinalfile = File::Spec->catfile(dirname($libfile), basename($impfile)); + if (! -e $impfinalfile) { + print STDERR "copy $impfile $impfinalfile\n"; + cp($impfile, $impfinalfile); + $self->add_to_cleanup($impfile); + } } } })->new( @@ -91,6 +101,8 @@ "ExtUtils::CBuilder" => "0.15", "ExtUtils::ParseXS" => 0, "File::Spec" => 0, + "File::Basename" => 0, + "File::Copy" => 0, "IO::File" => "1.03", "Module::Build" => 0, "Test::More" => 0, diff -Naur Devel-CallChecker-0.007.orig/lib/Devel/CallChecker.xs Devel-CallChecker-0.007.new/lib/Devel/CallChecker.xs --- Devel-CallChecker-0.007.orig/lib/Devel/CallChecker.xs 2015-03-21 13:06:38.000000000 +0100 +++ Devel-CallChecker-0.007.new/lib/Devel/CallChecker.xs 2015-04-05 11:59:52.376393300 +0200 @@ -423,52 +423,58 @@ wrap_op_checker(OP_ENTERSUB, myck_entersub, &nxck_entersub); #endif /* Q_PROVIDE_CV_SET_CALL_CHECKER */ -SV * -callchecker0_h() -CODE: - RETVAL = newSVpvs( - "/* DO NOT EDIT -- generated " - "by Devel::CallChecker version "XS_VERSION" */\n" - "#ifndef "QPFXS"INCLUDED\n" - "#define "QPFXS"INCLUDED 1\n" - "#ifndef PERL_VERSION\n" - " #error you must include perl.h before callchecker0.h\n" - "#elif !(PERL_REVISION == "STRINGIFY(PERL_REVISION) - " && PERL_VERSION == "STRINGIFY(PERL_VERSION) #if PERL_VERSION & 1 - " && PERL_SUBVERSION == "STRINGIFY(PERL_SUBVERSION) -#endif /* PERL_VERSION & 1 */ - ")\n" - " #error this callchecker0.h is for Perl " - STRINGIFY(PERL_REVISION)"."STRINGIFY(PERL_VERSION) +#define PERL_TESTVERSION "PERL_REVISION == "STRINGIFY(PERL_REVISION) \ + " && PERL_VERSION == "STRINGIFY(PERL_VERSION) \ + " && PERL_SUBVERSION == "STRINGIFY(PERL_SUBVERSION) +#else +#define PERL_TESTVERSION "PERL_REVISION == "STRINGIFY(PERL_REVISION) \ + " && PERL_VERSION == "STRINGIFY(PERL_VERSION) +#endif + #if PERL_VERSION & 1 - "."STRINGIFY(PERL_SUBVERSION) -#endif /* PERL_VERSION & 1 */ - " only\n" - "#endif /* Perl version mismatch */\n" +#define PERL_PRINTVERSION STRINGIFY(PERL_REVISION)"."STRINGIFY(PERL_VERSION)"."STRINGIFY(PERL_SUBVERSION) +#else +#define PERL_PRINTVERSION STRINGIFY(PERL_REVISION)"."STRINGIFY(PERL_VERSION) +#endif + #define DEFFN(RETTYPE, PUBNAME, PRIVNAME, ARGTYPES, ARGNAMES) \ MY_IMPORT_CALLCONV_S" "RETTYPE" "QPFXS PRIVNAME"(pTHX_ "ARGTYPES");\n" \ "#define Perl_"PUBNAME" "QPFXS PRIVNAME"\n" \ "#define "PUBNAME"("ARGNAMES") Perl_"PUBNAME"(aTHX_ "ARGNAMES")\n" + #if Q_PROVIDE_RV2CV_OP_CV - "#define RV2CVOPCV_MARK_EARLY 0x00000001\n" - "#define RV2CVOPCV_RETURN_NAME_GV 0x00000002\n" +#define Q_PROVIDE_RV2CV_OP_CV_STRING "#define RV2CVOPCV_MARK_EARLY 0x00000001\n" \ + "#define RV2CVOPCV_RETURN_NAME_GV 0x00000002\n" \ DEFFN("CV *", "rv2cv_op_cv", "roc0", "OP *, U32", "cvop, flags") +#else +#define Q_PROVIDE_RV2CV_OP_CV_STRING #endif /* Q_PROVIDE_RV2CV_OP_CV */ + #if Q_PROVIDE_CK_ENTERSUB_ARGS_PROTO_OR_LIST - DEFFN("OP *", "ck_entersub_args_list", "eal0", "OP *", "o") - DEFFN("OP *", "ck_entersub_args_proto", "eap0", - "OP *, GV *, SV *", "o, gv, sv") - DEFFN("OP *", "ck_entersub_args_proto_or_list", "ean0", +#define Q_PROVIDE_CK_ENTERSUB_ARGS_PROTO_OR_LIST_STRING DEFFN("OP *", "ck_entersub_args_list", "eal0", "OP *", "o") \ + DEFFN("OP *", "ck_entersub_args_proto", "eap0", \ + "OP *, GV *, SV *", "o, gv, sv") \ + DEFFN("OP *", "ck_entersub_args_proto_or_list", "ean0", \ "OP *, GV *, SV *", "o, gv, sv") +#else +#define Q_PROVIDE_CK_ENTERSUB_ARGS_PROTO_OR_LIST_STRING #endif /* Q_PROVIDE_CK_ENTERSUB_ARGS_PROTO_OR_LIST */ -#if Q_PROVIDE_CV_SET_CALL_CHECKER - "typedef OP *(*Perl_call_checker)(pTHX_ OP *, GV *, SV *);\n" - DEFFN("void", "cv_get_call_checker", "gcc0", - "CV *, Perl_call_checker *, SV **", "cv, fp, op") - DEFFN("void", "cv_set_call_checker", "scc0", - "CV *, Perl_call_checker, SV *", "cv, f, o") -#endif /* Q_PROVIDE_CV_SET_CALL_CHECKER */ + +SV * +callchecker0_h() +CODE: + RETVAL = newSVpvs( + "/* DO NOT EDIT -- generated by Devel::CallChecker version "XS_VERSION" */\n" + "#ifndef "QPFXS"INCLUDED\n" + "#define "QPFXS"INCLUDED 1\n" + "#ifndef PERL_VERSION\n" + " #error you must include perl.h before callchecker0.h\n" + "#elif !("PERL_TESTVERSION")\n" + " #error this callchecker0.h is for Perl "PERL_PRINTVERSION" only\n" + "#endif /* Perl version mismatch */\n" + Q_PROVIDE_RV2CV_OP_CV_STRING + Q_PROVIDE_CK_ENTERSUB_ARGS_PROTO_OR_LIST_STRING "#endif /* !"QPFXS"INCLUDED */\n" ); OUTPUT: