Conversation
|
I'm at present having arguments with Jenkins, but should eventually have a run of this in precheck... |
|
Huzzah - precheck shows a full testsuite pass for a |
|
I agree with the use of What I would like to see at this point is the 10-line PR that redefines |
9d00e56 to
702d8b7
Compare
c65f31a to
57d4242
Compare
|
Revised version pushed on top of #9924 and #9925. The other two commits come from
|
|
Thanks for the simplified PR, it's much easier for me to read, and it looks very good to me. Re |
Indeed! |
702d8b7 to
2bc77ee
Compare
57d4242 to
0ffc560
Compare
|
Rebased - this is just dependent on #9925 |
0ffc560 to
001c2d1
Compare
xavierleroy
left a comment
There was a problem hiding this comment.
Looks good to me. Thanks for the heroic effort! Please merge when you're ready.
|
Done - thanks for your copious reviewing assistance! |
`CAMLextern` must now be used for functions used by foreign stub code. For details: ocaml/ocaml#9927 Since this makes it more complicated to use, I took this as an opportunity to shorten the header and remove all functions from it that are only used internally by integers/ctypes.
Cygwin64 has been building with shared-library/natdynlink support for a couple of years. This PR restores support for this.
The problem is that Cygwin64 requires DLLs to load in a memory range which is more than +/-2GiB from the executable, which prevents FlexDLL from performing the required relocations for dynamic loading. Previous work tried to fix this in flexlink by using branch islands, but this is quite heavy and doesn't work for data symbols. It's also incredibly hairy to do for ARM64, which is where this alternate approach has sprung from.
The method for this fix (related to #1633), is a partial return to using
__declspecmacros by using__declspec(dllimport)for all symbols for Cygwin64. At present, the change is limited to Cygwin64 - there are presently nasty hacks in flexlink with base addresses in the mingw64 and msvc64 ports which can be removed, but I don't propose changing those ports this close to a version freeze.The change is made in 3 commits which are best viewed separately - indeed the first two are best viewed using a better visualiser than GitHub (patdiff is excellent for this). The first commit removes
CAMLexportwhich is no longer required (and hasn't been for some time). The second eliminates the useCAMLexternin the tree (but leavesCAMLexterndefined in the public facing headers). ReplacingCAMLexternis the newCAMLAPImacro intended for use in the tree only.Why? The problem with
CAMLexternis that it's just looked like an alias forexternand has been haphazardly used as such. There are two kinds of export necessary now - making a symbol accessible to the rest of the runtime (i.e. a normal Cexterndeclaration) or making the symbol accessible to dynamically loaded code (an actual export). The many micro PRs previously merged have gone through and rationalised the use of the oldCAMLexternto be the latter, so this switch just marks thoseCAMLexterndeclarations as actually part of the public API. The idea now is thatexternshould be writtenexternandCAMLAPIshould be added to things which actually need to be visible to stub libraries.Other PRs have also attempted to limit the use of C primitives from C code. A side-effect of this is that
CAMLprimat the moment does not need to includeCAMLAPI. That might get revisited, especially when #1633 re-rises as enabling the use of-fvisibility.