Repository: badaix/snapcast

Issue #255: Needs `-latomic` on RPi
Created: 2017-06-25T11:11:06Z
Building Snapcast on a first-gen Raspberry Pi (running an up-to-date Archlinux), the build ends up in undefined references:
g++ -march=armv6 -mfloat-abi=hard -mfpu=vfp -O2 -pipe -fstack-protector --param=ssp-buffer-size=4  -std=c++0x -Wall -Wno-unused-function -O3 -DASIO_STANDALONE -DVERSION=\"0.11.1\" -I. -I.. -isystem ../externals/asio/asio/include -I../externals/popl/include -pthread -DHAS_OGG -DHAS_ALSA -DHAS_AVAHI -DHAS_DAEMON -o snapclient snapClient.o stream.o clientConnection.o timeProvider.o player/player.o decoder/pcmDecoder.o decoder/oggDecoder.o decoder/flacDecoder.o controller.o ../message/pcmChunk.o ../common/log.o ../common/sampleFormat.o player/alsaPlayer.o browseZeroConf/browseAvahi.o -lrt -lasound -logg -lvorbis -lFLAC -lavahi-client -lavahi-common -static-libgcc -static-libstdc++
controller.o: In function `Controller::worker()':
controller.cpp:(.text+0x19b8): undefined reference to `__atomic_load_8'
stream.o: In function `Stream::getPlayerChunk(void*, std::chrono::duration<long long, std::ratio<1ll, 1000000ll> > const&, unsigned long)':
stream.cpp:(.text+0x28bc): undefined reference to `__atomic_load_8'
stream.cpp:(.text+0x2ae0): undefined reference to `__atomic_load_8'
stream.cpp:(.text+0x3780): undefined reference to `__atomic_load_8'
stream.cpp:(.text+0x4244): undefined reference to `__atomic_load_8'
timeProvider.o: In function `TimeProvider::setDiffToServer(double)':
timeProvider.cpp:(.text+0x21c): undefined reference to `__atomic_store_8'
timeProvider.cpp:(.text+0x304): undefined reference to `__atomic_store_8'
timeProvider.o: In function `TimeProvider::setDiff(tv const&, tv const&)':
timeProvider.cpp:(.text+0x638): undefined reference to `__atomic_store_8'
timeProvider.cpp:(.text+0x718): undefined reference to `__atomic_store_8'
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:70: snapclient] Error 1
make[1]: Leaving directory '/tmp/packerbuild-1001/snapcast/snapcast/src/snapcast/client'

Linking to libatomic works fine. The link stage ends up being:
g++ -march=armv6 -mfloat-abi=hard -mfpu=vfp -O2 -pipe -fstack-protector --param=ssp-buffer-size=4  -std=c++0x -Wall -Wno-unused-function -O3 -DASIO_STANDALONE -DVERSION=\"0.11.1\" -I. -I.. -isystem ../externals/asio/asio/include -I../externals/popl/include -pthread -DHAS_OGG -DHAS_ALSA -DHAS_AVAHI -DHAS_DAEMON -o snapclient snapClient.o stream.o clientConnection.o timeProvider.o player/player.o decoder/pcmDecoder.o decoder/oggDecoder.o decoder/flacDecoder.o controller.o ../message/pcmChunk.o ../common/log.o ../common/sampleFormat.o player/alsaPlayer.o browseZeroConf/browseAvahi.o -lrt -lasound -logg -lvorbis -lFLAC -lavahi-client -lavahi-common -static-libgcc -static-libstdc++ -latomic

This seems to affect the client only.

Duplicate issue #274: Snapcast fails to build under Arch Linux on ARM6vh (BCM2835)
Created: 2017-09-20T16:53:17Z
Fantastic piece of software, so much easier than using RTP sinks.  Bought a couple of Pi Zero W to extend music around the house and have found the build I'm using from the AUR repository (see https://aur.archlinux.org/packages/snapcast/) fails on the Pi Zero W with the following error(s)...
==> Starting build()...
make -C client
make[1]: Entering directory '/home/neil/build-repos/snapcast/src/snapcast/client'
g++ -march=armv6 -mfloat-abi=hard -mfpu=vfp -O2 -pipe -fstack-protector-strong -fno-plt  -std=c++0x -Wall -Wno-unused-function -O3 -DASIO_STANDALONE -DVERSION="0.11.1" -I. -I.. -isystem ../externals/asio/asio/include -I../externals/popl/include -pthread -DHAS_OGG -DHAS_ALSA -DHAS_AVAHI -DHAS_DAEMON -o snapclient snapClient.o stream.o clientConnection.o timeProvider.o player/player.o decoder/pcmDecoder.o decoder/oggDecoder.o decoder/flacDecoder.o controller.o ../message/pcmChunk.o ../common/log.o ../common/sampleFormat.o player/alsaPlayer.o browseZeroConf/browseAvahi.o -lrt -lasound -logg -lvorbis -lFLAC -lavahi-client -lavahi-common -static-libgcc -static-libstdc++
controller.o: In function Controller::worker()': controller.cpp:(.text+0x1d58): undefined reference to __atomic_load_8'
stream.o: In function Stream::getPlayerChunk(void*, std::chrono::duration<long long, std::ratio<1ll, 1000000ll> > const&, unsigned long)': stream.cpp:(.text+0x2af4): undefined reference to __atomic_load_8'
stream.cpp:(.text+0x2d3c): undefined reference to __atomic_load_8' stream.cpp:(.text+0x3a7c): undefined reference to __atomic_load_8'
stream.cpp:(.text+0x45c4): undefined reference to __atomic_load_8' timeProvider.o: In function TimeProvider::setDiffToServer(double)':
timeProvider.cpp:(.text+0x244): undefined reference to __atomic_store_8' timeProvider.cpp:(.text+0x2e0): undefined reference to __atomic_store_8'
timeProvider.o: In function TimeProvider::setDiff(tv const&, tv const&)': timeProvider.cpp:(.text+0x6a8): undefined reference to __atomic_store_8'
timeProvider.cpp:(.text+0x73c): undefined reference to `__atomic_store_8'
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile:70: snapclient] Error 1
make[1]: Leaving directory '/home/neil/build-repos/snapcast/src/snapcast/client'
make: *** [Makefile:9: client] Error 2
==> ERROR: A failure occurred in build().
Aborting...
If its something that might be related to gcc/cmake/etc. versions please let me know and I'll dig them out (not so familiar with Arch Linux as I normally use Gentoo where it builds from source fine, although thats on amd64 chipset).
Thanks,
slackline

Closing comment (2017-09-20T22:49:12Z): Seems like this is the same as #255