From owner-freebsd-stable@FreeBSD.ORG Sat Mar 29 04:48:21 2014 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7DCC8207 for ; Sat, 29 Mar 2014 04:48:21 +0000 (UTC) Received: from mailgate.gta.com (mailgate.gta.com [199.120.225.23]) by mx1.freebsd.org (Postfix) with ESMTP id 20F8432A for ; Sat, 29 Mar 2014 04:48:19 +0000 (UTC) Received: (qmail 84351 invoked by uid 1000); 29 Mar 2014 04:48:18 -0000 Date: 29 Mar 2014 04:48:18 -0000 Message-ID: <20140329044818.84350.qmail@mailgate.gta.com> From: Larry Baird To: freebsd-stable@freebsd.org Subject: Re: HEADS UP: merged llvm/clang 3.4 In-Reply-To: User-Agent: tin/2.2.0-20131224 ("Lochindaal") (UNIX) (FreeBSD/9.2-RELEASE-p3 (i386)) Cc: Dimitry Andric X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Mar 2014 04:48:21 -0000 >> > I understand that installing gdb from ports, changing compiler >> > flags from -g to -gdwarf-2 in Makefiles, or switching to compiling >> > with gcc are all reasonable workarounds, but this seems a bit like >> > POLA for a stable branch. >> >> Yeah, it is really unpleasant. >> >> Maybe we should do something like this for stable/9 and stable/10 >> branches (not tested). >> >> --- contrib/llvm/tools/clang/lib/Driver/Tools.cpp >> +++ contrib/llvm/tools/clang/lib/Driver/Tools.cpp >> @@ -2628,8 +2628,9 @@ void Clang::ConstructJob(Compilation &C, const Job >> CmdArgs.push_back("-gdwarf-4"); >> else if (!A->getOption().matches(options::OPT_g0) && >> !A->getOption().matches(options::OPT_ggdb0)) { >> - // Default is dwarf-2 for darwin. >> - if (getToolChain().getTriple().isOSDarwin()) >> + // Default is dwarf-2 for Darwin and FreeBSD. >> + if (getToolChain().getTriple().isOSDarwin() || >> + getToolChain().getTriple().getOS() == llvm::Triple::FreeBSD) >> CmdArgs.push_back("-gdwarf-2"); >> else >> CmdArgs.push_back("-g"); > > I'm now testing something similar, which also tests the FreeBSD version, > so it can be applied to head and then MFC'd. I will commit it soon. Glad to hear. Adding an extra flag, to get applications to a state where they could be debugged was unexpected. I am sure I wouldn't have been the only one surprised to find out that "cc -g" no longer works. Larry -- ------------------------------------------------------------------------ Larry Baird Global Technology Associates, Inc. 1992-2012 | http://www.gta.com Celebrating Twenty Years of Software Innovation | Orlando, FL Email: lab@gta.com | TEL 407-380-0220