Configure Option to Disable libc
Shivam Patel via Gcc-help <[email protected]>
| Newsgroups | gmane.comp.gcc.help |
|---|---|
| Message-ID | <LV3P222MB12185B4B753EC6F3306BB465B4D5A@LV3P222MB1218.NAMP222.PROD.OUTLOOK.COM> |
Hi,
For context, I'm working on a GCC backend for an extensible ISA.
Here is a link to a previous thread I had made "Help Emitting Proper Immediates": https://gcc.gnu.org/pipermail/gcc-help/2025-November/144575.html.
I've gotten further in the build process, but I am encountering the following error when running make all-target-libgcc:
In file included from ../../../etca-gcc/libgcc/gthr.h:157,
from ../../../etca-gcc/libgcc/unwind-dw2.c:37:
./gthr-default.h:35:10: fatal error: pthread.h: No such file or directory
35 | #include <pthread.h>
| ^~~~~~~~~~~
compilation terminated.
make[1]: *** [unwind-dw2.o] Error 1
make: *** [all-target-libgcc] Error 2
I was wondering if there was a way to disable libc at configuration time as
there isn't a libc for the target yet. Here is the exact configure line I've used:
../etca-gcc/configure \
--target=etca-elf \
--enable-languages=c \
--without-headers \
--prefix="$HOME/etca-compiler/out"
I've tried a few fixes:
*
Configuring with --disable-threads or --enable-threads=single
*
Adding tmakefile="${tmakefile} t-slibgcc-nolc-override" to config/gcc for the target
*
Also tried configuring with --without-headers
All of these have had no effect.
So I'm left with the following questions:
1. Is there a configure-time option (or some recommended approach) to
prevent libgcc from requiring target libc headers
like pthread.h when the target has no libc?
2. If not, what is the recommended minimal approach to build libgcc for a target
without a libc? Should I be using --with-newlib
or a different combination of options/overrides?
Is there somewhere I can read documentation about the configure process, options, and/or makefile fragments that are available? I have not been able to find it but I am hopeful that it would answer other questions that may arise from my project.
Thank you for any guidance!
Best,
Shivam