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.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, 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 2472 invoked from network); 10 May 2020 20:35:42 -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; 10 May 2020 20:35:42 -0000 Received: (qmail 9888 invoked by uid 550); 10 May 2020 20:35:37 -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 9866 invoked from network); 10 May 2020 20:35:36 -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 :cc; bh=mMyqrSdMk9Q9o/NWbJThWrxVZXo3SZK3UTyyOqcpSPE=; b=j7OiVnXWhIgoo2PJEtbSKhdtSp5OUXFtpTBqzTFGXz0fGe/j0uyfOy3x1O/AAu5XJI GAHlcPYela5oz8GNvvDzR052RfX9WaqsWpCIJ0ah0eF8yWe+PaZ9MXx/w2WM/HuBqhQV gHEopJC1s3rK8scycA8ElR9c2hx2DtWBu1rzJALOIKjm8V2ZQbGxlMAUCinsb6aAVEKp J+A3SoauiYLQDnPv4w8JKQ6dtZlnyPaBPwOFDSYz/GuPlhe747DI2G8NaKdSvH2bxjkj KTEoltG81nZZ3PaCvmg5YkowjKolNPD9FugwYXqDakRqtJOb3Xdgyz5kG+itvXtalN3U U+EA== 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:cc; bh=mMyqrSdMk9Q9o/NWbJThWrxVZXo3SZK3UTyyOqcpSPE=; b=AxUdifRgQ6POXF8iR1SbozIRosM1x5HCiUlWjNtmKemUEti9un+thShVfK5sYyIBRL EMzpCmcNfkw4wVRnMwvJN0ChmU3SQSQ/0wld5hNIx74gbS+c0C7h+TpWMJi2y7qyyyds Vechiv4wgwTSPUVeV8o/f1SBMdYl3cz3FRAHJO0c/vixEx1Luu/f/sA15ZcmI0swISoR QWzMKvWRJ0q5GVF8kHbw/89jkv2B8B8RY5mwvbru3yKppNllwO1r069CRPJFZiETY9oJ Z2U2fZ4CBNZ0iQMRn/79k4zxSupkcSEdJZCoAogbKEZADjJ9700de+5BUeP45AY6LovE Eduw== X-Gm-Message-State: AGi0PuZkN2b7IOMK+JL4jToQFqYFnwEVVNLVabuRwoeoz9crIyo3Q6km PrLFj9GFpBG+HL17etKqqAIk4GNZI0tUJBorSzVHYw== X-Google-Smtp-Source: APiQypLpPwPf9R4mMQil/x+vcBht7a6ZHg9Q6Z1ZCB+Pa2e11ATltxudhMmD0PSmVR712feX/9UcbYSan7iWapLHT3c= X-Received: by 2002:a92:4a11:: with SMTP id m17mr12638550ilf.125.1589142924296; Sun, 10 May 2020 13:35:24 -0700 (PDT) MIME-Version: 1.0 X-Originating-IP: [73.70.188.119] In-Reply-To: <20200510163555.GU21576@brightrain.aerifal.cx> References: <20181107064957.1137-1-mforney@mforney.org> <20200323043456.13327-1-mforney@mforney.org> <20200510163555.GU21576@brightrain.aerifal.cx> From: Michael Forney Date: Sun, 10 May 2020 13:35:23 -0700 Message-ID: To: Rich Felker Cc: musl@lists.openwall.com Content-Type: text/plain; charset="UTF-8" Subject: Re: [musl] Re: [musl-cross-make] [PATCH v2] litecross: Fix system header dir when building native toolchains Thanks for your response, Rich. On 2020-05-10, Rich Felker wrote: > Sorry I haven't had the time/attention to devote to this. I think > there's still a major mismatch in expectations -- the system you > install this native compiler onto is not going to have its include > files in /include but the standard /usr/include, among a lot of other > things. My understanding was that musl-cross-make toolchains (native or cross) were meant to be self-contained units, so the include directory relative to the sysroot is always /include. Merging a native toolchain into / can't work, even using the default /usr/include search directory, because you'd still have musl headers installed into /include, so the compiler would be unable to find the musl headers (this is the same reason why you currently need the usr -> . symlink). To support something like this, I think you'd need to make the prefix configurable. > Cross-compiling a native compiler is in many ways a really > poor match for what musl-cross-make is intended to do. The "stop to > build musl in the middle" logic doesn't really even make much sense > when the target libs are being compiled by an existing cross compiler > toolchain that already has its own musl headers and libc.so. > > I think you're right that we're doing something very wrong here, but I > don't understand exactly what it is, and before making changes I want > to get to the poing where we're on the same page about what it > *should* be doing. Maybe we mostly are, but I don't understand enough > yet to know whether we are. > > I know there's also an issue someone (perhaps yourself; I don't > remember at the moment) brought to my attention that there's a mixup > in the logic in litecross/Makefile for "is a cross compile" vs "is > being cross compiled" that messes up completely in the canadian cross > case. This further suggests to me that there's a big mess that needs > to be unraveled.. I'm sure there are other improvements that can be made, but I don't see why those should block this change. It's pretty clear to me that $SYSROOT/usr/include is the wrong directory to search for these headers, since they are not installed in this location. This is backed up by fact that litecross creates a usr -> . symlink in the sysroot, and that you need to create this symlink manually for a native toolchain. Even forgetting native compilers entirely, this patch still removes a hack for cross-compilers which only works coincidentally. > I'll try to get back to this sometime soon, but at the moment my focus > is already split several ways between mallocng, initial entropy source > and csprng issues for musl (was considered a prereq for merging > mallocng but I think it's turning out to be mostly separate which may > mean I can punt on this for a while), bringing this all together for > next musl release, and paid work independent from musl. No worries, there is no rush. But keep in mind that I sent this patch 1.5 years ago (and mentioned it a couple times on IRC).