Ableton / link

Ableton Link
Other
1.06k stars 145 forks source link

examples fail to build on architectures that require libatomic #129

Closed umlaeute closed 1 year ago

umlaeute commented 1 year ago

as of 1f12bcb81119919bb5b004d8771929cd6b3ac912 (included in Link-3.0.6), there is now:

Conditionally link against atomic and pthread so clients don't have to do this manually

unfrotunately, it seems that the "condition" is broken, as the Link examples now fails to compile on the armel architecture: https://ci.debian.net/data/autopkgtest/testing/armel/a/ableton-link/30260433/log.gz

afaict, the previous condition for linking against libatomic (which used to work, but was spread out in the consumers CMakeLists.txt), was whether the target system was Linux, kFreeBSD or GNU/Hurd: https://github.com/Ableton/link/blob/2641130bca65cdfb95794b31a6453a825333bd28/examples/CMakeLists.txt#L99-L101

the new additional condition (in the central AbletonLinkConfig.cmake) is instead, whether the compiler is clang: https://github.com/Ableton/link/blob/a33d2c34997dc8679ba9092652dd52bffc0c7b04/AbletonLinkConfig.cmake#L43-L48

this breaks compilation with gcc on architectures that require libatomic (for architectures supported by Debian, these are: armel, m68k, mipsel, powerpc, riscv64, sh4)

Why has the condition changed?

umlaeute commented 1 year ago

the proper way would be to actually check whether libatomic is required to use atomics, but this can become ugly soon (e.g. see here).

Alternatively, just link against the library if it is available (or even unconditionally link against it on the relevant platforms.

fgo-ableton commented 1 year ago

I pushed a commit that always links lib atomic on Linux|kFreeBSD|GNU again. Could you let me know if this works.

umlaeute commented 1 year ago

Looks good (but I'm currently afk, so i haven't actually tested...)