Skip to content

Fix compilation of native code systhreads#13520

Merged
xavierleroy merged 1 commit intoocaml:trunkfrom
dra27:partial-revert-12108
Oct 23, 2024
Merged

Fix compilation of native code systhreads#13520
xavierleroy merged 1 commit intoocaml:trunkfrom
dra27:partial-revert-12108

Conversation

@dra27
Copy link
Copy Markdown
Member

@dra27 dra27 commented Oct 3, 2024

st_stubs.c uses NATIVE_CODE, which had stopped being defined in #12108.

On Unix, this appears to be mostly benign, but it causes a noticeable error on Windows in ocamlnat, where caml_debugger_in_use is not masked away by the linker.

The full fix for Windows is a little bit bigger (which @shindere is working on), but this fix ought to go in 5.2/5.3 as well.

# st_stubs.n.$(O) from the same source file st_stubs.c (it is compiled
# twice, each time with different options).

st_stubs.n.$(O): OC_CPPFLAGS += $(OC_NATIVE_CPPFLAGS)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Isn't this line redundant with the generic rule added to line 146? (i.e. do things build correctly if you remove this line)?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Oh ah - turns out that this got left in in #9332!

@shindere
Copy link
Copy Markdown
Contributor

shindere commented Oct 7, 2024 via email

@dra27
Copy link
Copy Markdown
Member Author

dra27 commented Oct 7, 2024

Ah, I confess I had my reverting brain switched on at the time (see https://github.com/ocaml/ocaml/pull/12108/files#diff-634a7188134ebafc936dd83ec93b4d275f5f997118b79ae975ee37050133581d)... I'll double-check why that was done before that way. The += I agree looks dated.

st_stubs.c uses NATIVE_CODE, which had stopped being defined.
@dra27 dra27 force-pushed the partial-revert-12108 branch from 87d433b to 4a8beef Compare October 21, 2024 20:34
@dra27
Copy link
Copy Markdown
Member Author

dra27 commented Oct 21, 2024

Old duplicated definition removed and the += switched to a = (so it's now an even more partial revert of #12108 while not regressing #13322 🤪)

Copy link
Copy Markdown
Contributor

@xavierleroy xavierleroy left a comment

Choose a reason for hiding this comment

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

Looks good, thanks!

@xavierleroy xavierleroy merged commit 8f8ee0a into ocaml:trunk Oct 23, 2024
@xavierleroy xavierleroy added this to the 5.3.0 milestone Oct 23, 2024
xavierleroy pushed a commit that referenced this pull request Oct 23, 2024
st_stubs.c uses NATIVE_CODE, which had stopped being defined.

(cherry picked from commit 8f8ee0a)
@xavierleroy
Copy link
Copy Markdown
Contributor

Cherry-picked to 5.3. @Octachron I'l let you decide whether to backport this one to 5.2.

@dra27
Copy link
Copy Markdown
Member Author

dra27 commented Nov 7, 2024

@Octachron - OK to cherry-pick this to 5.2?

@Octachron
Copy link
Copy Markdown
Member

Octachron commented Nov 7, 2024

Ok, but beware that I will tag 5.2.1~rc1 this afternoon.

dra27 added a commit to dra27/ocaml that referenced this pull request Nov 7, 2024
st_stubs.c uses NATIVE_CODE, which had stopped being defined.

(cherry picked from commit 8f8ee0a)
dra27 added a commit to dra27/ocaml that referenced this pull request Nov 7, 2024
st_stubs.c uses NATIVE_CODE, which had stopped being defined.

(cherry picked from commit 8f8ee0a)
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.

4 participants