LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 05-08-2019, 04:08 PM   #1
orbea
Senior Member
 
Registered: Feb 2015
Distribution: Slackware64-current
Posts: 1,950

Rep: Reputation: Disabled
Slackware64-current clang-8.0.0 build failure with dolphin-emu


I was testing clang-8.0.0 in Slackware64-current by exporting CC=clang and CXX=clang++. This works as expected with most programs, but I encountered this issue with the git master for dolphin-emu.

Code:
In file included from /tmp/SBo/dolphin-emu/Source/Core/DiscIO/Blob.cpp:19:
In file included from /tmp/SBo/dolphin-emu/Source/Core/DiscIO/DirectoryBlob.h:13:
/usr/bin/../lib64/gcc/x86_64-slackware-linux/9.1.0/../../../../include/c++/9.1.0/variant:1559:55: error: '__get' is missing exception specification 'noexcept'
        friend constexpr decltype(auto) __detail::__variant::__get(_Vp&& __v);
                                                             ^
/tmp/SBo/dolphin-emu/Source/Core/DiscIO/DirectoryBlob.h:59:17: note: in instantiation of template class 'std::variant<std::__cxx11::basic_string<char>, const unsigned char *>' requested here
  ContentSource m_content_source;
                ^
/usr/bin/../lib64/gcc/x86_64-slackware-linux/9.1.0/../../../../include/c++/9.1.0/variant:263:5: note: previous declaration is here
    __get(_Variant&& __v) noexcept
    ^
Full log: https://pastebin.com/tSQ5Z0zX

As can be seen it is using gcc 9.1.0 includes.

This reference seems like it might be relevant.

https://stackoverflow.com/questions/...le-clang-6-0-0

So I appended -stdlib=libc++ to -DCMAKE_CXX_FLAGS="$SLKCFLAGS" and it got farther.

Code:
[ 80%] Linking CXX executable ../../../Binaries/dolphin-emu-nogui
/usr/bin/ld: ../Core/CMakeFiles/core.dir/NetPlayClient.cpp.o: in function `NetPlay::NetPlayClient::Connect()':
NetPlayClient.cpp:(.text+0x12cf): undefined reference to `sf::Packet::operator<<(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)'
/usr/bin/ld: NetPlayClient.cpp:(.text+0x12de): undefined reference to `sf::Packet::operator<<(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)'
/usr/bin/ld: NetPlayClient.cpp:(.text+0x12f1): undefined reference to `sf::Packet::operator<<(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)'
/usr/bin/ld: ../Core/CMakeFiles/core.dir/NetPlayClient.cpp.o: in function `NetPlay::NetPlayClient::OnData(sf::Packet&)':
NetPlayClient.cpp:(.text+0x1bc8): undefined reference to `sf::Packet::operator>>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&)'
/usr/bin/ld: NetPlayClient.cpp:(.text+0x1d0c): undefined reference to `sf::Packet::operator>>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&)'
/usr/bin/ld: NetPlayClient.cpp:(.text+0x1eb5): undefined reference to `sf::Packet::operator>>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&)'
/usr/bin/ld: NetPlayClient.cpp:(.text+0x2255): undefined reference to `sf::Packet::operator>>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&)'
/usr/bin/ld: NetPlayClient.cpp:(.text+0x2aba): undefined reference to `sf::Packet::operator>>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&)'
/usr/bin/ld: ../Core/CMakeFiles/core.dir/NetPlayClient.cpp.o:NetPlayClient.cpp:(.text+0x2b4f): more undefined references to `sf::Packet::operator>>(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&)' follow
/usr/bin/ld: ../Core/CMakeFiles/core.dir/NetPlayClient.cpp.o: in function `NetPlay::NetPlayClient::SendChatMessage(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)':
NetPlayClient.cpp:(.text+0x7e50): undefined reference to `sf::Packet::operator<<(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)'
/usr/bin/ld: ../Core/CMakeFiles/core.dir/NetPlayClient.cpp.o: in function `void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, NetPlay::NetPlayClient::ComputeMD5(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)::$_6> >(void*)':
NetPlayClient.cpp:(.text+0xa84e): undefined reference to `sf::Packet::operator<<(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)'
/usr/bin/ld: ../Core/CMakeFiles/core.dir/WiiUtils.cpp.o: in function `WiiUtils::OnlineSystemUpdater::GetSystemTitles()':
WiiUtils.cpp:(.text+0x1c73): undefined reference to `pugi::xml_document::save(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, char const*, unsigned int, pugi::xml_encoding) const'
clang-8: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [Source/Core/DolphinNoGUI/CMakeFiles/dolphin-nogui.dir/build.make:181: Binaries/dolphin-emu-nogui] Error 1
make[1]: *** [CMakeFiles/Makefile2:1470: Source/Core/DolphinNoGUI/CMakeFiles/dolphin-nogui.dir/all] Error 2
make: *** [Makefile:152: all] Error 2
Full log: https://pastebin.com/t1NebpLz

I asked dolphin developers on irc and was told they they could compile dolphin-emu with clang without doing anything special.

So am I doing something wrong, or maybe there is something missing in the llvm package?

For reference here is my build script.

https://notabug.org/orbea/SlackBuild...es/dolphin-emu

Edit: Relevant link.

https://forums.dolphin-emu.org/Threa...on-linux-fails

Last edited by orbea; 05-08-2019 at 05:41 PM.
 
Old 05-08-2019, 07:02 PM   #2
orbea
Senior Member
 
Registered: Feb 2015
Distribution: Slackware64-current
Posts: 1,950

Original Poster
Rep: Reputation: Disabled
I found a basic c++ hello world.

Code:
#include <iostream>
using namespace std;

int main() 
{
    cout << "Hello, World!";
    return 0;
}
Code:
$ clang++ hello.cpp -o hello -v 
clang version 8.0.0 (tags/RELEASE_800/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-slackware-linux/9.1.0
Found candidate GCC installation: /usr/bin/../lib64/gcc/x86_64-slackware-linux/9.1.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-slackware-linux/9.1.0
Found candidate GCC installation: /usr/lib64/gcc/x86_64-slackware-linux/9.1.0
Selected GCC installation: /usr/bin/../lib64/gcc/x86_64-slackware-linux/9.1.0
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Selected multilib: .;@m64
 "/usr/bin/clang-8" -cc1 -triple x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -discard-value-names -main-file-name hello.cpp -mrelocation-model static -mthread-model posix -mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64 -dwarf-column-info -debugger-tuning=gdb -v -resource-dir /usr/bin/../lib64/clang/8.0.0 -cxx-isystem /usr/lib64/qt/include -internal-isystem /usr/bin/../lib64/gcc/x86_64-slackware-linux/9.1.0/../../../../include/c++/9.1.0 -internal-isystem /usr/bin/../lib64/gcc/x86_64-slackware-linux/9.1.0/../../../../include/c++/9.1.0/x86_64-slackware-linux -internal-isystem /usr/bin/../lib64/gcc/x86_64-slackware-linux/9.1.0/../../../../include/c++/9.1.0/backward -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib64/clang/8.0.0/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -fdeprecated-macro -fdebug-compilation-dir /tmp -ferror-limit 19 -fmessage-length 82 -fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -o /tmp/hello-603b51.o -x c++ hello.cpp -faddrsig
clang -cc1 version 8.0.0 based upon LLVM 8.0.0 default target x86_64-unknown-linux-gnu
ignoring nonexistent directory "/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib64/qt/include
 /usr/bin/../lib64/gcc/x86_64-slackware-linux/9.1.0/../../../../include/c++/9.1.0
 /usr/bin/../lib64/gcc/x86_64-slackware-linux/9.1.0/../../../../include/c++/9.1.0/x86_64-slackware-linux
 /usr/bin/../lib64/gcc/x86_64-slackware-linux/9.1.0/../../../../include/c++/9.1.0/backward
 /usr/local/include
 /usr/bin/../lib64/clang/8.0.0/include
 /usr/include
End of search list.
 "/usr/bin/ld" --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o hello /usr/bin/../lib64/gcc/x86_64-slackware-linux/9.1.0/../../../../lib64/crt1.o /usr/bin/../lib64/gcc/x86_64-slackware-linux/9.1.0/../../../../lib64/crti.o /usr/bin/../lib64/gcc/x86_64-slackware-linux/9.1.0/crtbegin.o -L/usr/bin/../lib64/gcc/x86_64-slackware-linux/9.1.0 -L/usr/bin/../lib64/gcc/x86_64-slackware-linux/9.1.0/../../../../lib64 -L/usr/bin/../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/bin/../lib64/gcc/x86_64-slackware-linux/9.1.0/../../.. -L/usr/bin/../lib -L/lib -L/usr/lib /tmp/hello-603b51.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/bin/../lib64/gcc/x86_64-slackware-linux/9.1.0/crtend.o /usr/bin/../lib64/gcc/x86_64-slackware-linux/9.1.0/../../../../lib64/crtn.o
See how it includes gcc headers first.

Code:
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib64/qt/include
 /usr/bin/../lib64/gcc/x86_64-slackware-linux/9.1.0/../../../../include/c++/9.1.0
 /usr/bin/../lib64/gcc/x86_64-slackware-linux/9.1.0/../../../../include/c++/9.1.0/x86_64-slackware-linux
 /usr/bin/../lib64/gcc/x86_64-slackware-linux/9.1.0/../../../../include/c++/9.1.0/backward
 /usr/local/include
 /usr/bin/../lib64/clang/8.0.0/include
 /usr/include
End of search list.
However if I build with -stdlib=libc++ it finds the llvm headers.

Code:
$ clang++ -stdlib=libc++ hello.cpp -o hello -v 
clang version 8.0.0 (tags/RELEASE_800/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-slackware-linux/9.1.0
Found candidate GCC installation: /usr/bin/../lib64/gcc/x86_64-slackware-linux/9.1.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-slackware-linux/9.1.0
Found candidate GCC installation: /usr/lib64/gcc/x86_64-slackware-linux/9.1.0
Selected GCC installation: /usr/bin/../lib64/gcc/x86_64-slackware-linux/9.1.0
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Selected multilib: .;@m64
 "/usr/bin/clang-8" -cc1 -triple x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -discard-value-names -main-file-name hello.cpp -mrelocation-model static -mthread-model posix -mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64 -dwarf-column-info -debugger-tuning=gdb -v -resource-dir /usr/bin/../lib64/clang/8.0.0 -cxx-isystem /usr/lib64/qt/include -internal-isystem /usr/bin/../include/c++/v1 -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib64/clang/8.0.0/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -fdeprecated-macro -fdebug-compilation-dir /tmp -ferror-limit 19 -fmessage-length 82 -fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -o /tmp/hello-d0685a.o -x c++ hello.cpp -faddrsig
clang -cc1 version 8.0.0 based upon LLVM 8.0.0 default target x86_64-unknown-linux-gnu
ignoring nonexistent directory "/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib64/qt/include
 /usr/bin/../include/c++/v1
 /usr/local/include
 /usr/bin/../lib64/clang/8.0.0/include
 /usr/include
End of search list.
 "/usr/bin/ld" --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o hello /usr/bin/../lib64/gcc/x86_64-slackware-linux/9.1.0/../../../../lib64/crt1.o /usr/bin/../lib64/gcc/x86_64-slackware-linux/9.1.0/../../../../lib64/crti.o /usr/bin/../lib64/gcc/x86_64-slackware-linux/9.1.0/crtbegin.o -L/usr/bin/../lib64/gcc/x86_64-slackware-linux/9.1.0 -L/usr/bin/../lib64/gcc/x86_64-slackware-linux/9.1.0/../../../../lib64 -L/usr/bin/../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/bin/../lib64/gcc/x86_64-slackware-linux/9.1.0/../../.. -L/usr/bin/../lib -L/lib -L/usr/lib /tmp/hello-d0685a.o -lc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/bin/../lib64/gcc/x86_64-slackware-linux/9.1.0/crtend.o /usr/bin/../lib64/gcc/x86_64-slackware-linux/9.1.0/../../../../lib64/crtn.o
Code:
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib64/qt/include
 /usr/bin/../include/c++/v1
 /usr/local/include
 /usr/bin/../lib64/clang/8.0.0/include
 /usr/include
End of search list.
If I understand correctly dolphin-emu is failing without -stdlib=libc++ because of a conflict between the gcc headers and clang while when built with -stdlib=libc++ it fails later because various dependencies are not built with that compiler argument. How would someone get out of this or should I conclude that clang is not fully usable in Slackware?
 
1 members found this post helpful.
Old 05-09-2019, 12:58 AM   #3
orbea
Senior Member
 
Registered: Feb 2015
Distribution: Slackware64-current
Posts: 1,950

Original Poster
Rep: Reputation: Disabled
Following gentoo's ebuild I tried to rebuild llvm with the following.

Code:
-DCLANG_DEFAULT_CXX_STDLIB=libc++ \
-DCLANG_DEFAULT_RTLIB=compiler-rt
https://gitweb.gentoo.org/repo/gento...g-8.0.0.ebuild

This seem to have the intended effect of finding the correct includes, but now nothing links with clang so I am obviously missing something.

Code:
$ clang++ hello.cpp -o hello -v
clang version 8.0.0 (tags/RELEASE_800/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-slackware-linux/9.1.0
Found candidate GCC installation: /usr/bin/../lib64/gcc/x86_64-slackware-linux/9.1.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-slackware-linux/9.1.0
Found candidate GCC installation: /usr/lib64/gcc/x86_64-slackware-linux/9.1.0
Selected GCC installation: /usr/bin/../lib64/gcc/x86_64-slackware-linux/9.1.0
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Selected multilib: .;@m64
 "/usr/bin/clang-8" -cc1 -triple x86_64-unknown-linux-gnu -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -discard-value-names -main-file-name hello.cpp -mrelocation-model static -mthread-model posix -mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu x86-64 -dwarf-column-info -debugger-tuning=gdb -v -resource-dir /usr/bin/../lib64/clang/8.0.0 -cxx-isystem /usr/lib64/qt/include -internal-isystem /usr/bin/../include/c++/v1 -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib64/clang/8.0.0/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -fdeprecated-macro -fdebug-compilation-dir /tmp -ferror-limit 19 -fmessage-length 82 -fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option -fcolor-diagnostics -o /tmp/hello-99b552.o -x c++ hello.cpp -faddrsig
clang -cc1 version 8.0.0 based upon LLVM 8.0.0 default target x86_64-unknown-linux-gnu
ignoring nonexistent directory "/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib64/qt/include
 /usr/bin/../include/c++/v1
 /usr/local/include
 /usr/bin/../lib64/clang/8.0.0/include
 /usr/include
End of search list.
 "/usr/bin/ld" --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o hello /usr/bin/../lib64/gcc/x86_64-slackware-linux/9.1.0/../../../../lib64/crt1.o /usr/bin/../lib64/gcc/x86_64-slackware-linux/9.1.0/../../../../lib64/crti.o /usr/bin/../lib64/gcc/x86_64-slackware-linux/9.1.0/crtbegin.o -L/usr/bin/../lib64/gcc/x86_64-slackware-linux/9.1.0 -L/usr/bin/../lib64/gcc/x86_64-slackware-linux/9.1.0/../../../../lib64 -L/usr/bin/../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/bin/../lib64/gcc/x86_64-slackware-linux/9.1.0/../../.. -L/usr/bin/../lib -L/lib -L/usr/lib /tmp/hello-99b552.o -lc++ -lm /usr/bin/../lib64/clang/8.0.0/lib/linux/libclang_rt.builtins-x86_64.a -lc /usr/bin/../lib64/clang/8.0.0/lib/linux/libclang_rt.builtins-x86_64.a /usr/bin/../lib64/gcc/x86_64-slackware-linux/9.1.0/crtend.o /usr/bin/../lib64/gcc/x86_64-slackware-linux/9.1.0/../../../../lib64/crtn.o
/usr/bin/ld: /tmp/hello-99b552.o: undefined reference to symbol '_Unwind_Resume@@GCC_3.0'
/usr/bin/ld: /usr/bin/../lib64/gcc/x86_64-slackware-linux/9.1.0/../../../../lib64/../lib64/libgcc_s.so.1: error adding symbols: DSO missing from command line
clang-8: error: linker command failed with exit code 1 (use -v to see invocation)

Last edited by orbea; 05-09-2019 at 01:01 AM.
 
1 members found this post helpful.
Old 05-09-2019, 10:19 AM   #4
orbea
Senior Member
 
Registered: Feb 2015
Distribution: Slackware64-current
Posts: 1,950

Original Poster
Rep: Reputation: Disabled
I added llvm's libunwind to the llvm.SlackBuild.

http://releases.llvm.org/8.0.0/libun...0.0.src.tar.xz

And added the following configure argument.

Code:
-DLIBCXXABI_USE_LLVM_UNWINDER=ON
Now hello.cpp compiles and links. Unfortunately dolphin-emu now fails to link instead of the first issue, so I am still missing something...

Code:
/usr/bin/ld: CMakeFiles/common.dir/FileUtil.cpp.o: undefined reference to symbol '_ZNSt14basic_ifstreamIcSt11char_traitsIcEEC1ERKNSt7__cxx1112basic_stringIcS1_SaIcEEESt13_Ios_Openmode@@GLIBCXX_3.4.21'
/usr/bin/ld: /usr/lib64/libstdc++.so.6: error adding symbols: DSO missing from command line
clang-8: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [Source/Core/Common/CMakeFiles/traversal_server.dir/build.make:95: Binaries/traversal_server] Error 1
Reference: https://stackoverflow.com/questions/...ocker-image-sh
 
1 members found this post helpful.
Old 05-09-2019, 12:18 PM   #5
orbea
Senior Member
 
Registered: Feb 2015
Distribution: Slackware64-current
Posts: 1,950

Original Poster
Rep: Reputation: Disabled
Regarding the original error it seems variant is broken using clang++ with libstdc++, but not with libc++. Slackware uses the former and switching to libc++ doesn't seem practical given how many libraries would conflict.

There are already existing llvm issues for this.

https://bugs.llvm.org/show_bug.cgi?id=31852
https://bugs.llvm.org/show_bug.cgi?id=33222

Which reports it was fixed, I think in these two commits which should already be applied.

https://github.com/llvm-mirror/clang...e37368f2243edc
https://github.com/llvm-mirror/clang...087f43cd21fb27

However it clearly is not fixed...

Last edited by orbea; 05-09-2019 at 12:23 PM.
 
1 members found this post helpful.
Old 05-09-2019, 01:29 PM   #6
orbea
Senior Member
 
Registered: Feb 2015
Distribution: Slackware64-current
Posts: 1,950

Original Poster
Rep: Reputation: Disabled
I found a variant demo.

Code:
#include <variant>
#include <string>
#include <cassert>
 
int main()
{
    std::variant<int, float> v, w;
    v = 12; // v contains int
    int i = std::get<int>(v);
    w = std::get<int>(v);
    w = std::get<0>(v); // same effect as the previous line
    w = v; // same effect as the previous line
 
//  std::get<double>(v); // error: no double in [int, float]
//  std::get<3>(v);      // error: valid index values are 0 and 1
 
    try {
      std::get<float>(w); // w contains int, not float: will throw
    }
    catch (const std::bad_variant_access&) {}
 
    using namespace std::literals;
 
    std::variant<std::string> x("abc");
    // converting constructors work when unambiguous
    x = "def"; // converting assignment also works when unambiguous
 
    std::variant<std::string, void const*> y("abc");
    // casts to void const * when passed a char const *
    assert(std::holds_alternative<void const*>(y)); // succeeds
    y = "xyz"s;
    assert(std::holds_alternative<std::string>(y)); // succeeds
}
Source: https://en.cppreference.com/w/cpp/utility/variant

Compiling this g++ works.

Code:
g++ -std=c++17 test.cpp -o test -v
And it will fail with clang++.

Code:
clang++ -std=c++17 test.cpp -o test -v
However as expected it works with -stdlib=libc++.

Code:
clang++ -std=c++17 -stdlib=libc++ test.cpp -o test -v
I next started a Slackware64-current chroot which I have not updated in a while which successfully compiles the demo using clang with and without stdlib=libc++.

Code:
gcc-g++-8.2.0-x86_64-1
llvm-7.0.1-x86_64-1
 
1 members found this post helpful.
Old 05-09-2019, 05:59 PM   #7
orbea
Senior Member
 
Registered: Feb 2015
Distribution: Slackware64-current
Posts: 1,950

Original Poster
Rep: Reputation: Disabled
The issue seems like it could of started here.

https://gcc.gnu.org/viewcvs/gcc/trun...500&r2=270501&
 
1 members found this post helpful.
Old 05-09-2019, 07:11 PM   #8
orbea
Senior Member
 
Registered: Feb 2015
Distribution: Slackware64-current
Posts: 1,950

Original Poster
Rep: Reputation: Disabled
With some help in the dolphin-emu irc channel I was suggested to make this change to /usr/include/c++/9.1.0/variant.

Code:
--- variant.orig        2019-05-09 16:49:37.963890851 -0700
+++ variant     2019-05-09 16:45:56.600805688 -0700
@@ -1556,7 +1556,7 @@
 #endif
 
       template<size_t _Np, typename _Vp>
-       friend constexpr decltype(auto) __detail::__variant::__get(_Vp&& __v);
+       friend constexpr decltype(auto) __detail::__variant::__get(_Vp&& __v) noexcept;
 
       template<typename _Vp>
        friend void* __detail::__variant::__get_storage(_Vp&& __v);
And now dolphin-emu builds successfully with clang++ and works.

I did have to disable my ccache to avoid the previous linker issues from mixing libstdc++ and libc++.
 
2 members found this post helpful.
Old 05-16-2019, 09:16 AM   #9
orbea
Senior Member
 
Registered: Feb 2015
Distribution: Slackware64-current
Posts: 1,950

Original Poster
Rep: Reputation: Disabled
This is now solved in libstdc++ and current.

Fixed in: https://gcc.gnu.org/viewcvs/gcc?view...evision=271083

llvm issue report: https://bugs.llvm.org/show_bug.cgi?id=41863
gcc issue report: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90397

Code:
Thu May 16 04:55:49 UTC 2019
d/gcc-g++-9.1.0-x86_64-5.txz: Rebuilt.
       Applied patch: PR libstdc++/90397 fix std::variant friend declaration
       This fixes problems compiling programs that use std::variant with clang.

Last edited by orbea; 05-16-2019 at 09:29 AM.
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] clang compilation of simple main.c puts both clang and gcc in .comment hoes Linux - Software 2 05-03-2019 05:55 AM
Dolphin-emu: Mesa 17 radeon/amdgpu = segfault sljunkie Linux - Games 2 05-18-2017 11:58 PM
[SOLVED] Dolphin-emu cannot find -lLLVM-3.7.0 GreenFireFly Slackware 23 02-03-2016 07:25 PM
LXer: LLVM Clang 3.3, Early Clang 3.4 Benchmarks LXer Syndicated Linux News 0 06-23-2013 10:00 PM
[SOLVED] Dolphin hang and crash on KDE 4.5.1 (Slackware64-current) ack_iix Slackware 8 09-16-2010 10:05 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 11:08 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration