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=-13.2 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_IN_DEF_DKIM_WL autolearn=no 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 A5581C433FE for ; Mon, 7 Dec 2020 12:53:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 66EF323406 for ; Mon, 7 Dec 2020 12:53:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726220AbgLGMxD (ORCPT ); Mon, 7 Dec 2020 07:53:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53190 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726012AbgLGMxC (ORCPT ); Mon, 7 Dec 2020 07:53:02 -0500 Received: from mail-ot1-x341.google.com (mail-ot1-x341.google.com [IPv6:2607:f8b0:4864:20::341]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2CCFFC0613D1 for ; Mon, 7 Dec 2020 04:52:16 -0800 (PST) Received: by mail-ot1-x341.google.com with SMTP id 11so12298229oty.9 for ; Mon, 07 Dec 2020 04:52:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=EyGMufKhn3rdsN41H0khe/e5DDZRz7d+ODZIwycAubY=; b=CuoNQ1ZHRqc6zbhbK1YP+GZ7ktFO9Q/lyYuaIY4Jz3ZhK9OGgVPErHX95W8Ll0n2zI ge/Sf2P9PW26px7hU6YIIUfuUtpFMLgxMacRHFFSqWy8nqIW5dmrOMVICwubhJRZpdeh drywPQLLnE8sxP6kcz/T4gyRS02WTuGOxFKGIg5oYxm/A4VnwM9lOE1ZGmDR4pWpZ1/n Xph4GXlObo2q28Jp8ESDYHfAX3GvvAEt+uFK8E3U7RPDI+DADPi/KEM2VJBucZsddtPk nlhcTXUY3l8V+SfpnmKqHhAkwVEFcWYkKGkEahH5bweWejzM8IR/xV4WtSRnCTaay3AH XS0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=EyGMufKhn3rdsN41H0khe/e5DDZRz7d+ODZIwycAubY=; b=UovMa/8mhMbq6+VAyKWYfCCvEUKo84UDqup+B7oMmYR+jYTysn3rWrIqRbv5Hy8Vcv IChnDM00m3wgWRpoXke0g8e9iWvl5S+HSnpoes2A6CZCLQtzSG0xQnMFOey5oOmV6qFS taXMK3Dzj/qSJ7Ws7R9y5eoLRv/UlvKGC6vG21+OjdIHvgAe2w58T88lzjOYXnT+UkBR 7A13dujqWj1E6HpAs7jFY2foK9yjAukyMXYbCXwB7jKwtwA3MZO4o3YPl+U2nbCKFJ5i RUey8PNWSe2bUsrZ7U3w52reN+kPvownEBRjPI3TaLp+eyJdtiYT2jX3OrrHMspCF/LE rGLQ== X-Gm-Message-State: AOAM531IZNrkDnVHIGt/7R1L+pyM8ElCeJ8QUWu2idLy++DnleOgyHHA o3EWc8hdtdD90Waov30htcI3z4U2SFkGZUY8RXfTWA== X-Google-Smtp-Source: ABdhPJxVprKjmUCG8roIE9AUOYm4iqNmTYeBhRe9Vvez95kN2cFuEgYeLI/drFAYcAWr2iHleQglU518kMx4cKrEm88= X-Received: by 2002:a9d:6199:: with SMTP id g25mr2798381otk.17.1607345535306; Mon, 07 Dec 2020 04:52:15 -0800 (PST) MIME-Version: 1.0 References: <20201204210000.660293c6@canb.auug.org.au> <20201204211923.a88aa12dc06b61780282dd1b@linux-foundation.org> In-Reply-To: From: Marco Elver Date: Mon, 7 Dec 2020 13:52:03 +0100 Message-ID: Subject: Re: linux-next: build warning after merge of the akpm tree To: Dmitry Vyukov Cc: Andrew Morton , Stephen Rothwell , Linux Kernel Mailing List , Linux Next Mailing List , Alexander Potapenko , Andrey Konovalov , kasan-dev , Kees Cook Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 7 Dec 2020 at 13:38, 'Dmitry Vyukov' via kasan-dev wrote: > On Mon, Dec 7, 2020 at 1:08 PM Dmitry Vyukov wrote: > > > > Hi all, > > > > > > > > After merging the akpm tree, today's linux-next build (powerpc > > > > allyesconfig) produced warnings like this: > > > > > > > > kernel/kcov.c:296:14: warning: conflicting types for built-in function '__sanitizer_cov_trace_switch'; expected 'void(long unsigned int, void *)' [-Wbuiltin-declaration-mismatch] > > > > 296 | void notrace __sanitizer_cov_trace_switch(u64 val, u64 *cases) > > > > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > > > > > Odd. clang wants that signature, according to > > > https://clang.llvm.org/docs/SanitizerCoverage.html. But gcc seems to > > > want a different signature. Beats me - best I can do is to cc various > > > likely culprits ;) > > > > > > Which gcc version? Did you recently update gcc? > > > > > > > ld: warning: orphan section `.data..Lubsan_data177' from `arch/powerpc/oprofile/op_model_pa6t.o' being placed in section `.data..Lubsan_data177' > > > > > > > > (lots of these latter ones) > > > > > > > > I don't know what produced these, but it is in the akpm-current or > > > > akpm trees. > > > > I can reproduce this in x86_64 build as well but only if I enable > > UBSAN as well. There were some recent UBSAN changes by Kees, so maybe > > that's what affected the warning. > > Though, the warning itself looks legit and unrelated to UBSAN. In > > fact, if the compiler expects long and we accept u64, it may be broken > > on 32-bit arches... > > No, I think it works, the argument should be uint64. > > I think both gcc and clang signatures are correct and both want > uint64_t. The question is just how uint64_t is defined :) The old > printf joke that one can't write portable format specifier for > uint64_t. > > What I know so far: > clang 11 does not produce this warning even with obviously wrong > signatures (e.g. short). > I wasn't able to trigger it with gcc on 32-bits at all. KCOV is not > supported on i386 and on arm I got no warnings even with obviously > wrong signatures (e.g. short). > Using "(unsigned long val, void *cases)" fixes the warning on x86_64. > > I am still puzzled why gcc considers this as a builtin because we > don't enable -fsanitizer-coverage on this file. I am also puzzled how > UBSAN affects things. It might be some check-for-builtins check gone wrong if it enables any one of the sanitizers. That would be confirmed if it works with UBSAN_SANITIZE_kcov.o := n > We could change the signature to long, but it feels wrong/dangerous > because the variable should really be 64-bits (long is broken on > 32-bits). > Or we could introduce a typedef that is long on 64-bits and 'long > long' on 32-bits.