libtorrent icon indicating copy to clipboard operation
libtorrent copied to clipboard

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

Open MrDini123 opened this issue 6 years ago • 3 comments

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

MrDini123 avatar Jan 31 '18 17:01 MrDini123

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

rakshasa avatar Feb 01 '18 10:02 rakshasa

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

MrDini123 avatar Jun 09 '19 20:06 MrDini123

@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.

barracuda156 avatar Jan 26 '24 18:01 barracuda156