From owner-svn-src-head@freebsd.org Sat Jun 9 18:02:42 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9E9A1019FB4; Sat, 9 Jun 2018 18:02:41 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-io0-x244.google.com (mail-io0-x244.google.com [IPv6:2607:f8b0:4001:c06::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6C1FB69DC4; Sat, 9 Jun 2018 18:02:41 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-io0-x244.google.com with SMTP id l25-v6so19410206ioh.12; Sat, 09 Jun 2018 11:02:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=6nMre5dyDL4iQXzMzsdvuJrtxfy+9G1kwiHfoR+RTFo=; b=MZbtvyetfZKs09A3c1VClq09ZxNXU/w/N6mjcjPmyLKhKUfzW299jUkdIOwD0mvqLI C7GYEXlz9ouNImFDGmi5qjsA8OAeF52ooZt0QaoSlg1LFxtJUrx3ScM3cEfr0B0YufX9 Cjf7unux5Mp+et2P9oIyAJB+Ytrcccz9xQuo7BzDp7+U10Qkbm30fYiNq/mXWuaQEZNW uK2ifcjmr3v/di31GUhykzPJYFX0B38G/99czIrdnh6R6FJeFcn0v9KN0C+WeGk4f27B BMNW9L3TJGRooPtWk6b79b6dckWTHHWP9+/Q9z7+WBcNVyQ00s1j65jj4Aoy4eC2bmZ9 qPXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=6nMre5dyDL4iQXzMzsdvuJrtxfy+9G1kwiHfoR+RTFo=; b=O1yVu5Fg0MaA4irAtaveZNSHIdvq8mIJRzQnv/V0auscC94jndp7Z4ymjL+clJaG2W fV019JTsl2pjXoQ5SUOLCHd86J9zZc8IublJpoyPICkdZWdwq3KwZH7M+QpU/O8cxVyI QzlizXSlM4Lq/yynCSd1cfFLCwyEXz3Y5mPxkcj5AperihyhBPTzXEwkExyz0UrymbFb hlVBQxhu6c0EQ0LPi340Yjgaqe9KYucE2Bmw9UWEiu2t3sNuLpgaStNymJstXfiuqvVD eQxZnhl40geKgCnVqhT2CWbpqTEqp8bA1t9+129FSyQEw/YOKTFxW31tYX88+/ej4N1C c5hw== X-Gm-Message-State: APt69E15o35reuWdxNR9sT3Sh4Ne1PROzQVlB/Wlee19fjyHZUh0jiYh ee8jBYbOAELRSJuh4Lj3JuMzQs5z X-Google-Smtp-Source: ADUXVKLD+zpH8d420o/3GPXZl9xkD7LZ5mre+h0tZfLOJJAk8vJpZtfdyp6/HN9E/dHsOer24m7uIA== X-Received: by 2002:a6b:1b93:: with SMTP id b141-v6mr9641868iob.240.1528567360601; Sat, 09 Jun 2018 11:02:40 -0700 (PDT) Received: from pesky ([137.122.64.159]) by smtp.gmail.com with ESMTPSA id k139-v6sm2352673itk.27.2018.06.09.11.02.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 09 Jun 2018 11:02:39 -0700 (PDT) Sender: Mark Johnston Date: Sat, 9 Jun 2018 14:02:37 -0400 From: Mark Johnston To: Bryan Drewery Cc: "O. Hartmann" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r334883 - head/cddl/contrib/opensolaris/tools/ctf/cvt Message-ID: <20180609180237.GD1394@pesky> References: <201806091510.w59FAnIW036815@repo.freebsd.org> <20180609193527.46a0f9a6@thor.intern.walstatt.dynvpn.de> <20180609173951.GB1394@pesky> <80b8176b-61c5-c3b2-49b1-36ba9be77d1b@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <80b8176b-61c5-c3b2-49b1-36ba9be77d1b@FreeBSD.org> User-Agent: Mutt/1.10.0 (2018-05-17) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Jun 2018 18:02:42 -0000 On Sat, Jun 09, 2018 at 01:56:18PM -0400, Bryan Drewery wrote: > On 6/9/18 1:39 PM, Mark Johnston wrote: > > On Sat, Jun 09, 2018 at 07:35:00PM +0200, O. Hartmann wrote: > >> -----BEGIN PGP SIGNED MESSAGE----- > >> Hash: SHA512 > >> > >> Am Sat, 9 Jun 2018 15:10:49 +0000 (UTC) > >> Mark Johnston schrieb: > >> > >>> Author: markj > >>> Date: Sat Jun 9 15:10:49 2018 > >>> New Revision: 334883 > >>> URL: https://svnweb.freebsd.org/changeset/base/334883 > >>> > >>> Log: > >>> Don't process DWARF generated from non-C/C++ code. > >>> > >>> ctfconvert(1) is not designed to handle DWARF generated from such code, > >>> and will generally fail in non-obvious ways. Use an explicit check to > >>> help catch such potential failures. > >>> > >>> Reported by: Johannes Lundberg > >>> MFC after: 2 weeks > >>> > >>> Modified: > >>> head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c > >>> > >>> Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c > >>> ============================================================================== > >>> --- head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c Sat Jun 9 15:10:39 > >>> 2018 (r334882) +++ head/cddl/contrib/opensolaris/tools/ctf/cvt/dwarf.c > >>> Sat Jun 9 15:10:49 2018 (r334883) @@ -1901,7 +1901,7 @@ should_have_dwarf(Elf > >>> *elf) int > >>> dw_read(tdata_t *td, Elf *elf, char *filename __unused) > >>> { > >>> - Dwarf_Unsigned abboff, hdrlen, nxthdr; > >>> + Dwarf_Unsigned abboff, hdrlen, lang, nxthdr; > >>> Dwarf_Half vers, addrsz, offsz; > >>> Dwarf_Die cu = 0; > >>> Dwarf_Die child = 0; > >>> @@ -1941,8 +1941,8 @@ dw_read(tdata_t *td, Elf *elf, char *filename __unused > >>> } > >>> > >>> if ((rc = dwarf_next_cu_header_b(dw.dw_dw, &hdrlen, &vers, &abboff, > >>> - &addrsz, &offsz, NULL, &nxthdr, &dw.dw_err)) != DW_DLV_OK) { > >>> - if (dw.dw_err.err_error == DW_DLE_NO_ENTRY) > >>> + &addrsz, &offsz, NULL, &nxthdr, &dw.dw_err)) != DW_DLV_OK) { > >>> + if (dw.dw_err.err_error == DW_DLE_NO_ENTRY) > >>> exit(0); > >>> else > >>> terminate("rc = %d %s\n", rc, dwarf_errmsg(dw.dw_err)); > >>> @@ -1971,6 +1971,25 @@ dw_read(tdata_t *td, Elf *elf, char *filename __unused > >>> debug(1, "DWARF emitter: %s\n", prod); > >>> free(prod); > >>> } > >>> + > >>> + if (dwarf_attrval_unsigned(cu, DW_AT_language, &lang, &dw.dw_err) == 0) > >>> + switch (lang) { > >>> + case DW_LANG_C: > >>> + case DW_LANG_C89: > >>> + case DW_LANG_C99: > >>> + case DW_LANG_C11: > >>> + case DW_LANG_C_plus_plus: > >>> + case DW_LANG_C_plus_plus_03: > >>> + case DW_LANG_C_plus_plus_11: > >>> + case DW_LANG_C_plus_plus_14: > >>> + break; > >>> + default: > >>> + terminate("file contains DWARF for unsupported " > >>> + "language %d", lang); > >>> + } > >>> + else > >>> + warning("die %llu: failed to get language attribute: %s\n", > >>> + die_off(&dw, cu), dwarf_errmsg(dw.dw_err)); > >>> > >>> if ((dw.dw_cuname = die_name(&dw, cu)) != NULL) { > >>> char *base = xstrdup(basename(dw.dw_cuname)); > >>> _______________________________________________ > >>> svn-src-head@freebsd.org mailing list > >>> https://lists.freebsd.org/mailman/listinfo/svn-src-head > >>> To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > >> This commit makes buildworld (WITH_META_MODE) failing: > > > > I added these identifiers in r334881, and the CI build is passing. Might > > this be a problem with META_MODE? > > > >> [...] > >> ===> cddl/usr.bin/ctfconvert (obj,all,install) > >> Building /usr/obj/usr/src/amd64.amd64/tmp/obj-tools/cddl/usr.bin/ctfconvert/dwarf.o > > obj-tools means it is trying to build a HOST NATIVE version of this. > Where are these defined? In this case they need to be defined in > /usr/include already unless the build has -I.CURDIR/somewhere/to/headers > instead. The definitions are in contrib/elftoolchain/libdwarf/dwarf.h. Indeed, the ctfconvert makefile doesn't explicitly add libdwarf to the include path. I'm surprised that this is necessary though - do I need to modify the BOOTSTRAPPING check for _elftoolchain_libs in Makefile.inc1?