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

opam var arch reports kernel rather than user arch on Raspberry Pi OS #5949

Closed
dra27 opened this issue May 10, 2024 · 1 comment · Fixed by #5950
Closed

opam var arch reports kernel rather than user arch on Raspberry Pi OS #5949

dra27 opened this issue May 10, 2024 · 1 comment · Fixed by #5950

Comments

@dra27
Copy link
Member

dra27 commented May 10, 2024

32-bit Raspberry Pi OS runs with a 64-bit kernel and 32-bit userspace. This means that opam var arch returns arm64, but since the C compiler is 32-bit, it would be much more helpful it returned arm32 (as it does if run through linux32).

Certainly for Raspberry Pi OS, but possibly in general on Unix, we could perhaps use uname -m to determine the machine architecture, but then refine it with getconf LONG_BIT and if that returns 32 then map a few of the architectures down to smaller userspaces?

@dra27
Copy link
Member Author

dra27 commented May 10, 2024

Related issue in the compiler at ocaml/ocaml#12326 (which was solved by ocaml/ocaml#12465).

I'm also wondering instead whether we could have a new global variable indicating the result of getconf LONG_BIT or some such to keep arch really referring to the kernel architecture, but expose the ability to know what the C compiler is likely to be doing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant