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 builds with musl on glibc systems possible #3263

Merged
merged 2 commits into from
Aug 1, 2019

Conversation

dipinhora
Copy link
Contributor

Prior to this commit building with a toolchain based on musl
in a glibc distribution (like ubuntu) would result in an error.
For these environments execinfo.h is not available because
musl doesn't include it and these distributions don't package
libexecinfo resulting in an error.

This commit changes things to allow the builds to succeed by
ensuring that the socket.c includes are only used if the
__GLIBC__ macro is defined. It also updates ponyassert.c to
work around the lack of execinfo.h by ifdef'ing out the
call to backtrace resulting in a binary that compiles but is
not able to print a stacktrace on an assertion.

Prior to this commit building with a toolchain based on `musl`
in a `glibc` distribution (like ubuntu) would result in an error.
For these environments `execinfo.h` is not available because
`musl` doesn't include it and these distributions don't package
`libexecinfo` resulting in an error.

This commit changes things to allow the builds to succeed by
ensuring that the `socket.c` includes are only used if the
`__GLIBC__` macro is defined. It also updates `ponyassert.c` to
work around the lack of `execinfo.h` by `ifdef`'ing out the
call to `backtrace` resulting in a binary that compiles but is
not able to print a stacktrace on an assertion.
@@ -55,7 +58,9 @@ void ponyint_assert_fail(const char* expr, const char* file, size_t line,
"imprecise or incorrect.\nUse a debug version to get more meaningful "
"information.\n", stderr);
}

#else
fputs("Backtrace functionality not available.\n", stderr);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only bit I'm not sure about. Do we want this message?

Marking as "Needs discussion during sync" to get others input. Otherwise this looks good to me.

@SeanTAllen
Copy link
Member

I feel like this one should have a CHANGELOG entry.

@jemc any objection to a changelog entry for this?

@SeanTAllen
Copy link
Member

@dipinhora can you add a CHANGELOG entry and then we can merge.

@dipinhora
Copy link
Contributor Author

done

@SeanTAllen
Copy link
Member

Thanks @dipinhora!

@SeanTAllen SeanTAllen merged commit 0181d10 into ponylang:master Aug 1, 2019
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