From owner-freebsd-ports@freebsd.org Wed Oct 18 07:47:31 2017 Return-Path: Delivered-To: freebsd-ports@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB805E2F03E for ; Wed, 18 Oct 2017 07:47:31 +0000 (UTC) (envelope-from mad@madpilot.net) Received: from mail.madpilot.net (grunt.madpilot.net [78.47.145.38]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7A09E6ED54; Wed, 18 Oct 2017 07:47:30 +0000 (UTC) (envelope-from mad@madpilot.net) Received: from mail (mail [192.168.254.3]) by mail.madpilot.net (Postfix) with ESMTP id 3yH40J4LJ8zZqh; Wed, 18 Oct 2017 09:47:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=madpilot.net; h= content-transfer-encoding:content-language:content-type :content-type:in-reply-to:mime-version:user-agent:date:date :message-id:from:from:references:subject:subject:received :received; s=mail; t=1508312846; x=1510127247; bh=odekoKTf6CyM0a JKHfMsPXGICI6jTtCdXf9hYYc/hJQ=; b=TNulyfCy2FQq8pmvGbWUIxqqpjhvSr 2Vk9oR65P0+DkQSMujK0XImcCFlekTboxMFKwE5yDlKsSe17bLcLWXKt0hya2V4T oZukscGzEVlwW/qw/cdtYH2tX81dnzobLUTKwGqHzd7U+g2NTsBUEK24iwSoRq+h 8Rkv4fa3/syvk= Received: from mail.madpilot.net ([192.168.254.3]) by mail (mail.madpilot.net [192.168.254.3]) (amavisd-new, port 10024) with ESMTP id fLAJ85BgPUNh; Wed, 18 Oct 2017 09:47:26 +0200 (CEST) Received: from marvin.madpilot.net (micro.madpilot.net [88.149.173.206]) by mail.madpilot.net (Postfix) with ESMTPSA; Wed, 18 Oct 2017 09:47:26 +0200 (CEST) Subject: Re: Debugging ports To: Jan Beich , Kubilay Kocak Cc: Piotr Kubaj , freebsd-ports@freebsd.org References: <20171017160445.GA31080@smtp.iq.pl> <3bd75024-2458-d06a-afa6-9bb75414ff0d@FreeBSD.org> From: Guido Falsi Message-ID: <4b870afb-152d-7ff4-73b5-cce742858346@madpilot.net> Date: Wed, 18 Oct 2017 09:47:25 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Oct 2017 07:47:31 -0000 On 10/18/2017 06:33, Jan Beich wrote: > Kubilay Kocak writes: > >> On 10/18/17 8:29 AM, Jan Beich wrote: >> >>> Guido Falsi writes: >>> >>>> On 10/17/2017 23:11, Guido Falsi wrote: >>>> >>>>>> >>>>>> Thing is, recompiling with WITH_DEBUG doesn't help (I only get >>>>>> memory addresses in gdb), nor does -DCMAKE_BUILD_TYPE=Debug to >>>>>> CMAKE_ARGS (the port uses CMake). >>>> >>>> Sorry, I clearly did not parse your message correctly. >>>> >>>> Looks strange though, WITH_DEBUG always worked for me... Usually I >>>> compile the whole set in poudriere with WITH_DEBUG, to make sure all >>>> libraries have symbols too. >>> >>> WITH_DEBUG doesn't disable vendor optimizations like -fomit-frame-pointer >>> which may hinder stack unwinding, doesn't enable debug symbols for ports >>> not respecting CFLAGS, often a nop for non-C/C++ ports, etc. >> >> Could the framework WITH_DEBUG block remove this (and potentially) other >> relevant flags from C*FLAGS if present with variable modifiers? > > Only for what make(1) inherits when Mk/bsd.port.mk is parsed. A lot more > ports pass the option via makefiles under WRKSRC that cannot be altered > short of patching or overriding all CFLAGS. > > To get accurate list of offenders an -exp run WITH_DEBUG=1 is required > then grep(1) build logs for -fomit-frame-pointer and -O* flags. This can > result in bugs against ports that fail to properly respect CFLAGS, so the > port maintainers can help with patches. I'm preparing a patch related to WITH_DEBUG, which, if accepted, will need an exp-run before going in. That would be a good chance to perform a check for these kind of things. But I'm still working on it and will need a little more time. I'll let you know as soon as I have something I am willing to show. BTW on head gdb is gone from base for i386/amd64 AFAIK, so ports gdb will be the only way to go in the future. -- Guido Falsi