From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-vk1-xa33.google.com (mail-vk1-xa33.google.com [IPv6:2607:f8b0:4864:20::a33]) by sourceware.org (Postfix) with ESMTPS id 657C13858D39 for ; Sun, 30 Jul 2023 03:47:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 657C13858D39 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-vk1-xa33.google.com with SMTP id 71dfb90a1353d-486198c70adso1126630e0c.0 for ; Sat, 29 Jul 2023 20:47:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690688855; x=1691293655; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=029DJ/fsO/kN+x4UVReogcNz36PpNQjjfN7yE6e/8t4=; b=Tloheu2RRJgkykwd82ciM/+p5RNM1x4uts0HFHd+4+F0tYE0t/N6p7c0q4ZF4zWQba aJqdvHTPkUA0jnanmX3jZHR9imNGjakwIQ8l0CI9K4AUk08zA2TgmdrSi/by7yppW338 tTz307QislabidmqiDHM0qmCD/CdnSxdy05zM2mPFV9nZMQUP24Jw4fSbHxtxkdxngmG b+dWlRC6pr05o9S82po42MFqAXaOCGe2e7i+z4hdfTX58rNI8ogcVPrvxWwQ5H2idc4x zRfdmbSfAeROOj/3CiJI3CxlhjJ3wH24r7Nn/g/yjYkzh+JRQatNvW+vFU+iObxUX8cu waOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690688855; x=1691293655; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=029DJ/fsO/kN+x4UVReogcNz36PpNQjjfN7yE6e/8t4=; b=QBbbEhPp9b7PCgftFpCWASjnKTQJ48D+3JnNN44Pq9MFuWm5RhmOZ+Ms6Xu1sPQqWZ n1XxUSPhl8x1x4bhYHIpruvT6Bw2IfOtKhR8qHuqkxRqjpyGr+8Knj4mlV7vt078LQhl JWJbV1UL7VwT9n08AFQz9mLPMR/itJcTdUwMzZNeYj2MvYsnXxP6HZaUGjbjerR+wfdL hioCKKKc8Y2sUDSTDcw6s+grD7gPn6gCCwsmCG9vGppKDcU44G4bjzHNUbj94qoPAAbO BiiHlCVty9P7vlv8z77jZTyibtZrMxSD73V/CBaLkEC+AZk0tiVaOkTU72KlFDdv/GRo iY5w== X-Gm-Message-State: ABy/qLYNHFD7GO8LtIP3Beu/OrZDK7/Xdjtu6p+gFCBFb4i6q+xjjr55 2SamDhgvX0IFSFrBo//kilWVQEl9AEkl69rou06RfEbIb5M= X-Google-Smtp-Source: APBJJlF7U4G7E3AMbiPMpflKfsED78R2deLil/tBPOrL2gTxIz2VEtq2QFEtdTDIzKDo/J218jIPU9SkRtQQTFBghQQ= X-Received: by 2002:a05:6102:2f5:b0:443:7787:8333 with SMTP id j21-20020a05610202f500b0044377878333mr3702559vsj.8.1690688854504; Sat, 29 Jul 2023 20:47:34 -0700 (PDT) MIME-Version: 1.0 From: Ammar Ali Ratnani Date: Sat, 29 Jul 2023 23:45:44 -0400 Message-ID: Subject: Unable to Compile LibNoSys in LibGloss To: newlib@sourceware.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: 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>, , , 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