From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/13167 Path: news.gmane.org!.POSTED!not-for-mail From: John Found Newsgroups: gmane.linux.lib.musl.general Subject: Compiling 32bit executables on 64bit system with MUSL Date: Sun, 2 Sep 2018 16:01:25 +0300 Message-ID: <20180902160125.a754c267dcd23f87d004dbb0@asm32.info> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart=_Sun__2_Sep_2018_16_01_25_+0300_iWsRm_ZTSJb6+Ae7" X-Trace: blaine.gmane.org 1535893244 4086 195.159.176.226 (2 Sep 2018 13:00:44 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 2 Sep 2018 13:00:44 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-13183-gllmg-musl=m.gmane.org@lists.openwall.com Sun Sep 02 15:00:40 2018 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1fwRzb-0000z3-Vp for gllmg-musl@m.gmane.org; Sun, 02 Sep 2018 15:00:40 +0200 Original-Received: (qmail 5189 invoked by uid 550); 2 Sep 2018 13:02:44 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 5148 invoked from network); 2 Sep 2018 13:02:43 -0000 X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; x86_64-unknown-linux-gnu) Xref: news.gmane.org gmane.linux.lib.musl.general:13167 Archived-At: This is a multi-part message in MIME format. --Multipart=_Sun__2_Sep_2018_16_01_25_+0300_iWsRm_ZTSJb6+Ae7 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit I was able to do it before, although with some hassle and questions in the mailing list. But today I tried again and it seems the old tricks does not work now. What I am doing: 1. Compile and install MUSL for i386: $ sudo ln -s /usr/bin/ar /usr/bin/i386-ar $ sudo ln -s /usr/bin/ranlib /usr/bin/i386-ranlib $ ./configure --host=i386 CC="gcc -m32" $ make $ sudo make install 2. edit the file /usr/local/musl/bin/musl-gcc (removing double quotes): exec ${REALGCC:-gcc -m32} "$@" -specs "/usr/local/musl/lib/musl-gcc.specs" 3. Change the file /usr/local/musl/lib/musl-gcc.specs to the attached in this message. As I said, this procedure happened to work before. But now, when trying to compile some file, the compilation failed with linker error message. Here is some simple test: $cat ./hello.c #include int main() { printf("Hello, World!"); return 0; } $musl-gcc -o hello ./hello.c /usr/bin/ld: /usr/lib/gcc/x86_64-pc-linux-gnu/8.2.0/32/crtbegin.o: direct GOT relocation R_386_GOT32X against `_ITM_deregisterTMCloneTable' without base register can not be used when making a shared object /usr/bin/ld: final link failed: nonrepresentable section on output collect2: error: ld returned 1 exit status Actually my C programming skills are very low, so I can't even understand what the linker is talking about. The version of GCC is 8.2.0; Any help will be appreciated! -- John Found https://board.asm32.info --Multipart=_Sun__2_Sep_2018_16_01_25_+0300_iWsRm_ZTSJb6+Ae7 Content-Type: application/octet-stream; name="musl-gcc.specs" Content-Disposition: attachment; filename="musl-gcc.specs" Content-Transfer-Encoding: base64 KmFzbToKLS0zMgoKJXJlbmFtZSBjcHBfb3B0aW9ucyBvbGRfY3BwX29wdGlvbnMKCipjcHBfb3B0 aW9uczoKLW5vc3RkaW5jIC1pc3lzdGVtIC91c3IvbG9jYWwvbXVzbC9pbmNsdWRlIC1pc3lzdGVt IGluY2x1ZGUlcyAlKG9sZF9jcHBfb3B0aW9ucykKCipjYzE6CiUoY2MxX2NwdSkgLW0zMiAtbm9z dGRpbmMgLWlzeXN0ZW0gL3Vzci9sb2NhbC9tdXNsL2luY2x1ZGUgLWlzeXN0ZW0gaW5jbHVkZSVz CgoqbGlua19saWJnY2M6Ci1ML3Vzci9sb2NhbC9tdXNsL2xpYiAtTCAuJXMKCipsaWJnY2M6CjMy L2xpYmdjYy5hJXMgJTppZi1leGlzdHMoMzIvbGliZ2NjX2VoLmElcykKCipzdGFydGZpbGU6CiV7 IXNoYXJlZDogL3Vzci9sb2NhbC9tdXNsL2xpYi8le3BpZTpTfWNydDEub30gL3Vzci9sb2NhbC9t dXNsL2xpYi9jcnRpLm8gJXtzaGFyZWR8cGllOmNydGJlZ2luUy5vJXM7OjMyL2NydGJlZ2luLm8l c30KCiplbmRmaWxlOgole3NoYXJlZHxwaWU6Y3J0ZW5kUy5vJXM7OjMyL2NydGVuZC5vJXN9IC91 c3IvbG9jYWwvbXVzbC9saWIvY3J0bi5vCgoqbGluazoKLW0gZWxmX2kzODYgLWR5bmFtaWMtbGlu a2VyIC9saWIvbGQtbXVzbC1pMzg2LnNvLjEgLW5vc3RkbGliICV7c2hhcmVkOi1zaGFyZWR9ICV7 c3RhdGljOi1zdGF0aWN9ICV7cmR5bmFtaWM6LWV4cG9ydC1keW5hbWljfQoKKmVzcF9saW5rOgoK Ciplc3Bfb3B0aW9uczoKCgoqZXNwX2NwcF9vcHRpb25zOgoKCg== --Multipart=_Sun__2_Sep_2018_16_01_25_+0300_iWsRm_ZTSJb6+Ae7--