-
Notifications
You must be signed in to change notification settings - Fork 568
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix finding the correct cplusplus compiler #23146
base: blead
Are you sure you want to change the base?
Conversation
ExtUtils::CBuilder was using a slightly maverick method for finding the matching cplusplus compiler to the c compiler used to build perl. On a Linux system with a perl built with the Oracle Developer cc cc='/opt/oracle/developerstudio12.6/bin/cc' Errors were observed: "c++: error: unrecognized command line option ‘-KPIC’; did you mean ‘-fPIC’?" The cplusplus command for Oracle Developer suite is CC not c++ and the detection was picking up the system c++ (g++). If there is a ccpath, the code should exhaust all the options and not fail through to using no path.
Are there any changes that could be added to CBuilder's test suite that would exercise these code changes? |
if( can_run( $cxx1 ) ) { | ||
$self->{config}{cxx} = $cxx1; | ||
last; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The indentation here doesn't match the rest of the file, and has added literal tabs mixed with the spaces.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't actually change that from the original, the literal tab was there before. But let me fix that.
The test t/03-cpluscplus.t was the test that highlighted to me that the detection behaviour was wrong. |
ExtUtils::CBuilder was using a slightly maverick method for finding the matching cplusplus compiler to the c compiler used to build perl.
On a Linux system with a perl built with the Oracle Developer cc cc='/opt/oracle/developerstudio12.6/bin/cc'
Errors were observed:
"c++: error: unrecognized command line option ‘-KPIC’; did you mean ‘-fPIC’?"
The cplusplus command for Oracle Developer suite is CC not c++ and the detection was picking up the system c++ (g++).
If there is a ccpath, the code should exhaust all the options and not fail through to using no path.
Clang/Clang++ were missing from the C/C++ mappings so I have added those as well.