From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B3075C4361B for ; Fri, 11 Dec 2020 00:33:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 823E32312C for ; Fri, 11 Dec 2020 00:33:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728493AbgLKAc4 (ORCPT ); Thu, 10 Dec 2020 19:32:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57182 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730557AbgLKAci (ORCPT ); Thu, 10 Dec 2020 19:32:38 -0500 Received: from mail-il1-x142.google.com (mail-il1-x142.google.com [IPv6:2607:f8b0:4864:20::142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 49E69C0613D3 for ; Thu, 10 Dec 2020 16:31:58 -0800 (PST) Received: by mail-il1-x142.google.com with SMTP id u12so7131942ilv.3 for ; Thu, 10 Dec 2020 16:31:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=yiQdoMf12SNG+ZW2M45uraLJUUvpcbUlT/pdENldQuk=; b=NOzXytw9rV0o+nt1jsY54EeUYWKilyIEweWh0TG7nJUVx6LuHfXmVkFK5WZcZyXjeM i1cochq1LtAR7f9NkETZYT8+nJy1/SE9/J1/0XLincXyxaAbeD1GXSW8loHW3xEjk2I5 MDcOHGfsEkX4d7b/mt+dj0lk8Wyf7d6WF3Elk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=yiQdoMf12SNG+ZW2M45uraLJUUvpcbUlT/pdENldQuk=; b=moWkg5QK7Tje6RXfTrYifHeEZScgzcT6FEdV0fkdOL4WDxn8nNfdeeKswXudgbiBzy EVebdoo2kKdTCWe6B+fCFWYIwEeSFRStvBTR6PacRlKbEkLk2GB8K+EpNYUBOS1bzIsV VFUQkyW0LCcNN7YbU+XnuIcO1Ekbk4AFtk8EfLDLJvlpou+czLkMbTuBtHIu8Kw/dQ8Z dp5YEXB0dGwbiYC+qpo2avd5AH3oQBMUXSwqqG/+8dNKx0Q+aHBGsWWx9SjlBgTz8JE0 mwlqfc3IREj2q1ZgOooVDBHsXw+r8wX12+N2K/Cz3sTFZZ5yWIdIRXtYCBk0DM3dgkns mPLg== X-Gm-Message-State: AOAM5310MFEx/XYnYk6Srs5G8eTCUnLmcRtNpsS3EKIbj6HfZ85Wgqd9 +lkEsNbLsTXQvH+P5D32dt2zRQ== X-Google-Smtp-Source: ABdhPJx1/3vmncVRCjAKW3J2bHnvwcYzuWOZKTReo1KJXIzw1iQP1d06zqWGJA7p/oQJdblmqtgvTA== X-Received: by 2002:a05:6e02:1b8a:: with SMTP id h10mr12793622ili.266.1607646716914; Thu, 10 Dec 2020 16:31:56 -0800 (PST) Received: from [192.168.1.112] (c-24-9-64-241.hsd1.co.comcast.net. [24.9.64.241]) by smtp.gmail.com with ESMTPSA id d5sm4007163ilf.33.2020.12.10.16.31.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 10 Dec 2020 16:31:56 -0800 (PST) Subject: Re: [PATCH] selftests: propagate CC to selftest submakes To: Andrew Delgadillo , Nick Desaulniers Cc: Shuah Khan , Nathan Chancellor , "open list:KERNEL SELFTEST FRAMEWORK" , LKML , clang-built-linux , Shuah Khan References: <20201203221005.2813159-1-adelg@google.com> From: Shuah Khan Message-ID: Date: Thu, 10 Dec 2020 17:31:55 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org On 12/10/20 5:10 PM, Andrew Delgadillo wrote: > On Thu, Dec 10, 2020 at 3:08 PM Nick Desaulniers > wrote: >> >> On Thu, Dec 3, 2020 at 2:10 PM Andrew Delgadillo wrote: >>> >>> lib.mk defaults to gcc when CC is not set. When building selftests >>> as part of a kernel compilation, MAKEFLAGS is cleared to allow implicit >>> build rules to be used. This has the side-effect of clearing the CC >>> variable, which will cause selftests to be built with gcc regardless of >>> if we are using gcc or clang. To remedy this, propagate the CC variable >>> when clearing makeflags to ensure the correct compiler is used. >>> >>> Signed-off-by: Andrew Delgadillo >> >> Hi Andrew, thanks for the patch. Can you walk me through how to build >> the selftests? >> >> Documentation/dev-tools/kselftest.rst says: >> $ make -C tools/testing/selftests >> >> And if I do: >> $ make CC=clang defconfig >> $ make CC=clang -C tools/testing/selftests -j >> >> I observe a spew of errors. If I apply your patch and rerun the >> above, I see what looks like the same spew of errors. Am I "holding >> it wrong" or could the docs use a refresh? >> > > Hi Nick, sure thing! > > I also see a slew of errors when building with make -C > tools/testing/selftests. However, that is not the problem I am trying > to solve. I believe we are seeing errors building that way because it > is missing some make variables that are normally set up when building > from the kernel's top level makefile. > Both options are supported and should work. make -C tools/testing/selftests make kselftest That being said, I use gcc. Can you send the errors you are seeing? It is possible, a few tests aren't building and need to be fixed for clang and gcc. thanks, -- Shuah