amule-project / amule

'All-platform' P2P client based on eMule
1.01k stars 221 forks source link

aMule 2.3.3 fails to build with musl C-Library #341

Open ernsteiswuerfel opened 2 years ago

ernsteiswuerfel commented 2 years ago

Trying to build aMule 2.3.3 on my Gentoo musl box it errors out with MuleDebug.cpp:70:14: error: 'set_terminate' is not a member of 'std'

[...]
/usr/include/wx-3.0-gtk3/wx/string.h:4055:86: warning: implicitly-declared 'constexpr wxUniCharRef::wxUniCharRef(const wxUniCharRef&)' is deprecated [-Wdeprecated-copy]
 4055 | inline bool operator!=(const wxString& s, const wxUniCharRef& c) { return !s.IsSameAs(c); }
      |                                                                            ~~~~~~~~~~^~~
/usr/include/wx-3.0-gtk3/wx/unichar.h:224:19: note: because 'wxUniCharRef' has user-provided 'wxUniCharRef& wxUniCharRef::operator=(const wxUniCharRef&)'
  224 |     wxUniCharRef& operator=(const wxUniCharRef& c)
      |                   ^~~~~~~~
/usr/include/wx-3.0-gtk3/wx/string.h:2146:30: note:   initializing argument 1 of 'bool wxString::IsSameAs(wxUniCharRef, bool) const'
 2146 |   bool IsSameAs(wxUniCharRef c, bool compareWithCase = true) const
      |                 ~~~~~~~~~~~~~^
MuleDebug.cpp: In function 'void OnUnhandledException()':
MuleDebug.cpp:70:14: error: 'set_terminate' is not a member of 'std'
   70 |         std::set_terminate(std::abort);
      |              ^~~~~~~~~~~~~
MuleDebug.cpp: In function 'void InstallMuleExceptionHandler()':
MuleDebug.cpp:113:14: error: 'set_terminate' is not a member of 'std'
  113 |         std::set_terminate(OnUnhandledException);
      |              ^~~~~~~~~~~~~
MuleDebug.cpp: In function 'wxString get_backtrace(unsigned int)':
MuleDebug.cpp:313:33: warning: unused parameter 'n' [-Wunused-parameter]
  313 | wxString get_backtrace(unsigned n)
      |                        ~~~~~~~~~^
MuleDebug.cpp: At global scope:
MuleDebug.cpp:287:17: warning: 'wxString demangle(const wxString&)' defined but not used [-Wunused-function]
  287 | static wxString demangle(const wxString& function)
      |                 ^~~~~~~~
make[4]: *** [Makefile:536: MuleDebug.o] Error 1

Same with git HEAD. But it builds fine on my other Gentoo box with glibc C-Library.

Here is the Gentoo downstream bug report: https://bugs.gentoo.org/872263

amule-2.3.3:20220921-215952.log config.log

minnyres commented 2 years ago

This will happen for GCC 11 or later. Try this patch: https://github.com/minnyres/amule-win32/blob/main/patches/amule-fix-exception.patch

ernsteiswuerfel commented 2 years ago

This will happen for GCC 11 or later. Try this patch: https://github.com/minnyres/amule-win32/blob/main/patches/amule-fix-exception.patch

Thanks! With this patch 2.3.3 and HEAD build fine.

If it's a general GCC>=11 problem I guess the patch will be merged in git-master?

minnyres commented 2 years ago

If it's a general GCC>=11 problem I guess the patch will be merged in git-master?

Yes I think it will be merged in git-master one day, but this project is not under active development recently since the maintainers have their own life.