From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 391C93844046; Tue, 28 Jul 2020 13:54:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 391C93844046 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark@simark.ca Received: from [10.0.0.11] (173-246-6-90.qc.cable.ebox.net [173.246.6.90]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id B8B551E794; Tue, 28 Jul 2020 09:54:38 -0400 (EDT) Subject: Re: V2 [PATCH] PKG_CHECK_MODULES: Check if $pkg_cv_[]$1[]_LIBS works To: "H.J. Lu" Cc: Aaron Merey , Tom Tromey , GCC Patches , Aaron Merey via Binutils , GDB References: <20200502022903.175852-1-amerey@redhat.com> <87a72ino27.fsf@tromey.com> <64517fee-8b8f-84b2-a116-c3d146ff1119@simark.ca> <87eep4hp3s.fsf@tromey.com> <996bd0f9-cec5-119c-19ea-b127cf1bb95d@simark.ca> From: Simon Marchi Message-ID: <3627b719-b2c5-5605-bae8-f444b57f9cb1@simark.ca> Date: Tue, 28 Jul 2020 09:54:32 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: fr Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, 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: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jul 2020 13:54:40 -0000 On 2020-07-28 9:33 a.m., H.J. Lu wrote: > On x86, the native GCC can support -m32 and -m64. "gcc -m32" or "gcc -m64" > are not cross compiling. And how does that make it not cross-compîling? >> Anyway regardless of vocabulary, I don't think there was a problem to begin with (not that I blame >> you, it's not made in an intuitive way). The problem is that you were using pkg-config as >> configured to look up x86_64 packages. It looks up .pc files in (amongst others) >> /usr/lib64/pkgconfig, which provides information about x86_64 packages, which are in turn obviously >> not suitable not suitable to build a i686 program. Just like you cross-compile "for real" (say, >> for an ARM host), you need to set PKG_CONFIG or the PKG_CONFIG_* variables to returns packages for >> the --host architecture. That means searching in /usr/lib/pkgconfig instead of /usr/lib64/pkgconfig. >> >> You could for example set the PKG_CONFIG_LIBDIR variable to /usr/lib/pkgconfig:/usr/share/pkgconfig > > I didn't set PKG_CONFIG_LIBDIR and I don't want to set it. Why are you fine adjusting CC="gcc -m32" but not PKG_CONFIG*? > >> This way, if you don't install the elfutils-debuginfod-client-devel.i686 package, your binutils won't >> try to link with libdebuginfod (because pkg-config won't find it). If you install it, then your >> binutils will be built against the i686 libdebuginfod. >> >> Ideally, distros would ship a i686-something-something-pkg-config that automatically searchs in paths >> that make sense for that architecture (just like you have arm-linux-gnueabihf-pkg-config when cross >> compiling for ARM), but that doesn't seem to exist. But this is just like you have to explicitly set >> CC="gcc -m32" instead of using some i686-something-something-gcc. >> >> You can always make it yourself, create, say, a `i686-pc-linux-gnu-pkg-config` file somewhere in $PATH, >> with: >> >> export PKG_CONFIG_LIBDIR=/usr/lib/pkgconfig:/usr/share/pkgconfig >> exec pkg-config $* > > I don't want to do it. PKG_CHECK_MODULES should check if the library > really works. > Otherwise we can use remove it and use the library directly without checking. We could, but that would have its own disadvantages. Simon