From 5b8d24f678560edb545beeffee7668761ad5fa7e Mon Sep 17 00:00:00 2001 From: James Zern Date: Mon, 6 Nov 2023 10:21:56 -0800 Subject: [PATCH] configure: detect PIE and enable PIC Fixes the creation of DT_TEXTREL entries in binaries built with PIE enabled: /usr/bin/ld: warning: creating DT_TEXTREL in a PIE This matches the changes made in libaom: 1df26009da aom_configure: only override CONFIG_PIC if not set on cmd line 7235e65746 aom_configure.cmake: detect PIE and set CONFIG_PIC Change-Id: I0a43e964af2d8eb8c5e7811ce14ad39285eec3a8 --- build/make/configure.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/build/make/configure.sh b/build/make/configure.sh index 9d3cd80..54fb1da 100644 --- a/build/make/configure.sh +++ b/build/make/configure.sh @@ -863,8 +863,14 @@ process_common_toolchain() { ;; esac - # PIC is probably what we want when building shared libs + # Position independent code (PIC) is probably what we want when building + # shared libs or position independent executable (PIE) targets. enabled shared && soft_enable pic + check_cpp << EOF || soft_enable pic +#if !(__pie__ || __PIE__) +#error Neither __pie__ or __PIE__ are set +#endif +EOF # Minimum iOS version for all target platforms (darwin and iphonesimulator). # Shared library framework builds are only possible on iOS 8 and later. -- 2.7.4