From unknown Sat Jun 14 19:14:55 2025 X-Loop: help-debbugs@gnu.org Subject: bug#8912: cross-compile code for LD setup does not use the right system macro Resent-From: Eric PAIRE Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-libtool@gnu.org Resent-Date: Tue, 21 Jun 2011 15:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 8912 X-GNU-PR-Package: libtool X-GNU-PR-Keywords: To: 8912@debbugs.gnu.org X-Debbugs-Original-To: "bug-libtool@gnu.org" Received: via spool by submit@debbugs.gnu.org id=B.13086698768809 (code B ref -1); Tue, 21 Jun 2011 15:25:02 +0000 Received: (at submit) by debbugs.gnu.org; 21 Jun 2011 15:24:36 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QZ2oc-0002I2-Vl for submit@debbugs.gnu.org; Tue, 21 Jun 2011 11:24:35 -0400 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QYzou-0004gy-Jl for submit@debbugs.gnu.org; Tue, 21 Jun 2011 08:12:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QYzoo-00040q-Ff for submit@debbugs.gnu.org; Tue, 21 Jun 2011 08:12:35 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,HTML_MESSAGE, RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([140.186.70.17]:36709) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QYzoo-00040m-9z for submit@debbugs.gnu.org; Tue, 21 Jun 2011 08:12:34 -0400 Received: from eggs.gnu.org ([140.186.70.92]:50101) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QYzon-0000QI-2q for bug-libtool@gnu.org; Tue, 21 Jun 2011 08:12:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QYzol-00040R-MK for bug-libtool@gnu.org; Tue, 21 Jun 2011 08:12:33 -0400 Received: from eu1sys200aog101.obsmtp.com ([207.126.144.111]:39147) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QYzol-0003zA-Ap for bug-libtool@gnu.org; Tue, 21 Jun 2011 08:12:31 -0400 Received: from beta.dmz-eu.st.com ([164.129.1.35]) (using TLSv1) by eu1sys200aob101.postini.com ([207.126.147.11]) with SMTP ID DSNKTgCKnPAIRlZr7t+iRolABXg7XuLhlWeb@postini.com; Tue, 21 Jun 2011 12:12:31 UTC Received: from zeta.dmz-eu.st.com (ns2.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 70070F3 for ; Tue, 21 Jun 2011 12:12:08 +0000 (GMT) Received: from Webmail-eu.st.com (safex1hubcas1.st.com [10.75.90.14]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 0339B261D for ; Tue, 21 Jun 2011 12:12:08 +0000 (GMT) Received: from SAFEX1MAIL2.st.com ([10.75.90.4]) by SAFEX1HUBCAS1.st.com ([10.75.90.14]) with mapi; Tue, 21 Jun 2011 14:12:07 +0200 From: Eric PAIRE Date: Tue, 21 Jun 2011 14:12:02 +0200 Thread-Topic: cross-compile code for LD setup does not use the right system macro Thread-Index: AcwwDG2OKSKVhUDVQB2hnTfVB6PWJg== Message-ID: <68B811F07A63BA48BF0F49F7D822D419C48B31BBB4@SAFEX1MAIL2.st.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: multipart/mixed; boundary="_004_68B811F07A63BA48BF0F49F7D822D419C48B31BBB4SAFEX1MAIL2st_" MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.17 X-Spam-Score: -6.6 (------) X-Mailman-Approved-At: Tue, 21 Jun 2011 11:24:33 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.6 (------) --_004_68B811F07A63BA48BF0F49F7D822D419C48B31BBB4SAFEX1MAIL2st_ Content-Type: multipart/alternative; boundary="_000_68B811F07A63BA48BF0F49F7D822D419C48B31BBB4SAFEX1MAIL2st_" --_000_68B811F07A63BA48BF0F49F7D822D419C48B31BBB4SAFEX1MAIL2st_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi all, While compiling on 64-bit Linux a package that will be executed on a 32-bit= Linux ([--build=3Dx86_64-unknown-linux-gnu] --host=3Di686-pc-linux-gnu), I= am facing an issue with the value of the LD macro generated in libtool, as= the libtool part of configure does not add the '-m elf_i386' option for LD= to generate a 32-bit object/program. Actually, the problem is that libtool.m4 checks for the build system type w= ith $host, whereas it should be $build. I have understood that $build is th= e system on which the program is generated (64-bit in my case) and $host th= e system on which the program created (32-bit in my case) is meant to run. = So the right macro should test build system, and not host. You will find attached a fix proposal. Thanks, Eric PAIRE --_000_68B811F07A63BA48BF0F49F7D822D419C48B31BBB4SAFEX1MAIL2st_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Hi all,

 

While = compiling on 64-bit Linux a package that will be executed on a 32-bit Linux= ([--build=3Dx86_64-unknown-linux-gnu] --host=3Di686-pc-linux-gnu), I am fa= cing an issue with the value of the LD macro generated in libtool, as the l= ibtool part of configure does not add the '-m elf_i386' option for LD to ge= nerate a 32-bit object/program.

&nb= sp;

Actually, the problem is that libtool.m4 = checks for the build system type with $host, whereas it should be $build. I= have understood that $build is the system on which the program is generate= d (64-bit in my case) and $host the system on which the program created (32= -bit in my case) is meant to run. So the right macro should test build syst= em, and not host.

 

<= p class=3DMsoNormal>You will find attached a fix proposal.

 

Thanks,

Eric PAIRE

=  

= --_000_68B811F07A63BA48BF0F49F7D822D419C48B31BBB4SAFEX1MAIL2st_-- --_004_68B811F07A63BA48BF0F49F7D822D419C48B31BBB4SAFEX1MAIL2st_ Content-Type: application/octet-stream; name="PATCH.libtool" Content-Description: PATCH.libtool Content-Disposition: attachment; filename="PATCH.libtool"; size=532; creation-date="Tue, 21 Jun 2011 14:06:47 GMT"; modification-date="Tue, 21 Jun 2011 13:57:22 GMT" Content-Transfer-Encoding: base64 LS0tIGxpYnRvb2wtMi40L2xpYmx0ZGwvbTQvbGlidG9vbC5tNC5vbGQJMjAxMC0wOS0yMiAxMDo0 MToxOS4wMDAwMDAwMDAgKzAyMDAKKysrIGxpYnRvb2wtMi40L2xpYmx0ZGwvbTQvbGlidG9vbC5t NAkyMDExLTA2LTIxIDEzOjU2OjQ2LjAwMDAwMDAwMCArMDIwMApAQCAtMTI3NSw3ICsxMjc1LDcg QEAKICAgaWYgQUNfVFJZX0VWQUwoYWNfY29tcGlsZSk7IHRoZW4KICAgICBjYXNlIGAvdXNyL2Jp bi9maWxlIGNvbmZ0ZXN0Lm9gIGluCiAgICAgICAqMzItYml0KikKLQljYXNlICRob3N0IGluCisJ Y2FzZSAkYnVpbGQgaW4KIAkgIHg4Nl82NC0qa2ZyZWVic2QqLWdudSkKIAkgICAgTEQ9IiR7TEQt bGR9IC1tIGVsZl9pMzg2X2Zic2QiCiAJICAgIDs7CkBAIC0xMjk0LDcgKzEyOTQsNyBAQAogCWVz YWMKIAk7OwogICAgICAgKjY0LWJpdCopCi0JY2FzZSAkaG9zdCBpbgorCWNhc2UgJGJ1aWxkIGlu CiAJICB4ODZfNjQtKmtmcmVlYnNkKi1nbnUpCiAJICAgIExEPSIke0xELWxkfSAtbSBlbGZfeDg2 XzY0X2Zic2QiCiAJICAgIDs7Cg== --_004_68B811F07A63BA48BF0F49F7D822D419C48B31BBB4SAFEX1MAIL2st_-- From unknown Sat Jun 14 19:14:55 2025 X-Loop: help-debbugs@gnu.org Subject: bug#8912: cross-compile code for LD setup does not use the right system macro References: <68B811F07A63BA48BF0F49F7D822D419C48B31BBB4@SAFEX1MAIL2.st.com> In-Reply-To: <68B811F07A63BA48BF0F49F7D822D419C48B31BBB4@SAFEX1MAIL2.st.com> Resent-From: Mike Frysinger Original-Sender: "Debbugs-submit" Resent-CC: bug-libtool@gnu.org Resent-Date: Tue, 16 Jan 2024 01:33:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 8912 X-GNU-PR-Package: libtool X-GNU-PR-Keywords: To: Eric PAIRE Cc: 8912@debbugs.gnu.org X-Debbugs-Original-Cc: 8912@debbugs.gnu.org, "bug-libtool@gnu.org" Received: via spool by 8912-submit@debbugs.gnu.org id=B8912.170536874229242 (code B ref 8912); Tue, 16 Jan 2024 01:33:03 +0000 Received: (at 8912) by debbugs.gnu.org; 16 Jan 2024 01:32:22 +0000 Received: from localhost ([127.0.0.1]:47320 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rPYJR-0007ba-T5 for submit@debbugs.gnu.org; Mon, 15 Jan 2024 20:32:22 -0500 Received: from woodpecker.gentoo.org ([140.211.166.183]:57332 helo=smtp.gentoo.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rPYJO-0007bH-O3 for 8912@debbugs.gnu.org; Mon, 15 Jan 2024 20:32:19 -0500 Received: by smtp.gentoo.org (Postfix, from userid 559) id DF95B3432A0; Tue, 16 Jan 2024 01:32:12 +0000 (UTC) From: Mike Frysinger User-Agent: GNU debbugs/0 Message-Id: <20240116013212.DF95B3432A0@smtp.gentoo.org> Date: Tue, 16 Jan 2024 01:32:12 +0000 (UTC) X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) On Tue, 21 Jun 2011 14:12:02 +0200, Eric PAIRE wrote: > While compiling on 64-bit Linux a package that will be executed on a 32-bit Linux ([--build=x86_64-unknown-linux-gnu] --host=i686-pc-linux-gnu), I am facing an issue with the value of the LD macro generated in libtool, as the libtool part of configure does not add the '-m elf_i386' option for LD to generate a 32-bit object/program. can you share an example project/configure/config.log showing the problem ? > Actually, the problem is that libtool.m4 checks for the build system type with $host, whereas it should be $build. I have understood that $build is the system on which the program is generated (64-bit in my case) and $host the system on which the program created (32-bit in my case) is meant to run. So the right macro should test build system, and not host. this is incorrect. $build controls where things are compiling. $host controls where the things will run. please see: https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.72/html_node/Specifying-Target-Triplets.html -mike From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 15 21:48:03 2024 Received: (at control) by debbugs.gnu.org; 16 Jan 2024 02:48:03 +0000 Received: from localhost ([127.0.0.1]:47361 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rPZUh-0006Lr-45 for submit@debbugs.gnu.org; Mon, 15 Jan 2024 21:48:03 -0500 Received: from woodpecker.gentoo.org ([140.211.166.183]:39416 helo=smtp.gentoo.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rPZUf-0006Ko-JJ for control@debbugs.gnu.org; Mon, 15 Jan 2024 21:48:02 -0500 Received: by smtp.gentoo.org (Postfix, from userid 559) id 0D2A034328C; Tue, 16 Jan 2024 02:47:55 +0000 (UTC) From: Mike Frysinger To: control@debbugs.gnu.org Subject: Control message User-Agent: GNU debbugs/0 Message-Id: <20240116024755.0D2A034328C@smtp.gentoo.org> Date: Tue, 16 Jan 2024 02:47:54 +0000 (UTC) X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) merge 68494 8912 thankyou