Page 1 of 1

Error while configuring libstdc++-v3

Posted: Sat Sep 12, 2020 1:11 am
by catOS

Code: Select all

checking stdbool.h usability... no
checking stdbool.h presence... yes
configure: WARNING: stdbool.h: present but cannot be compiled
configure: WARNING: stdbool.h:     check for missing prerequisite headers?
configure: WARNING: stdbool.h: see the Autoconf documentation
configure: WARNING: stdbool.h:     section "Present But Cannot Be Compiled"
configure: WARNING: stdbool.h: proceeding with the compiler's result
checking for stdbool.h... no
checking stdalign.h usability... no
checking stdalign.h presence... yes
configure: WARNING: stdalign.h: present but cannot be compiled
configure: WARNING: stdalign.h:     check for missing prerequisite headers?
configure: WARNING: stdalign.h: see the Autoconf documentation
configure: WARNING: stdalign.h:     section "Present But Cannot Be Compiled"
configure: WARNING: stdalign.h: proceeding with the compiler's result
checking for stdalign.h... no
checking for the value of EOF... configure: error: computing EOF failed
make: *** [Makefile:11272: configure-target-libstdc++-v3] Error 1
My build script:
https://gist.github.com/masterneko/79c4 ... 319be100ba

Re: Error while configuring libstdc++-v3

Posted: Sat Sep 12, 2020 2:28 am
by nullplan
First of all, get rid of that assignment to LD_LIBRARY_PATH at the start. It does not do what you think it does. Second, to my knowledge, libstdc++ requires a libc first. You have currently no libc installed for your target, nor do I think one exists. Your cross-compiler is pretty much just a freestanding compiler (x86_64-elf has no OS attached to it). You are going to have to write any library routines yourself, except the ones already contained in libgcc. Even then, you may be better off ignoring libgcc altogether and just writing those routines yourself, since you can compile those with the correct settings. You can do the same for libgcc with its multilib feature, but that is complicated. Not as complicated as writing such routines as might be required. On a 64-bit target, you probably don't even need division routines.

To make it short, you can't compile libstdc++ until you have a libc, and I don't think your target will ever have a libc. Once your OS project is far enough along where it can host programs, you might write (or, more realistically, adopt) a libc, and then you can complie a libstdc++ for your OS. But for the freestanding target, that is no option. Not to my knowledge, at least.