On Wed, Nov 14, 2012 at 11:36 AM, Florian Fainelli <[email protected]> wrote: > On Wednesday 14 November 2012 11:24:10 Drasko DRASKOVIC wrote: >> > - the second libtool command does not use the cross-linker, and for that I >> > have no idea yet >> >> It does not, and it is related to the bug (or wrong params) in the >> libtool described here : >> http://www.metastatic.org/text/libtool.html >> >> --tag=CC can be passed to libtool, and then it uses >> mipsel-openwrt-linux-uclibc-gcc for compilatin, which is correct. >> However, in the link stage with same --tag=CC passed, it switches to >> the native gcc which is wrong and provokes errors. > > Should not you use --tag=LD then? I agree that it should work anyway.
No, this tag is not recognized by libtool (my idea exactly, unfortunately it ignores it as an unknown tag). >> Solution here is either to correct libtool or use cross libtool, I >> think, but I am not quite sure. It sounds strange to me that I am the >> first person in the world who cross compiles libraries with libtool on >> OpenWRT... > > There is no such thing as a cross-libtool, as it does not make sense, a cross > libtool would mean a libtool that gets compiled for your target platform, but > executed on the build platform? That does not fly. Well, cross-libtool sort-of, this is what I wanted to say. libtool is just a shell script (10k lines long horror), but it can be configured for the target like this : > ./configure --prefix=/opt/Toolchain --host=target --program-prefix=target- Please refer to the link http://www.metastatic.org/text/libtool.html, section "The wrong-gcc problem". I do not know what this configure does, but I guess it changes some internal variables inside libtool, so it changes the way it constructs it's compilation command. Libtool provided by OpenWRT is the one for the host. Libtools provided by packages are in my opinion configured and "make"-d during the package cross-compilation, thus they work well with the target code. What OpenWRT is missing is cross-compiled libtool that should be somewhere in the toolchain (binutils?) directory, that I can use, instead of cross-making libtool for every package. even worse, libtool has to be pached in order to change it's internal "libdir" variable (link http://www.metastatic.org/text/libtool.html, first section). This is done in OpenWRT by libtool patch for the host libtool, but is this done for every libtool provided with the package? I seriously doubt. Maybe this patching could be configured with PKG_FIXUP:=autoreconf, as suggested before, but this is another problem. Primary problem for now is cross-compiler call, and does every package has to provide it's own libtool. BR, Drasko _______________________________________________ openwrt-devel mailing list [email protected] https://lists.openwrt.org/mailman/listinfo/openwrt-devel
