From ea980f84f9b165fb0808d187a70f1ae6969a9106 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20Romanik?= Date: Sun, 9 Apr 2023 17:26:16 +0200 Subject: [PATCH] samsung-crownlte: fix 'ld: read-only segment has dynamic relocations' kernel build error (MR 4004) [ci:skip-build]: already built successfully in CI --- ...-segment-has-dynamic-relocations-error.patch | 17 +++++++++++++++++ ...-segment-has-dynamic-relocations-error.patch | 1 + device/testing/linux-samsung-crownlte/APKBUILD | 4 +++- 3 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 device/.shared-patches/linux/fix-read-only-segment-has-dynamic-relocations-error.patch create mode 120000 device/testing/linux-samsung-crownlte/06-fix-read-only-segment-has-dynamic-relocations-error.patch diff --git a/device/.shared-patches/linux/fix-read-only-segment-has-dynamic-relocations-error.patch b/device/.shared-patches/linux/fix-read-only-segment-has-dynamic-relocations-error.patch new file mode 100644 index 000000000..6d892dc34 --- /dev/null +++ b/device/.shared-patches/linux/fix-read-only-segment-has-dynamic-relocations-error.patch @@ -0,0 +1,17 @@ +Fixes "ld: read-only segment has dynamic relocations" error caused by "main/binutils: add -z text by default": +https://gitlab.alpinelinux.org/alpine/aports/-/commit/a737d101cad8c0acf782d9a0ec38cf8d3432b6ff +https://gitlab.alpinelinux.org/alpine/aports/-/commit/098309ba27bbb71f3723aa2e6e180776e0396b86 + +diff --git a/Makefile b/Makefile +index 4ee2a6394ec3..3fbced2573d1 100644 +--- a/Makefile ++++ b/Makefile +@@ -969,6 +969,8 @@ ifeq ($(CONFIG_STRIP_ASM_SYMS),y) + LDFLAGS_vmlinux += $(call ld-option, -X,) + endif + ++LDFLAGS_vmlinux += -z notext ++ + ifneq ($(SEC_BUILD_CONF_USE_FINGERPRINT_TZ), false) + ifeq ($(CONFIG_SENSORS_FINGERPRINT), y) + ifneq ($(CONFIG_SEC_FACTORY), y) diff --git a/device/testing/linux-samsung-crownlte/06-fix-read-only-segment-has-dynamic-relocations-error.patch b/device/testing/linux-samsung-crownlte/06-fix-read-only-segment-has-dynamic-relocations-error.patch new file mode 120000 index 000000000..7c25c49b8 --- /dev/null +++ b/device/testing/linux-samsung-crownlte/06-fix-read-only-segment-has-dynamic-relocations-error.patch @@ -0,0 +1 @@ +../../.shared-patches/linux/fix-read-only-segment-has-dynamic-relocations-error.patch \ No newline at end of file diff --git a/device/testing/linux-samsung-crownlte/APKBUILD b/device/testing/linux-samsung-crownlte/APKBUILD index f88c5c4bf..92b4684c4 100644 --- a/device/testing/linux-samsung-crownlte/APKBUILD +++ b/device/testing/linux-samsung-crownlte/APKBUILD @@ -3,7 +3,7 @@ pkgname=linux-samsung-crownlte pkgver=4.9.218 -pkgrel=2 +pkgrel=3 pkgdesc="Samsung Galaxy Note 9 kernel fork" arch="aarch64" _carch="arm64" @@ -34,6 +34,7 @@ source=" 03-decon_dsi-UNBLANK-missed.patch 04-wifi-firmware-path.patch 05-decon_core-disable-decon_release.patch + 06-fix-read-only-segment-has-dynamic-relocations-error.patch " builddir="$srcdir/$_repository-$_commit" _outdir="out" @@ -68,4 +69,5 @@ a19967220faac402dd6fc2424f89cc236f367047d069a2234ca391e44a47fe04e3aff9562dd0be6f 24eb8701d77ad6cfc98a153341874d753a67930a369b1a08d8d51682a5d1014971e106bda93b7180bcacdf7032bb952fdca02f68886ea27c761eab8fefdb03fa 03-decon_dsi-UNBLANK-missed.patch 596235334147a430d0104d01647e57aeac71b7a9e484daf4ad8fca9cd1cf23e040fbf2c00dea7fb2a096e741eb1dde71471585a59d71d47dcdb1336e5c16efad 04-wifi-firmware-path.patch 3bae3abd47766eba42ebe1ca758f0d9e1f8a926132d98705985b493fb99115af863700cc76cfaf3a8b812fcae86b52b7c6807dc8fbade95f98c1e965c5e3dddc 05-decon_core-disable-decon_release.patch +763b7bb86f7b0d381771c292f531f81e33826438e7d3e866e3b295295415366a68f55a0b9ed6afd1a2a1ffc4204537cbc14a55af8b500e2c087cc4ef7f25b059 06-fix-read-only-segment-has-dynamic-relocations-error.patch "