Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2365096pxu; Mon, 7 Dec 2020 04:55:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJw4Lx0f7iZusCvsr0BQXyThcVzzNgqFH+VswV0wKWPSK1Qy/x8pfnqfx/DYbe46xCTKWWHD X-Received: by 2002:a50:f392:: with SMTP id g18mr18192114edm.306.1607345704237; Mon, 07 Dec 2020 04:55:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607345704; cv=none; d=google.com; s=arc-20160816; b=wQoF8/SGrG06haRguMO16xnPs+cI8CNTkY09kawdaX4tjUxj7sDu44j3gjIWJghNnL hEGLh5L03NimhPDs04zfxZkBzbUAeJb9+4hDCBVaDhR4pWzPnjIWaSYd4NkGPGR3ZRAa xByYkepvDsjbtIZvJikxoGEze5IEv4RKjyz3Km/6BhN8q/yxPHIZ+QDOePkBa6SB+SD4 PCZbpYj9MXfknKRE3mxr3ObLZ1ewvaDwVLHM45lPJM9e5TVbGqU7osaDZkG+CkAxpdKX 5XsYVGN1AmIEIr/o014YxMjvBwQe3nFd7imSUnxDuNJ+9njtIkIm9Gggbfl/TfJopDyp cibw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=EyGMufKhn3rdsN41H0khe/e5DDZRz7d+ODZIwycAubY=; b=S7z/N4kA0h88hQj2J91Jl5ajwXkg5HV8VBMkZy5SJfiaa+IMi6UwIREOOw7cMursgY tHuqNQE4RzkFc3WF8MkWR9uoeZPFdkYLqYlO23MM8MQ052AnTheUntR3UWvmYW3RSCSN ehuSJKjWec4KCZXXnGolnaslAvQhowLkVYd/kLwQDsvmL3T3vXp777F1lof+4h5f9631 s7RSG2OhayJ6bHFOlkmmv1J5mi+og6jZy7bgr6pQlNz0YkE+MhyvYLiOyLHzBAP7oO0l 7JAV0T5X3vFxI0mRWllNAZZ85rQr2PcTt1y98tA3r5eZCGymueRG0eG/SZjRspaISekN 8pqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=CuoNQ1ZH; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d19si8541748eds.173.2020.12.07.04.54.41; Mon, 07 Dec 2020 04:55:04 -0800 (PST) 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=@google.com header.s=20161025 header.b=CuoNQ1ZH; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726066AbgLGMxD (ORCPT + 99 others); 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-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.