From c79f6538fe5b1fe35382903168b76167be44db9e Mon Sep 17 00:00:00 2001 From: emaste Date: Mon, 1 Dec 2014 17:49:42 +0000 Subject: Build infrastructure for elftoolchain tools Set WITH_ELFTOOLCHAIN_TOOLS in src.conf to use the elftoolchain version of the following tools: * addr2line * elfcopy (strip / mcs) * nm * size * strings Reviewed by: bapt (earlier version) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D1224 --- usr.bin/Makefile | 15 ++++++++++++++- usr.bin/addr2line/Makefile | 16 ++++++++++++++++ usr.bin/elfcopy/Makefile | 24 ++++++++++++++++++++++++ usr.bin/nm/Makefile | 16 ++++++++++++++++ usr.bin/size/Makefile | 16 ++++++++++++++++ usr.bin/strings/Makefile | 15 +++++++++++++++ 6 files changed, 101 insertions(+), 1 deletion(-) create mode 100644 usr.bin/addr2line/Makefile create mode 100644 usr.bin/elfcopy/Makefile create mode 100644 usr.bin/nm/Makefile create mode 100644 usr.bin/size/Makefile create mode 100644 usr.bin/strings/Makefile (limited to 'usr.bin') diff --git a/usr.bin/Makefile b/usr.bin/Makefile index 298903e..88628fb 100644 --- a/usr.bin/Makefile +++ b/usr.bin/Makefile @@ -9,7 +9,8 @@ # Moved to secure: bdes # -SUBDIR= alias \ +SUBDIR= ${_addr2line} \ + alias \ apply \ asa \ awk \ @@ -41,6 +42,7 @@ SUBDIR= alias \ du \ ee \ elf2aout \ + ${_elfcopy} \ elfdump \ enigma \ env \ @@ -119,6 +121,7 @@ SUBDIR= alias \ nfsstat \ nice \ nl \ + ${_nm} \ nohup \ opieinfo \ opiekey \ @@ -150,12 +153,14 @@ SUBDIR= alias \ seq \ shar \ showmount \ + ${_size} \ sockstat \ soeliminate \ sort \ split \ stat \ stdbuf \ + ${_strings} \ su \ systat \ tabs \ @@ -236,6 +241,14 @@ SUBDIR+= calendar _clang= clang .endif +.if ${MK_ELFTOOLCHAIN_TOOLS} != "no" +_addr2line= addr2line +_elfcopy= elfcopy +_nm= nm +_size= size +_strings= strings +.endif + .if ${MK_FMAKE} != "no" SUBDIR+= make .endif diff --git a/usr.bin/addr2line/Makefile b/usr.bin/addr2line/Makefile new file mode 100644 index 0000000..918707a --- /dev/null +++ b/usr.bin/addr2line/Makefile @@ -0,0 +1,16 @@ +# $FreeBSD$ + +.include + +ELFTCDIR= ${.CURDIR}/../../contrib/elftoolchain +ADDR2LINEDIR= ${ELFTCDIR}/addr2line + +.PATH: ${ADDR2LINEDIR} + +PROG= addr2line + +LIBADD= elftc dwarf elf + +CFLAGS+=-I${ELFTCDIR}/libelftc -I${ELFTCDIR}/common + +.include diff --git a/usr.bin/elfcopy/Makefile b/usr.bin/elfcopy/Makefile new file mode 100644 index 0000000..8e7f31d --- /dev/null +++ b/usr.bin/elfcopy/Makefile @@ -0,0 +1,24 @@ +# $FreeBSD$ + +.include + +ELFTCDIR= ${.CURDIR}/../../contrib/elftoolchain +ELFCOPYDIR= ${ELFTCDIR}/elfcopy + +.PATH: ${ELFCOPYDIR} + +PROG= elfcopy + +SRCS= archive.c ascii.c binary.c main.c sections.c segments.c symbols.c + +WARNS?= 5 + +LIBADD= archive elftc elf + +CFLAGS+=-I${ELFTCDIR}/libelftc -I${ELFTCDIR}/common + +MAN= elfcopy.1 strip.1 + +LINKS= ${BINDIR}/elfcopy ${BINDIR}/strip + +.include diff --git a/usr.bin/nm/Makefile b/usr.bin/nm/Makefile new file mode 100644 index 0000000..5078e10 --- /dev/null +++ b/usr.bin/nm/Makefile @@ -0,0 +1,16 @@ +# $FreeBSD$ + +.include + +ELFTCDIR= ${.CURDIR}/../../contrib/elftoolchain +NMDIR= ${ELFTCDIR}/nm + +.PATH: ${NMDIR} + +PROG= nm + +LIBADD= dwarf elftc elf + +CFLAGS+=-I${ELFTCDIR}/libelftc -I${ELFTCDIR}/common + +.include diff --git a/usr.bin/size/Makefile b/usr.bin/size/Makefile new file mode 100644 index 0000000..6aba73d --- /dev/null +++ b/usr.bin/size/Makefile @@ -0,0 +1,16 @@ +# $FreeBSD$ + +.include + +ELFTCDIR= ${.CURDIR}/../../contrib/elftoolchain +SIZEDIR= ${ELFTCDIR}/size + +.PATH: ${SIZEDIR} + +PROG= size + +LIBADD= elftc elf + +CFLAGS+=-I${ELFTCDIR}/libelftc -I${ELFTCDIR}/common + +.include diff --git a/usr.bin/strings/Makefile b/usr.bin/strings/Makefile new file mode 100644 index 0000000..8543dcf --- /dev/null +++ b/usr.bin/strings/Makefile @@ -0,0 +1,15 @@ +# $FreeBSD$ + +.include + +ELFTCDIR= ${.CURDIR}/../../contrib/elftoolchain + +.PATH: ${ELFTCDIR}/strings + +PROG= strings + +LIBADD= elftc elf + +CFLAGS+=-I${ELFTCDIR}/libelftc -I${ELFTCDIR}/common + +.include -- cgit v1.1