Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

meson.build: add atomic dependency for sparc #45

Closed
wants to merge 2 commits into from
Closed

meson.build: add atomic dependency for sparc #45

wants to merge 2 commits into from

Conversation

ffontaine
Copy link

Linking with libatomic is needed on sparc otherwise build fails on:
ncmpc@exe/src_Main.cxx.o: In function std::__atomic_base<long>::operator++()': /home/buildroot/autobuild/instance-1/output/host/opt/ext-toolchain/sparc-buildroot-linux-uclibc/include/c++/6.4.0/bits/atomic_base.h:296: undefined reference to __atomic_fetch_add_4'

Fixes:

Signed-off-by: Fabrice Fontaine fontaine.fabrice@gmail.com

Linking with libatomic is needed on sparc otherwise build fails on:
ncmpc@exe/src_Main.cxx.o: In function `std::__atomic_base<long>::operator++()':
/home/buildroot/autobuild/instance-1/output/host/opt/ext-toolchain/sparc-buildroot-linux-uclibc/include/c++/6.4.0/bits/atomic_base.h:296: undefined reference to `__atomic_fetch_add_4'

Fixes:
 - http://autobuild.buildroot.org/results/7ac1a07e4f72633d3ec92b79dc5d8c062490abdc

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
@MaxKellermann
Copy link
Member

ncmpc itself doesn't need libatomic; your C++ standard library does. I would expect your toolchain to automatically link such a non-standard internal dependency.

Build with gcc 5 fails on:

FAILED: ncmpc@exe/src_TagListPage.cxx.o
/accts/mlweber1/rclinux/rc-buildroot-test/scripts/instance-0/output/host/bin/mips-linux-gnu-g++ -Incmpc@exe -I. -I.. -I../src -I../ -I/accts/mlweber1/rclinux/rc-buildroot-test/scripts/instance-0/output/host/usr/bin/../mips64el-buildroot-linux-gnu/sysroot/usr/include -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wnon-virtual-dtor -std=c++14 -O3 -DBOOST_NO_IOSTREAM -DBOOST_ERROR_CODE_HEADER_ONLY -DBOOST_SYSTEM_NO_DEPRECATED -Wall -Wextra -Wno-deprecated-declarations -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Wmissing-declarations -Wmissing-noreturn -Wmissing-format-attribute -Wredundant-decls -Wundef -Wno-non-virtual-dtor -fvisibility=hidden -ffunction-sections -fdata-sections -D_GNU_SOURCE -D_DEFAULT_SOURCE -pthread -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -MD -MQ 'ncmpc@exe/src_TagListPage.cxx.o' -MF 'ncmpc@exe/src_TagListPage.cxx.o.d' -o 'ncmpc@exe/src_TagListPage.cxx.o' -c ../src/TagListPage.cxx
../src/TagListPage.cxx: In member function 'TagFilter TagListPage::MakeCursorFilter() const':
../src/TagListPage.cxx:41:12: error: converting to 'TagFilter {aka std::forward_list<std::pair<mpd_tag_type, std::__cxx11::basic_string<char> > >}' from initializer list would use explicit constructor 'std::forward_list<_Tp, _Alloc>::forward_list(const _Alloc&) [with _Tp = std::pair<mpd_tag_type, std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::pair<mpd_tag_type, std::__cxx11::basic_string<char> > >]'
    return {};

Fix this error by returning {{}} (a list with one empty element) instead
of {}, see:
https://stackoverflow.com/questions/26947704/implicit-conversion-failure-from-initializer-list

Fixes:
 - http://autobuild.buildroot.org/results/655eb4905c6e308d34293658acee4fc4e1fe0bbc

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
@MaxKellermann
Copy link
Member

Closing because I believe this works around a bug in your toolchain which would rather be fixed there. I don't believe each software should micro-manage every dependency of standard libraries.
Your GCC5 commit doesn't belong here, but I don't find it acceptable because GCC5 is not a supported compiler.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants