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 F0E3A383F841; Tue, 28 Jul 2020 15:13:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org F0E3A383F841 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) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 75C251E792; Tue, 28 Jul 2020 11:13:41 -0400 (EDT) Subject: Re: V2 [PATCH] PKG_CHECK_MODULES: Check if $pkg_cv_[]$1[]_LIBS works To: "H.J. Lu" Cc: GCC Patches , "H.J. Lu via Binutils" , Aaron Merey , Andreas Schwab , Tom Tromey , GDB References: <20200502022903.175852-1-amerey@redhat.com> <996bd0f9-cec5-119c-19ea-b127cf1bb95d@simark.ca> <87r1svyche.fsf@igel.home> From: Simon Marchi Message-ID: <3209078a-429a-4be7-b151-93c3f4a53655@simark.ca> Date: Tue, 28 Jul 2020 11:13:35 -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: 7bit X-Spam-Status: No, score=-3.8 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 15:13:43 -0000 On 2020-07-28 11:05 a.m., H.J. Lu via Gdb-patches wrote: >> Can you clarify how this magic works, is this standard autoconf? Because I am trying this >> on Fedora, so pretty much the same setup as you, and I don't see this behavior: >> >> $ /home/simark/src/binutils-gdb/configure CC="gcc -m32" CXX="g++ -m32" >> checking build system type... x86_64-pc-linux-gnu >> checking host system type... x86_64-pc-linux-gnu >> checking target system type... x86_64-pc-linux-gnu >> ... >> > > I checked it again. I also passed i686-linux, not --host=, to configure. Ok I see, the configure line you pasted was wrapped by your email client so was not very readable. Doing `./configure ` looks like a deprecated way to set all build/host/target, as the warning message it shows implies: configure: WARNING: you should use --build, --host, --target Anyway, my point still stands: the problem is you not using a pkg-config configured properly for the cross compilation you are attempting, not pkg.m4. >> >> And even if it worked, why would it set "build" to i686, it doesn't make sense. The gcc you >> compile with, and its environment, is still x86_64, not i686. >> >> So *if* it works, it would be a shortcut for setting --host=i686-something, maybe. So >> regardless of how that above works, that doesn't remove the need to configure pkg-config >> correctly for the host system. >> >> If you don't want to learn about with pkg-config and deal with it, then please say "I think >> we should not use pkg-config", and ideally give supporting points. Please don't unilaterally >> push patches just to paper over your own problems. You just make it so that somebody will >> need to untangle more mess later. > > I am OK to remove pkg.m4. Well I am not. I find it quite handy to avoid having to hardcode necessary CFLAGS and LDFLAGS required to build against a library, so I think it's better to use pkg-config if the libraries we want to use provide a .pc file. I propose that we revert the patch for now to go back to the pristing pkg.m4 version. Simon