Skip to content

Commit

Permalink
Support building on Alpine Linux musl
Browse files Browse the repository at this point in the history
- fix issue with NULL_BACKTRACE support (there was a typo)
- support building without libexecinfo (Alpine doesn't have it)
- support linux-musl OSTYPE
  • Loading branch information
lhotari committed Dec 18, 2024
1 parent cbdfba0 commit 0c4a08c
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion aws/utils/backtrace/bsd_backtrace.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@

#include "backtrace.h"
#include <aws/utils/writer_methods.h>
#include <execinfo.h>
#include <unistd.h>

#ifdef BSD_BACKTRACE
#include <execinfo.h>
namespace aws {
namespace utils {
namespace backtrace {
Expand Down
3 changes: 1 addition & 2 deletions aws/utils/backtrace/gcc_backtrace.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,14 @@

#include "backtrace.h"
#include <aws/utils/writer_methods.h>
#include <execinfo.h>
#include <unistd.h>
#include <aws/utils/logging.h>
#include <aws/utils/writer_methods.h>
#include <cstring>
#include <cstdio>

#ifdef LIB_BACKTRACE

#include <execinfo.h>
#include <backtrace.h>

namespace {
Expand Down
6 changes: 3 additions & 3 deletions aws/utils/backtrace/null_backtrace.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@

#include "backtrace.h"
#include <aws/utils/writer_methods.h>
#include <execinfo.h>
#include <unistd.h>

#ifdef NULL_STACKTRACE
#ifdef NULL_BACKTRACE
#include <execinfo.h>

namespace aws {
namespace utils {
Expand All @@ -36,4 +36,4 @@ void stack_trace_for_signal(int skip, bool /*signaled*/) {
}
}

#endif // NULL_STACKTRACE
#endif // NULL_BACKTRACE
1 change: 0 additions & 1 deletion aws/utils/signal_handler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#include "backtrace/backtrace.h"

#include <signal.h>
#include <execinfo.h>
#include <unistd.h>
#include <cstring>
#include <cstdint>
Expand Down
3 changes: 3 additions & 0 deletions bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ function find_release_type() {
if [[ $OSTYPE == "linux-gnu" ]]; then
echo "linux-$(uname -m)"
return
elif [[ $OSTYPE == "linux-musl" ]]; then
echo "linux-musl-$(uname -m)"
return
elif [[ $OSTYPE == darwin* ]]; then
echo "osx"
return
Expand Down

0 comments on commit 0c4a08c

Please sign in to comment.