From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) by sourceware.org (Postfix) with ESMTP id 1ACE8385E009 for ; Sat, 28 Mar 2020 10:26:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 1ACE8385E009 Received: from sf (tunnel547699-pt.tunnel.tserv1.lon2.ipv6.he.net [IPv6:2001:470:1f1c:3e6::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: slyfox) by smtp.gentoo.org (Postfix) with ESMTPSA id ED5F334F967 for ; Sat, 28 Mar 2020 10:26:45 +0000 (UTC) Date: Sat, 28 Mar 2020 10:26:38 +0000 From: Sergei Trofimovich To: gcc@gcc.gnu.org Subject: './configure --disable-multilib' and 'gcc -print-multi-os-directory' interaction Message-ID: <20200328102638.0ca019b1@sf> X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Mar 2020 10:26:48 -0000 x86_64-linux-musl targets do not support multilib layout as-is and usually expects libdir=lib. glibc target usually uses libdir=lib64. In https://bugs.gentoo.org/675954 (also touched on https://gcc.gnu.org/PR90077) Gentoo discovered the following discrepancy when gcc is built with --disable-multilib: 1. --disable-multilib ../gcc/configure --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --target=x86_64-gentoo-linux-musl --disable-multilib $ gcc/xgcc -B. -print-multi-os-directory ../lib64 Wouldn't it be reasonable to have '.' instead of '../lib64' here? 2. --disable-multilib --with-multilib-list= ../gcc/configure --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --target=x86_64-gentoo-linux-musl --disable-multilib --with-multilib-list= $ gcc/xgcc -B. -print-multi-os-directory . 3. --disable-multilib --with-multilib-list=m64 ../gcc/configure --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --target=x86_64-gentoo-linux-musl --disable-multilib --with-multilib-list=m64 $ gcc/xgcc -B. -print-multi-os-directory ../lib64 Currently Gentoo uses [3.] and experiences problems in 'meson' build systems which extract libdir via 'gcc -print-multi-os-directory' and observed "lib" != "lib64" mismatch. I have a few questions: Q1. Are all [1.]/[2.]/[3.] behaviors correct and expected? Should '--with-multilib-list=' (empty) be always accompanied with '--disable-multilib' to avoid multi-os-dir=../lib64? Or should gcc be tweaked to disallow contradicting cases like [3.]? Q2. What is the best way for *-musl* targets to just default to 'lib' layout at least for explicit '--disable-multilib' case? Just advise users do [2.] or should gcc be tweaked? Q3. Is '--disable-multilib --with-multilib-list=m64' a sensible configuration at all? Should it be an equivalent of '--disable-multilib --with-multilib-list=' (multi-os-dir=.) with default m64 ABI? Or should it be an equivalent of '--enable-multilib' (multi-os-dir=../lib64) with default m64 ABI? Thank you! -- Sergei