From d24a98c46b90220aadc69b578b97fdf4e9cbb6fa Mon Sep 17 00:00:00 2001 From: Arkadiusz Bokowy Date: Tue, 6 Aug 2024 14:35:54 +0200 Subject: [PATCH 1/3] Add support stripping all symbols from executables --- build/config/compiler/BUILD.gn | 6 +++++- build/config/compiler/compiler.gni | 3 +++ scripts/build/builders/tizen.py | 4 ++++ third_party/tizen/tizen_sdk.gni | 2 +- 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn index 93333078f6f477..1a58dbffd775ae 100644 --- a/build/config/compiler/BUILD.gn +++ b/build/config/compiler/BUILD.gn @@ -334,7 +334,11 @@ config("warnings_third_party") { } config("symbols_default") { - cflags = [ "-g${symbol_level}" ] + if (strip_symbols) { + cflags = [ "-s" ] + } else { + cflags = [ "-g${symbol_level}" ] + } } config("std_default") { diff --git a/build/config/compiler/compiler.gni b/build/config/compiler/compiler.gni index 74dc224f3ecec7..c864259ff470be 100644 --- a/build/config/compiler/compiler.gni +++ b/build/config/compiler/compiler.gni @@ -48,6 +48,9 @@ declare_args() { # enable libfuzzer is_libfuzzer = false + # Remove all symbol table and relocation information from the binary. + strip_symbols = false + # Generate code coverage analysis artifacts when enabled. use_coverage = false diff --git a/scripts/build/builders/tizen.py b/scripts/build/builders/tizen.py index 97124328c5dd1e..b9b9c59661cf74 100644 --- a/scripts/build/builders/tizen.py +++ b/scripts/build/builders/tizen.py @@ -117,6 +117,10 @@ def __init__(self, if app == TizenApp.TESTS: self.extra_gn_options.append('chip_build_tests=true') + # Tizen test driver creates ISO image with all unit test files. So, + # it uses twice as much space as regular build. Due to CI storage + # limitations, we need to strip debug symbols from executables. + self.extra_gn_options.append('strip_symbols=true') self.build_command = 'check' if not enable_ble: diff --git a/third_party/tizen/tizen_sdk.gni b/third_party/tizen/tizen_sdk.gni index ebbc8dadd077d0..7f711c693ea599 100644 --- a/third_party/tizen/tizen_sdk.gni +++ b/third_party/tizen/tizen_sdk.gni @@ -189,7 +189,7 @@ template("tizen_qemu_mkisofs") { "mkisofs", "-input-charset=default", "-VCHIP", # Volume ID = CHIP - "-JRU", # Joliet + Rock Ridge with untranslated filenames + "-JrU", # Joliet + Rock Ridge with untranslated filenames ] # Exclude files from the ISO image which might otherwise be included From 8f822110356bd5ae42ac2435989b52ab088abf90 Mon Sep 17 00:00:00 2001 From: Arkadiusz Bokowy Date: Tue, 6 Aug 2024 14:37:52 +0200 Subject: [PATCH 2/3] Compile Tizen with -fPIC and -pie --- build/config/compiler/compiler.gni | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build/config/compiler/compiler.gni b/build/config/compiler/compiler.gni index c864259ff470be..63b1840bc884d2 100644 --- a/build/config/compiler/compiler.gni +++ b/build/config/compiler/compiler.gni @@ -30,11 +30,11 @@ declare_args() { symbol_level = 2 # Enable position independent code (-fPIC). - enable_pic = - current_os == "linux" || current_os == "mac" || current_os == "android" + enable_pic = current_os == "linux" || current_os == "mac" || + current_os == "android" || current_os == "tizen" # Enable position independent executables (-pie). - enable_pie = current_os == "linux" + enable_pie = current_os == "linux" || current_os == "tizen" # Remove unwind tables from the binary to save space. exclude_unwind_tables = current_os != "android" From 1813863601a5a60bd554fec2d631c1c9be94398d Mon Sep 17 00:00:00 2001 From: Arkadiusz Bokowy Date: Tue, 6 Aug 2024 14:41:45 +0200 Subject: [PATCH 3/3] Re-enable Tizen QEMU workflow --- .github/workflows/qemu.yaml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/qemu.yaml b/.github/workflows/qemu.yaml index be2320f975beae..051af08a2893da 100644 --- a/.github/workflows/qemu.yaml +++ b/.github/workflows/qemu.yaml @@ -27,7 +27,7 @@ concurrency: env: CHIP_NO_LOG_TIMESTAMPS: true - + jobs: qemu-esp32: @@ -75,12 +75,7 @@ jobs: name: Tizen runs-on: ubuntu-latest - # NOTE: job temporarely disabled as it seems flaky. The flake does not result in usable - # logs so the current theory is that we run out of space. This is unusual as - # larger docker images succeed at bootstrap, however it needs more investigation - # to detect an exact/real root cause. - if: false - # if: github.actor != 'restyled-io[bot]' + if: github.actor != 'restyled-io[bot]' container: image: ghcr.io/project-chip/chip-build-tizen-qemu:54