Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Add MKCTF



Hi,

I'm adding a new build variable MKCTF, which
was discussed on the chat some days ago.

Currently CTF tools are built and used to generate
and manipulate CTF data of ELF binaries when
we build with MKDTRACE=yes. Unfortunately,
current CTF tools don't work on i386/amd64/arm,
and that adds a burden to try DTrace by users.

The new variable is intended to separate CTF
stuffs from MKDTRACE; we can build DTrace
solely without worrying about the CTF issues.
Fortunately, CTF data are not used yet by
current DTrace of NetBSD, so DTrace still
works without CTF data.

Once CTF issues are solved, we would be
able to merge MKCTF to MKDTRACE again
but it would not come soon. So I think the
workaround is still useful at this point.

My patch is attached and also available at
http://www.netbsd.org/~ozaki-r/MKCTF.diff .

This is the diffstat of the patch:
$ diffstat MKCTF.diff
 distrib/sets/lists/comp/mi           |    6 +++---
 distrib/sets/lists/man/mi            |   18 +++++++++---------
 etc/Makefile.params                  |    2 +-
 external/cddl/Makefile               |    2 +-
 external/cddl/osnet/lib/Makefile     |    2 ++
 external/cddl/osnet/usr.bin/Makefile |    2 +-
 share/man/man5/mk.conf.5             |    7 +++++++
 share/mk/bsd.README                  |    5 +++++
 share/mk/bsd.own.mk                  |    4 ++--
 share/mk/bsd.prog.mk                 |    2 +-
 tools/Makefile                       |    2 ++
 11 files changed, 34 insertions(+), 18 deletions(-)

Any comments and suggestions are welcome.

Best regards,
  ozaki-r
Index: distrib/sets/lists/comp/mi
===================================================================
RCS file: /cvs/cvsroot/src/distrib/sets/lists/comp/mi,v
retrieving revision 1.1885
diff -u -r1.1885 mi
--- distrib/sets/lists/comp/mi  22 Mar 2014 11:24:35 -0000      1.1885
+++ distrib/sets/lists/comp/mi  24 Mar 2014 09:43:41 -0000
@@ -20,9 +20,9 @@
 ./usr/bin/config                               comp-util-bin
 ./usr/bin/crunchgen                            comp-c-bin
 ./usr/bin/crunchide                            comp-c-bin
-./usr/bin/ctfconvert                           comp-util-bin           dtrace
-./usr/bin/ctfdump                              comp-util-bin           dtrace
-./usr/bin/ctfmerge                             comp-util-bin           dtrace
+./usr/bin/ctfconvert                           comp-util-bin           ctf
+./usr/bin/ctfdump                              comp-util-bin           ctf
+./usr/bin/ctfmerge                             comp-util-bin           ctf
 ./usr/bin/cvs                                  comp-cvs-bin            cvs
 ./usr/bin/cvsbug                               comp-cvs-bin            cvs
 ./usr/bin/elfedit                              comp-util-bin           binutils
Index: distrib/sets/lists/man/mi
===================================================================
RCS file: /cvs/cvsroot/src/distrib/sets/lists/man/mi,v
retrieving revision 1.1465
diff -u -r1.1465 mi
--- distrib/sets/lists/man/mi   19 Mar 2014 15:26:41 -0000      1.1465
+++ distrib/sets/lists/man/mi   24 Mar 2014 09:43:43 -0000
@@ -125,9 +125,9 @@
 ./usr/share/man/cat1/csh.0                     man-util-catman         .cat
 ./usr/share/man/cat1/csplit.0                  man-util-catman         .cat
 ./usr/share/man/cat1/ctags.0                   man-c-catman            .cat
-./usr/share/man/cat1/ctfconvert.0              man-util-catman         
.cat,dtrace
-./usr/share/man/cat1/ctfdump.0                 man-util-catman         
.cat,dtrace
-./usr/share/man/cat1/ctfmerge.0                        man-util-catman         
.cat,dtrace
+./usr/share/man/cat1/ctfconvert.0              man-util-catman         .cat,ctf
+./usr/share/man/cat1/ctfdump.0                 man-util-catman         .cat,ctf
+./usr/share/man/cat1/ctfmerge.0                        man-util-catman         
.cat,ctf
 ./usr/share/man/cat1/cu.0                      man-util-catman         .cat
 ./usr/share/man/cat1/cut.0                     man-util-catman         .cat
 ./usr/share/man/cat1/daicctl.0                 man-sysutil-catman      .cat
@@ -3240,9 +3240,9 @@
 ./usr/share/man/html1/csh.html                 man-util-htmlman        html
 ./usr/share/man/html1/csplit.html              man-util-htmlman        html
 ./usr/share/man/html1/ctags.html               man-c-htmlman           html
-./usr/share/man/html1/ctfconvert.html          man-util-htmlman        
html,dtrace
-./usr/share/man/html1/ctfdump.html             man-util-htmlman        
html,dtrace
-./usr/share/man/html1/ctfmerge.html            man-util-htmlman        
html,dtrace
+./usr/share/man/html1/ctfconvert.html          man-util-htmlman        html,ctf
+./usr/share/man/html1/ctfdump.html             man-util-htmlman        html,ctf
+./usr/share/man/html1/ctfmerge.html            man-util-htmlman        html,ctf
 ./usr/share/man/html1/cu.html                  man-util-htmlman        html
 ./usr/share/man/html1/cut.html                 man-util-htmlman        html
 ./usr/share/man/html1/daicctl.html             man-sysutil-htmlman     html
@@ -5963,9 +5963,9 @@
 ./usr/share/man/man1/csh.1                     man-util-man            .man
 ./usr/share/man/man1/csplit.1                  man-util-man            .man
 ./usr/share/man/man1/ctags.1                   man-c-man               .man
-./usr/share/man/man1/ctfconvert.1              man-util-man            
.man,dtrace
-./usr/share/man/man1/ctfdump.1                 man-util-man            
.man,dtrace
-./usr/share/man/man1/ctfmerge.1                        man-util-man            
.man,dtrace
+./usr/share/man/man1/ctfconvert.1              man-util-man            .man,ctf
+./usr/share/man/man1/ctfdump.1                 man-util-man            .man,ctf
+./usr/share/man/man1/ctfmerge.1                        man-util-man            
.man,ctf
 ./usr/share/man/man1/cu.1                      man-util-man            .man
 ./usr/share/man/man1/cut.1                     man-util-man            .man
 ./usr/share/man/man1/daicctl.1                 man-sysutil-man         .man
Index: etc/Makefile.params
===================================================================
RCS file: /cvs/cvsroot/src/etc/Makefile.params,v
retrieving revision 1.10
diff -u -r1.10 Makefile.params
--- etc/Makefile.params 26 Jan 2014 17:33:53 -0000      1.10
+++ etc/Makefile.params 24 Mar 2014 09:43:43 -0000
@@ -44,7 +44,7 @@
                MACHINE MACHINE_ARCH MAKE MAKECONF MAKEFLAGS \
                MAKEOBJDIR MAKEOBJDIRPREFIX MAKEVERBOSE \
                MKARZERO MKATF MKBFD MKBINUTILS MKCATPAGES \
-               MKCRYPTO MKCRYPTO_RC5 MKCVS \
+               MKCRYPTO MKCRYPTO_RC5 MKCTF MKCVS \
                MKDEBUG MKDEBUGLIB MKDOC MKDTRACE MKDYNAMICROOT \
                MKGCC MKGCCCMDS MKGDB \
                MKHESIOD MKHTML MKIEEEFP MKINET6 MKINFO MKIPFILTER \
Index: external/cddl/Makefile
===================================================================
RCS file: /cvs/cvsroot/src/external/cddl/Makefile,v
retrieving revision 1.2
diff -u -r1.2 Makefile
--- external/cddl/Makefile      25 Feb 2010 00:14:10 -0000      1.2
+++ external/cddl/Makefile      24 Mar 2014 09:43:54 -0000
@@ -3,7 +3,7 @@
 
 # We need more modular flag e.g. we can add dtrace to osnet later
 
-.if ( ${MKZFS} != "no" || ${MKDTRACE} != "no" )
+.if ( ${MKZFS} != "no" || ${MKDTRACE} != "no" || ${MKCTF} != "no")
 SUBDIR+= osnet
 .endif
 
Index: external/cddl/osnet/lib/Makefile
===================================================================
RCS file: /cvs/cvsroot/src/external/cddl/osnet/lib/Makefile,v
retrieving revision 1.5
diff -u -r1.5 Makefile
--- external/cddl/osnet/lib/Makefile    11 Sep 2013 23:04:10 -0000      1.5
+++ external/cddl/osnet/lib/Makefile    24 Mar 2014 09:43:54 -0000
@@ -6,6 +6,8 @@
 
 .if (defined(MKDTRACE) && ${MKDTRACE} != "no")
 SUBDIR+=       libdtrace
+.endif
+.if ${MKDTRACE:Uno} != "no" || ${MKCTF:Uno} != "no"
 SUBDIR+=       libctf
 .endif
 
Index: external/cddl/osnet/usr.bin/Makefile
===================================================================
RCS file: /cvs/cvsroot/src/external/cddl/osnet/usr.bin/Makefile,v
retrieving revision 1.2
diff -u -r1.2 Makefile
--- external/cddl/osnet/usr.bin/Makefile        21 Feb 2010 01:46:36 -0000      
1.2
+++ external/cddl/osnet/usr.bin/Makefile        24 Mar 2014 09:43:54 -0000
@@ -2,7 +2,7 @@
 
 .include <bsd.own.mk>
 
-.if ${MKDTRACE} != "no"
+.if ${MKCTF} != "no"
 SUBDIR+=       ctfconvert ctfmerge ctfdump
 .endif
 
Index: share/man/man5/mk.conf.5
===================================================================
RCS file: /cvs/cvsroot/src/share/man/man5/mk.conf.5,v
retrieving revision 1.67
diff -u -r1.67 mk.conf.5
--- share/man/man5/mk.conf.5    2 Jun 2013 11:02:40 -0000       1.67
+++ share/man/man5/mk.conf.5    24 Mar 2014 09:44:14 -0000
@@ -325,6 +325,13 @@
 .In complex.h .
 .DFLTy
 .
+.It Sy MKCTF
+.YorN
+Indicates whether CTF tools are to be built and installed.
+If yes, the tools will be used to generate and manipulate
+CTF data of ELF binaries during build.
+.DFLTn
+.
 .It Sy MKCRYPTO
 .YorN
 Indicates whether cryptographic code will be included in a build;
Index: share/mk/bsd.README
===================================================================
RCS file: /cvs/cvsroot/src/share/mk/bsd.README,v
retrieving revision 1.328
diff -u -r1.328 bsd.README
--- share/mk/bsd.README 24 Feb 2014 07:23:41 -0000      1.328
+++ share/mk/bsd.README 24 Mar 2014 09:44:14 -0000
@@ -146,6 +146,11 @@
 MKCRYPTO_RC5   If not "no", RC5 support will be built into libcrypto_rc5
                Default: no
 
+MKCTF          If "no", do not build and install CTF tools, and also
+               don't generate and manipulate CTF data of ELF binaries
+               during build.
+               Default: no
+
 MKCVS          If "no", don't build or install cvs(1).
                Default: yes
 
Index: share/mk/bsd.own.mk
===================================================================
RCS file: /cvs/cvsroot/src/share/mk/bsd.own.mk,v
retrieving revision 1.790
diff -u -r1.790 bsd.own.mk
--- share/mk/bsd.own.mk 18 Mar 2014 13:10:27 -0000      1.790
+++ share/mk/bsd.own.mk 24 Mar 2014 09:44:14 -0000
@@ -504,7 +504,7 @@
 OBJC=          ${TOOL_OBJC.${ACTIVE_OBJC}}
 
 # Override with tools versions if needed
-.if exists(${TOOL_CTFCONVERT}) && exists(${TOOL_CTFMERGE})
+.if ${MKCTF:Uno} != "no" && exists(${TOOL_CTFCONVERT}) && 
exists(${TOOL_CTFMERGE})
 CTFCONVERT=    ${TOOL_CTFCONVERT}
 CTFMERGE=      ${TOOL_CTFMERGE}
 .endif
@@ -971,7 +971,7 @@
 #
 _MKVARS.no= \
        MKBSDGREP MKBSDTAR \
-       MKCATPAGES MKCRYPTO_RC5 MKDEBUG \
+       MKCATPAGES MKCRYPTO_RC5 MKCTF MKDEBUG \
        MKDEBUGLIB MKDTRACE MKEXTSRC \
        MKKYUA MKLLD MKLLDB MKLINT \
        MKMANZ MKMCLINKER MKOBJDIRS \
Index: share/mk/bsd.prog.mk
===================================================================
RCS file: /cvs/cvsroot/src/share/mk/bsd.prog.mk,v
retrieving revision 1.289
diff -u -r1.289 bsd.prog.mk
--- share/mk/bsd.prog.mk        9 Mar 2014 18:00:51 -0000       1.289
+++ share/mk/bsd.prog.mk        24 Mar 2014 09:44:14 -0000
@@ -62,7 +62,7 @@
 MKDEP_SUFFIXES?=       .o .ln
 
 # CTF preserve debug symbols
-.if defined(MKDTRACE) && (${MKDTRACE} != "no") && (${CFLAGS:M-g} != "")
+.if (${MKCTF:Uno} != "no") && (${CFLAGS:M-g} != "")
 CTFFLAGS+= -g
 CTFMFLAGS+= -g
 .if defined(HAVE_GCC) && ${HAVE_GCC} >= 48
Index: tools/Makefile
===================================================================
RCS file: /cvs/cvsroot/src/tools/Makefile,v
retrieving revision 1.171
diff -u -r1.171 Makefile
--- tools/Makefile      24 Feb 2014 07:23:44 -0000      1.171
+++ tools/Makefile      24 Mar 2014 09:44:19 -0000
@@ -69,6 +69,8 @@
 DTRACE_BITS+= .WAIT libelf
 DTRACE_BITS+= .WAIT libdwarf
 DTRACE_BITS+= .WAIT libctf
+.endif
+.if ${MKCTF} != "no"
 DTRACE_BITS+= .WAIT ctfconvert ctfmerge
 .endif
 


Home | Main Index | Thread Index | Old Index