From 38f7e5d6f23330e35df7f7bcde63134382bbbc33 Mon Sep 17 00:00:00 2001 From: Kenzzer <14257866+kenzzer@users.noreply.github.com> Date: Mon, 22 Sep 2025 12:19:59 +0000 Subject: [PATCH] Don't link standard C/C++ statically + patch http upload for windows --- AMBuildScript | 3 +-- patches/0006-Fix-multipart-missing-CRLF.patch | 13 +++++++++++++ third_party/Patch | 3 ++- 3 files changed, 16 insertions(+), 3 deletions(-) create mode 100644 patches/0006-Fix-multipart-missing-CRLF.patch diff --git a/AMBuildScript b/AMBuildScript index 47c1367..b5f4568 100644 --- a/AMBuildScript +++ b/AMBuildScript @@ -32,7 +32,6 @@ class AcceleratorConfig(object): self.libbreakpad_client = None self.libbreakpad = None self.libdisasm = None - self.breakpad_patch = None self.targets = [] self.target_archs = set() self.breakpad_config = dict() @@ -119,7 +118,7 @@ class AcceleratorConfig(object): '-Wno-implicit-exception-spec-mismatch' ] - cxx.postlink += ['-pthread', '-static-libstdc++', '-static-libgcc'] + cxx.postlink += ['-pthread', '-Wl,-z,noexecstack'] if builder.options.opt == '1': cxx.cflags += ['-O3'] diff --git a/patches/0006-Fix-multipart-missing-CRLF.patch b/patches/0006-Fix-multipart-missing-CRLF.patch new file mode 100644 index 0000000..8772edb --- /dev/null +++ b/patches/0006-Fix-multipart-missing-CRLF.patch @@ -0,0 +1,13 @@ +diff --git a/src/common/windows/http_upload.cc b/src/common/windows/http_upload.cc +index bd48a233..cd12a24e 100644 +--- a/src/common/windows/http_upload.cc ++++ b/src/common/windows/http_upload.cc +@@ -536,7 +536,7 @@ namespace { + return false; + } + } +- request_body->append("--" + boundary_str + "--\r\n"); ++ request_body->append("\r\n--" + boundary_str + "--\r\n"); + return true; + } + } diff --git a/third_party/Patch b/third_party/Patch index f1df2f3..5fef224 100644 --- a/third_party/Patch +++ b/third_party/Patch @@ -38,7 +38,8 @@ patches = AddFilesFromDir(os.path.join(builder.currentSourcePath, '..', 'patches "0002-Write-FUNC-records-instead-of-PUBLIC-for-ELF-symbols.patch", "0003-Support-compilation-on-VS-2015.patch", "0004-Fix-Linux-a-out-include.patch", - "0005-Add-LSS.patch" + "0005-Add-LSS.patch", + "0006-Fix-multipart-missing-CRLF.patch" ]) # Reset the breakpad directory before applying patches