Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mark core_unix.v0.17.0 as unavailable on more architectures #25977

Merged
merged 2 commits into from
May 30, 2024

Conversation

Leonidas-from-XIV
Copy link
Contributor

@Leonidas-from-XIV Leonidas-from-XIV commented May 30, 2024

The build failure on ppc64 (example) and s390x (example) is the following:

/usr/bin/ld: /home/opam/.opam/5.2/lib/core_unix/time_stamp_counter/libtime_stamp_counter_stubs.a(time_stamp_counter_stubs.o): in function `caml_rdtsc_unboxed':
/home/opam/.opam/5.2/.opam-switch/build/core_unix.v0.17.0/_build/default/time_stamp_counter/src/time_stamp_counter_stubs.c:51: undefined reference to `rdtsc'
/usr/bin/ld: /home/opam/.opam/5.2/lib/core_unix/time_stamp_counter/libtime_stamp_counter_stubs.a(time_stamp_counter_stubs.o): in function `caml_rdtsc':
/home/opam/.opam/5.2/.opam-switch/build/core_unix.v0.17.0/_build/default/time_stamp_counter/src/time_stamp_counter_stubs.c:56: undefined reference to `rdtsc'
collect2: error: ld returned 1 exit status

Looking at the relevant code (as I wanted to know whether this is also the case in v0.16 - the code is quite different so it probably isn't) in https://github.com/janestreet/core_unix/blob/v0.17/time_stamp_counter/src/time_stamp_counter_stubs.c#L33-L47 this is due to the function only defined on x86, amd64 and arm64, so maybe it would make even more sense flip the availability condition to these three architectures instead?

The build failure on ppc64 and s390x is the following:

/usr/bin/ld: /home/opam/.opam/5.2/lib/core_unix/time_stamp_counter/libtime_stamp_counter_stubs.a(time_stamp_counter_stubs.o): in function `caml_rdtsc_unboxed':
/home/opam/.opam/5.2/.opam-switch/build/core_unix.v0.17.0/_build/default/time_stamp_counter/src/time_stamp_counter_stubs.c:51: undefined reference to `rdtsc'
/usr/bin/ld: /home/opam/.opam/5.2/lib/core_unix/time_stamp_counter/libtime_stamp_counter_stubs.a(time_stamp_counter_stubs.o): in function `caml_rdtsc':
/home/opam/.opam/5.2/.opam-switch/build/core_unix.v0.17.0/_build/default/time_stamp_counter/src/time_stamp_counter_stubs.c:56: undefined reference to `rdtsc'
collect2: error: ld returned 1 exit status
@Leonidas-from-XIV
Copy link
Contributor Author

I thought about flipping the condition but at current it also excludes x86_32 which I guess maps to __i386__ which in theory works (at least it doesn't fail because rdtrc is undefined), but maybe there's other issues that prevent it from working on i386.

@avsm
Copy link
Member

avsm commented May 30, 2024

/cc @dkalinichenko-js

@dkalinichenko-js
Copy link
Contributor

Hi, thanks for reporting! Let's keep x86_32 excluded -- we don't test on 32-bit platforms, and we previously found issues in our other packages on them.

This prevents issues with new platforms added for which the C stubs will
not generate the `rdtsc` function.

Signed-off-by: Marek Kubica <[email protected]>
@Leonidas-from-XIV
Copy link
Contributor Author

Thanks @dkalinichenko-js that's a good point. I've flipped the condition to be opt-in but left x86_32 out.

If opam-repo maintainers prefer the other way, they can cherry-pick the previous commit :-)

@mseri mseri merged commit 7c9334f into ocaml:master May 30, 2024
1 of 2 checks passed
@mseri
Copy link
Member

mseri commented May 30, 2024

Thanks

@Leonidas-from-XIV Leonidas-from-XIV deleted the core-unix-rdtsc branch May 30, 2024 14:52
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