rakshasa / libtorrent

libTorrent BitTorrent library
http://rtorrent.net/downloads/
GNU General Public License v2.0
885 stars 209 forks source link

libtorrent can't be linked on old ARM boxes, where there is no ATOMIC support #163

Open MrDini123 opened 6 years ago

MrDini123 commented 6 years ago

Hí,

I tried to build rtorrent, but it gave me this:

/ffp/bin/ld: conftest: hidden symbol `__sync_val_compare_and_swap_4' in /usr/local/zy-pkgs/ffproot/ffp/bin/../lib/gcc/arm-ffp-linux-uclibcgnueabi/4.9.2/libgcc.a(linux-atomic.o) is referenced by DSO
/ffp/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
rakshasa commented 6 years ago

This would need to wait until I rewrite most of the code to using c++11's std::atomic types.

MrDini123 commented 5 years ago

Any progress on the rewrite? Or is there any hacky way for me to compile libtorrent without atomic support?

barracuda156 commented 7 months ago

@rakshasa It also fails on Darwin ppc due to the same issue (it builds, but library is broken). If it used __atomic* builtins instead of __sync*, that would work fine (provided linking to libatomic is done).

36-246% /opt/local/bin/rtorrent
dyld: lazy symbol binding failed: Symbol not found: ___sync_add_and_fetch_8
  Referenced from: /opt/local/lib/libtorrent.21.dylib
  Expected in: dynamic lookup

dyld: Symbol not found: ___sync_add_and_fetch_8
  Referenced from: /opt/local/lib/libtorrent.21.dylib
  Expected in: dynamic lookup

@MrDini123 Well, possibly rewriting to __atomic* will fix it. They are not drop-in replacements, arguments differ, but they provide the same functionality, just better.