Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp5164249yba; Tue, 30 Apr 2019 10:08:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqxBfbkozAhEbKXuPWpd8RvTZr6VYncwvoZXU4gpIFr8AIiE8S/teQVFfFHbqkUpykH/9XFh X-Received: by 2002:a17:902:4a0c:: with SMTP id w12mr54595221pld.52.1556644094305; Tue, 30 Apr 2019 10:08:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556644094; cv=none; d=google.com; s=arc-20160816; b=tUZ/PhU738oQSM4j4FH8cYVELJOID0Z3D6zXfzG/PHkjlAqgAMO42+FAoucZInb42N +bpwdmFetIZIZqDc5NSJDI3+erJ52pkH8C/uoWhDwc8+cnnpdjaFqk7sRe5g/OhwK/Yy vFJ79sLnfwznG2SDyKnya7WyfHTq2lBc69YsOoyxQBSDLbm+QNg2oS3T9G2b+RdAnKLp ynGExNQ2D/Kvj+Iu800cYkSTdqbZIgY6w9E0mQV4HXk4Tk4w4sWKphlX+z0izSV82a/z cUxYjFOpv1f2F3pULZE0BEB9NGf8ttlyql6AzRY12rR7bvd1/bHxdQ5MaHoSDRuoBLxS QmJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=vJBkrc76riKxPYgJ8BHGhlBKTa7huMjoowLdlDCDO9k=; b=xZ4xG8Wl9F4ivfk/UbhJSEPIv/j83CZLSPzavk/4tyruCZ+YI6Hkl9cyr0cgvvy1gN EGglRvwTDVFHbx1T2Oxr+SSm5Jrrz12OoP/U7FG1nj/NNKGe2REryDmo6G1HVXr06lnF L8QYlqYrbt53tyYBELNF24l5V+Wgw3MNjONtUMAU6Qn6jyRhQ7dLihoNxpiOkpPBZlc0 eKapqizFRfpvdkYSJAcHIyZPWWKa4lIGXdo+k9i7h5Rr71Zen6XtLFIZsf2EuleG0Do6 Pqru33/hSrXazhRnt03rTY3lbU0NeD6dIqotdt+xvqcqWsdLouh9HGQ6herb3PP9lck2 r1XA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w6si9902343pgs.119.2019.04.30.10.07.56; Tue, 30 Apr 2019 10:08:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726842AbfD3RER (ORCPT + 99 others); Tue, 30 Apr 2019 13:04:17 -0400 Received: from 216-12-86-13.cv.mvl.ntelos.net ([216.12.86.13]:32848 "EHLO brightrain.aerifal.cx" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726050AbfD3RER (ORCPT ); Tue, 30 Apr 2019 13:04:17 -0400 Received: from dalias by brightrain.aerifal.cx with local (Exim 3.15 #2) id 1hLWAm-0000Av-00; Tue, 30 Apr 2019 17:04:04 +0000 Date: Tue, 30 Apr 2019 13:04:04 -0400 From: Rich Felker To: Vineet Gupta Cc: Arnaldo Carvalho de Melo , "devel@uclibc-ng.org" , "linux-perf-users@vger.kernel.org" , Arnaldo Carvalho de Melo , lkml , arcml , Arnd Bergmann , Jiri Olsa , Namhyung Kim Subject: Re: Detecting libc in perf (was Re: perf tools build broken after v5.1-rc1) Message-ID: <20190430170404.GX23599@brightrain.aerifal.cx> References: <20190422152027.GB11750@kernel.org> <20190425214800.GC21829@kernel.org> <20190430011818.GE7857@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 30, 2019 at 03:53:18PM +0000, Vineet Gupta wrote: > On 4/29/19 6:18 PM, Arnaldo Carvalho de Melo wrote: > >>> Auto-detecting system features: > >>> ... dwarf: [ OFF ] > >>> ... dwarf_getlocations: [ OFF ] > >>> ... glibc: [ on ] > >> Not related to current issue, this run uses a uClibc toolchain and yet it is > >> detecting glibc - doesn't seem right to me. > > Ok, I'll improve that, I think it just tries to detect a libc, yeah, > > see: > > > > [acme@quaco linux]$ cat tools/build/feature/test-glibc.c > > // SPDX-License-Identifier: GPL-2.0 > > #include > > > > #if !defined(__UCLIBC__) > > #include > > #else > > #define XSTR(s) STR(s) > > #define STR(s) #s > > #endif > > > > int main(void) > > { > > #if !defined(__UCLIBC__) > > const char *version = gnu_get_libc_version(); > > #else > > const char *version = XSTR(__GLIBC__) "." XSTR(__GLIBC_MINOR__); > > #endif > > > > return (long)version; > > } > > [acme@quaco linux]$ > > > > [perfbuilder@59ca4b424ded /]$ grep __GLIBC__ /arc_gnu_2017.09-rc2_prebuilt_uclibc_le_arc700_linux_install/arc-snps-linux-uclibc/sysroot/usr/include/*.h > > /arc_gnu_2017.09-rc2_prebuilt_uclibc_le_arc700_linux_install/arc-snps-linux-uclibc/sysroot/usr/include/features.h: The macros `__GNU_LIBRARY__', `__GLIBC__', and `__GLIBC_MINOR__' are > > /arc_gnu_2017.09-rc2_prebuilt_uclibc_le_arc700_linux_install/arc-snps-linux-uclibc/sysroot/usr/include/features.h:#define __GLIBC__ 2 > > /arc_gnu_2017.09-rc2_prebuilt_uclibc_le_arc700_linux_install/arc-snps-linux-uclibc/sysroot/usr/include/features.h: ((__GLIBC__ << 16) + __GLIBC_MINOR__ >= ((maj) << 16) + (min)) > > [perfbuilder@59ca4b424ded /]$ > > > > Isn't that part of uClibc? > > Right you are. Per the big fat comment right above that code, this gross hack in > uclibc is unavoidable as applications tend to rely on that define. > So a better fix would be to check for various !GLIBC libs explicitly. > > #ifdef __UCLIBC__ > > #elseif defined __MUSL__ > > .... > > Not pretty from app usage pov, but that seems to be the only sane way of doing it. What are you trying to achieve? I was just CC'd and I'm missing the context. Rich