public inbox for
 help / color / mirror / Atom feed
From: Ammar Ali Ratnani <>
Subject: Unable to Compile LibNoSys in LibGloss
Date: Sat, 29 Jul 2023 23:45:44 -0400	[thread overview]
Message-ID: <> (raw)

I tried running the following commands on a fresh checkout of both
main and newlib-4.3.0:
$ cd libgloss && mkdir build && cd build/
$ ../configure
$ make
It fails with:
$ make
make  all-recursive
make[1]: Entering directory '/home/ammra/Desktop/newlib-cygwin/libgloss/build'
Making all in .
make[2]: Entering directory '/home/ammra/Desktop/newlib-cygwin/libgloss/build'
depbase=`echo libnosys/chown.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
gcc -nostdinc  -isystem
/usr/lib/gcc/x86_64-pc-linux-gnu/13.1.1/include -isystem
/usr/lib/gcc/x86_64-pc-linux-gnu/13.1.1/include-fixed -DHAVE_CONFIG_H
-I. -I..     -g -O2 -MT libnosys/chown.o -MD -MP -MF $depbase.Tpo -c
-o libnosys/chown.o ../libnosys/chown.c &&\
mv -f $depbase.Tpo $depbase.Po
../libnosys/chown.c:6:10: fatal error: _ansi.h: No such file or directory
    6 | #include <_ansi.h>
      |          ^~~~~~~~~
compilation terminated.
make[2]: *** [Makefile:2146: libnosys/chown.o] Error 1
make[2]: Leaving directory '/home/ammra/Desktop/newlib-cygwin/libgloss/build'
make[1]: *** [Makefile:4072: all-recursive] Error 1
make[1]: Leaving directory '/home/ammra/Desktop/newlib-cygwin/libgloss/build'
make: *** [Makefile:1097: all] Error 2
The gcc command does not seem to be looking for headers installed with
libc. This appears to be intended behavior (as evidenced by e0c0ad82).
However, the C files reference <_ansi.h>, <errno.h>, <unistd.h>, and
others - which I thought would be provided by a C library. I suppose
my question is: who should provide these files to allow LibNoSys to

Additionally, my build process may not be correct. Running the build
process in the top-level directory results in nothing happening, with
the following build output:
$ make
make[1]: Entering directory '/home/ammra/Desktop/newlib-cygwin/build'
mkdir -p -- ./etc
Configuring in ./etc
configure: creating cache ./config.cache
checking whether to enable maintainer-specific portions of Makefiles... no
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
configure: updating cache ./config.cache
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
make[2]: Entering directory '/home/ammra/Desktop/newlib-cygwin/build/etc'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/home/ammra/Desktop/newlib-cygwin/build/etc'
make[1]: Nothing to be done for 'all-target'.
make[1]: Leaving directory '/home/ammra/Desktop/newlib-cygwin/build'
I am able to build newlib, though.

To avoid the XY problem, I am attempting to port newlib to a new
architecture. By fiddling with the compiler options, I was able to
compile newlib. However, I think I still need to write the syscalls. I
believe new targets should them in LibGloss, so I attempted to cross
compile that as well. I got the same error while cross compiling, and
eventually I found it doesn't work on the host system either. I want
to be able to at least compile newlib with the "stubbed" system calls.

Thank you,
- Ammar Ratnani

                 reply	other threads:[~2023-07-30  3:47 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).