From patchwork Wed Jan 5 16:03:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 12704514 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 D5721C433F5 for ; Wed, 5 Jan 2022 16:03:39 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 723746B0073; Wed, 5 Jan 2022 11:03:39 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 6D2A36B0074; Wed, 5 Jan 2022 11:03:39 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 59AE46B0075; Wed, 5 Jan 2022 11:03:39 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0051.hostedemail.com [216.40.44.51]) by kanga.kvack.org (Postfix) with ESMTP id 4AE616B0073 for ; Wed, 5 Jan 2022 11:03:39 -0500 (EST) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id E79128249980 for ; Wed, 5 Jan 2022 16:03:38 +0000 (UTC) X-FDA: 78996703716.28.8D5A782 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf18.hostedemail.com (Postfix) with ESMTP id 6E50A1C001B for ; Wed, 5 Jan 2022 16:03:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1641398616; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Hkde+7eKZjv80qwsVvmCX2T7y8AoaKGRyE5+tZVJ4q0=; b=UfvotGERhK03kSMVqzkAb3T1aeBE5eyTgHOhyIlJA//JJkYvUlMacCm8xlWQnpT5OenmiF glXYHIvIoezVTl9rQ4ux/v1hjNxrLmnxf6dgbNxW9gGJdvIgu3PxtzWtLUPKuOctYFPVXs 01FdNoHtT6RF+7SanpzAXH/cr5kpooE= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-611-b7RAR5SOOa-mxTpn4XvsZw-1; Wed, 05 Jan 2022 11:03:33 -0500 X-MC-Unique: b7RAR5SOOa-mxTpn4XvsZw-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C27F8196E6C6; Wed, 5 Jan 2022 16:03:20 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.39.192.102]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 79BBF7DE2F; Wed, 5 Jan 2022 16:03:17 +0000 (UTC) From: Florian Weimer To: "Andy Lutomirski" Cc: linux-arch@vger.kernel.org, "Linux API" , linux-x86_64@vger.kernel.org, kernel-hardening@lists.openwall.com, linux-mm@kvack.org, "the arch/x86 maintainers" , musl@lists.openwall.com, , , "Dave Hansen" , "Kees Cook" , Andrei Vagin Subject: [PATCH v3 2/3] selftests/x86/Makefile: Support per-target $(LIBS) configuration In-Reply-To: <3a1c8280967b491bf6917a18fbff6c9b52e8df24.1641398395.git.fweimer@redhat.com> References: <3a1c8280967b491bf6917a18fbff6c9b52e8df24.1641398395.git.fweimer@redhat.com> X-From-Line: 54ae0e1f8928160c1c4120263ea21c8133aa3ec4 Mon Sep 17 00:00:00 2001 Message-Id: <54ae0e1f8928160c1c4120263ea21c8133aa3ec4.1641398395.git.fweimer@redhat.com> Date: Wed, 05 Jan 2022 17:03:15 +0100 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 6E50A1C001B X-Stat-Signature: rm57duswcugyof6rjc3zbqb3hdrbajdq Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=UfvotGER; spf=none (imf18.hostedemail.com: domain of fweimer@redhat.com has no SPF policy when checking 170.10.129.124) smtp.mailfrom=fweimer@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-HE-Tag: 1641398606-895458 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: And avoid compiling PCHs by accident. Signed-off-by: Florian Weimer --- v3: Patch split out. tools/testing/selftests/x86/Makefile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/x86/Makefile b/tools/testing/selftests/x86/Makefile index 8a1f62ab3c8e..0993d12f2c38 100644 --- a/tools/testing/selftests/x86/Makefile +++ b/tools/testing/selftests/x86/Makefile @@ -72,10 +72,12 @@ all_64: $(BINARIES_64) EXTRA_CLEAN := $(BINARIES_32) $(BINARIES_64) $(BINARIES_32): $(OUTPUT)/%_32: %.c helpers.h - $(CC) -m32 -o $@ $(CFLAGS) $(EXTRA_CFLAGS) $^ -lrt -ldl -lm + $(CC) -m32 -o $@ $(CFLAGS) $(EXTRA_CFLAGS) $(filter-out %.h, $^) \ + $(or $(LIBS), -lrt -ldl -lm) $(BINARIES_64): $(OUTPUT)/%_64: %.c helpers.h - $(CC) -m64 -o $@ $(CFLAGS) $(EXTRA_CFLAGS) $^ -lrt -ldl + $(CC) -m64 -o $@ $(CFLAGS) $(EXTRA_CFLAGS) $(filter-out %.h, $^) \ + $(or $(LIBS), -lrt -ldl -lm) # x86_64 users should be encouraged to install 32-bit libraries ifeq ($(CAN_BUILD_I386)$(CAN_BUILD_X86_64),01)