From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23779 invoked by alias); 20 Jul 2018 14:06:13 -0000 Mailing-List: contact libc-help-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Post: List-Help: , Sender: libc-help-owner@sourceware.org Received: (qmail 23030 invoked by uid 89); 20 Jul 2018 14:06:12 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=assessment X-HELO: mail-qt0-f172.google.com Received: from mail-qt0-f172.google.com (HELO mail-qt0-f172.google.com) (209.85.216.172) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 20 Jul 2018 14:06:10 +0000 Received: by mail-qt0-f172.google.com with SMTP id n6-v6so5793082qtl.4 for ; Fri, 20 Jul 2018 07:06:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:references:from:openpgp:autocrypt:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=QnCcrELLZsDBTxeJ0CaGYBQnrJW8ju6cxQbj33Ou58E=; b=eqyJAgpWgPtMkOTHlgm4p+cRaTkBm7N45HWhv43bAKr+KvnZAFuPyBzOWrrVZT/shV kAaczOTzao94qVVIolCCLK7+51BrUSZT7xqdbuTA/TANpKc7Q0eDavoTz3zkvJmJojCa ZPn/dEnqo1LGTVfl9Xk+RLVDVEoh5kFRCyGdQ= Return-Path: Received: from [10.0.0.106] ([179.159.11.160]) by smtp.googlemail.com with ESMTPSA id x26-v6sm1412474qth.15.2018.07.20.07.06.07 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 20 Jul 2018 07:06:08 -0700 (PDT) Subject: Re: gcov support for glibc To: libc-help@sourceware.org References: From: Adhemerval Zanella Openpgp: preference=signencrypt Message-ID: <3f227b86-862c-c672-2cab-9721f38a4c64@linaro.org> Date: Fri, 20 Jul 2018 14:06:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2018-07/txt/msg00012.txt.bz2 On 20/07/2018 00:32, Palleti, Avinash Reddy wrote: > Hi, > > We are trying to get coverage analysis for glibc test cases, we tried below command to enable gcov support while building glibc. > > CFLAGS="-ftest-coverage -fprofile-arcs -O2 -U_FORTIFY_SOURCE" CXXFLAGS="-ftest-coverage -fprofile-arcs" LD_FLAGS="-fprofile-arcs" ../configure --prefix=/opt/ --disable-werror libc_cv_ctors_header=yes libc_cv_c_cleanup=yes > > With this configure line, "make tests" was giving segmentation fault with not much information in coredump. Then we realized that there is no support for gcov in glibc (https://sourceware.org/ml/libc-help/2017-09/msg00031.html) > There are suggestions to use oprofile but that just gives functional coverage, we are looking for line coverage. > Does anyone tried supporting gcov for glibc, if yes, please share the patches or give us pointers to work on the same. > > Thanks, > Avinash I think you will need to do an assessment similar when we added -fstack-protector support, where will need to identify which objects you will need to suppress the gcov flags and any additional linking steps to get a functional build (maybe by disabling on loader or adding any runtime required on a static build). You can try to identify the problematic object which is causing the segfault by using some points at [1]. Usually the most common issue is GDB can't find the debug information (by issuing the linking manually) and one option is to use --enable-hardcoded-path-in-tests. [1] https://sourceware.org/glibc/wiki/Debugging/Development_Debugging