Source-Changes-HG archive

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

[src/trunk]: src/tools/elftoolchain Build 'libelf' and 'libdwarf' under 'tool...



details:   https://anonhg.NetBSD.org/src/rev/c8557aad1bf7
branches:  trunk
changeset: 365693:c8557aad1bf7
user:      jkoshy <jkoshy%NetBSD.org@localhost>
date:      Mon Apr 18 14:11:43 2022 +0000

description:
Build 'libelf' and 'libdwarf' under 'tools/elftoolchain', after
'tools/elftoolchain/common' has been built.

This change aligns the 'tools' build with the regular build.

Subsequent commits will change 'tools/libctf' and
'tools/cft{merge,convert}' to use the new build paths.

diffstat:

 tools/elftoolchain/Makefile          |   4 +-
 tools/elftoolchain/libdwarf/Makefile |  96 ++++++++++++++++++++++++++++++++++++
 tools/elftoolchain/libelf/Makefile   |  91 ++++++++++++++++++++++++++++++++++
 3 files changed, 190 insertions(+), 1 deletions(-)

diffs (207 lines):

diff -r e87a4880c6d5 -r c8557aad1bf7 tools/elftoolchain/Makefile
--- a/tools/elftoolchain/Makefile       Mon Apr 18 10:09:07 2022 +0000
+++ b/tools/elftoolchain/Makefile       Mon Apr 18 14:11:43 2022 +0000
@@ -1,5 +1,7 @@
-# $NetBSD: Makefile,v 1.1 2022/04/13 17:52:56 jkoshy Exp $
+# $NetBSD: Makefile,v 1.2 2022/04/18 14:11:43 jkoshy Exp $
 
 SUBDIR= common
+SUBDIR+= .WAIT libelf
+SUBDIR+= .WAIT libdwarf
 
 .include <bsd.subdir.mk>
diff -r e87a4880c6d5 -r c8557aad1bf7 tools/elftoolchain/libdwarf/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/elftoolchain/libdwarf/Makefile      Mon Apr 18 14:11:43 2022 +0000
@@ -0,0 +1,96 @@
+#      $NetBSD: Makefile,v 1.1 2022/04/18 14:11:43 jkoshy Exp $
+
+HOSTLIB=dwarf
+
+.include <bsd.hostinit.mk>
+
+SRCS= \
+       dwarf_abbrev.c  \
+       dwarf_arange.c  \
+       dwarf_attr.c    \
+       dwarf_attrval.c \
+       dwarf_cu.c      \
+       dwarf_dealloc.c \
+       dwarf_die.c     \
+       dwarf_dump.c    \
+       dwarf_errmsg.c  \
+       dwarf_finish.c  \
+       dwarf_form.c    \
+       dwarf_frame.c   \
+       dwarf_init.c    \
+       dwarf_lineno.c  \
+       dwarf_loclist.c \
+       dwarf_macinfo.c \
+       dwarf_pro_arange.c      \
+       dwarf_pro_attr.c        \
+       dwarf_pro_die.c \
+       dwarf_pro_expr.c        \
+       dwarf_pro_finish.c      \
+       dwarf_pro_frame.c       \
+       dwarf_pro_init.c        \
+       dwarf_pro_lineno.c      \
+       dwarf_pro_macinfo.c     \
+       dwarf_pro_reloc.c       \
+       dwarf_pro_sections.c    \
+       dwarf_ranges.c  \
+       dwarf_reloc.c   \
+       dwarf_seterror.c        \
+       dwarf_str.c     \
+       libdwarf.c      \
+       libdwarf_abbrev.c       \
+       libdwarf_arange.c       \
+       libdwarf_attr.c \
+       libdwarf_die.c  \
+       libdwarf_elf_access.c   \
+       libdwarf_elf_init.c     \
+       libdwarf_error.c        \
+       libdwarf_frame.c        \
+       libdwarf_info.c \
+       libdwarf_init.c \
+       libdwarf_lineno.c       \
+       libdwarf_loc.c  \
+       libdwarf_loclist.c      \
+       libdwarf_macinfo.c      \
+       libdwarf_nametbl.c      \
+       libdwarf_ranges.c       \
+       libdwarf_reloc.c        \
+       libdwarf_rw.c   \
+       libdwarf_sections.c     \
+       libdwarf_str.c
+
+ELFTOOLCHAIN_DIR=${.CURDIR}/../../../external/bsd/elftoolchain/dist
+LIBDWARF_DIR=  ${ELFTOOLCHAIN_DIR}/libdwarf
+LIBELF_DIR=    ${ELFTOOLCHAIN_DIR}/libelf
+COMMON_DIR=    ${ELFTOOLCHAIN_DIR}/common
+
+INCS=          dwarf.h libdwarf.h
+INCSDIR=       /usr/include
+
+.ifndef NOCOMPATLIB
+COMPATLIB_NO_LIB= yes # only the include files, not the library
+.-include      "${TOOLDIR}/share/compat/defs.mk"
+.endif
+
+CPPFLAGS+=     -I${.CURDIR}/../../compat
+CPPFLAGS+=     -I${.CURDIR}/../../common
+CPPFLAGS+=     -I${LIBDWARF_DIR} -I${LIBELF_DIR} -I${COMMON_DIR}
+CPPFLAGS+=     -I${TOOLDIR}/include -I${TOOLDIR}/include/nbinclude
+
+BUILD_OSTYPE!=  uname -s
+
+# Disable use of pre-compiled headers on Darwin.
+.if ${BUILD_OSTYPE} == "Darwin"
+CPPFLAGS+=     -no-cpp-precomp
+.endif
+
+# -D_FILE_OFFSET_BITS=64 produces a much more amenable `struct stat', and
+# other file ops, on many systems, without changing function names.
+
+CPPFLAGS+=     -DHAVE_NBTOOL_CONFIG_H=1 -D_FILE_OFFSET_BITS=64
+
+.PATH:         ${LIBDWARF_DIR}
+
+HOST_CPPFLAGS:=        ${CPPFLAGS} ${HOST_CPPFLAGS}
+CPPFLAGS:=     # empty
+
+.include <bsd.hostlib.mk>
diff -r e87a4880c6d5 -r c8557aad1bf7 tools/elftoolchain/libelf/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tools/elftoolchain/libelf/Makefile        Mon Apr 18 14:11:43 2022 +0000
@@ -0,0 +1,91 @@
+#      $NetBSD: Makefile,v 1.1 2022/04/18 14:11:44 jkoshy Exp $
+
+HOSTLIB=       elf
+
+.include <bsd.hostinit.mk>
+
+SRCS=          elf_begin.c                                             \
+               elf_cntl.c                                              \
+               elf_end.c elf_errmsg.c elf_errno.c                      \
+               elf_data.c                                              \
+               elf_fill.c elf_flag.c                                   \
+               elf_getarhdr.c elf_getarsym.c elf_getbase.c             \
+                   elf_getident.c                                      \
+               elf_hash.c                                              \
+               elf_kind.c                                              \
+               elf_memory.c                                            \
+               elf_next.c                                              \
+               elf_rand.c elf_rawfile.c                                \
+               elf_phnum.c                                             \
+               elf_shnum.c elf_shstrndx.c elf_scn.c elf_strptr.c       \
+               elf_update.c                                            \
+               elf_version.c                                           \
+               gelf_cap.c                                              \
+               gelf_checksum.c                                         \
+               gelf_dyn.c                                              \
+               gelf_ehdr.c                                             \
+               gelf_getclass.c                                         \
+               gelf_fsize.c                                            \
+               gelf_move.c                                             \
+               gelf_phdr.c                                             \
+               gelf_rel.c gelf_rela.c                                  \
+               gelf_shdr.c gelf_sym.c gelf_syminfo.c gelf_symshndx.c   \
+               gelf_xlate.c                                            \
+               elf.c                                                   \
+               libelf_align.c libelf_allocate.c libelf_ar.c            \
+               libelf_ar_util.c                                        \
+               libelf_checksum.c                                       \
+               libelf_data.c                                           \
+               libelf_ehdr.c libelf_extended.c                         \
+               libelf_memory.c                                         \
+               libelf_open.c                                           \
+               libelf_phdr.c                                           \
+               libelf_shdr.c                                           \
+               libelf_xlate.c                                          \
+               ${LIBELF_GENSRCS}
+
+LIBELF_GENSRCS=        libelf_fsize.c libelf_msize.c libelf_convert.c
+
+LIBELF_DIR=    ${.CURDIR}/../../../external/bsd/elftoolchain/dist/libelf
+LIBELF_OBJDIR!=        cd ${.CURDIR} && ${PRINTOBJDIR}
+
+CLEANFILES+=   ${LIBELF_GENSRCS}
+CPPFLAGS+=     -I${.CURDIR}/../../compat
+CPPFLAGS+=     -I${LIBELF_DIR} -I${LIBELF_DIR}/../common
+CPPFLAGS+=     -I${LIBELF_OBJDIR}/../common
+CPPFLAGS+=     -I${TOOLDIR}/include -I${TOOLDIR}/include/nbinclude
+
+CPPFLAGS+=     -DLIBELF_TEST_HOOKS
+
+libelf_convert.c:      elf_types.m4 libelf_convert.m4
+libelf_fsize.c:                elf_types.m4 libelf_fsize.m4
+libelf_msize.c:                elf_types.m4 libelf_msize.m4
+
+BUILD_OSTYPE!=  uname -s
+
+# Disable use of pre-compiled headers on Darwin.
+.if ${BUILD_OSTYPE} == "Darwin"
+CPPFLAGS+=     -no-cpp-precomp
+.endif
+
+# -D_FILE_OFFSET_BITS=64 produces a much more amenable `struct stat', and
+# other file ops, on many systems, without changing function names.
+
+CPPFLAGS+=     -DHAVE_NBTOOL_CONFIG_H=1 -D_FILE_OFFSET_BITS=64
+.ifndef NOCOMPATLIB
+COMPATLIB_NO_LIB= yes # only the include files, not the library
+.-include      "${TOOLDIR}/share/compat/defs.mk"
+.endif
+
+.PATH:         ${LIBELF_DIR}
+
+HOST_CPPFLAGS:=        ${CPPFLAGS} ${HOST_CPPFLAGS}
+CPPFLAGS:=     # empty
+
+.include <bsd.hostlib.mk>
+
+# Keep the .SUFFIXES line after the include of bsd.hostlib.mk
+M4OBJDIR!=     cd ${.CURDIR}/../../m4 && ${PRINTOBJDIR}
+.SUFFIXES:     .m4 .c
+.m4.c:
+       ${M4OBJDIR}/m4 -D SRCDIR=${LIBELF_DIR} ${.IMPSRC} > ${.TARGET}



Home | Main Index | Thread Index | Old Index