Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3011158imw; Wed, 6 Jul 2022 15:55:32 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sLOWrGAgX64yUeXT1MDlE0YSkp+Pyljon/Ic6V9lluATLm0N/F8Nl//6bqCndhsVZps850 X-Received: by 2002:a05:6402:44a:b0:437:8234:f4c6 with SMTP id p10-20020a056402044a00b004378234f4c6mr58276114edw.346.1657148131881; Wed, 06 Jul 2022 15:55:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657148131; cv=none; d=google.com; s=arc-20160816; b=XmrhKd2EjdE8r4ed9IHR5/E/QH4BtxpZD/UZMg/7DYwkD5usaMpzGLvOXmJWmUAean f1VWI5kDsoeM372NfYZ+LmRtfU/YdRZ8MxylmEmj9arNgawr8R3Kh0zx/uOafJpEtsdJ TUwOqLGtpSsFjyrWRYsVHubzd9+P6ZbYmqUJon5CphO4idl3f+094qGx9XXjoC0R17bR cJBDBS55Vm3uahdqmMvu5VRp3qbq6UG2NuCLY3XP0zLnFwMnudzblrffdyEU93PpWpLo XrsybZqaleUWrl0TfW5DJJJuDfkqMDZ3kt+aQ/IiDexS80yHjWy1MyicuWa7V0wZNlBI Xfyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=iMi4Oe3OsGy1kv8HY71erxFZBn4oR7ZEBB7R/1ydiIA=; b=rRQ8WXHmazkAH6qk6YkExIPVoizuPgRjBmEI3Y+5OwucAhAvmSqC0rvp/1DzTkbjEV q1C8Lx6QQjeGW2G8T4iVXCN/x3KAPbWwCoI6cbZOZrygRCL+CE6kuwEf6lXcRSS6MXAN Bc+SLbyaxj2ieVty+bRZF7tSYCWQmoziA+2RLQdbadxXRt9kgFaQcCPKxdPb2Ms68QnX ENhdrves1IqRixhrDZBFmwyvsL0qM/sMK8nKdPnRszD5GuBw5lCXVIWFffE8j2B8OA2J sncRFCyy66Z+uxhB9oIU8soZUyHdMUHPffiGP8o6n6aGk0TAqpHV2xBaA32HLUPTwTrW ZoxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="P4tcQC/S"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gn42-20020a1709070d2a00b00726c8adb7efsi30527751ejc.224.2022.07.06.15.55.07; Wed, 06 Jul 2022 15:55:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="P4tcQC/S"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234363AbiGFW2I (ORCPT + 99 others); Wed, 6 Jul 2022 18:28:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34172 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234207AbiGFW2B (ORCPT ); Wed, 6 Jul 2022 18:28:01 -0400 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8CE902B1B5; Wed, 6 Jul 2022 15:28:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1657146480; x=1688682480; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=Vleb0k6acAvZjo7qEApfQ8FJmwV6hNoP1hTpCH2VGUk=; b=P4tcQC/SuS6YykZByJzTQh9PdHsYugrIYk0xPzs56gdJqYqhNPZHIxXE RZoglXc5mwwZqTciTiOs1yFlLfjS2xLbwZ8TxC5lPaqC0qa06iXUq2Nfp NJcGxK9WT0eXlrRxJmZOfNK0SB4Aq7WhfRwCwYrM1j4puxa5UWE5hexEp d17aXVeJ/Na4SHpKEgiOF97ml2yVVfTl5JMOTPVEhtlWZERVpmLqaebq+ mNbCe7+PoWHhsIICGX/erIi0ghpam7xkcojee4stK95NUXD8QXTzGj7HM +LhWnVOR3+VQKyMstaK0DqsX9LjfDwOrOqmWKTaElL0Z3YDcf45kp/SEe Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10400"; a="347866390" X-IronPort-AV: E=Sophos;i="5.92,251,1650956400"; d="scan'208";a="347866390" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Jul 2022 15:27:59 -0700 X-IronPort-AV: E=Sophos;i="5.92,251,1650956400"; d="scan'208";a="696286196" Received: from ffsotto-mobl.amr.corp.intel.com (HELO [10.209.100.19]) ([10.209.100.19]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Jul 2022 15:27:58 -0700 Message-ID: <842b718f-8207-1565-3373-61098a4c2d33@intel.com> Date: Wed, 6 Jul 2022 15:25:51 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH] x86/Kconfig: Fix CONFIG_CC_HAS_SANE_STACKPROTECTOR when cross compiling with clang Content-Language: en-US To: Nathan Chancellor , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org Cc: "H. Peter Anvin" , Nick Desaulniers , Tom Rix , Daniel Kolesa , linux-kernel@vger.kernel.org, patches@lists.linux.dev, llvm@lists.linux.dev, stable@vger.kernel.org References: <20220617180845.2788442-1-nathan@kernel.org> From: Dave Hansen In-Reply-To: <20220617180845.2788442-1-nathan@kernel.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/17/22 11:08, Nathan Chancellor wrote: > When clang is invoked without a '--target' flag, code is generated for > the default target, which is usually the host (it is configurable via > cmake). As a result, the has-stack-protector scripts will generate code > for the default target but check for x86 specific segment registers, > which cannot succeed if the default target is not x86. I guess the real root cause here is the direct use of '$(CC)' without any other flags. Adding '$(CLANG_FLAGS)' seems like a pretty normal fix, like in scripts/Kconfig.include. I suspect there's another one of these here: arch/x86/um/vdso/Makefile: cmd_vdso = $(CC) -nostdlib -o $@ but I wouldn't be surprised if UML doesn't work with clang in the first place.