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

Make MTProxy compatible with non-glibc systems #443

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

marshall-lee
Copy link

MTProxy relies on some specific glibc features that not every libc supports. So if one wants to compile it on Alpine Linux some tweaks are required. I successfully compiled MTProxy with musl libc by doing the following:

  • backtrace function is non-standard. Use libexecinfo port if it's available in the system.
  • Change lrand48_r, mrand48_r, drand48_r, rand48_r to their standard counterparts.
  • Add -fcommon option to fix the build on the latest GCC versions.

In the version 10 of GCC they changed the default from `-fcommon` to
`-fno-common`. The MTProxy object files share some global vars defined in
`common/*.c` so it's required to provide the option to the compiler.

https://www.gnu.org/software/gcc/gcc-10/changes.html
It makes it possible to compile MTProxy on Alpine Linux.
wention added a commit to wention/MTProxy that referenced this pull request Mar 11, 2022
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