In one of my crates it would be very helpful to know whether SGX is being targeted and/or whether there is no underlying operating system, e.g. because the user of the crate is itself an operating system. Up to this point we’ve done this by using
#![no_std], however this approach has worked out fairly poorly because avoiding use of the default allocator is painful. I would instead like to target "x86_64 with no operating system facilities assumed except for a heap for dynamic allocation.”
I remember the old discussion on “scenerios” which lead to the portability lint RFC. However there doesn’t seem to be a concrete plan for the subsetting idea; in particular, there doesn’t seem to be a way to indicate that some code (optionally) depends on only the heap allocation part of libstd.
Thus, my questions are:
What should the target for SGX be? Should there be a x86_64-intel-sgx target? Should we use some x86_64-pc-none target?
What should the target for an (x86-64) operating system kernel be?
What is the preferred route to creating a way to target an (x86_64) subset of libstd that where libstd provides a heap but none of the (I/O) services that delegate to an OS?