This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
RE: sys-include/newlib.h
- From: <jon at beniston dot com>
- To: <newlib at sourceware dot org>
- Date: Wed, 12 Dec 2018 12:24:24 -0000
- Subject: RE: sys-include/newlib.h
- References: <84b001d25232$da74dd20$8f5e9760$@beniston.com> <212353526.2559217.1481310415007.JavaMail.zimbra@redhat.com> <84da01d2525d$7b9eb340$72dc19c0$@beniston.com> <2124737575.2574471.1481318295834.JavaMail.zimbra@redhat.com> <84eb01d25279$2f381250$8da836f0$@beniston.com> <1800414984.3578894.1481568856487.JavaMail.zimbra@redhat.com>
Hi Jeff,
>> > Is it possible to point to an empty directory to skirt the
>> > inhibit_libc check
>>
>> No, as stdio.h needs to exist there ($target_header_dir gets set to
>> --with_headers value)
>>
>> if { { test x$host != x$target && test "x$with_sysroot" = x ; } ||
>> test x$with_newlib = xyes ; } &&
>> { test "x$with_headers" = xno || test ! -f "$target_header_dir/stdio.h";
>> } ; then
>> inhibit_libc=true
>>
> And creating a dummy stdio.h doesn't work, as that then gets installed
> in sys-include and used.
>
> > and use the target/include headers that you say are on the include
> > path
>>
>> For a clean build, these only exist after newlib is built and
>> installed though. Does that mean GCC needs to be built twice?
>>
>
>What you want to do isn't currently supported in a single configure/build.
It seems that inhibt_libc still gets set even if I build gcc for a second time using --with-headers, because $target_header_dir/stdio.h does not exist, as $target_header_dir is target/sys-include, rather than target/include (and target/sys-include is only created if --with-headers=dir had been used for the first gcc build, but we can't do that because that creates a empty newlib.h file in there).
If for the second build of gcc, I pass --with-headers=/path/to/target/include instead of just --with-headers then inhibit_lib gets set to false as I want, but gcc/configure copies all of target/include to target/sys-include, which isn't ideal as I then have duplicate directories and any subsequent updates to target/include are hidden as target/sys-include is at the head of gcc's search path.
Deleting target/sys-include after it's built is a possibility, but seems a bit hacky. Should the test for ! -f "$target_header_dir/stdio.h" be changed/omitted instead? Is there a better procedure to build the libraries?
Cheers,
Jon