From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.1 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_PASS autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 31741 invoked from network); 9 May 2020 00:27:30 -0000 Received-SPF: pass (mother.openwall.net: domain of lists.openwall.com designates 195.42.179.200 as permitted sender) receiver=inbox.vuxu.org; client-ip=195.42.179.200 envelope-from= Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 9 May 2020 00:27:30 -0000 Received: (qmail 3972 invoked by uid 550); 9 May 2020 00:27:25 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 3942 invoked from network); 9 May 2020 00:27:24 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mforney-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=ogweb2D4rpdfaxZUjAOjJjZGx1nmc4/S0lwFQrpYWmc=; b=cNmCRwYYncITxzsUX0xgqZ83tvPEWwxQP80BEfMFmBfLKvS0pTSGeX0IRbo2pvrNpF z0mYtVgrqydiW8YlTyLlDgozI+3RfuCtpDc+bvDzQQ0qQc4RXBI9HhW1iBwURnv7VcI7 +toWnP5FLrjVsP+IOy7Fe+PG/vYtvzbnAT5PS7OR/CHNIA/clHD02hzRoRWEdhIZI6C4 jT8RBPnicOgrjYKDzMlHsxBnbHeMb0sSJg0AigDHfh1Wp8112K4Rp18aNCcrclnOHCWu 4RThZS9pNudD1HzGh2fAED7Jc1Fgcfxmz7xrRU3YkEuSxlJsRVRDqiOz0onGm8rMR/zb wOOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=ogweb2D4rpdfaxZUjAOjJjZGx1nmc4/S0lwFQrpYWmc=; b=CBX4wxrvjZvoXHw9bowCqVn1lTlByaGM53pzixdZu78B0u8UpcXxXJJMtiazGKiA20 pH0kf5/xs8szWUy46fCOKNWnMnlNNb1r42/KPXhJNb/7SU1Lva4/a409zcOccgLsgfYl QDyJYsXsVB6PmQg9Q4nNXnWdfkhXpInrmnvSrcUsfMJk7ylPEb2bUP27mk7IlVScrq6G E3SS5J41zmsrYhhVCHhlngL0NnkQzBUjuc/3BwPboiARHBpcCDYnnOvAkNrlI9Q4FAen 0D/uVabohpBTVjFTV2cidh80WVoPuylesqDScnVVw9QYNHXwGjHr48bfx8FOKiizS+iz bm/Q== X-Gm-Message-State: AGi0PuZuXDVlPFjIoOZjd5tuBgoTAz1+V6hPPYJZxS6ProTaXZ3rSqcb bm6aaIXP0Xb8oNJx4RKgXjWPOvaBfaLopJHknWgJRt/p X-Google-Smtp-Source: APiQypIJFdb/n/EB8AR83MC3ykv+1PpF7YMpAQC+WBUq2cpHds1VJ52F9YYCdgE3foBRmMqSFT31LUA5xc4txfcyhM0= X-Received: by 2002:a05:6e02:106d:: with SMTP id q13mr1640603ilj.107.1588984031773; Fri, 08 May 2020 17:27:11 -0700 (PDT) MIME-Version: 1.0 X-Originating-IP: [73.70.188.119] In-Reply-To: <20200323043456.13327-1-mforney@mforney.org> References: <20181107064957.1137-1-mforney@mforney.org> <20200323043456.13327-1-mforney@mforney.org> From: Michael Forney Date: Fri, 8 May 2020 17:27:11 -0700 Message-ID: To: musl@lists.openwall.com Content-Type: text/plain; charset="UTF-8" Subject: [musl] Re: [musl-cross-make] [PATCH v2] litecross: Fix system header dir when building native toolchains On 2020-03-22, Michael Forney wrote: > Hi, > > Resending this patch because this is still an issue, and I realized > that the usr -> . symlink could also be removed in the build sysroot. > Anyone who has built a native toolchain with musl-cross-make has > probably run into this and worked around it by creating a usr -> . > symlink in the install directory manually. > > To demonstrate that this only currently works by accident with > cross-compilers, I'll start with current musl-cross-make master, > and override the sysroot to something else: > > $ make TARGET=aarch64-linux-musl SYSROOT=/something-else install > > $ echo '#include ' | ./output/bin/aarch64-linux-musl-gcc -v -x c > - > > ignoring nonexistent directory > "/tmp/musl-cross-make/output/bin/../something-else/usr/local/include" > ignoring duplicate directory > "/tmp/musl-cross-make/output/bin/../lib/gcc/../../lib/gcc/aarch64-linux-musl/9.2.0/../../../../aarch64-linux-musl/include" > ignoring nonexistent directory > "/tmp/musl-cross-make/output/bin/../something-else/usr/include" > ignoring duplicate directory > "/tmp/musl-cross-make/output/bin/../lib/gcc/../../lib/gcc/aarch64-linux-musl/9.2.0/include" > #include "..." search starts here: > #include <...> search starts here: > /tmp/musl-cross-make/output/bin/../lib/gcc/aarch64-linux-musl/9.2.0/../../../../aarch64-linux-musl/include > /tmp/musl-cross-make/output/bin/../lib/gcc/aarch64-linux-musl/9.2.0/include > End of search list. > GNU C17 (GCC) version 9.2.0 (aarch64-linux-musl) > compiled by GNU C version 9.2.0, GMP version 6.1.2, MPFR version > 4.0.2, MPC version 1.1.0, isl version none > GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 > Compiler executable checksum: 32e14193b549d09fa3807c50f194d659 > :1:10: fatal error: stdlib.h: No such file or directory > compilation terminated. > $ > > As you can see, gcc *is* searching for headers in the /something-else > sysroot, but under the incorrect system header directory. It still > searches for headers in /aarch64-linux-musl/include since that is > the gcc tool directory. > > To demonstrate the problem with native toolchains, let's build a > native toolchain and try to use it: > > $ make TARGET=x86_64-linux-musl NATIVE=1 install > > $ echo '#include ' | ./output-x86_64-linux-musl/bin/gcc -v -x c - > > ignoring nonexistent directory > "/tmp/musl-cross-make/output-x86_64-linux-musl/bin/../lib/gcc/x86_64-linux-musl/9.2.0/../../../../x86_64-linux-musl/include" > ignoring nonexistent directory > "/tmp/musl-cross-make/output-x86_64-linux-musl/bin/../usr/local/include" > ignoring nonexistent directory > "/tmp/musl-cross-make/output-x86_64-linux-musl/bin/../lib/gcc/../../lib/gcc/x86_64-linux-musl/9.2.0/../../../../x86_64-linux-musl/include" > ignoring nonexistent directory > "/tmp/musl-cross-make/output-x86_64-linux-musl/bin/../usr/include" > ignoring duplicate directory > "/tmp/musl-cross-make/output-x86_64-linux-musl/bin/../lib/gcc/../../lib/gcc/x86_64-linux-musl/9.2.0/include" > #include "..." search starts here: > #include <...> search starts here: > /tmp/musl-cross-make/output-x86_64-linux-musl/bin/../lib/gcc/x86_64-linux-musl/9.2.0/include > End of search list. > GNU C17 (GCC) version 9.2.0 (x86_64-linux-musl) > compiled by GNU C version 9.2.0, GMP version 6.1.2, MPFR version > 4.0.2, MPC version 1.1.0, isl version none > GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 > Compiler executable checksum: 60320f85342923d8a86b40331aa7a54b > :1:10: fatal error: stdlib.h: No such file or directory > compilation terminated. > $ > > With the proposed patch, both of these cases are fixed. Hopefully > this makes the problem clear. Hi Rich, When I mentioned this patch on IRC, you expressed some concern that you didn't think --with-native-system-header-dir was relevant for cross compilers. However, I think I have made a pretty good case here showing that it is, and that the default value of /usr/include is not correct. If you still have concerns, could you please let me know so I can try to address them? Thanks, Michael