public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
* Unable to Compile LibNoSys in LibGloss
@ 2023-07-30  3:45 Ammar Ali Ratnani
  0 siblings, 0 replies; only message in thread
From: Ammar Ali Ratnani @ 2023-07-30  3:45 UTC (permalink / raw)
  To: newlib

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
compile?

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-07-30  3:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-30  3:45 Unable to Compile LibNoSys in LibGloss Ammar Ali Ratnani

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).