Skip to content

Conversation

t-a-k
Copy link
Contributor

@t-a-k t-a-k commented Sep 20, 2025

Some FreeBSD systems have <stdckdint.h>, but it cannot be compiled with C++ compilers. This patch modifies Configure to check whether ckd_* functions can be compiled, and leave I_STDCKDINT undefined (so that <stdckdint.h> won't be used in build time) if the compilation failed.

Will fix GH #23725.


  • This set of changes does not require a perldelta entry.

Some FreeBSD systems have <stdckdint.h>, but it cannot be compiled
with C++ compilers.  Configure now checks whether `ckd_*` functions
can be compiled, and leave I_STDCKDINT undefined if the compilation
failed.

Will fix GH Perl#23725 (d51aa1a build-time failure with clang++ and g++).
@jkeenan
Copy link
Contributor

jkeenan commented Sep 20, 2025

IIUC, the differences which your patch would effect could be detected simply by running ./Configure, i.e., even before running make.

I decided to use the same FreeBSD machine on which I explored #23725 to test this out. I took my regular configuration command (which by default uses clang in whatever is its current default version), substitute in clang++ (in its current default version, 18):

sh ./Configure -des -Dusedevel \
  -Dcc=clang++ \
  -Duseithreads \
  -Doptimize="-O2 -pipe -fstack-protector-strong -fno-strict-aliasing"

... and use that first on blead, then on the branch in your pull request. I then compared their respective config.sh files. This is what I got:

diff --ignore-matching-lines 'Configuration time:' \
     --ignore-matching-lines 'cf_time=' \
     blead.clang++.config.sh \
     branch.clang++.config.sh

814c814
< i_stdckdint='define'
---
> i_stdckdint='undef'

@t-a-k, is this what you would have expected?

On each of these two builds I then ran make test_prep. In blead, the build failed in the same way as reported in #23725 (comment). In branch, the build succeeded, as did make test_harness.

$ ./perl -Ilib -v | head -2 | tail -1
This is perl 5, version 43, subversion 3 (v5.43.3 (v5.43.2-339-g9f09ee5689)) built for amd64-freebsd-thread-multi

$ ./perl -Ilib -V:config_args
config_args='-des -Dusedevel -Dcc=clang++ -Duseithreads -Doptimize=-O2 -pipe -fstack-protector-strong -fno-strict-aliasing';

This pull request DWIMs for me, but it should also be reviewed by people more familiar with ./Configure than me. @khwilliamson, @Tux, can you take a look?

@t-a-k
Copy link
Contributor Author

t-a-k commented Sep 20, 2025

Thank you for testing!

... and use that first on blead, then on the branch in your pull request. I then compared their respective config.sh files. This is what I got:

diff --ignore-matching-lines 'Configuration time:' \
     --ignore-matching-lines 'cf_time=' \
     blead.clang++.config.sh \
     branch.clang++.config.sh

814c814
< i_stdckdint='define'
---
> i_stdckdint='undef'

@t-a-k, is this what you would have expected?

Yes. In this case <stdckdint.h> is present but fails to compile with specified compiler (probably because it is not compatible with C++), therefore Configure in this branch will set i_stdckdint to undef to indicate <stdckdint.h> is not usable.

@jkeenan jkeenan requested a review from Tux September 20, 2025 17:45
@khwilliamson
Copy link
Contributor

My question is, is there a C++ compatible hdr that would serve instead of this

@khwilliamson
Copy link
Contributor

And the answer to my question is no

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants