From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 34252 invoked by alias); 16 Sep 2017 18:46:33 -0000 Mailing-List: contact crossgcc-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: crossgcc-owner@sourceware.org Received: (qmail 33942 invoked by uid 89); 16 Sep 2017 18:46:32 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 spammy=HX-Yahoo-Newman-Property:ymail-3, H*r:NNFMP, symlink, Hx-languages-length:3143 X-HELO: nm25-vm9.access.bullet.mail.bf1.yahoo.com Received: from nm25-vm9.access.bullet.mail.bf1.yahoo.com (HELO nm25-vm9.access.bullet.mail.bf1.yahoo.com) (216.109.115.200) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 16 Sep 2017 18:46:31 +0000 Received: from [66.196.81.157] by nm25.access.bullet.mail.bf1.yahoo.com with NNFMP; 16 Sep 2017 18:46:29 -0000 Received: from [10.218.253.205] by tm3.access.bullet.mail.bf1.yahoo.com with NNFMP; 16 Sep 2017 18:46:29 -0000 Received: from [127.0.0.1] by smtp116.sbc.mail.ne1.yahoo.com with NNFMP; 16 Sep 2017 18:46:29 -0000 X-Yahoo-SMTP: 0h0Q7euswBD_g.kcEqbzJWRFfrba801gq1M1 Subject: Re: canadian cross host mingw: build of liblto_plugin-0.dll fails To: Titus von Boxberg Cc: "crossgcc@sourceware.org" References: From: Alexey Neyman Message-ID: Date: Sat, 16 Sep 2017 18:46:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2017-09/txt/msg00006.txt.bz2 Hi Titus, On 09/15/2017 04:33 AM, Titus von Boxberg wrote: > Alexey, all, > > on opensuse linux, I'm trying to build an arm-none toolchain for host mingw-w64 > with a fairly recent crosstool-NG. > As the build machine compiler I'm using gcc-7.2 from opensuse package > https://build.opensuse.org/package/show/windows%3Amingw%3Awin64/mingw64-cross-gcc > > Everything is going smooth except that in the build step for the final gcc > libtool refuses to generate the liblto_plugin-0.dll > > The command line is: > ./libtool --tag=CC --tag=disable-static --mode=link x86_64-host_w64-mingw32-gcc -Wall -O2 -g -pipe -I/home/ELBE/titus/tmp/m32-ctng-m7/.build/HOST-x86_64-w64-mingw32/arm-m7-eabi/buildtools/complibs-host/include -Os -D__USE_MINGW_ACCESS -Wc,-static-libgcc -no-undefined -bindir "/opt/cross/arm-m7-eabi/bin" -module -bindir /opt/cross/arm-m7-eabi/libexec/gcc/arm-m7-eabi/7.2.0 -Wc,../libiberty/libiberty.a -Xcompiler '-static-libstdc++' -Xcompiler '-static-libgcc' '-L/home/ELBE/titus/tmp/m32-ctng-m7/.build/HOST-x86_64-w64-mingw32/arm-m7-eabi/buildtools/complibs-host/lib' '-lstdc++' '-lm' '-Wl,--stack,12582912' -o liblto_plugin.la -rpath /opt/cross/arm-m7-eabi/libexec/gcc/arm-m7-eabi/7.2.0 lto-plugin.lo > > The message is: > *** Warning: linker path does not have real file for library -lstdc++. > *** I have the capability to make that library automatically link in when > *** you link to this library. But I can only do this if you have a > *** shared version of the library, which you do not appear to have > *** because I did check the linker path looking for a file starting > *** with libstdc++ but no candidates were found. (...for file magic test) > > *** Warning: libtool could not satisfy all declared inter-library > *** dependencies of module liblto_plugin. Therefore, libtool will create > *** a static module, that should work as long as the dlopening > *** application is linked with the -dlopen flag. > > libtool is looking into these paths: > /home/ELBE/titus/tmp/m32-ctng-m7/.build/HOST-x86_64-w64-mingw32/arm-m7-eabi/buildtools/complibs-host/lib > /usr/x86_64-w64-mingw32/lib > /usr/x86_64-w64-mingw32/sys-root/mingw/lib > > I found that the opensuse c++ runtime package installs libstdc++-6.dll > into the bin directory of the sysroot > /usr/x86_64-w64-mingw32/sys-root/mingw/bin > > When manually copying libstdc++-6.dll into the sysroot's lib directory, libtool is happy. > > Any ideas where to look to get this fixed reliably? Well, I think this placement is not correct. I am not sure if they did any hacks to GCC to search /bin for libraries - but this obviously breaks any other scripts which assume /lib as the library directory. I assume they did that so that the /bin directory, when copied to the host, could find this DLL. Maybe they should provide a symlink in /lib then. Anyway, it is a problem with opensuse's package and I don't see what we can do here in crosstool-NG to remediate this. You can try the mingw compiler from crosstool-NG by the way, I think it uses conventional placement of the libraries. Regards, Alexey.