PerlFFI / FFI-Platypus-Lang-CPP

Documentation and tools for using Platypus with the C++ programming language
Other
4 stars 1 forks source link

ExtUtils::CBuilder#have_cplusplus doesn't find C++ on solaris #5

Open plicease opened 9 years ago

plicease commented 9 years ago

This is probably a bug in ExtUtils::CBuilder and thus needs to be reported with perlbug but opening an issue here to coordinate with FFI.

sun% perl -MExtUtils::CBuilder -E 'say ExtUtils::CBuilder->new->have_cplusplus'
cc: Warning: Option -x passed to ld, if ld is invoked, ignored otherwise
cc: No valid input files specified, no output generated
0
plicease commented 9 years ago

verified that I have this same issue with ExtUtils::CBuilder 0.280220

plicease commented 9 years ago

My Perl on solaris is quite old though might need to upgrade and verify it doesn't work on a more recent version of Perl.

plicease commented 9 years ago

The bundled perl doesn't even have that method:

sun% /usr/bin/perl -MExtUtils::CBuilder -E 'say ExtUtils::CBuilder->new->have_cplusplus'
Can't locate object method "have_cplusplus" via package "ExtUtils::CBuilder" at -e line 1.
plicease commented 9 years ago

here it is with verbosity:

sun% perl -MExtUtils::CBuilder -E 'say ExtUtils::CBuilder->new->have_cplusplus'
cc -I/home/ollisg/opt/perl/5.16.2/lib/5.16.2/i86pc-solaris/CORE -KPIC -c -x c++ -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DPERL_USE_SAFE_PUTENV -O -o compilet-fbYef.o compilet-fbYef.cc
cc: Warning: Option -x passed to ld, if ld is invoked, ignored otherwise
cc: No valid input files specified, no output generated
0

I think -xCC may need to be used instead of -x c++ but there is more to it.

plicease commented 9 years ago

Also may need to pass -xCC in as the link step which may be a problem, since ExtUtils::CBuilder dosn't appear to have an option for telling it that the code is C++.

We can work around this in this distro if the problem isn't resolvable in the core.