From owner-freebsd-stable@FreeBSD.ORG Fri Mar 28 21:18:14 2014 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from hammer.pct.niksun.com (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by hub.freebsd.org (Postfix) with ESMTP id 5503CE6F; Fri, 28 Mar 2014 21:18:14 +0000 (UTC) Message-ID: <5335E715.3090603@FreeBSD.org> Date: Fri, 28 Mar 2014 17:18:13 -0400 From: Jung-uk Kim User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: Craig Rodrigues , Dimitry Andric Subject: Re: HEADS UP: merged llvm/clang 3.4 References: <20140328165121.13797.qmail@mailgate.gta.com> <6F2AEDEC-4173-45B0-9C21-1D80E33660F6@FreeBSD.org> <1396029772.81853.150.camel@revolution.hippie.lan> In-Reply-To: X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Larry Baird , FreeBSD stable , Ian Lepore 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: Fri, 28 Mar 2014 21:18:14 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 2014-03-28 16:25:42 -0400, Craig Rodrigues wrote: > On Fri, Mar 28, 2014 at 11:11 AM, Dimitry Andric > wrote: >> >> You need to rebuild the system anyway, if you want debug >> information, so nothing changed? If you insist on wanting to use >> the crummy gdb in base, which should have been axed years ago, >> then just use DEBUG_FLAGS=-gdwarf-2, otherwise use ports gdb, >> which any sensible person should do. >> >> -Dimitry >> > > This kind of thing is OK for HEAD, but to me seems like something > which is not OK for a stable branch. > > Before your change: "cc -g" from base + gdb in base = can debug > After your change: "cc -g" from base + gdb in base = cannot > debug > > Is it possible to modify clang in base, so that on the stable > branches, "cc -g" will output dwarf-2 instead of dwarf-4 by > default? > > 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"); Jung-uk Kim -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (FreeBSD) iQEcBAEBAgAGBQJTNecVAAoJEHyflib82/FGEAIH/jAq9qWtvbSn/EGmJmMSFH6O YRhtVdA+npUU/QMdfd9ligAi2gccjGxnjXRdTbezPwa8e8i9enNtrDpRKVcto8f4 SZtzRoUEp1hnrylm0brt0pVYWD8xwz403XUMszQ5HVmTOiaWJtWKzksNTc2H5llF 3FBIRNm9sKNc1RlQOS1NzVEbtsFiP46otvfSprncQTuNJl+5t2awUnJJRtEbtRgi EwfsXqhBspwRHqm85az5xMJ2fLOQrtSJF3vpW70cnl2g7SXp8QuI4HmIks6CXmJH tDDs85GdxJhZbady6uiT10QkS8WYxdbc176bXNelN+HyYKXzsuXgl1z25dMdyIg= =gdcE -----END PGP SIGNATURE-----