Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp4099595pxf; Tue, 16 Mar 2021 05:54:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyWcqAbhKMgz+gpMA+sF01NEaoOu11wnxBC9zLbS45FP8EzeIH23626hsRnqciCOnXaH0Ek X-Received: by 2002:a17:906:4955:: with SMTP id f21mr30383831ejt.74.1615899298360; Tue, 16 Mar 2021 05:54:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615899298; cv=none; d=google.com; s=arc-20160816; b=PWhrH2kkJx60NohW2dxJUoCjTBkPNsAIUJNtlMigNwKKyd2+GR/f0GtlgLQ75i5Hk8 A/foWbRm0HPbpBeZ2wGHZTmlC1LdAKzPqMkVqCCz4/V++EFs5GUQx6AKMzKD9edNkkPg xLrKnC9vvcvNpmnu/5ANOx5bCQAhaVbI/IpNzoYammtUsQPNCvlRbXt/nLQYqIe7wyUR LglwYvD85c8IU8L4JI8w/64IrW7K3AqkuND+o0CJ6Aahy3BqL1aAwSlFqMZ3iDxAEWp3 g27iMvle4o3yEQPL4yZ0/clst6t6/BcrUFV/Aex1+XZPDs4sx4sIcyJBN6mLGLypUZJf m00Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=kqAXu675v6OnL5XbW/0TGkcABN28nbaEWPcSSWuZUk0=; b=Isef1TkD/WI7Azb/yNn9Q0WfA8UKpHQNQ8H9D8hch88CJESdYRnTC9l+5/6AgXlQug Nl5+45xW1ehuZN8OQ9OA2hHgmpJURAGrOyNV1R71wru80U0YG7IQWd/HPHnhQIXTtRpX b6ZxG0HVGuNQnxR66sDIw1VQQVZO/cVLfcIN/7W4IGTkICQ6sJ363g8BEhkxAiPZLXHE 5SLzKJerLUnrwdixGfjJ+aC15TZOByEjyNW2tO5trbOHAVfW4ZxtQwiOmhwIRpanIVhT ksK9AycZEkvlh1OpX3cx3DOyZlg+WrCLTROWEcRCAW+vtacZqLDXzzNvLW2XNaxUYUqd zL/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=dUBRBXBN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id pj10si13817726ejb.348.2021.03.16.05.54.12; Tue, 16 Mar 2021 05:54:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=dUBRBXBN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235330AbhCPFJO (ORCPT + 99 others); Tue, 16 Mar 2021 01:09:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43614 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235201AbhCPFIe (ORCPT ); Tue, 16 Mar 2021 01:08:34 -0400 Received: from mail-io1-xd29.google.com (mail-io1-xd29.google.com [IPv6:2607:f8b0:4864:20::d29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 90A41C06174A for ; Mon, 15 Mar 2021 22:08:34 -0700 (PDT) Received: by mail-io1-xd29.google.com with SMTP id f20so35809572ioo.10 for ; Mon, 15 Mar 2021 22:08:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=kqAXu675v6OnL5XbW/0TGkcABN28nbaEWPcSSWuZUk0=; b=dUBRBXBNpf+Btudd9Q2psknj/2lm2pPKFQZDChY0CK+oCT7sCePXrLskUn5CFokdo6 gk5L+eokVTKuJ4o5dU5ppn/NzU0qN5qpXU9rpigpAo6iucFxnav4DGxN4lkxDu/sDjxh Ra4Lbp2UsNaQQxWelS9ZxH+j8a49doMiOhxGmX3oFX+aPsqv380icA59AuuE7IU2dZJu tkhamvzZnI06oXEfw/ZpCd96V8cIWemL46KyJpb/J1Xwh1ldlKxRH4e/CJHmC9gPpyE0 nhSNFhhrkWTG5S237FcseBQwItnWNz2EiYEpgAeB51RwGI98Bbc8QLJ1sJ0ML2asUgfT Z01A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=kqAXu675v6OnL5XbW/0TGkcABN28nbaEWPcSSWuZUk0=; b=hwsncSCpaRodtgva/i3zd3+5fTI+YQj9d/k2RzUWZhqCpBb4xVS5uRBnL6glFg+CYQ 525bINE/N/Ol4P1CHblYIelXaKeqeAID0VBs/rR1goT7Tv83ez3W+FsYlShyaONB9eQF XNnGDEEJY9dAiziLaNXp13ceMcrlQNmbAA3SAMbIVgay1VFpi+xeZ0Z1wE14RY7umXxy I+7wSsjslHRzVZOplriZUdj3hMSTOGqNt5ow/HofZYiWKWzBYs6HAT2/AUMr+adMFKTZ AowEEFDdkMBKNAl7NbONUJ4rC4CVQZ7S7Pk2zU6vSHWyEfeMoX2ULrJNEHKzN/qSitX4 lPkQ== X-Gm-Message-State: AOAM532hsuy0Qe/e9hMdfuxh8XECWs439OGDai8mCdcQeW3ZUa2A0BYU 195PzZa1N9IfXO1ehPj6ovY= X-Received: by 2002:a6b:f909:: with SMTP id j9mr2128887iog.138.1615871314076; Mon, 15 Mar 2021 22:08:34 -0700 (PDT) Received: from frodo.mearth (c-24-9-77-57.hsd1.co.comcast.net. [24.9.77.57]) by smtp.googlemail.com with ESMTPSA id y9sm8587469ill.15.2021.03.15.22.08.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Mar 2021 22:08:33 -0700 (PDT) From: Jim Cromie To: jbaron@akamai.com, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org Cc: Jim Cromie Subject: [RFC PATCH v3 16/18] dyndbg: prevent build bugs via -DNO_DYNAMIC_DEBUG_TABLE Date: Mon, 15 Mar 2021 23:07:59 -0600 Message-Id: <20210316050801.2446401-17-jim.cromie@gmail.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210316050801.2446401-1-jim.cromie@gmail.com> References: <20210316050801.2446401-1-jim.cromie@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The next patch adds DEFINE_DYNAMIC_DEBUG_TABLE(), which breaks some subtrees with special compile constraints (efi etc). Avoid this by adding a define to suppress the *remote declaration* done by DEFINE_DYNAMIC_DEBUG_TABLE(), automatically, on behalf of all possible users of pr_debug. Signed-off-by: Jim Cromie --- arch/x86/boot/compressed/Makefile | 1 + arch/x86/entry/vdso/Makefile | 3 +++ arch/x86/purgatory/Makefile | 1 + drivers/firmware/efi/libstub/Makefile | 3 ++- 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile index e0bc3988c3fa..ada4eb960d95 100644 --- a/arch/x86/boot/compressed/Makefile +++ b/arch/x86/boot/compressed/Makefile @@ -31,6 +31,7 @@ targets := vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 vmlinux.bin.lzma \ KBUILD_CFLAGS := -m$(BITS) -O2 KBUILD_CFLAGS += -fno-strict-aliasing -fPIE KBUILD_CFLAGS += -DDISABLE_BRANCH_PROFILING +KBUILD_CFLAGS += -DNO_DYNAMIC_DEBUG_TABLE cflags-$(CONFIG_X86_32) := -march=i386 cflags-$(CONFIG_X86_64) := -mcmodel=small -mno-red-zone KBUILD_CFLAGS += $(cflags-y) diff --git a/arch/x86/entry/vdso/Makefile b/arch/x86/entry/vdso/Makefile index 05c4abc2fdfd..619878f2c427 100644 --- a/arch/x86/entry/vdso/Makefile +++ b/arch/x86/entry/vdso/Makefile @@ -29,6 +29,9 @@ vobjs32-y := vdso32/note.o vdso32/system_call.o vdso32/sigreturn.o vobjs32-y += vdso32/vclock_gettime.o vobjs-$(CONFIG_X86_SGX) += vsgx.o +# avoid a x86_64_RELATIVE error +KBUILD_CFLAGS += -DNO_DYNAMIC_DEBUG_TABLE + # files to link into kernel obj-y += vma.o extable.o KASAN_SANITIZE_vma.o := y diff --git a/arch/x86/purgatory/Makefile b/arch/x86/purgatory/Makefile index 95ea17a9d20c..95ba7b18410f 100644 --- a/arch/x86/purgatory/Makefile +++ b/arch/x86/purgatory/Makefile @@ -35,6 +35,7 @@ PURGATORY_CFLAGS_REMOVE := -mcmodel=kernel PURGATORY_CFLAGS := -mcmodel=large -ffreestanding -fno-zero-initialized-in-bss -g0 PURGATORY_CFLAGS += $(DISABLE_STACKLEAK_PLUGIN) -DDISABLE_BRANCH_PROFILING PURGATORY_CFLAGS += -fno-stack-protector +PURGATORY_CFLAGS += -DNO_DYNAMIC_DEBUG_TABLE # Default KBUILD_CFLAGS can have -pg option set when FTRACE is enabled. That # in turn leaves some undefined symbols like __fentry__ in purgatory and not diff --git a/drivers/firmware/efi/libstub/Makefile b/drivers/firmware/efi/libstub/Makefile index c23466e05e60..def8febefbd3 100644 --- a/drivers/firmware/efi/libstub/Makefile +++ b/drivers/firmware/efi/libstub/Makefile @@ -13,7 +13,8 @@ cflags-$(CONFIG_X86) += -m$(BITS) -D__KERNEL__ \ -Wno-pointer-sign \ $(call cc-disable-warning, address-of-packed-member) \ $(call cc-disable-warning, gnu) \ - -fno-asynchronous-unwind-tables + -fno-asynchronous-unwind-tables \ + -DNO_DYNAMIC_DEBUG_TABLE # arm64 uses the full KBUILD_CFLAGS so it's necessary to explicitly # disable the stackleak plugin -- 2.29.2