Pseudabo 32 Posted April 29, 2023 Share Posted April 29, 2023 (edited) Hi, any idea? GCC12 + c++20 (newest) CryptoPP 8.7 (newest) FreeBSD 13 (newest) I maybe forgot some lib in makefile, or something, but idk I dont found what can be bad.. CryptoPP is installed and compiled from github repo. Linking: ../../bin/release/game /usr/local/bin/ld: ../../../Extern/lib/libcryptopp.a(asn.o): undefined reference to symbol '_ZNSt3__115basic_streambufIcNS_11char_traitsIcEEED2Ev' /usr/local/bin/ld: /usr/lib/libc++.so.1: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status gmake: *** [Makefile:102: ../../bin/release/game] Error 1 Edited April 29, 2023 by Pseudabo Link to comment Share on other sites More sharing options...
Premium Intel 757 Posted April 29, 2023 Premium Share Posted April 29, 2023 (edited) When compiling cryptopp you need to use gcc/g++ (same compiler used for the game/db). It probably compiled it with clang. You can edit the GNUmakefile and set CXX and CC: ########################################################### ##### System Attributes and Programs ##### ########################################################### CXX = g++ CC = gcc # https://www.gnu.org/software/make/manual/make.html#Makefile-Conventions # and https://www.gnu.org/prep/standards/standards.html SHELL = /bin/sh rest of the file Edited April 29, 2023 by Intel Link to comment Share on other sites More sharing options...
Pseudabo 32 Posted April 29, 2023 Author Share Posted April 29, 2023 Ok, thanks mate, I found problem.. Because I didnt sleep 40 hours.. I made a mistake.. I linked cryptopp 2x in makefile from different directories.. (have 3.. yeah good rubish.. xd) and still compile oldest version.. Now I repair all mistakes and make one newest + add mv lib to new directory from cryptopp, but have same problem as 10000 peoples.. Cryptopp 8.7 doesnt work properly with gcc12. HOW SAD. Link to comment Share on other sites More sharing options...
Premium Intel 757 Posted April 29, 2023 Premium Share Posted April 29, 2023 (edited) Wym it doesn't work? I've heard about this, but I've tried 32 and 64bit on FreeBSD 13.0 and GCC12.2 and I got no problem. The only problems I had with crypto were in Ubuntu 64bit lmao Meanwhile Ubuntu sadge: Edited April 29, 2023 by Metin2 Dev International Core X - External 2 Internal Link to comment Share on other sites More sharing options...
Pseudabo 32 Posted April 29, 2023 Author Share Posted April 29, 2023 (edited) As I search on google, this bug has many peoples of the world and official is here bug, but developers idk where.. gcm.cpp: In member function 'size_t CryptoPP::GCM_Base::_ZN8CryptoPP8GCM_Base18AuthenticateBlocksEPKhj.part.0(const CryptoPP::byte*, size_t)': gcm.cpp:566:13: error: the register '%xmm5' cannot be clobbered in 'asm' for the current target 566 | __asm__ __volatile__ | Btw. freebsd is last clean install, same as all packages.. (35hours old installation) I trying now downgrade to 8.6 and we see if this solve problems.. Which packages you have installed on freebsd, where cryptopp 8.7 works for u? I have only: boost 1.8.1 mysql-5.6 makedepend make lzo-2.10 gcc12 devil-1.8 cryptopp-8.7 bsd is x86 (from minimal bootonly) Edit: Ok cryptopp 8.6 without problem under gcc12 ranlib libcryptopp.a mv libcryptopp.a ../../lib root@server:/usr/home/m2source/Extern/include/cryptopp # Going to try game now.. Edited April 29, 2023 by Pseudabo Link to comment Share on other sites More sharing options...
Premium Intel 757 Posted April 29, 2023 Premium Share Posted April 29, 2023 (edited) 25 minutes ago, Pseudabo said: As I search on google, this bug has many peoples of the world and official is here bug, but developers idk where.. gcm.cpp: In member function 'size_t CryptoPP::GCM_Base::_ZN8CryptoPP8GCM_Base18AuthenticateBlocksEPKhj.part.0(const CryptoPP::byte*, size_t)': gcm.cpp:566:13: error: the register '%xmm5' cannot be clobbered in 'asm' for the current target 566 | __asm__ __volatile__ | Mmh, I cannot find anything about this, the only thing I could find was this: Quote We removed GCC 12 from the supported compilers list. We believe it has a bug that is causing the validation suite to crash. See Issue 1134, Issue 1141 and GCC Issue 106568 for some of the discussion. The crash is present with GCC 12 at -O2 or higher, and happens around the ECGDSA test suite. The crash is not present in GCC 12 at -O1 or -Os. The crash is not present in other compilers like Clang and MSVC. The crash was not present in earlier versions of GCC. Tools like Asan, UBsan and Valgirnd do not show a problem. -DCRYPTOPP_DISABLE_ASM and -fno-lto do not affect the problem. We do not have a minimal reproducer, so tracking down the crash is problematic. We also cannot report it to the GCC folks without a reproducer. The current workaround is to build the library at -O1 or -Os. CryptoPP 8.7.0 to me is not crashing, at least in the metin2 implementation (except Ubuntu22.04, all tests passes but idk wtf happens with the packet encryption, even -O2, -O1 or older version. Ubuntu even uses gcc11, not 12). It also definitely compiles gcm.cpp: or the whole library for that matter: Edited April 29, 2023 by Metin2 Dev International Core X - External 2 Internal Link to comment Share on other sites More sharing options...
Pseudabo 32 Posted April 29, 2023 Author Share Posted April 29, 2023 14 minutes ago, Intel said: Mmh, I cannot find anything about this, the only thing I could find was this: CryptoPP 8.7.0 to me is not crashing, at least in the metin2 implementation (except Ubuntu22.04, all tests passes but idk wtf happens with the packet encryption, even -O2, -O1 or older version. Ubuntu even uses gcc11, not 12). It also definitely compiles gcm.cpp: or the whole library for that matter: I try found something more about it + maybe is not bad idea try to compile under 64bit with jail.. Now have this error with cryptopp 8.6 Linking: ../../bin/release/game /usr/local/bin/ld: release/cipher.o:(.rodata._ZTVN8CryptoPP16BlockCipherFinalILNS_9CipherDirE0ENS_7SHACAL23EncEEE[_ZTVN8CryptoPP16BlockCipherFinalILNS_9CipherDirE0ENS_7SHACAL23EncEEE]+0x50): undefined reference to `CryptoPP::SHACAL2::Base::AlgorithmProvider[abi:cxx11]() const' /usr/local/bin/ld: release/cipher.o:(.rodata._ZTVN8CryptoPP16BlockCipherFinalILNS_9CipherDirE0ENS_7SHACAL23EncEEE[_ZTVN8CryptoPP16BlockCipherFinalILNS_9CipherDirE0ENS_7SHACAL23EncEEE]+0x78): undefined reference to `non-virtual thunk to CryptoPP::SHACAL2::Base::AlgorithmProvider[abi:cxx11]() const' /usr/local/bin/ld: release/cipher.o:(.rodata._ZTVN8CryptoPP36CipherModeFinalTemplate_CipherHolderINS_16BlockCipherFinalILNS_9CipherDirE0ENS_7SHACAL23EncEEENS_20ConcretePolicyHolderINS_5EmptyENS_22AdditiveCipherTemplateINS_20AbstractPolicyHolderINS_28AdditiveCipherAbstractPolicyENS_14CTR_ModePolicyEEEEESA_EEEE[_ZTVN8CryptoPP36CipherModeFinalTemplate_CipherHolderINS_16BlockCipherFinalILNS_9CipherDirE0ENS_7SHACAL23EncEEENS_20ConcretePolicyHolderINS_5EmptyENS_22AdditiveCipherTemplateINS_20AbstractPolicyHolderINS_28AdditiveCipherAbstractPolicyENS_14CTR_ModePolicyEEEEESA_EEEE]+0x16c): undefined reference to `CryptoPP::RandomNumberGenerator::GenerateIntoBufferedTransformation(CryptoPP::BufferedTransformation&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned long long)' /usr/local/bin/ld: release/cipher.o:(.rodata._ZTVN8CryptoPP36CipherModeFinalTemplate_CipherHolderINS_16BlockCipherFinalILNS_9CipherDirE0ENS_3TEA3EncEEENS_20ConcretePolicyHolderINS_5EmptyENS_22AdditiveCipherTemplateINS_20AbstractPolicyHolderINS_28AdditiveCipherAbstractPolicyENS_14CTR_ModePolicyEEEEESA_EEEE[_ZTVN8CryptoPP36CipherModeFinalTemplate_CipherHolderINS_16BlockCipherFinalILNS_9CipherDirE0ENS_3TEA3EncEEENS_20ConcretePolicyHolderINS_5EmptyENS_22AdditiveCipherTemplateINS_20AbstractPolicyHolderINS_28AdditiveCipherAbstractPolicyENS_14CTR_ModePolicyEEEEESA_EEEE]+0x16c): undefined reference to `CryptoPP::RandomNumberGenerator::GenerateIntoBufferedTransformation(CryptoPP::BufferedTransformation&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned long long)' /usr/local/bin/ld: release/cipher.o:(.rodata._ZTVN8CryptoPP36CipherModeFinalTemplate_CipherHolderINS_16BlockCipherFinalILNS_9CipherDirE0ENS_8Blowfish4BaseEEENS_20ConcretePolicyHolderINS_5EmptyENS_22AdditiveCipherTemplateINS_20AbstractPolicyHolderINS_28AdditiveCipherAbstractPolicyENS_14CTR_ModePolicyEEEEESA_EEEE[_ZTVN8CryptoPP36CipherModeFinalTemplate_CipherHolderINS_16BlockCipherFinalILNS_9CipherDirE0ENS_8Blowfish4BaseEEENS_20ConcretePolicyHolderINS_5EmptyENS_22AdditiveCipherTemplateINS_20AbstractPolicyHolderINS_28AdditiveCipherAbstractPolicyENS_14CTR_ModePolicyEEEEESA_EEEE]+0x16c): undefined reference to `CryptoPP::RandomNumberGenerator::GenerateIntoBufferedTransformation(CryptoPP::BufferedTransformation&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned long long)' /usr/local/bin/ld: release/cipher.o:(.rodata._ZTVN8CryptoPP36CipherModeFinalTemplate_CipherHolderINS_16BlockCipherFinalILNS_9CipherDirE0ENS_3RC53EncEEENS_20ConcretePolicyHolderINS_5EmptyENS_22AdditiveCipherTemplateINS_20AbstractPolicyHolderINS_28AdditiveCipherAbstractPolicyENS_14CTR_ModePolicyEEEEESA_EEEE[_ZTVN8CryptoPP36CipherModeFinalTemplate_CipherHolderINS_16BlockCipherFinalILNS_9CipherDirE0ENS_3RC53EncEEENS_20ConcretePolicyHolderINS_5EmptyENS_22AdditiveCipherTemplateINS_20AbstractPolicyHolderINS_28AdditiveCipherAbstractPolicyENS_14CTR_ModePolicyEEEEESA_EEEE]+0x16c): undefined reference to `CryptoPP::RandomNumberGenerator::GenerateIntoBufferedTransformation(CryptoPP::BufferedTransformation&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned long long)' /usr/local/bin/ld: release/cipher.o:(.rodata._ZTVN8CryptoPP36CipherModeFinalTemplate_CipherHolderINS_16BlockCipherFinalILNS_9CipherDirE0ENS_4SEED4BaseEEENS_20ConcretePolicyHolderINS_5EmptyENS_22AdditiveCipherTemplateINS_20AbstractPolicyHolderINS_28AdditiveCipherAbstractPolicyENS_14CTR_ModePolicyEEEEESA_EEEE[_ZTVN8CryptoPP36CipherModeFinalTemplate_CipherHolderINS_16BlockCipherFinalILNS_9CipherDirE0ENS_4SEED4BaseEEENS_20ConcretePolicyHolderINS_5EmptyENS_22AdditiveCipherTemplateINS_20AbstractPolicyHolderINS_28AdditiveCipherAbstractPolicyENS_14CTR_ModePolicyEEEEESA_EEEE]+0x16c): undefined reference to `CryptoPP::RandomNumberGenerator::GenerateIntoBufferedTransformation(CryptoPP::BufferedTransformation&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned long long)' /usr/local/bin/ld: release/cipher.o:(.rodata._ZTVN8CryptoPP36CipherModeFinalTemplate_CipherHolderINS_16BlockCipherFinalILNS_9CipherDirE0ENS_8Camellia4BaseEEENS_20ConcretePolicyHolderINS_5EmptyENS_22AdditiveCipherTemplateINS_20AbstractPolicyHolderINS_28AdditiveCipherAbstractPolicyENS_14CTR_ModePolicyEEEEESA_EEEE[_ZTVN8CryptoPP36CipherModeFinalTemplate_CipherHolderINS_16BlockCipherFinalILNS_9CipherDirE0ENS_8Camellia4BaseEEENS_20ConcretePolicyHolderINS_5EmptyENS_22AdditiveCipherTemplateINS_20AbstractPolicyHolderINS_28AdditiveCipherAbstractPolicyENS_14CTR_ModePolicyEEEEESA_EEEE]+0x16c): more undefined references to `CryptoPP::RandomNumberGenerator::GenerateIntoBufferedTransformation(CryptoPP::BufferedTransformation&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned long long)' follow /usr/local/bin/ld: release/cipher.o:(.rodata._ZTVN8CryptoPP20ConcretePolicyHolderINS_5EmptyENS_22AdditiveCipherTemplateINS_20AbstractPolicyHolderINS_28AdditiveCipherAbstractPolicyENS_14CTR_ModePolicyEEEEES4_EE[_ZTVN8CryptoPP20ConcretePolicyHolderINS_5EmptyENS_22AdditiveCipherTemplateINS_20AbstractPolicyHolderINS_28AdditiveCipherAbstractPolicyENS_14CTR_ModePolicyEEEEES4_EE]+0x48): undefined reference to `CryptoPP::AdditiveCipherTemplate<CryptoPP::AbstractPolicyHolder<CryptoPP::AdditiveCipherAbstractPolicy, CryptoPP::CTR_ModePolicy> >::AlgorithmProvider[abi:cxx11]() const' /usr/local/bin/ld: release/cipher.o:(.rodata._ZTVN8CryptoPP20ConcretePolicyHolderINS_5EmptyENS_22AdditiveCipherTemplateINS_20AbstractPolicyHolderINS_28AdditiveCipherAbstractPolicyENS_14CTR_ModePolicyEEEEES4_EE[_ZTVN8CryptoPP20ConcretePolicyHolderINS_5EmptyENS_22AdditiveCipherTemplateINS_20AbstractPolicyHolderINS_28AdditiveCipherAbstractPolicyENS_14CTR_ModePolicyEEEEES4_EE]+0xc0): undefined reference to `non-virtual thunk to CryptoPP::AdditiveCipherTemplate<CryptoPP::AbstractPolicyHolder<CryptoPP::AdditiveCipherAbstractPolicy, CryptoPP::CTR_ModePolicy> >::AlgorithmProvider[abi:cxx11]() const' /usr/local/bin/ld: release/cipher.o:(.rodata._ZTVN8CryptoPP20ConcretePolicyHolderINS_5EmptyENS_22AdditiveCipherTemplateINS_20AbstractPolicyHolderINS_28AdditiveCipherAbstractPolicyENS_14CTR_ModePolicyEEEEES4_EE[_ZTVN8CryptoPP20ConcretePolicyHolderINS_5EmptyENS_22AdditiveCipherTemplateINS_20AbstractPolicyHolderINS_28AdditiveCipherAbstractPolicyENS_14CTR_ModePolicyEEEEES4_EE]+0x130): undefined reference to `non-virtual thunk to CryptoPP::AdditiveCipherTemplate<CryptoPP::AbstractPolicyHolder<CryptoPP::AdditiveCipherAbstractPolicy, CryptoPP::CTR_ModePolicy> >::AlgorithmProvider[abi:cxx11]() const' /usr/local/bin/ld: release/cipher.o:(.rodata._ZTVN8CryptoPP20ConcretePolicyHolderINS_5EmptyENS_22AdditiveCipherTemplateINS_20AbstractPolicyHolderINS_28AdditiveCipherAbstractPolicyENS_14CTR_ModePolicyEEEEES4_EE[_ZTVN8CryptoPP20ConcretePolicyHolderINS_5EmptyENS_22AdditiveCipherTemplateINS_20AbstractPolicyHolderINS_28AdditiveCipherAbstractPolicyENS_14CTR_ModePolicyEEEEES4_EE]+0x14c): undefined reference to `non-virtual thunk to CryptoPP::AdditiveCipherTemplate<CryptoPP::AbstractPolicyHolder<CryptoPP::AdditiveCipherAbstractPolicy, CryptoPP::CTR_ModePolicy> >::AlgorithmProvider[abi:cxx11]() const' /usr/local/bin/ld: release/cipher.o:(.rodata._ZTVN8CryptoPP20ConcretePolicyHolderINS_5EmptyENS_22AdditiveCipherTemplateINS_20AbstractPolicyHolderINS_28AdditiveCipherAbstractPolicyENS_14CTR_ModePolicyEEEEES4_EE[_ZTVN8CryptoPP20ConcretePolicyHolderINS_5EmptyENS_22AdditiveCipherTemplateINS_20AbstractPolicyHolderINS_28AdditiveCipherAbstractPolicyENS_14CTR_ModePolicyEEEEES4_EE]+0x168): undefined reference to `CryptoPP::RandomNumberGenerator::GenerateIntoBufferedTransformation(CryptoPP::BufferedTransformation&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned long long)' /usr/local/bin/ld: release/cipher.o:(.rodata._ZTVN8CryptoPP20AutoSeededRandomPoolE[_ZTVN8CryptoPP20AutoSeededRandomPoolE]+0x34): undefined reference to `CryptoPP::RandomPool::GenerateIntoBufferedTransformation(CryptoPP::BufferedTransformation&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, unsigned long long)' /usr/local/bin/ld: /usr/local/lib/gcc12/gcc/i386-portbld-freebsd13.1/12.2.0/../../../libstdc++.so: undefined reference to `__divmoddi4@GCC_7.0.0' collect2: error: ld returned 1 exit status gmake: *** [Makefile:108: ../../bin/release/game] Error 1 root@server:/usr/home/m2source/Server/game/src # Link to comment Share on other sites More sharing options...
Premium Intel 757 Posted April 29, 2023 Premium Share Posted April 29, 2023 (edited) All these basic strings errors remind me to the same problem I already mentioned: compiling one thing with clang/++ and the other with gcc/++. There's a similar issue for example with the fmt library. A simple program: //myprogram.cpp #include <fmt/core.h> int main() { fmt::print("Hello, world!\n"); return 0; } would have linker errors related to std::__cxx11::basic_string if you compile fmt with clang and then do: g++ -lfmt myprogram.cpp Edited April 29, 2023 by Intel Link to comment Share on other sites More sharing options...
Pseudabo 32 Posted April 29, 2023 Author Share Posted April 29, 2023 19 minutes ago, Intel said: All these basic strings errors remind me to the same problem I already mentioned: compiling one thing with clang/++ and the other with gcc/++. There's a similar issue for example with the fmt library. A simple program: //myprogram.cpp #include <fmt/core.h> int main() { fmt::print("Hello, world!\n"); return 0; } would have linker errors related to std::__cxx11::basic_string if you compile fmt with clang and then do: g++ -lfmt myprogram.cpp I deleted package of cryptopp and have now only from extern and finally have only this problem: Linking: ../../bin/release/game /usr/local/bin/ld: /usr/local/lib/gcc12/gcc/i386-portbld-freebsd13.1/12.2.0/../../../libstdc++.so: undefined reference to `__divmoddi4@GCC_7.0.0' collect2: error: ld returned 1 exit status gmake: *** [Makefile:108: ../../bin/release/game] Error 1 root@server:/usr/home/m2source/Server/game/src # Yea fmt, can be.. I will try recompile fmt with newest gcc (maybe is compiled with oldest gcc..) Link to comment Share on other sites More sharing options...
Premium Intel 757 Posted April 29, 2023 Premium Share Posted April 29, 2023 (edited) fmt was an example (it's not used on metin2 server files). Try to clean all and recompile Edited April 29, 2023 by Intel Link to comment Share on other sites More sharing options...
Pseudabo 32 Posted April 29, 2023 Author Share Posted April 29, 2023 (edited) 14 minutes ago, Intel said: fmt was an example (it's not used on metin2 server files). Try to clean all and recompile No, you are right, I using fmt in my source.. +1 for you Edit: Yeeep finally SOLVED! Thank you so much for help! But Im not glad with that cryptopp 8.7 I try to other platforms, maybe found something.. gcc12 c++20 Boost 1.81.0 (can be removed from source) DevIL 1.8.0 (fix with mark already exist) CryptoPP 8.6 Works like a charm, so if anyone upgrading source, ill can use these versions. Edited April 29, 2023 by Pseudabo Link to comment Share on other sites More sharing options...
Premium Intel 757 Posted April 29, 2023 Premium Share Posted April 29, 2023 (edited) 1 hour ago, Pseudabo said: No, you are right, I using fmt in my source.. +1 for you Edit: Yeeep finally SOLVED! Thank you so much for help! But Im not glad with that cryptopp 8.7 I try to other platforms, maybe found something.. gcc12 c++20 Boost 1.81.0 (can be removed from source) DevIL 1.8.0 (fix with mark already exist) CryptoPP 8.6 Works like a charm, so if anyone upgrading source, ill can use these versions. Oh, you were using fmt? Well then ahah Boost can be removed yeah, although I still use it: Btw gcc13 has been released, don't know when it will be officially available on freebsd pkg manager though Edited April 29, 2023 by Metin2 Dev International Core X - External 2 Internal Link to comment Share on other sites More sharing options...
Pseudabo 32 Posted April 29, 2023 Author Share Posted April 29, 2023 1 hour ago, Intel said: Oh, you were using fmt? Well then ahah Boost can be removed yeah, although I still use it: Btw gcc13 has been released, don't know when it will be officially available on freebsd pkg manager though Yeah too using boost, I said it only for info if anyone read this topic.. We will see if gcc13 fix cryptopp or not.. Btw. c++23 will be too out in december Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now