Skip to content

Commit

Permalink
update patches for 3.13
Browse files Browse the repository at this point in the history
Fix -ggdb debug symbols patch for 3.13.
Add linux sysroot for macos patch.
  • Loading branch information
ardera committed Aug 19, 2023
1 parent 901c96f commit c8132dd
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 18 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -417,8 +417,9 @@ jobs:

# use git apply instead of git am to avoid `Committer identity unknown` error
run: |
git apply $GITHUB_WORKSPACE/0001-fix-armv7-build-make-arm64-tune-work.patch
git apply $GITHUB_WORKSPACE/0002-always-include-debug-symbols.patch
git apply $GITHUB_WORKSPACE/0001-allow-downloading-linux-sysroot-on-darwin.patch
git apply $GITHUB_WORKSPACE/0002-fix-armv7-build-make-arm64-tune-work.patch
git apply $GITHUB_WORKSPACE/0003-always-include-debug-symbols.patch
- name: Show git status
working-directory: engine/src
Expand Down
25 changes: 25 additions & 0 deletions 0001-allow-downloading-linux-sysroot-on-darwin.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
From d03cd38f90e0e4cbc4a37cbfeb34c65ed3ddeefe Mon Sep 17 00:00:00 2001
From: Hannes Winkler <hanneswinkler2000@web.de>
Date: Mon, 27 Mar 2023 12:42:17 +0200
Subject: [PATCH 1/3] allow downloading linux sysroot on darwin

---
build/linux/sysroot_scripts/install-sysroot.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/build/linux/sysroot_scripts/install-sysroot.py b/build/linux/sysroot_scripts/install-sysroot.py
index d3e7664..6dfbe42 100755
--- a/build/linux/sysroot_scripts/install-sysroot.py
+++ b/build/linux/sysroot_scripts/install-sysroot.py
@@ -77,7 +77,7 @@ def main(args):
parser.add_option('--print-hash',
help='Print the hash of the sysroot for the given arch.')
options, _ = parser.parse_args(args)
- if not sys.platform.startswith('linux'):
+ if not (sys.platform.startswith('linux') or sys.platform.startswith('darwin')):
return 0

if options.print_hash:
--
2.39.2

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 66d13274d3e0214a334a89c317ca91767c874131 Mon Sep 17 00:00:00 2001
From 44c7f560828270e9944b806f55a2de15b4d5b710 Mon Sep 17 00:00:00 2001
From: Hannes Winkler <hanneswinkler2000@web.de>
Date: Wed, 11 Aug 2021 02:21:25 +0200
Subject: [PATCH 1/2] fix armv7 build - make arm64 tune work
Subject: [PATCH 2/3] fix armv7 build - make arm64 tune work

---
build/config/arm.gni | 27 +++-------
Expand Down Expand Up @@ -57,19 +57,19 @@ index 7a293e6..1c6ff69 100644
arm_float_abi = "softfp"
}
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
index 4c9a1ee..d136413 100644
index 148c97e..cd2e662 100644
--- a/build/config/compiler/BUILD.gn
+++ b/build/config/compiler/BUILD.gn
@@ -3,7 +3,7 @@
# found in the LICENSE file.
@@ -4,7 +4,7 @@

import("//build/config/android/config.gni")
import("//build/toolchain/wasm.gni")
-if (current_cpu == "arm") {
+if (current_cpu == "arm" || current_cpu == "arm64") {
import("//build/config/arm.gni")
}
if (is_posix) {
@@ -207,33 +207,78 @@ config("compiler") {
@@ -211,33 +211,78 @@ config("compiler") {
]
}
} else if (current_cpu == "arm") {
Expand Down Expand Up @@ -193,4 +193,5 @@ index 7987e51..2c225a0 100644
exec_script("//build/dir_exists.py", [ sysroot ], "string") == "True",
"Missing sysroot ($sysroot). To fix, run: build/linux/sysroot_scripts/install-sysroot.py --arch=$current_cpu")
--
2.25.1
2.39.2

Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
From c8afa410df725d2f0e2493fc0c24724a0d060671 Mon Sep 17 00:00:00 2001
From ab2a5fd6b3b2384fa7ec975c1b1b4754eb540d47 Mon Sep 17 00:00:00 2001
From: Hannes Winkler <hanneswinkler2000@web.de>
Date: Thu, 22 Jun 2023 16:30:00 +0000
Subject: [PATCH 2/2] always include debug symbols - always build with `-ggdb
-fdebug-default-version=4` by default. - symbols are stripped later anyway
and they're still useful for debugging.
Subject: [PATCH 3/3] always include debug symbols

Always build with `-ggdb -fdebug-default-version=4` by default.
Symbols are stripped later anyway and they're still useful for debugging.
---
build/config/compiler/BUILD.gn | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
index d136413..59b0243 100644
index cd2e662..cce2c1a 100644
--- a/build/config/compiler/BUILD.gn
+++ b/build/config/compiler/BUILD.gn
@@ -996,7 +996,7 @@ config("symbols") {
@@ -1015,7 +1015,7 @@ config("symbols") {
ldflags = [ "-gsource-map"]
}
ldflags = [ "/DEBUG" ]
} else {
- cflags = [ "-g2" ]
+ cflags = [ "-ggdb", "-fdebug-default-version=4" ]
}
}

@@ -1005,12 +1005,12 @@ config("minimal_symbols") {
@@ -1024,12 +1024,12 @@ config("minimal_symbols") {
# Linker symbols for backtraces only.
ldflags = [ "/DEBUG" ]
} else {
Expand All @@ -38,4 +38,5 @@ index d136413..59b0243 100644
}
}
--
2.25.1
2.39.2

0 comments on commit c8132dd

Please sign in to comment.