From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 19 11:03:39 2018 Received: (at submit) by debbugs.gnu.org; 19 Jul 2018 15:03:39 +0000 Received: from localhost ([127.0.0.1]:48417 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fgASw-0000kW-6M for submit@debbugs.gnu.org; Thu, 19 Jul 2018 11:03:38 -0400 Received: from eggs.gnu.org ([208.118.235.92]:56244) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fg9iE-0005wE-V7 for submit@debbugs.gnu.org; Thu, 19 Jul 2018 10:15:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fg9i8-0008RM-KA for submit@debbugs.gnu.org; Thu, 19 Jul 2018 10:15:17 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_05 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:36264) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fg9i8-0008QN-FU for submit@debbugs.gnu.org; Thu, 19 Jul 2018 10:15:16 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47149) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fg9i7-00017a-58 for bug-libtool@gnu.org; Thu, 19 Jul 2018 10:15:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fg9i3-0008Nb-4z for bug-libtool@gnu.org; Thu, 19 Jul 2018 10:15:15 -0400 Received: from smtp8.iai.uni-bonn.de ([131.220.63.194]:46980) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fg9i2-0008Lz-O9 for bug-libtool@gnu.org; Thu, 19 Jul 2018 10:15:11 -0400 X-IAI-Env-From: : [127.0.0.1] Received: from smtp8.iai.uni-bonn.de (smtp8.iai.uni-bonn.de [127.0.0.1]) by smtp8.iai.uni-bonn.de (Postfix) with ESMTP id 01A5F86F8 for ; Thu, 19 Jul 2018 16:07:12 +0200 (MEST) (envelope-from stucke@informatik.uni-bonn.de) (envelope-to bug-libtool@gnu.org) (1) X-IAI-Env-From: : [193.175.71.191] Received: from [10.71.191.212] (unknown [193.175.71.191]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: stucke@auth.iai.uni-bonn.de) by smtp8.iai.uni-bonn.de (Postfix) with ESMTPSA id EBF5186F7 for ; Thu, 19 Jul 2018 16:07:11 +0200 (MEST) (envelope-from stucke@informatik.uni-bonn.de) (envelope-to bug-libtool@gnu.org) (1) (internal use: ta=1, tu=1, te=1, am=P, au=stucke) X-IAI-Auth: EbhwrSvKj9wVgfs75h3vQGtaUKL5D3cfmarZbMn+e9IQERLDkgD+DQvhE/D+mPI/waUlZ3GTX503V9TgNNhsm6MzdETvVNUA7tIWTTUmoU0QHH0Co8/ykZDFPyId1K+9VB4LOexvQxEAAAAAAAAAAA==@auth.iai.uni-bonn.de To: bug-libtool@gnu.org From: =?UTF-8?Q?J=c3=b6rg_Stucke?= Subject: problems with cross-compiling Openpgp: preference=signencrypt Autocrypt: addr=stucke@informatik.uni-bonn.de; prefer-encrypt=mutual; keydata= xsFNBFmBuQsBEACuJaPr+GNvdPxaCMeu5KIMZu0WnEvG3h82VOphLHxbCCnoLWufhYggdj7z gzb7S7l8LYFSJX2IjpdWmzmxkp2f5kkGYHRnLiHOH17BgkhVfxggMSIb3SFRs9o8Te8BtUjp fcPjxEsl+qdmucZVENHYwWaNVMtAGAunA0adfqHd6I6/dYa9Wr2IHOE9yp0XM8+8NlEjRFTL FMYZeKtEPiS/mHaNPadTpCu9CRYE++kZzKtN4dlHEQY1rw0JUUZp0n5VsGk1n49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CznWNj0GDvz8D7xjK/1paTWEalsT/5JdhPOPUb BcHBTt4t+BND7OSB56KVCQSOVt+gpAETd6oAY/gYm3yJznQvp8K+X4jOoi+bEbryv5Mv71DK SHr23QoVPtf+FkbQV9TA3Y4t0whKzbtrKYsABBbw2bcdHSirQxqbFpQ4GW4HVQ0J2WSLBiVi B3vNd+ms55iH2TnEuEANKFYrklxkkNEIYdGlpVHqCXw10z3d0Ynud24OpkOahJ5s94FG+tEP KOrQsnE5qUvREvPwfRhc6KzxYF2/QyHotcR7EB8FkE+0I0V0xpaFLGNIixbBcR5eoS5EdZSb 0kNhZ7LxChbkerrVmEXMKuJnILFTaR9aycjoBiO5AKJGc8cFgcUEbUvcUMKvhMTrt3CEVo5M 64F7Y/EOmgsP8y7in6vdhfCcZK71JLJcq3UkE1xzE0c24LIosZJn6nitEU0Rz+crZackr0+K qeOsi8chkieGsuDFE3tHVZb3pw8IIgfz/POmXbof2rbzxE4d0RLvAx8vJy8AbwA434gcTLLZ lTAre6dXGQXhGR0SmgEffxf894GdKmju Message-ID: Date: Thu, 19 Jul 2018 16:07:10 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: GNU/Linux (Android) [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Thu, 19 Jul 2018 11:03:37 -0400 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: -6.0 (------) Hi, I was trying to cross-compile lighttpd using a mips cross-compiling toolchain and clang. lighttpd uses libtool to compile some libraries. I got an error when libtool tried to link with clang: /bin/bash ../libtool=C2=A0 --tag=3DCC=C2=A0=C2=A0 --mode=3Dlink /usr/bin/= clang-6.0=C2=A0=C2=A0 -target mips-linux-gnu -I/usr/mips-linux-gnu/include/ -Wall -W -Wshadow -pedantic -module -export-dynamic -avoid-version -target mips-linux-gnu -o mod_flv_streaming.la -rpath /usr/local/lib mod_flv_streaming.lo libtool: link: rm -fr=C2=A0 .libs/mod_flv_streaming.la =2Elibs/mod_flv_streaming.lai .libs/mod_flv_streaming.so libtool: link: /usr/bin/clang-6.0 -shared=C2=A0 -fPIC -DPIC=C2=A0 =2Elibs/mod_flv_streaming.o=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 -Wl,-soname -Wl= ,mod_flv_streaming.so -o =2Elibs/mod_flv_streaming.so /usr/bin/ld: .libs/mod_flv_streaming.o: Relocations in generic ELF (EM: 8= ) /usr/bin/ld: .libs/mod_flv_streaming.o: Relocations in generic ELF (EM: 8= ) /usr/bin/ld: .libs/mod_flv_streaming.o: Relocations in generic ELF (EM: 8= ) =2Elibs/mod_flv_streaming.o: error adding symbols: File in wrong format clang: error: linker command failed with exit code 1 (use -v to see invocation) It seems that the linking flag "-target mips-linux-gnu" was removed by libtool which resulted in the linker (clang) assuming the wrong architecture (x86_64). The flag was set in the LDFLAGS environment variable. Before, it gets passed correctly during compiling (with CFLAGS=3D"-target= mips-linux-gnu"): /bin/bash ../libtool=C2=A0 --tag=3DCC=C2=A0=C2=A0 --mode=3Dcompile /usr/b= in/clang-6.0 -DHAVE_CONFIG_H -DHAVE_VERSIONSTAMP_H - DLIBRARY_DIR=3D"\"/usr/local/lib\"" -DSBIN_DIR=3D"\"/usr/local/sbin\"" -I= =2E -I..=C2=A0=C2=A0 -D_REENTRANT -D_FILE_OFFSET_ BITS=3D64 -D_LARGEFILE_SOURCE -D_LARGE_FILES=C2=A0=C2=A0 -target mips-lin= ux-gnu -I/usr/mips-linux-gnu/include/ -Wall - W -Wshadow -pedantic -MT mod_flv_streaming.lo -MD -MP -MF =2Edeps/mod_flv_streaming.Tpo -c -o mod_flv_stream ing.lo mod_flv_streaming.c libtool: compile:=C2=A0 /usr/bin/clang-6.0 -DHAVE_CONFIG_H -DHAVE_VERSIONSTAMP_H -DLIBRARY_DIR=3D\"/usr/local/lib \" -DSBIN_DIR=3D\"/usr/local/sbin\" -I. -I.. -D_REENTRANT -D_FILE_OFFSET_BITS=3D64 -D_LARGEFILE_SOURCE -D_LARG E_FILES -target mips-linux-gnu -I/usr/mips-linux-gnu/include/ -Wall -W -Wshadow -pedantic -MT mod_flv_stre aming.lo -MD -MP -MF .deps/mod_flv_streaming.Tpo -c mod_flv_streaming.c=C2= =A0 -fPIC -DPIC -o .libs/mod_flv_streaming.o I'm not sure if this is intended or an error. The Problem only occurs if the flag "-target mips-linux-gnu" is set in=C2=A0 CFLAGS and LDFLAGS. Changing the environment variable CC to "/usr/bin/clang -target mips-linux-gnu" instead, mitigates the problem, since it is then present during linking with libtool. I tried it with lighttpd 1.4.49 which uses the latest release version of libtool (2.4.6). regards, J=C3=B6rg From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 19 14:45:27 2018 Received: (at submit) by debbugs.gnu.org; 19 Jul 2018 18:45:27 +0000 Received: from localhost ([127.0.0.1]:48531 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fgDva-0006Hl-Pf for submit@debbugs.gnu.org; Thu, 19 Jul 2018 14:45:26 -0400 Received: from eggs.gnu.org ([208.118.235.92]:58749) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fgDvZ-0006HW-LH for submit@debbugs.gnu.org; Thu, 19 Jul 2018 14:45:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fgDvT-0001Ay-JO for submit@debbugs.gnu.org; Thu, 19 Jul 2018 14:45:20 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_20 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:42815) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fgDvT-0001AY-FV for submit@debbugs.gnu.org; Thu, 19 Jul 2018 14:45:19 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49709) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fgDvS-00056H-6i for bug-libtool@gnu.org; Thu, 19 Jul 2018 14:45:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fgDvP-00017W-If for bug-libtool@gnu.org; Thu, 19 Jul 2018 14:45:18 -0400 Received: from smtp.simplesystems.org ([65.66.246.90]:64194) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fgDvP-00016b-9C for bug-libtool@gnu.org; Thu, 19 Jul 2018 14:45:15 -0400 Received: from scrappy.simplesystems.org (scrappy.simplesystems.org [65.66.246.73]) by smtp.simplesystems.org (8.14.4+Sun/8.14.4) with ESMTP id w6JIj0u2007957; Thu, 19 Jul 2018 13:45:00 -0500 (CDT) Date: Thu, 19 Jul 2018 13:45:00 -0500 (CDT) From: Bob Friesenhahn X-X-Sender: bfriesen@scrappy.simplesystems.org To: =?ISO-8859-15?Q?J=F6rg_Stucke?= Subject: Re: bug#32211: problems with cross-compiling In-Reply-To: Message-ID: References: User-Agent: Alpine 2.20 (GSO 67 2015-01-07) MIME-Version: 1.0 Content-Type: multipart/mixed; BOUNDARY="3735943886-2110444415-1532025901=:1627" X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (smtp.simplesystems.org [65.66.246.90]); Thu, 19 Jul 2018 13:45:01 -0500 (CDT) X-detected-operating-system: by eggs.gnu.org: GNU/Linux (Android) [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.1 (----) X-Debbugs-Envelope-To: submit Cc: bug-libtool@gnu.org, 32211@debbugs.gnu.org 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: -5.1 (-----) This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --3735943886-2110444415-1532025901=:1627 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by smtp.simplesystems.org id w6JIj0u2007957 On Thu, 19 Jul 2018, J=C3=B6rg Stucke wrote: > > It seems that the linking flag "-target mips-linux-gnu" was removed by > libtool which resulted in the linker (clang) assuming the wrong > architecture (x86_64). The flag was set in the LDFLAGS environment > variable. Libtool only passes through options that it understands. Otherwise=20 one must use -Wc, and -Wl, syntax to pass options to the compiler or=20 linker. Also, usually cross-tools are supposed to be named a particular way=20 (including the target triplet in the name) according to autoconf=20 conventions (see the autoconf documentation). This helps autoconf and=20 libtool understand that cross-compilation is being performed, and=20 assures that the correct tools are used. On a system here, I see cross tools named like mips-linux-gcc and=20 mips-unknown-linux-uclibc-gcc. Bob --=20 Bob Friesenhahn bfriesen@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen= / GraphicsMagick Maintainer, http://www.GraphicsMagick.org/ --3735943886-2110444415-1532025901=:1627--