Transmission cross-compilation issues after v2.84

Ask for help and report issues not specific to either the Mac OS X or GTK+ versions of Transmission
Post Reply
-=guybrush=-
Posts: 5
Joined: Wed Mar 07, 2018 9:38 am

Transmission cross-compilation issues after v2.84

Post by -=guybrush=- »

Hello to everyone. I'm new here but I'm a long time user and first of all I'd like to thank all the developers for this great piece of work! As I was explaining, I'm a long time user and I've always built the sources with a cross-compilation toolchain for a mips router.
Up to Transmission v2.84 I haven't had any issue with compiling the sources: everything has always gone smoothly. With the newer versions, the configure script goes fine (with exactly the same switches used before) but the make command always fails on bitfield-test. I'd like to add that I've refreshed my toolchain succesfully building the latest versions for all the dependencies but unfortunately this hasn't changed anything.
I'm sure that there isn't anything wrong with the sources and the problem is on my side so I ask you here: is there any workaround to be able to build the newer versions?
I'd really like to succeed because (I presume it is a well known bug but I haven't made a search about) with v2.84 I can't manage to handle magnets: they remain stuck on the metadata retrieval forever (0.00%), no matter if they are working magnets with many seeders but this is an off topic here and eventually I'll dig about this issue in the appropriate places.
Thanks in advance for your replies and have a good day! :)
cfpp2p
Posts: 290
Joined: Sat Aug 08, 2009 3:14 pm

Re: Transmission cross-compilation issues after v2.84

Post by cfpp2p »

-=guybrush=-
Posts: 5
Joined: Wed Mar 07, 2018 9:38 am

Re: Transmission cross-compilation issues after v2.84

Post by -=guybrush=- »

Hi and first of all thanks for your reply. Unfortunately, it doesn't solve my problem: first because it is only a workaround and I'd like to be able to build the latest sources by myself as I've always done and second because those binaries aren't suitable for my router. Thanks anyway for your kind advices!
To better detail the issue I'm experiencing, here is the error I get during compilation:

Code: Select all

make[1]: ingresso nella directory "/home/domenico/work/transmission/transmission-2.93+/libtransmission"
  CCLD     bitfield-test
/opt/toolchains/uclibc-crosstools_gcc-3.4.2_uclibc-20050502/bin/../lib/gcc/mips-linux-uclibc/3.4.2/../../../../mips-linux-uclibc/bin/ld: /opt/toolchains/uclibc-crosstools/lib/: No such file: File format not recognized
collect2: ld returned 1 exit status
Makefile:1090: set di istruzioni per l'obiettivo "bitfield-test" non riuscito
make[1]: *** [bitfield-test] Errore 1
I've checked the line 1090 of the makefile for libtransmission:

Code: Select all

@rm -f bitfield-test$(EXEEXT)
and commenting it I can go on with the compilation for a while but again I get other errors later on. I suspect something could be wrong with the paths specified in the environment variables for my toolchain but I don't understand why I've been able to build flawlessly all the Transmission versions up to v2.84 (and I'm still able to do it should you be wondering if my toolchain has got broken in the meantime) then.
Just a last clarification: I get the error shown above with the latest SVN sources but even downloading the 2.92 tarball for example produces EXACTLY the same outcome: the problem isn't there for sure, not that I've ever thought it could. As already said, I can't manage to successfully build EVERY Transmission version newer than v2.84: no matter what I try, I always get the same error.
I'm sure there is a simple explanation for all of this but I haven't the necessary insight to understand what's wrong unfortunately. Have a good day! :)
-=guybrush=-
Posts: 5
Joined: Wed Mar 07, 2018 9:38 am

Re: Transmission cross-compilation issues after v2.84

Post by -=guybrush=- »

I haven't thought that a topic like this could attract such a low interest. Usually, questions like this one are answered by the developers themselves, glad to broaden the number of devices where their software was being used but unfortunately this doesn't seem to be the case.
I'm wondering if this is due to me not detailing the issue good enough and should this be the case I'm free to give more details. I'm sure that something relevant might have changed in the code (or in the makefiles generation) which has broken things for me and developers surely know where to look.
I hope to receive just a little advice to lead me in the right direction and I thank everyone in advance for that.
mike.dld
Transmission Developer
Posts: 306
Joined: Wed Dec 25, 2013 10:56 pm

Re: Transmission cross-compilation issues after v2.84

Post by mike.dld »

I don't think the issue is with bitfield-test specifically, but rather with linking of dynamic targets, and bitfield-test is the first such target you encounter during the build. The error you're getting mentions something about instruction set (I'm not good with Italian, would appreciate if you run the build with LC_ALL=C to get English messages); can't see a reason for `rm` command to result in such an error, so you're most probably looking at the wrong line or the wrong file; moreover the error message tells you that in fact `ld` and not `rm` command is the one that failed.

If I were to guess, I'd say that you might be mixing libraries from host and target architectures when linking. Post the complete configuration and build logs for further analysis, unless you're able to figure it out on your own.
-=guybrush=-
Posts: 5
Joined: Wed Mar 07, 2018 9:38 am

Re: Transmission cross-compilation issues after v2.84

Post by -=guybrush=- »

First of all thank you very much for your kind and detailed reply and please excuse me for being late with replying. I've set that environment variable as you've told me (thanks for telling me, I didn't know that!) and here is the error log in english:

Code: Select all

make[1]: Entering directory '/home/domenico/work/transmission/transmission-2.93+/libtransmission'
  CCLD     bitfield-test
/opt/toolchains/uclibc-crosstools_gcc-3.4.2_uclibc-20050502/bin/../lib/gcc/mips-linux-uclibc/3.4.2/../../../../mips-linux-uclibc/bin/ld: /opt/toolchains/uclibc-crosstools/lib/: No such file: File format not recognized
collect2: ld returned 1 exit status
Makefile:1090: recipe for target 'bitfield-test' failed
make[1]: *** [bitfield-test] Error 1
make[1]: Leaving directory '/home/domenico/work/transmission/transmission-2.93+/libtransmission'
Makefile:501: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1
For what concerns the rest, I apologize as I've been misleading. According to the error log, it's clear that the error arises when trying to build libtransmission so I've checked line 1090 for its Makefile and it is the one I've previously reported but it's clear that I haven't thought for a split second the problem was with the rm command indeed I've commented all the lines linked with bitfield-test (which I completely agree with you isn't the culprit but only the first point where the issue arises, an issue certainly linked to my particular case, almost certainly my toolchain though I can't still understand why up to v2.84 everthing has always gone and still goes smoothly),
What I've commented are lines from 1089 to 1091:

Code: Select all

bitfield-test$(EXEEXT): $(bitfield_test_OBJECTS) $(bitfield_test_DEPENDENCIES) $(EXTRA_bitfield_test_DEPENDENCIES) 
@rm -f bitfield-test$(EXEEXT)
$(AM_V_CCLD)$(bitfield_test_LINK) $(bitfield_test_OBJECTS) $(bitfield_test_LDADD) $(LIBS)
Following this modification (which I don't believe is a very ortodox one), I immediatetely get an error about bitfield-test.h:

Code: Select all

bitfield.h:12:2: #error only libtransmission should #include this header.
Disabling that check in the header, I can go on for a while but again I get stuck on another error later on:

Code: Select all

st.c:232: undefined reference to `runTests'
collect2: ld returned 1 exit status
<builtin>: recipe for target 'bitfield-test' failed
make: *** [bitfield-test] Error 1
This isn't certainly the way to follow, that's sure. I've only tried to detail the best I could what I've done and the path I've followed to avoid other misunderstandings like the previous one which was completely my fault. I would thoroughly read again and again your message to figure out what else I can do now.
Just a last thing: I'm almost certain I'm not mixing anything up; the libraries should definitively be all for the target architecture and the only thing coming from the host one is the pkg-config executable. I'm forced to use this workaround to make it work. I define manually the PKG_CONFIG environment variable immediately before launching the configure script then the make command for Transmission:

Code: Select all

export PKG_CONFIG=/usr/bin/pkg-config

but I've done exactly the same with all the Transmission versions successfully built till now.
Again, I haven't issues building other libraries or executables, neither Transmission up to v2.84 so I'm confident my toolchain isn't broken (nor are the newer Transmission sources, that's clear: I just believe my toolchain has something which clashes with something that has changed in the Transmission sources in the meantime). Here are all the other relevant environment variables should they help:

Code: Select all

AR=mips-linux-ar
LDFLAGS=-L/opt/toolchains/uclibc-crosstools/lib
ac_cv_func_nonposix_getpwuid_r=no
CPPFLAGS=-I/opt/toolchains/uclibc-crosstools/include
LC_ALL=C
PATH=/opt/toolchains:/opt/toolchains/uclibc-crosstools/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
LD=mips-linux-ld
CXX=mips-linux-g++
CFLAGS=-I/opt/toolchains/uclibc-crosstools/include
ac_cv_func_posix_getpwuid_r=yes
glib_cv_uscore=no
PKG_CONFIG_PATH=/opt/toolchains/uclibc-crosstools/lib/pkgconfig
CC=mips-linux-gcc
ZLIB_LIBS=/opt/toolchains/uclibc-crosstools/lib/
Thanks again and have a good day! :)
mike.dld
Transmission Developer
Posts: 306
Joined: Wed Dec 25, 2013 10:56 pm

Re: Transmission cross-compilation issues after v2.84

Post by mike.dld »

As could be seen from your last message, ZLIB_LIBS environment variable value is not currect. It should point to libz.a/.so, but instead points to a directory (not even a file). That is what I presume is causing the "/opt/toolchains/uclibc-crosstools/lib/: No such file: File format not recognized" error.
-=guybrush=-
Posts: 5
Joined: Wed Mar 07, 2018 9:38 am

Re: Transmission cross-compilation issues after v2.84

Post by -=guybrush=- »

I can confirm that correctly defining the ZLIB_LIBS environment variable:

Code: Select all

export ZLIB_LIBS=/opt/toolchains/uclibc-crosstools/lib/libz.a
The compilation goes fine. What I don't understand is why up to v2.84 in spite of my mistake with the definition I could manage to successfully build the executables anyway, probably a check has been added or something has changed in the meantime but this is out of the scope of this thread.
I'd like to thank mike.dld for his invaluable help and, being a developer, once again for his great work to make Transmission real. Thank you very much! :)
Post Reply