Error while configuring libstdc++-v3

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
catOS
Member
Member
Posts: 28
Joined: Tue Mar 31, 2020 6:28 pm

Error while configuring libstdc++-v3

Post 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
Last edited by catOS on Tue May 03, 2022 1:55 am, edited 1 time in total.
Visit ackOS's GitHub page:
>> https://github.com/ackOS-project/ackOS <<
nullplan
Member
Member
Posts: 1790
Joined: Wed Aug 30, 2017 8:24 am

Re: Error while configuring libstdc++-v3

Post 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.
Carpe diem!
Post Reply