AndrewAPrice wrote:
thewrongchristian wrote:
Octocontrabass wrote:
Is there any particular reason why you're not using the red zone in userspace?
I'd also question the use of "-ffreestanding -nostdlib -nostdinc++" for a user level programme.
In fact, the flags look like they are flags for compiling kernel files.
I still need those flags (other than the no red zone flag) as I'm providing custom C and C++ standard libraries?
My understanding is you need -ffreestanding for kernels because kernels are loaded by a boot loader, and need startup code to initialise the CPU state correctly. The kernel is not started like a normal user process.
But your server process is just a normal user process (presumably), and should probably be started in a standard manner even if you're not using std C++ library.
But looking at your flags again, are you even excluding the C++ std library? You have -nostdlib (which would exclude standard libraries like startup libs and libgcc,) but you have no -nostdlib++, so you're actually including the C++ std library if I'm not mistaken. You might not end up pulling them in though, if you don't reference them.
If you don't use the C++ std library, then it won't be pulled in. If you're providing your own C++ library, fair play, but it seems like extra work excluding the std library unnecessarily.
I will admit, though, that this is all critique from a point of ignorance. My day job is MSVC C++, and it's a bastard mix of MFC and C++ std library, Urgh!
I would like my user space to have a relatively standard C++ library, but I've only got minimal C user space so far, so I'm curious what your motivation for avoiding the std library is/was? Was it a porting issue you didn't want to deal with, or perhaps you just fancied having a go implementing your own C++ library (understandable, we're all here for similar reasons?)