Compatibility between two perls of the same version but with different config options?

Viewed 44

If I have two configurations of the same version of Perl for example,

  • One compiled with -Dusethreads
  • One compiled without it

Will both of those version be able to share the same corelist modules? Or will I need to a package a separate one too. Is there known XS code compilation oddities with this approach? Is it likely that anything built against a threaded Perl will work with a non-threaded Perl? Assuming the version is the same.

1 Answers

In general, XS modules are not binary compatible between different build options (and between different perl releases). Because if nothing else, different build options may cause the sizes and alignment of structures to vary between the perl core and the compiled modules, which will cause a crash if both have access to the same struct (such as a perl scalar var). Also in MULTIPLICITY builds, which includes threaded builds, most perl core API functions have an extra argument added (a pointer to the current interpreter), and calling that function without that pointer or vice versa will again cause a crash.

Related