Closed kraj closed 2 years ago
This could bring in non-freestanding headers (like string.h
) from the toolchain, right? Maybe it would be better to provide our own freestanding stdbool.h
, stddef.h
, etc. instead of relying on the toolchain for some headers.
This could bring in non-freestanding headers (like
string.h
) from the toolchain, right? Maybe it would be better to provide our own freestandingstdbool.h
,stddef.h
, etc. instead of relying on the toolchain for some headers.
I think -ffreestanding
might be a good choice here. You want to use compiler headers and you are ok for compiler to use it from its own installation, what you really don't want is hosted environment assumptions which is what -ffreestanding
will give you. I have updated the patch accordingly.
This could bring in non-freestanding headers (like
string.h
) from the toolchain, right? Maybe it would be better to provide our own freestandingstdbool.h
,stddef.h
, etc. instead of relying on the toolchain for some headers.I think
-ffreestanding
might be a good choice here. You want to use compiler headers and you are ok for compiler to use it from its own installation, what you really don't want is hosted environment assumptions which is what-ffreestanding
will give you. I have updated the patch accordingly.
-ffreestanding
is already in the compiler flags.
It looks like dropping -nostdinc
may be fine. On my machine, with "gcc version 11.1.0" built by musl-cross-make
, the program still builds and runs fine. So I think I'll merge this, and revisit if it breaks with anyone else's compiler.
This could bring in non-freestanding headers (like
string.h
) from the toolchain, right? Maybe it would be better to provide our own freestandingstdbool.h
,stddef.h
, etc. instead of relying on the toolchain for some headers.I think
-ffreestanding
might be a good choice here. You want to use compiler headers and you are ok for compiler to use it from its own installation, what you really don't want is hosted environment assumptions which is what-ffreestanding
will give you. I have updated the patch accordingly.
-ffreestanding
is already in the compiler flags.It looks like dropping
-nostdinc
may be fine. On my machine, with "gcc version 11.1.0" built bymusl-cross-make
, the program still builds and runs fine. So I think I'll merge this, and revisit if it breaks with anyone else's compiler.
OK let me push the old copy.
I merged this as 4da9c518c124d6f6123bf274e449514863df3646. Thanks again for sending these cleanup PRs.
This helps building on different kind of toolchains e.g. OE/Yocto where the standard install paths may vary and this is better to avoid to have to poke into system to find headers etc.
Signed-off-by: Khem Raj raj.khem@gmail.com