Skip to content

Fix compilation of num on 4.x bytecode-only architectures#48

Merged
xavierleroy merged 2 commits into
ocaml:masterfrom
dra27:bytecode-num
Jun 19, 2026
Merged

Fix compilation of num on 4.x bytecode-only architectures#48
xavierleroy merged 2 commits into
ocaml:masterfrom
dra27:bytecode-num

Conversation

@dra27

@dra27 dra27 commented Jun 16, 2026

Copy link
Copy Markdown
Member

Comment in the code explains the underlying slightly weird issue. 5.x behaves more logically with these variables - I happened to stumble across this oddity with some relocatable stuff.

As it happens, fixes #39 - but it would be better if --disable-native-compiler were instead being specified here.

@xavierleroy xavierleroy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I fixed a typo directly. Thanks for having looked into this.

@xavierleroy xavierleroy merged commit ffbcb46 into ocaml:master Jun 19, 2026
6 of 9 checks passed
@barracuda156

Copy link
Copy Markdown

@dra27 Besides, does bytecode-only automatically imply NATDYNLINK = false?

@dra27

dra27 commented Jun 21, 2026

Copy link
Copy Markdown
Member Author

@dra27 Besides, does bytecode-only automatically imply NATDYNLINK = false?

I’m not sure what you mean by “automatically”. In the 4.x configure script, a bytecode-only architecture wasn’t expected, and you don’t get the correct configuration unless --disable-native-compiler is given explicitly. If you do that, then both NATIVE_COMPILER and NATDYNLINK are set correctly to false, but otherwise they’ll both be true.

@dra27 dra27 deleted the bytecode-num branch June 21, 2026 08:12
@dra27

dra27 commented Jun 21, 2026

Copy link
Copy Markdown
Member Author

I fixed a typo directly.

Ouch - I’d like to blame autocorrect, but Vim insists it doesn’t do that 🫣

@barracuda156

Copy link
Copy Markdown

@dra27 I just did not know that NATDYNLINK implied NATIVE_COMPILER. I assumed it stood for something like “dynamic linking is natively supported on a platform”.

@xavierleroy

Copy link
Copy Markdown
Contributor

No problem. NATDYNLINK specifically refers to the dynamic loading of native code produced by ocamlopt from OCaml sources. So you need both ocamlopt and dynamic loading facilities a la dlopen.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bytecode-only build does not work: build system tries to use missing ocamlopt and freezes

3 participants