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

Add "unknown" to LINUX_ABI #2054

Closed
wants to merge 1 commit into from
Closed

Conversation

exFalso
Copy link

@exFalso exFalso commented May 8, 2024

This PR adds unknown to the LINUX_ABI array in build.rs. This is specifically to support --target=x86_64-fortanix-unknown-sgx, this target currently fails to link altogether because of the missing object files. With unknown added, everything works as expected.

@exFalso

This comment was marked as off-topic.

@briansmith
Copy link
Owner

Obviously every "unknown" OS isn't guaranteed to have the same ABI as Linux. A more precise change to build.rs is needed to support SGX.

@briansmith briansmith closed this May 12, 2024
@exFalso
Copy link
Author

exFalso commented May 13, 2024

Just noting: in SGX there is no operating system, it's all straight x86 code.

Also, it turned out that even with the project linking, at runtime the C code faulted, so we ended up completely replacing the ring dependency.

@briansmith
Copy link
Owner

Also, it turned out that even with the project linking, at runtime the C code faulted, so we ended up completely replacing the ring dependency.

That's because SGX requires its own implementation of the CPU feature detection in ring::cpu::intel. See the discussion in #775.

@briansmith
Copy link
Owner

Just noting: in SGX there is no operating system, it's all straight x86 code.

It is true that for SGX targets, "unknown" is the target OS, and this assembly code can be (AFAICT) used in SGX.

However, it isn't true that just because the OS is "unknown" then the assembly code is guaranteed to work. Consider x86_64-unknown-none, for example; this assembly code doesn't work for that target because it uses SIMD instructions, but SIMD instructions aren't (in general) available in x86_64-unknown-none, even if CPUID says they are supported.

@exFalso
Copy link
Author

exFalso commented May 13, 2024

Makes sense, fair enough, thank you for the context!

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.

2 participants