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

Crashpad linux mipsel support #479

Merged
merged 2 commits into from
Dec 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions scripts/build-crashpad.sh
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ cd crashpad
fetch --nohistory crashpad || true
cd crashpad
git checkout -f 5613499bbda780dfa663344ea6253844e82c88c4
git reset --hard
gclient sync -f

# patch stage
Expand All @@ -121,6 +122,8 @@ esac

cp -f ../../../scripts/mini_chromium.BUILD.gn third_party/mini_chromium/mini_chromium/build/config/BUILD.gn
$sed 's|__hlt(0)|asm volatile("hlt #0")|g' third_party/mini_chromium/mini_chromium/base/logging.cc
patch -p1 < ../../../scripts/crashpad_mips.patch

# build stage
rm -rf "$out"
mkdir -p "$out"
Expand Down
28 changes: 28 additions & 0 deletions scripts/crashpad_mips.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
diff --git a/snapshot/linux/cpu_context_linux.h b/snapshot/linux/cpu_context_linux.h
index 507d1b44..d901ef9d 100644
--- a/snapshot/linux/cpu_context_linux.h
+++ b/snapshot/linux/cpu_context_linux.h
@@ -20,6 +20,8 @@
#include "snapshot/linux/signal_context.h"
#include "util/linux/thread_info.h"

+#include <string.h>
+
namespace crashpad {
namespace internal {

diff --git a/util/net/http_transport_libcurl.cc b/util/net/http_transport_libcurl.cc
index df63a772..0d2abfa3 100644
--- a/util/net/http_transport_libcurl.cc
+++ b/util/net/http_transport_libcurl.cc
@@ -239,6 +239,10 @@ std::string UserAgent() {
#endif
#elif defined (ARCH_CPU_RISCV64)
static constexpr char arch[] = "riscv64";
+#elif defined (ARCH_CPU_MIPSEL)
+ static constexpr char arch[] = "mipsel";
+#elif defined (ARCH_CPU_MIPS64EL)
+ static constexpr char arch[] = "mips64el";
#else
#error Port
#endif
6 changes: 6 additions & 0 deletions scripts/mini_chromium.BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,12 @@ config("default") {
common_flags += [ "-m64" ]
} else if (current_cpu == "arm64") {
common_flags += [ "--target=aarch64-linux-gnu" ]
} else if (current_cpu == "armhf") {
common_flags += [ "--target=arm-linux-gnueabihf" ]
} else if (current_cpu == "mipsel") {
common_flags += [ "--target=mipsel-linux-gnu" ]
} else if (current_cpu == "mips64el") {
common_flags += [ "--target=mips64el-linux-gnuabi64" ]
} else if (current_cpu == "riscv64") {
common_flags += [ "--target=riscv64-linux-gnu" ]
} else {
Expand Down
2 changes: 1 addition & 1 deletion third_party/libc++/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ foreach(CompilerFlag ${CompilerFlags})
string(REPLACE "-stdlib=libc++" "" ${CompilerFlag} "${${CompilerFlag}}")
endforeach()

set(libcxx_CR "84fb809dd6dae36d556dc0bb702c6cc2ce9d4b80")
set(libcxx_CR "dba32e9eac193da3ced542421017c5a0de5ef1f6")
# Fixed libc++ configuration macros are in
# buildtools/third_party/libc++/__config_site. This config only has defines
# that vary depending on gn args, and non-define flags.
Expand Down
2 changes: 1 addition & 1 deletion third_party/libc++/trunk
Submodule trunk updated from 13c081 to dba32e
Loading