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
This commit is contained in:
parent
6afb32fc67
commit
3194293903
@ -1415,6 +1415,14 @@ _kgzip= usr.sbin/kgzip
|
|||||||
# If we're given an XAS, don't build binutils.
|
# If we're given an XAS, don't build binutils.
|
||||||
.if ${XAS:M/*} == "" && ${MK_BINUTILS_BOOTSTRAP} != "no"
|
.if ${XAS:M/*} == "" && ${MK_BINUTILS_BOOTSTRAP} != "no"
|
||||||
_binutils= gnu/usr.bin/binutils
|
_binutils= gnu/usr.bin/binutils
|
||||||
|
.if ${MK_ELFTOOLCHAIN_TOOLS} != "no"
|
||||||
|
_elftctools= lib/libelftc \
|
||||||
|
usr.bin/addr2line \
|
||||||
|
usr.bin/elfcopy \
|
||||||
|
usr.bin/nm \
|
||||||
|
usr.bin/size \
|
||||||
|
usr.bin/strings
|
||||||
|
.endif
|
||||||
.endif
|
.endif
|
||||||
|
|
||||||
# If an full path to an external cross compiler is given, don't build
|
# If an full path to an external cross compiler is given, don't build
|
||||||
@ -1434,6 +1442,7 @@ cross-tools: .MAKE
|
|||||||
${_clang_libs} \
|
${_clang_libs} \
|
||||||
${_clang} \
|
${_clang} \
|
||||||
${_binutils} \
|
${_binutils} \
|
||||||
|
${_elftctools} \
|
||||||
${_cc} \
|
${_cc} \
|
||||||
usr.bin/xlint/lint1 usr.bin/xlint/lint2 usr.bin/xlint/xlint \
|
usr.bin/xlint/lint1 usr.bin/xlint/lint2 usr.bin/xlint/xlint \
|
||||||
${_btxld} \
|
${_btxld} \
|
||||||
@ -1491,6 +1500,7 @@ native-xtools: .MAKE
|
|||||||
${_clang_tblgen} \
|
${_clang_tblgen} \
|
||||||
usr.bin/ar \
|
usr.bin/ar \
|
||||||
${_binutils} \
|
${_binutils} \
|
||||||
|
${_elftctools} \
|
||||||
${_cc} \
|
${_cc} \
|
||||||
${_gcc_tools} \
|
${_gcc_tools} \
|
||||||
${_clang_libs} \
|
${_clang_libs} \
|
||||||
@ -2045,6 +2055,7 @@ _xb-build-tools:
|
|||||||
_xb-cross-tools:
|
_xb-cross-tools:
|
||||||
.for _tool in \
|
.for _tool in \
|
||||||
${_binutils} \
|
${_binutils} \
|
||||||
|
${_elftctools} \
|
||||||
usr.bin/ar \
|
usr.bin/ar \
|
||||||
${_clang_libs} \
|
${_clang_libs} \
|
||||||
${_clang} \
|
${_clang} \
|
||||||
@ -2077,6 +2088,7 @@ _xi-cross-tools:
|
|||||||
@echo "_xi-cross-tools"
|
@echo "_xi-cross-tools"
|
||||||
.for _tool in \
|
.for _tool in \
|
||||||
${_binutils} \
|
${_binutils} \
|
||||||
|
${_elftctools} \
|
||||||
usr.bin/ar \
|
usr.bin/ar \
|
||||||
${_clang_libs} \
|
${_clang_libs} \
|
||||||
${_clang} \
|
${_clang} \
|
||||||
|
@ -1,19 +1,29 @@
|
|||||||
# $FreeBSD$
|
# $FreeBSD$
|
||||||
|
|
||||||
|
.include <src.opts.mk>
|
||||||
|
|
||||||
SUBDIR= libiberty \
|
SUBDIR= libiberty \
|
||||||
libbfd \
|
libbfd \
|
||||||
libopcodes \
|
libopcodes \
|
||||||
libbinutils \
|
libbinutils \
|
||||||
addr2line \
|
${_addr2line} \
|
||||||
as \
|
as \
|
||||||
ld \
|
ld \
|
||||||
nm \
|
${_nm} \
|
||||||
objcopy \
|
objcopy \
|
||||||
objdump \
|
objdump \
|
||||||
readelf \
|
readelf \
|
||||||
size \
|
${_size} \
|
||||||
strings \
|
${_strings} \
|
||||||
strip \
|
${_strip} \
|
||||||
doc
|
doc
|
||||||
|
|
||||||
|
.if ${MK_ELFTOOLCHAIN_TOOLS} == "no"
|
||||||
|
_addr2line= addr2line
|
||||||
|
_nm= nm
|
||||||
|
_size= size
|
||||||
|
_strings= strings
|
||||||
|
_strip= strip
|
||||||
|
.endif
|
||||||
|
|
||||||
.include <bsd.subdir.mk>
|
.include <bsd.subdir.mk>
|
||||||
|
@ -45,6 +45,7 @@ SUBDIR= ${SUBDIR_ORDERED} \
|
|||||||
libdpv \
|
libdpv \
|
||||||
libdwarf \
|
libdwarf \
|
||||||
libedit \
|
libedit \
|
||||||
|
${_libelftc} \
|
||||||
${_libevent} \
|
${_libevent} \
|
||||||
libexecinfo \
|
libexecinfo \
|
||||||
libexpat \
|
libexpat \
|
||||||
@ -190,6 +191,10 @@ _clang= clang
|
|||||||
_cuse= libcuse
|
_cuse= libcuse
|
||||||
.endif
|
.endif
|
||||||
|
|
||||||
|
.if ${MK_ELFTOOLCHAIN_TOOLS} != "no"
|
||||||
|
_libelftc= libelftc
|
||||||
|
.endif
|
||||||
|
|
||||||
.if ${MK_GPIB} != "no"
|
.if ${MK_GPIB} != "no"
|
||||||
_libgpib= libgpib
|
_libgpib= libgpib
|
||||||
.endif
|
.endif
|
||||||
|
30
lib/libelftc/Makefile
Normal file
30
lib/libelftc/Makefile
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
# $FreeBSD$
|
||||||
|
.include <bsd.own.mk>
|
||||||
|
|
||||||
|
INTERNALLIB=
|
||||||
|
|
||||||
|
ELFTCDIR= ${.CURDIR}/../../contrib/elftoolchain
|
||||||
|
|
||||||
|
.PATH: ${ELFTCDIR}/libelftc
|
||||||
|
|
||||||
|
LIB= elftc
|
||||||
|
|
||||||
|
SRCS= elftc_bfdtarget.c \
|
||||||
|
elftc_copyfile.c \
|
||||||
|
elftc_demangle.c \
|
||||||
|
elftc_set_timestamps.c \
|
||||||
|
elftc_string_table.c \
|
||||||
|
elftc_version.c \
|
||||||
|
libelftc_bfdtarget.c \
|
||||||
|
libelftc_dem_arm.c \
|
||||||
|
libelftc_dem_gnu2.c \
|
||||||
|
libelftc_dem_gnu3.c \
|
||||||
|
libelftc_hash.c \
|
||||||
|
libelftc_vstr.c
|
||||||
|
|
||||||
|
INCS= libelftc.h
|
||||||
|
CFLAGS+=-I${ELFTCDIR}/libelftc -I${ELFTCDIR}/common
|
||||||
|
|
||||||
|
NO_MAN= yes
|
||||||
|
|
||||||
|
.include <bsd.lib.mk>
|
10
lib/libelftc/elftc_version.c
Normal file
10
lib/libelftc/elftc_version.c
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
/* $FreeBSD$ */
|
||||||
|
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <libelftc.h>
|
||||||
|
|
||||||
|
const char *
|
||||||
|
elftc_version(void)
|
||||||
|
{
|
||||||
|
return "libelftc r2974";
|
||||||
|
}
|
@ -27,6 +27,7 @@ _INTERNALIBS= \
|
|||||||
amu \
|
amu \
|
||||||
bsnmptools \
|
bsnmptools \
|
||||||
cron \
|
cron \
|
||||||
|
elftc \
|
||||||
event \
|
event \
|
||||||
fifolog \
|
fifolog \
|
||||||
ipf \
|
ipf \
|
||||||
@ -286,6 +287,10 @@ LIBATF_CXX?= ${LIBATF_CXXDIR}/libatf-c++.a
|
|||||||
LIBBSDSTATDIR= ${ROOTOBJDIR}/lib/libbsdstat
|
LIBBSDSTATDIR= ${ROOTOBJDIR}/lib/libbsdstat
|
||||||
LIBBSDSTAT?= ${LIBBSDSTATDIR}/libbsdstat.a
|
LIBBSDSTAT?= ${LIBBSDSTATDIR}/libbsdstat.a
|
||||||
|
|
||||||
|
LIBELFTCDIR= ${ROOTOBJDIR}/lib/libelftc
|
||||||
|
LDELFTC?= ${LIBELFTCDIR}/libelftc.a
|
||||||
|
LIBELFTC?= ${LIBELFTCDIR}/libelftc.a
|
||||||
|
|
||||||
LIBEVENTDIR= ${ROOTOBJDIR}/lib/libevent
|
LIBEVENTDIR= ${ROOTOBJDIR}/lib/libevent
|
||||||
LIBEVENT?= ${LIBEVENTDIR}/libevent.a
|
LIBEVENT?= ${LIBEVENTDIR}/libevent.a
|
||||||
|
|
||||||
|
@ -160,6 +160,7 @@ __DEFAULT_NO_OPTIONS = \
|
|||||||
BSD_GREP \
|
BSD_GREP \
|
||||||
CLANG_EXTRAS \
|
CLANG_EXTRAS \
|
||||||
EISA \
|
EISA \
|
||||||
|
ELFTOOLCHAIN_TOOLS \
|
||||||
FMAKE \
|
FMAKE \
|
||||||
HESIOD \
|
HESIOD \
|
||||||
LLDB \
|
LLDB \
|
||||||
|
9
tools/build/options/WITH_ELFTOOLCHAIN_TOOLS
Normal file
9
tools/build/options/WITH_ELFTOOLCHAIN_TOOLS
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
.\" $FreeBSD$
|
||||||
|
Set to use
|
||||||
|
.Xr addr2line 1 ,
|
||||||
|
.Xr nm 1 ,
|
||||||
|
.Xr size 1 ,
|
||||||
|
.Xr strings 1 ,
|
||||||
|
and
|
||||||
|
.Xr strip 1
|
||||||
|
from the elftoolchain project instead of GNU binutils.
|
@ -9,7 +9,8 @@
|
|||||||
# Moved to secure: bdes
|
# Moved to secure: bdes
|
||||||
#
|
#
|
||||||
|
|
||||||
SUBDIR= alias \
|
SUBDIR= ${_addr2line} \
|
||||||
|
alias \
|
||||||
apply \
|
apply \
|
||||||
asa \
|
asa \
|
||||||
awk \
|
awk \
|
||||||
@ -41,6 +42,7 @@ SUBDIR= alias \
|
|||||||
du \
|
du \
|
||||||
ee \
|
ee \
|
||||||
elf2aout \
|
elf2aout \
|
||||||
|
${_elfcopy} \
|
||||||
elfdump \
|
elfdump \
|
||||||
enigma \
|
enigma \
|
||||||
env \
|
env \
|
||||||
@ -119,6 +121,7 @@ SUBDIR= alias \
|
|||||||
nfsstat \
|
nfsstat \
|
||||||
nice \
|
nice \
|
||||||
nl \
|
nl \
|
||||||
|
${_nm} \
|
||||||
nohup \
|
nohup \
|
||||||
opieinfo \
|
opieinfo \
|
||||||
opiekey \
|
opiekey \
|
||||||
@ -150,12 +153,14 @@ SUBDIR= alias \
|
|||||||
seq \
|
seq \
|
||||||
shar \
|
shar \
|
||||||
showmount \
|
showmount \
|
||||||
|
${_size} \
|
||||||
sockstat \
|
sockstat \
|
||||||
soeliminate \
|
soeliminate \
|
||||||
sort \
|
sort \
|
||||||
split \
|
split \
|
||||||
stat \
|
stat \
|
||||||
stdbuf \
|
stdbuf \
|
||||||
|
${_strings} \
|
||||||
su \
|
su \
|
||||||
systat \
|
systat \
|
||||||
tabs \
|
tabs \
|
||||||
@ -236,6 +241,14 @@ SUBDIR+= calendar
|
|||||||
_clang= clang
|
_clang= clang
|
||||||
.endif
|
.endif
|
||||||
|
|
||||||
|
.if ${MK_ELFTOOLCHAIN_TOOLS} != "no"
|
||||||
|
_addr2line= addr2line
|
||||||
|
_elfcopy= elfcopy
|
||||||
|
_nm= nm
|
||||||
|
_size= size
|
||||||
|
_strings= strings
|
||||||
|
.endif
|
||||||
|
|
||||||
.if ${MK_FMAKE} != "no"
|
.if ${MK_FMAKE} != "no"
|
||||||
SUBDIR+= make
|
SUBDIR+= make
|
||||||
.endif
|
.endif
|
||||||
|
16
usr.bin/addr2line/Makefile
Normal file
16
usr.bin/addr2line/Makefile
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
# $FreeBSD$
|
||||||
|
|
||||||
|
.include <src.opts.mk>
|
||||||
|
|
||||||
|
ELFTCDIR= ${.CURDIR}/../../contrib/elftoolchain
|
||||||
|
ADDR2LINEDIR= ${ELFTCDIR}/addr2line
|
||||||
|
|
||||||
|
.PATH: ${ADDR2LINEDIR}
|
||||||
|
|
||||||
|
PROG= addr2line
|
||||||
|
|
||||||
|
LIBADD= elftc dwarf elf
|
||||||
|
|
||||||
|
CFLAGS+=-I${ELFTCDIR}/libelftc -I${ELFTCDIR}/common
|
||||||
|
|
||||||
|
.include <bsd.prog.mk>
|
24
usr.bin/elfcopy/Makefile
Normal file
24
usr.bin/elfcopy/Makefile
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
# $FreeBSD$
|
||||||
|
|
||||||
|
.include <src.opts.mk>
|
||||||
|
|
||||||
|
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 <bsd.prog.mk>
|
16
usr.bin/nm/Makefile
Normal file
16
usr.bin/nm/Makefile
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
# $FreeBSD$
|
||||||
|
|
||||||
|
.include <src.opts.mk>
|
||||||
|
|
||||||
|
ELFTCDIR= ${.CURDIR}/../../contrib/elftoolchain
|
||||||
|
NMDIR= ${ELFTCDIR}/nm
|
||||||
|
|
||||||
|
.PATH: ${NMDIR}
|
||||||
|
|
||||||
|
PROG= nm
|
||||||
|
|
||||||
|
LIBADD= dwarf elftc elf
|
||||||
|
|
||||||
|
CFLAGS+=-I${ELFTCDIR}/libelftc -I${ELFTCDIR}/common
|
||||||
|
|
||||||
|
.include <bsd.prog.mk>
|
16
usr.bin/size/Makefile
Normal file
16
usr.bin/size/Makefile
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
# $FreeBSD$
|
||||||
|
|
||||||
|
.include <src.opts.mk>
|
||||||
|
|
||||||
|
ELFTCDIR= ${.CURDIR}/../../contrib/elftoolchain
|
||||||
|
SIZEDIR= ${ELFTCDIR}/size
|
||||||
|
|
||||||
|
.PATH: ${SIZEDIR}
|
||||||
|
|
||||||
|
PROG= size
|
||||||
|
|
||||||
|
LIBADD= elftc elf
|
||||||
|
|
||||||
|
CFLAGS+=-I${ELFTCDIR}/libelftc -I${ELFTCDIR}/common
|
||||||
|
|
||||||
|
.include <bsd.prog.mk>
|
15
usr.bin/strings/Makefile
Normal file
15
usr.bin/strings/Makefile
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
# $FreeBSD$
|
||||||
|
|
||||||
|
.include <src.opts.mk>
|
||||||
|
|
||||||
|
ELFTCDIR= ${.CURDIR}/../../contrib/elftoolchain
|
||||||
|
|
||||||
|
.PATH: ${ELFTCDIR}/strings
|
||||||
|
|
||||||
|
PROG= strings
|
||||||
|
|
||||||
|
LIBADD= elftc elf
|
||||||
|
|
||||||
|
CFLAGS+=-I${ELFTCDIR}/libelftc -I${ELFTCDIR}/common
|
||||||
|
|
||||||
|
.include <bsd.prog.mk>
|
Loading…
Reference in New Issue
Block a user