From patchwork Tue Jun 25 22:34:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Edward Liaw X-Patchwork-Id: 13712107 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id EBF5BC2BBCA for ; Tue, 25 Jun 2024 22:35:08 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6FF7C6B0098; Tue, 25 Jun 2024 18:35:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 688626B0099; Tue, 25 Jun 2024 18:35:08 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4B34E6B009A; Tue, 25 Jun 2024 18:35:08 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 2A40A6B0098 for ; Tue, 25 Jun 2024 18:35:08 -0400 (EDT) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id D7ED0804DB for ; Tue, 25 Jun 2024 22:35:07 +0000 (UTC) X-FDA: 82270867854.20.E0E4C71 Received: from mail-yw1-f201.google.com (mail-yw1-f201.google.com [209.85.128.201]) by imf18.hostedemail.com (Postfix) with ESMTP id 0FB991C0003 for ; Tue, 25 Jun 2024 22:35:05 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=iu2WUWgc; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf18.hostedemail.com: domain of 3GEZ7ZgYKCMsvu2zrDx55x2v.t532z4BE-331Crt1.58x@flex--edliaw.bounces.google.com designates 209.85.128.201 as permitted sender) smtp.mailfrom=3GEZ7ZgYKCMsvu2zrDx55x2v.t532z4BE-331Crt1.58x@flex--edliaw.bounces.google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1719354893; a=rsa-sha256; cv=none; b=OPu/2rT16nDCpcjloLeGzbtc3kF/Tk5kIQoUwZO0vKTwdqCT9XFWFXv0jtQtDxsb6PvIup AX4cVCqcRAkp6yZk9dBSSxVLQ1TrHRhsNuip/Gq+gq1xJcyunJksKenwyVE3GiaGB1SlVl y+FcrEUjHFn9N+B8KyewqZinShhqCzU= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=iu2WUWgc; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf18.hostedemail.com: domain of 3GEZ7ZgYKCMsvu2zrDx55x2v.t532z4BE-331Crt1.58x@flex--edliaw.bounces.google.com designates 209.85.128.201 as permitted sender) smtp.mailfrom=3GEZ7ZgYKCMsvu2zrDx55x2v.t532z4BE-331Crt1.58x@flex--edliaw.bounces.google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1719354893; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=87Jin1neXman428FZaPVpz5vAZT4i6hdnDg6P39Dvmk=; b=n7LGRTIB3BCAraxTs9mq5eGg8+bSwENMwDnD17KfjOV8DCEsh7smbLsxhSmwEdSsPPSb4s NLCFy0q8OLi/35nht8RUw+ZRxN/K92bunB5+TVWJo+gv68cWf0pfbMXKjRW+ge5lm47PTE hfVcFuWKfifpCqY3WYUtI+Bi9aqDPvE= Received: by mail-yw1-f201.google.com with SMTP id 00721157ae682-62f8a1b2969so137105207b3.3 for ; Tue, 25 Jun 2024 15:35:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1719354905; x=1719959705; darn=kvack.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=87Jin1neXman428FZaPVpz5vAZT4i6hdnDg6P39Dvmk=; b=iu2WUWgcPl2F1ePSo8+R2alVwNykjt73oK7tsXkBrnq92yAo8qs7dyd+Yxamq0/hig TsB2+s+cxaV7uCyp31PQnbo6vf9s89p1dWSyMUmhs3w/xRpWQbko2yIXYUy6a8On30sY zq3wrRdGHinj3WxxNwVZ+ZEurNaYyC3zJLodfAUPGH8mGYbWndgwvUSv51Q4w39pXtjA HBnH7PN7gD4zS59w0S/FYi3rh8Jiow9LeaQEkYYuvOUybBtYWwB4in1W3v5qC7MGnAAS TlqkUq/q2VLFOgzt/OPAerAlrLP3ysxrUnvXQju1IDLFz+XmeTwtelIGrmx7D+jtldph mUOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719354905; x=1719959705; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=87Jin1neXman428FZaPVpz5vAZT4i6hdnDg6P39Dvmk=; b=YtJ4vVeThD8gDZPaW35ivPX8j/UdAOEOVJ7/VlX/Q6O+ORSBbVnebVXssIiO8Snkkt Ks9im1P4ae2n09+b8eDRybPmlwHOsprNfz/25yNC7ixOeeQ1vKqgCSdYvzGyL38jihFR 5bdKYGQHhLBbEy/7IxGzcQXzaFMCTLkGUYM3IDG+cO4RzZzMgh3lvcyRloFZhbYnrdUC LXl35wM6qG1IizOtynS4A83vOigE3DBlZOEmJnFLkvlqQ2qNVCzK+mNQlk1rGEY3iDwm kyqxBqhygLvALzA/tSNXex1YlWbedhrXtEt0NgJDIN0BNw+03e3iZAFUF2XmSrS1u/Sl 73qQ== X-Forwarded-Encrypted: i=1; AJvYcCXEYDM/FUdxIle/GeWARV9ARnIs4yirqTxH9e86pggM9PVOo8lcKGI3pB1qdJRcBDxXqrDm/5nuuYxkRp1NxedIYmc= X-Gm-Message-State: AOJu0Yyr49HbKmg1dsoPiYelg9/o59dI1w4C0zrvN8h+6CeUYOUdUA1F c/VGyLiccqFwEu/k9ZM6DwNem49qGlndO/9/2A5uUNR7DfIdF908UuHB3ulfdp1hXIQFfZlWMYN lWg== X-Google-Smtp-Source: AGHT+IEGuPw81A+vd3VK4UXWXuPsSlJshJybw2PugwKr4mE141Kgqb4D3k0bZmkq8unTm2UAe55tWdXFj6o= X-Received: from edliaw.c.googlers.com ([fda3:e722:ac3:cc00:24:72f4:c0a8:305d]) (user=edliaw job=sendgmr) by 2002:a05:690c:6112:b0:61c:89a4:dd5f with SMTP id 00721157ae682-643a76e6dd7mr1219237b3.0.1719354904824; Tue, 25 Jun 2024 15:35:04 -0700 (PDT) Date: Tue, 25 Jun 2024 22:34:45 +0000 In-Reply-To: <20240625223454.1586259-1-edliaw@google.com> Mime-Version: 1.0 References: <20240625223454.1586259-1-edliaw@google.com> X-Mailer: git-send-email 2.45.2.803.g4e1b14247a-goog Message-ID: <20240625223454.1586259-2-edliaw@google.com> Subject: [PATCH v7 1/1] selftests: Centralize -D_GNU_SOURCE= to CFLAGS in lib.mk From: Edward Liaw To: linux-kselftest@vger.kernel.org, Eric Biederman , Kees Cook , Shuah Khan , Thomas Gleixner , Ingo Molnar , Peter Zijlstra , Darren Hart , Davidlohr Bueso , " =?utf-8?q?Andr=C3=A9_Almeida?= " , Jason Gunthorpe , Kevin Tian , Paolo Bonzini , Andrew Morton , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Fenghua Yu , Reinette Chatre , Paul Walmsley , Palmer Dabbelt , Albert Ou , Jarkko Sakkinen , Dave Hansen Cc: linux-kernel@vger.kernel.org, usama.anjum@collabora.com, seanjc@google.com, kernel-team@android.com, Edward Liaw , linux-mm@kvack.org, iommu@lists.linux.dev, kvm@vger.kernel.org, netdev@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-riscv@lists.infradead.org, linux-sgx@vger.kernel.org, John Hubbard X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 0FB991C0003 X-Stat-Signature: 8wk7391kg8rqsctt3d5oicxpbkcci17u X-Rspam-User: X-HE-Tag: 1719354905-768024 X-HE-Meta: U2FsdGVkX1/3y3T6eC7tTwYEaYrtOBGDlTaBmK7I6xtTxS8tHLQJzSDfd5d6l0SONP5TlR1hS3z1aqz5xEcxg1z1EAb3B4S9GVS+6spQpw+fFFJU9Y8VdPFeIrTGU56Nw+LKIHabW2gv3v9INppED0IouszAbCGfwQ7J0ZGAVpMNSHfnAd6mj5gAClekKkTqFB6Ic55aNY3zBzI85gr+JUtU7yjb1yZn1nfZZAKHQGWmL+xksCA4wlcegt+fJtKdevMNbmAeARlTG/jDssQ+m+JYHKEtcKz2W9LmP4V8QqsPR6SHMehfN1M+6d4GQEieMGyi1S6zqBL+jh7Hpmz1J4a/Q6fKZk3LlzelIWkhKyLkCyOcy2OJR8HHmsycws68/GRDlfyJtz8mSHAASbasY8GKLCHhGYkrFbPMoocM65Ir2z+ubh7K6nr0kHd2mKn/TLflo8WE4sd+enIdgtsQAEWtjEKaRUq2vcAE1tc1WJ4w0x0syms492N0ICsxII4fZwOoplnBJWqcISBwEPIsEoKdN1nyFUlcRz+sG7VBEHWZyIWErSXGWgz8PXMJ3EMJz8KHlhTuSR752mv1V3JFuN6EkRgR9SlW/xaw9Opy2tFhvvq1v80jyXe/Pub0MDItbSxBLvNkYmBnMb3yS7wNs9pfswnsqYG97Xu9h8qnCBqWbOOOHFEoaLuHkvvKaNgvmObfqJGcykqCMiJarsVffCMVeyxzZgR+6D6yPA/QX9h7o6nIclryArcoIw+qT1G4VHjQZ8eDPKycX6zSJ52WDcRVn8P13tPUnpK7j8Evrvmj3Rtyg1qBCWdN6zFyCWQz5xBxxSuV+eSO3wBlr3DnFj5Kl4qFulKfDus8xevJM2FdzNan4Q19BnJyDeZvCnwoozAprZOVyXj1MeDr7OfkCpm9BJSa51gocOBcsaEDI9RddRXLGRedw8LRLuGZJQ5Hce1e/MXF7G0Ds/bQnjn Qdd2DLob 17SvtjrdzRtXrievBIsmicM+R0R00qlEAW9qJRvE4HOOUdKIClvhLYu4UL352e/QYw+ocxJdB/JUYoWvI607cP/Z8OqjXg3EWjRGzGFWuBSks2laIBOBi3SpiUsW9ftRK9Dk9iK1uFU1glKpSH0PmmUSQD3wCfRURZ4S6UMtXDwO9rpFWxAw9tKiGebO6fn0vG3skQxULsShPCD1AGUMpSCUqWnCRdlM0eg5rhBZ6HPWGqxxO0VN/59Rc/q+goTRTu9eNqR4pLuE/KT58vPfBx1650XDmIaD7WQJ2ziyhsWv2B59aRvDEHvJgUnil0qWmLBsOqX2TUsg3CN7hSuBmdF9p9XRlNzl6aPGeJxyQmCXr+NrPHOQ7Eo8zS2ZcrLpn/pTrCzOGIsrJuLUke7/ebIOf0qXRXyp26f2iEpG12yBidPmmkyaPI/n82ASKruDiVtExSKljnJDgZ9XnG9YVQdeTH7Qv8MGJVVUAnvDJwWpegS81gfjY1AQY+jomPL3MevAoqnxfIHCXCq0uVUpezOO340VkDmVtbckMuWdU+FuyYy3ejIi+lNnKJfg6vLlwIh22MahAnpg3b411rGMbmJrYUg== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Centralize the _GNU_SOURCE definition to CFLAGS in lib.mk. Remove redundant defines from Makefiles that import lib.mk. Convert any usage of "#define _GNU_SOURCE 1" to "#define _GNU_SOURCE". This uses the form "-D_GNU_SOURCE=", which is equivalent to "#define _GNU_SOURCE". Otherwise using "-D_GNU_SOURCE" is equivalent to "-D_GNU_SOURCE=1" and "#define _GNU_SOURCE 1", which is less commonly seen in source code and would require many changes in selftests to avoid redefinition warnings. Suggested-by: John Hubbard Signed-off-by: Edward Liaw Acked-by: Shuah Khan Reviewed-by: Muhammad Usama Anjum --- tools/testing/selftests/exec/Makefile | 1 - tools/testing/selftests/futex/functional/Makefile | 2 +- tools/testing/selftests/intel_pstate/Makefile | 2 +- tools/testing/selftests/iommu/Makefile | 2 -- tools/testing/selftests/kvm/Makefile | 2 +- tools/testing/selftests/lib.mk | 3 +++ tools/testing/selftests/mm/thuge-gen.c | 2 +- tools/testing/selftests/net/Makefile | 2 +- tools/testing/selftests/net/tcp_ao/Makefile | 2 +- tools/testing/selftests/proc/Makefile | 1 - tools/testing/selftests/resctrl/Makefile | 2 +- tools/testing/selftests/ring-buffer/Makefile | 1 - tools/testing/selftests/riscv/mm/Makefile | 2 +- tools/testing/selftests/sgx/Makefile | 2 +- tools/testing/selftests/tmpfs/Makefile | 1 - 15 files changed, 12 insertions(+), 15 deletions(-) diff --git a/tools/testing/selftests/exec/Makefile b/tools/testing/selftests/exec/Makefile index ab67d58cfab7..ba012bc5aab9 100644 --- a/tools/testing/selftests/exec/Makefile +++ b/tools/testing/selftests/exec/Makefile @@ -1,7 +1,6 @@ # SPDX-License-Identifier: GPL-2.0 CFLAGS = -Wall CFLAGS += -Wno-nonnull -CFLAGS += -D_GNU_SOURCE ALIGNS := 0x1000 0x200000 0x1000000 ALIGN_PIES := $(patsubst %,load_address.%,$(ALIGNS)) diff --git a/tools/testing/selftests/futex/functional/Makefile b/tools/testing/selftests/futex/functional/Makefile index 994fa3468f17..f79f9bac7918 100644 --- a/tools/testing/selftests/futex/functional/Makefile +++ b/tools/testing/selftests/futex/functional/Makefile @@ -1,6 +1,6 @@ # SPDX-License-Identifier: GPL-2.0 INCLUDES := -I../include -I../../ $(KHDR_INCLUDES) -CFLAGS := $(CFLAGS) -g -O2 -Wall -D_GNU_SOURCE= -pthread $(INCLUDES) $(KHDR_INCLUDES) +CFLAGS := $(CFLAGS) -g -O2 -Wall -pthread $(INCLUDES) $(KHDR_INCLUDES) LDLIBS := -lpthread -lrt LOCAL_HDRS := \ diff --git a/tools/testing/selftests/intel_pstate/Makefile b/tools/testing/selftests/intel_pstate/Makefile index 05d66ef50c97..f45372cb00fe 100644 --- a/tools/testing/selftests/intel_pstate/Makefile +++ b/tools/testing/selftests/intel_pstate/Makefile @@ -1,5 +1,5 @@ # SPDX-License-Identifier: GPL-2.0 -CFLAGS := $(CFLAGS) -Wall -D_GNU_SOURCE +CFLAGS := $(CFLAGS) -Wall LDLIBS += -lm ARCH ?= $(shell uname -m 2>/dev/null || echo not) diff --git a/tools/testing/selftests/iommu/Makefile b/tools/testing/selftests/iommu/Makefile index 32c5fdfd0eef..fd6477911f24 100644 --- a/tools/testing/selftests/iommu/Makefile +++ b/tools/testing/selftests/iommu/Makefile @@ -2,8 +2,6 @@ CFLAGS += -Wall -O2 -Wno-unused-function CFLAGS += $(KHDR_INCLUDES) -CFLAGS += -D_GNU_SOURCE - TEST_GEN_PROGS := TEST_GEN_PROGS += iommufd TEST_GEN_PROGS += iommufd_fail_nth diff --git a/tools/testing/selftests/kvm/Makefile b/tools/testing/selftests/kvm/Makefile index ac280dcba996..4ee37abf70ff 100644 --- a/tools/testing/selftests/kvm/Makefile +++ b/tools/testing/selftests/kvm/Makefile @@ -231,7 +231,7 @@ LINUX_TOOL_ARCH_INCLUDE = $(top_srcdir)/tools/arch/$(ARCH)/include endif CFLAGS += -Wall -Wstrict-prototypes -Wuninitialized -O2 -g -std=gnu99 \ -Wno-gnu-variable-sized-type-not-at-end -MD -MP -DCONFIG_64BIT \ - -D_GNU_SOURCE -fno-builtin-memcmp -fno-builtin-memcpy \ + -fno-builtin-memcmp -fno-builtin-memcpy \ -fno-builtin-memset -fno-builtin-strnlen \ -fno-stack-protector -fno-PIE -I$(LINUX_TOOL_INCLUDE) \ -I$(LINUX_TOOL_ARCH_INCLUDE) -I$(LINUX_HDR_PATH) -Iinclude \ diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk index 7b299ed5ff45..d6edcfcb5be8 100644 --- a/tools/testing/selftests/lib.mk +++ b/tools/testing/selftests/lib.mk @@ -196,6 +196,9 @@ endef clean: $(if $(TEST_GEN_MODS_DIR),clean_mods_dir) $(CLEAN) +# Build with _GNU_SOURCE by default +CFLAGS += -D_GNU_SOURCE= + # Enables to extend CFLAGS and LDFLAGS from command line, e.g. # make USERCFLAGS=-Werror USERLDFLAGS=-static CFLAGS += $(USERCFLAGS) diff --git a/tools/testing/selftests/mm/thuge-gen.c b/tools/testing/selftests/mm/thuge-gen.c index d50dc71cac32..e4370b79b62f 100644 --- a/tools/testing/selftests/mm/thuge-gen.c +++ b/tools/testing/selftests/mm/thuge-gen.c @@ -13,7 +13,7 @@ sudo ipcs | awk '$1 == "0x00000000" {print $2}' | xargs -n1 sudo ipcrm -m (warning this will remove all if someone else uses them) */ -#define _GNU_SOURCE 1 +#define _GNU_SOURCE #include #include #include diff --git a/tools/testing/selftests/net/Makefile b/tools/testing/selftests/net/Makefile index bc3925200637..8eaffd7a641c 100644 --- a/tools/testing/selftests/net/Makefile +++ b/tools/testing/selftests/net/Makefile @@ -1,7 +1,7 @@ # SPDX-License-Identifier: GPL-2.0 # Makefile for net selftests -CFLAGS = -Wall -Wl,--no-as-needed -O2 -g +CFLAGS += -Wall -Wl,--no-as-needed -O2 -g CFLAGS += -I../../../../usr/include/ $(KHDR_INCLUDES) # Additional include paths needed by kselftest.h CFLAGS += -I../ diff --git a/tools/testing/selftests/net/tcp_ao/Makefile b/tools/testing/selftests/net/tcp_ao/Makefile index 522d991e310e..bd88b90b902b 100644 --- a/tools/testing/selftests/net/tcp_ao/Makefile +++ b/tools/testing/selftests/net/tcp_ao/Makefile @@ -26,7 +26,7 @@ LIB := $(LIBDIR)/libaotst.a LDLIBS += $(LIB) -pthread LIBDEPS := lib/aolib.h Makefile -CFLAGS := -Wall -O2 -g -D_GNU_SOURCE -fno-strict-aliasing +CFLAGS += -Wall -O2 -g -fno-strict-aliasing CFLAGS += $(KHDR_INCLUDES) CFLAGS += -iquote ./lib/ -I ../../../../include/ diff --git a/tools/testing/selftests/proc/Makefile b/tools/testing/selftests/proc/Makefile index 6066f607f758..ee424a9f075f 100644 --- a/tools/testing/selftests/proc/Makefile +++ b/tools/testing/selftests/proc/Makefile @@ -1,6 +1,5 @@ # SPDX-License-Identifier: GPL-2.0-only CFLAGS += -Wall -O2 -Wno-unused-function -CFLAGS += -D_GNU_SOURCE LDFLAGS += -pthread TEST_GEN_PROGS := diff --git a/tools/testing/selftests/resctrl/Makefile b/tools/testing/selftests/resctrl/Makefile index 021863f86053..f408bd6bfc3d 100644 --- a/tools/testing/selftests/resctrl/Makefile +++ b/tools/testing/selftests/resctrl/Makefile @@ -1,6 +1,6 @@ # SPDX-License-Identifier: GPL-2.0 -CFLAGS = -g -Wall -O2 -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE +CFLAGS = -g -Wall -O2 -D_FORTIFY_SOURCE=2 CFLAGS += $(KHDR_INCLUDES) TEST_GEN_PROGS := resctrl_tests diff --git a/tools/testing/selftests/ring-buffer/Makefile b/tools/testing/selftests/ring-buffer/Makefile index 627c5fa6d1ab..23605782639e 100644 --- a/tools/testing/selftests/ring-buffer/Makefile +++ b/tools/testing/selftests/ring-buffer/Makefile @@ -1,7 +1,6 @@ # SPDX-License-Identifier: GPL-2.0 CFLAGS += -Wl,-no-as-needed -Wall CFLAGS += $(KHDR_INCLUDES) -CFLAGS += -D_GNU_SOURCE TEST_GEN_PROGS = map_test diff --git a/tools/testing/selftests/riscv/mm/Makefile b/tools/testing/selftests/riscv/mm/Makefile index c333263f2b27..4664ed79e20b 100644 --- a/tools/testing/selftests/riscv/mm/Makefile +++ b/tools/testing/selftests/riscv/mm/Makefile @@ -3,7 +3,7 @@ # Originally tools/testing/arm64/abi/Makefile # Additional include paths needed by kselftest.h and local headers -CFLAGS += -D_GNU_SOURCE -std=gnu99 -I. +CFLAGS += -std=gnu99 -I. TEST_GEN_FILES := mmap_default mmap_bottomup diff --git a/tools/testing/selftests/sgx/Makefile b/tools/testing/selftests/sgx/Makefile index 867f88ce2570..03b5e13b872b 100644 --- a/tools/testing/selftests/sgx/Makefile +++ b/tools/testing/selftests/sgx/Makefile @@ -12,7 +12,7 @@ OBJCOPY := $(CROSS_COMPILE)objcopy endif INCLUDES := -I$(top_srcdir)/tools/include -HOST_CFLAGS := -Wall -Werror -g $(INCLUDES) -fPIC +HOST_CFLAGS := -Wall -Werror -g $(INCLUDES) -fPIC $(CFLAGS) HOST_LDFLAGS := -z noexecstack -lcrypto ENCL_CFLAGS += -Wall -Werror -static-pie -nostdlib -ffreestanding -fPIE \ -fno-stack-protector -mrdrnd $(INCLUDES) diff --git a/tools/testing/selftests/tmpfs/Makefile b/tools/testing/selftests/tmpfs/Makefile index aa11ccc92e5b..3be931e1193f 100644 --- a/tools/testing/selftests/tmpfs/Makefile +++ b/tools/testing/selftests/tmpfs/Makefile @@ -1,6 +1,5 @@ # SPDX-License-Identifier: GPL-2.0-only CFLAGS += -Wall -O2 -CFLAGS += -D_GNU_SOURCE TEST_GEN_PROGS := TEST_GEN_PROGS += bug-link-o-tmpfile