[Lldb-commits] [lldb] [lldb][test] Disable PIE for some API tests (PR #93808)

Vladislav Dzhidzhoev via lldb-commits lldb-commits at lists.llvm.org
Wed Jun 12 08:09:52 PDT 2024


https://github.com/dzhidzhoev updated https://github.com/llvm/llvm-project/pull/93808

>From eaf50dc4a1f5285676c16b59c4149483d94fb986 Mon Sep 17 00:00:00 2001
From: Vladislav Dzhidzhoev <vdzhidzhoev at accesssoftek.com>
Date: Thu, 9 May 2024 04:53:23 +0000
Subject: [PATCH] [lldb][test] Disable PIE for some API tests

These tests fail when PIE is enabled by default on a platform since
`target variable` can't read global string variable value before
running inferior.
---
 lldb/test/API/commands/target/basic/Makefile   | 4 ++++
 lldb/test/API/lang/c/global_variables/Makefile | 3 +++
 lldb/test/API/lang/cpp/char8_t/Makefile        | 3 +++
 3 files changed, 10 insertions(+)

diff --git a/lldb/test/API/commands/target/basic/Makefile b/lldb/test/API/commands/target/basic/Makefile
index b31e594019f6f..e66971834b689 100644
--- a/lldb/test/API/commands/target/basic/Makefile
+++ b/lldb/test/API/commands/target/basic/Makefile
@@ -3,4 +3,8 @@
 # C_SOURCES := b.c
 # EXE := b.out
 
+ifndef PIE
+	LDFLAGS := -no-pie
+endif
+
 include Makefile.rules
diff --git a/lldb/test/API/lang/c/global_variables/Makefile b/lldb/test/API/lang/c/global_variables/Makefile
index 7b94b6556f254..00c2557033d81 100644
--- a/lldb/test/API/lang/c/global_variables/Makefile
+++ b/lldb/test/API/lang/c/global_variables/Makefile
@@ -2,5 +2,8 @@ C_SOURCES := main.c
 
 DYLIB_NAME := a
 DYLIB_C_SOURCES := a.c
+ifndef PIE
+	LDFLAGS := -no-pie
+endif
 
 include Makefile.rules
diff --git a/lldb/test/API/lang/cpp/char8_t/Makefile b/lldb/test/API/lang/cpp/char8_t/Makefile
index e7c9938b5a85e..28f982a0078d8 100644
--- a/lldb/test/API/lang/cpp/char8_t/Makefile
+++ b/lldb/test/API/lang/cpp/char8_t/Makefile
@@ -1,4 +1,7 @@
 CXX_SOURCES := main.cpp
 CXXFLAGS_EXTRAS := -std=c++2a -fchar8_t
+ifndef PIE
+	LDFLAGS := -no-pie
+endif
 
 include Makefile.rules



More information about the lldb-commits mailing list