From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com [IPv6:2607:f8b0:4864:20::102a]) by sourceware.org (Postfix) with ESMTPS id 1A5823858D20 for ; Sat, 29 Oct 2022 05:59:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1A5823858D20 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=google.com Received: by mail-pj1-x102a.google.com with SMTP id q1-20020a17090a750100b002139ec1e999so1872931pjk.1 for ; Fri, 28 Oct 2022 22:59:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=dcW2XhAR/kicgFXy7KCfSG5KkdEIYGM+Y2b2R2mMSy0=; b=p12hoxSQ48lQorWuYT5U8mqRbYrIq+QJkezrDWjwxDMyWDWLEN9n+TAIvE1Bba/M2L iIViCZ29IAK/+AyM2vV0dEIRX70B+MzPuZwXAwjiVZdiseKOmreDJNPKxS8IIQ12Gwis TDEfdw1WGgcz+DGCdhu4pWdWIhEdIuKTpdA6oerpiveVHQJ783heTT2aag5nARGr2Qgl 1/EtgIlZNRJpjvuJaNxb6tUP9elduqJQwjjfOj3sTB/GPRmDXK/POV7aQkbsnRZVTAxX 6E/HcfSvvZqlQbc81ribCPvPjAdrS55UfkH6N1GtD5jN+/M6mAx79M86haHDu3t1S/N9 cfWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=dcW2XhAR/kicgFXy7KCfSG5KkdEIYGM+Y2b2R2mMSy0=; b=oXmpy21EJKkY8tJpBKPiJZmTutHPrkZ1TRSgU6X9kHyQATenSop/Xw+LJBaGCqJkZq iu8m3F0MugWb4RjbywpvPbN0Tgak2pmccvqpRhAUQ+qrpeMce7iwA0N2yj72qcmiJcte OJgO7XTAnYu1tnC61pnWJZNzMJWwtgW/Jrmz/nT3wJT1Hps/zbBu0gS9+x/f6m9zPWT2 pkJmEk6eGBd6luvw8bWhXP42ghnis2X9R4q9Vft0l2Shx91ZvgSAiT/sBv+MP4gWsx9Y 6oHy0jFMhOeNb3gl4LG/ONDxeiDK7s6RDJJnCZjn+wBkOvuQCdB3JlhaweeA2tPRt8nB kSTA== X-Gm-Message-State: ACrzQf21QEdlJatgQkL/P8xn+9RJ0s9bt8SrPNosLpqMKBCpHCvLHnmB GC22KLlHyIKP7apmN3UGpJbqwHZu7SoFiw== X-Google-Smtp-Source: AMsMyM5s8/2nLw01jtKY1u5ljQekLKAZ/S5HWR7wjShj971CLdcbrLyFMDChgDEgUFGAZ/1dBcNcmA== X-Received: by 2002:a17:903:200b:b0:186:892f:9f0b with SMTP id s11-20020a170903200b00b00186892f9f0bmr2841392pla.56.1667023181046; Fri, 28 Oct 2022 22:59:41 -0700 (PDT) Received: from google.com ([2620:15c:2ce:200:8981:f21e:b257:256]) by smtp.gmail.com with ESMTPSA id x62-20020a623141000000b0056c3d3f5a8dsm438132pfx.56.2022.10.28.22.59.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Oct 2022 22:59:40 -0700 (PDT) Date: Fri, 28 Oct 2022 22:59:36 -0700 From: Fangrui Song To: Adhemerval Zanella Cc: libc-alpha@sourceware.org Subject: Re: [PATCH 08/11] configure: Use -Wno-ignored-attributes if compiler warns about multiple aliases Message-ID: <20221029055936.y4qtf52hxnqba2en@google.com> References: <20221028173532.876027-1-adhemerval.zanella@linaro.org> <20221028173532.876027-9-adhemerval.zanella@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20221028173532.876027-9-adhemerval.zanella@linaro.org> X-Spam-Status: No, score=-20.4 required=5.0 tests=BAYES_00,DKIMWL_WL_MED,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,ENV_AND_HDR_SPF_MATCH,KAM_INFOUSMEBIZ,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 2022-10-28, Adhemerval Zanella via Libc-alpha wrote: >clang emits an warning when a double alias redirection is used, to warn >the the original symbol will be used even when weak definition is >overridden. Howerver, this is a common pattern for weak_alias, where >multiple alias are set to same symbol. Confirmed that the pattern is common. % rg -U 'libc_hidden_def.*\nweak_alias.*\nlibc_hidden_weak' -l login/getlogin_r.c libio/iofgets_u.c libio/iofflush.c libio/iofputs_u.c libio/iofflush_u.c libio/iofgets.c libio/fileno.c string/memmem.c resource/getrlimit64.c string/argz-next.c inet/if_index.c io/open.c string/basename.c wcsmbs/wmemset.c wcsmbs/wcschr.c wcsmbs/wmemchr.c wctype/wcfuncs.c resolv/inet_pton.c sysdeps/x86_64/wmemchr.S sysdeps/x86_64/memset.S sysdeps/unix/getlogin_r.c sysdeps/x86_64/wcschr.S sysdeps/mach/hurd/getpid.c sysdeps/mach/hurd/read.c sysdeps/mach/hurd/write.c sysdeps/mach/hurd/getlogin_r.c sysdeps/mach/hurd/if_index.c sysdeps/mach/hurd/fcntl.c sysdeps/mach/hurd/open.c sysdeps/unix/sysv/linux/getlogin_r.c sysdeps/unix/sysv/linux/fcntl64.c sysdeps/unix/sysv/linux/if_index.c The three macros can be reordered and there may be more results. I just took some notes here https://maskray.me/blog/2021-10-10-when-can-glibc-be-built-with-clang#alias-to-a-weak-alias I feel that the pattern is ugly but I cannot figure out a better way. Clang has a reasonable diagnostic. It is fine to ignore it as the Clang symbol codegen matches GCC. ``` 26: 0000000000000000 596 FUNC GLOBAL HIDDEN 1 __GI___mbrtowc 33: 0000000000000000 596 FUNC GLOBAL DEFAULT 1 __mbrtowc 34: 0000000000000000 596 FUNC WEAK HIDDEN 1 __GI_mbrtowc 35: 0000000000000000 596 FUNC WEAK DEFAULT 1 mbrtowc ``` So here is a Reviewed-by tag: but I really hope that we can come up with a better way. Reviewed-by: Fangrui Song