Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 Feb 2014 15:47:52 -0700
From:      "Justin T. Gibbs" <gibbs@FreeBSD.org>
To:        Roman Divacky <rdivacky@freebsd.org>
Cc:        freebsd-toolchain@freebsd.org
Subject:   Re: ctfconvert broken for C++ objects?
Message-ID:  <81C07491-7E51-4CF0-B257-88ED998EE2A0@FreeBSD.org>
In-Reply-To: <20140220172608.GA85526@freebsd.org>
References:  <216B816A-8ADA-438F-B834-8C386C5BC460@FreeBSD.org> <20140220172608.GA85526@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
On Feb 20, 2014, at 10:26 AM, Roman Divacky <rdivacky@freebsd.org> wrote:

> The dwarf backend for ctfconvert was completely reimplemented a few weeks ago.
> It's now based on elftoolchain libdwarf.
> 
> Test on current.

The failures I’ve experienced occur when attempting to ctfconvert the C++ code in the base (e.g. ATF or devd).  You can replicate the failures on head by applying the share/mk patch below (a version of my previous patch rebased on head).

On a slightly related node, do you know why there is a FreeBSD version ranged exclusion around bootstrapping the dtrace tools?

From src/Makefile.inc1:
# dtrace tools are required for older bootstrap env and cross-build              
.if ${MK_CDDL} != "no" && \                                                      
    ((${BOOTSTRAPPING} < 1000034 && \                                            
          !(${BOOTSTRAPPING} >= 901505 && ${BOOTSTRAPPING} < 999999)) \          
      || (${MACHINE} != ${TARGET} || ${MACHINE_ARCH} != ${TARGET_ARCH}))         
_dtrace_tools= cddl/usr.bin/sgsmsg cddl/lib/libctf lib/libelf \                  
    lib/libdwarf cddl/usr.bin/ctfconvert cddl/usr.bin/ctfmerge                   
.endif

We had to disable this protection in our build so that the fixes to the dtrace tool chain took effect prior to compiling any C++ code during buildworld.

In testing this on head, I also found that 9-stable’s g++ segfaulted when bootstrapping clang, so I had to buildworld using 9-stable’s clang to get past the bootstrap phase.  (By 9-stable, I mean a 9-stable tree from October/November from last year).

—
Justin


[-- Attachment #2 --]
Index: bsd.lib.mk
===================================================================
--- bsd.lib.mk	(revision 262298)
+++ bsd.lib.mk	(working copy)
@@ -80,12 +80,15 @@
 
 .cc.o .C.o .cpp.o .cxx.o:
 	${CXX} ${STATIC_CXXFLAGS} ${CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET}
+	${CTFCONVERT_CMD}
 
 .cc.po .C.po .cpp.po .cxx.po:
 	${CXX} ${PO_FLAG} ${STATIC_CXXFLAGS} ${PO_CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET}
+	${CTFCONVERT_CMD}
 
 .cc.So .C.So .cpp.So .cxx.So:
 	${CXX} ${PICFLAG} -DPIC ${SHARED_CXXFLAGS} ${CXXFLAGS} -c ${.IMPSRC} -o ${.TARGET}
+	${CTFCONVERT_CMD}
 
 .f.po:
 	${FC} -pg ${FFLAGS} -o ${.TARGET} -c ${.IMPSRC}
Index: sys.mk
===================================================================
--- sys.mk	(revision 262298)
+++ sys.mk	(working copy)
@@ -246,9 +246,11 @@
 
 .cc .cpp .cxx .C:
 	${CXX} ${CXXFLAGS} ${LDFLAGS} ${.IMPSRC} ${LDLIBS} -o ${.TARGET}
+	${CTFCONVERT_CMD}
 
 .cc.o .cpp.o .cxx.o .C.o:
 	${CXX} ${CXXFLAGS} -c ${.IMPSRC}
+	${CTFCONVERT_CMD}
 
 .m.o:
 	${OBJC} ${OBJCFLAGS} -c ${.IMPSRC}

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?81C07491-7E51-4CF0-B257-88ED998EE2A0>