[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Minios-devel] [UNIKRAFT PATCH v2] plat/kvm: Add VGA textmode console support.



Hi Florian, hi Dafna,

On 23.07.2018 08:44, Florian Schmidt wrote:
Hi,

On 07/21/2018 08:56 PM, Dafna Hirschfeld wrote:
    This didn't build for me in my testing environment with "unknown
    type name ‘size_t’" errors. You need to #include <stddef.h> here.
    This might have been masked by other build options in your build
    that implicitly included it somewhere down the line.


I compile the code on top of the staging branch through the helloworld repository, https://xenbits.xen.org/git-http/unikraft/apps/helloworld.git I also see that stdint.h includes stddef.h . I wonder why I am able to compile and you aren't.

Aha, now I see the problem. It indeed builds with the unikraft-provided nolibc. However, it does not build with newlib, which I use in my testing environment, because newlib's stdint.h does not include stddef.h. Actually, now that I think about it, maybe stddef.h isn't even the best to include (as I suggested originally), but rather sys/types.h, because it's really all about the size_t, which is provided by sys/types.h, and stddef.h just includes that one plus a bunch of other things.

On a related not, now I wonder whether including stddef.h from stdint.h in nolibc is actually a bad idea, because it masks problems that occur once people use a real libc.For comparison, I went and checked how some other standard implementations do it, and indeed, neither glibc nor musl include stddef.h from stdint.h. Maybe we should remove that include in nolibc and fix the potentially resulting build errors for better compatibility?

I agree with you. We should re-visit this in nolibc. Additionally we should suggest that people try building with both libc's with their code: nolibc, newlibc.

@Dafna: sys/types.h fixes it for you?


Cheers,
FLorian


Thanks,

Simon


_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.