From db135d737cfa196aa49fedb8285810c53c183f87 Mon Sep 17 00:00:00 2001 From: joerg Date: Wed, 27 Feb 2013 21:25:05 +0000 Subject: [PATCH] Add infrastructure for building MCLinker. --- distrib/sets/lists/comp/mi | 3 +- distrib/sets/sets.subr | 5 +- external/bsd/llvm/Makefile | 10 +- external/bsd/llvm/Makefile.inc | 11 +- external/bsd/llvm/bin/Makefile | 7 +- external/bsd/llvm/bin/llvm-mcld/Makefile | 76 ++++++++++++ .../llvm/config/mclinker/mcld/Config/Config.h | 108 ++++++++++++++++++ .../config/mclinker/mcld/Config/Linkers.def | 28 +++++ .../config/mclinker/mcld/Config/Targets.def | 28 +++++ external/bsd/llvm/lib/Makefile | 23 +++- external/bsd/llvm/lib/libMCLinkerADT/Makefile | 15 +++ .../llvm/lib/libMCLinkerARMCodeGen/Makefile | 28 +++++ .../lib/libMCLinkerARMTargetInfo/Makefile | 15 +++ .../bsd/llvm/lib/libMCLinkerCodeGen/Makefile | 16 +++ .../bsd/llvm/lib/libMCLinkerCore/Makefile | 25 ++++ .../bsd/llvm/lib/libMCLinkerFragment/Makefile | 23 ++++ external/bsd/llvm/lib/libMCLinkerLD/Makefile | 63 ++++++++++ external/bsd/llvm/lib/libMCLinkerMC/Makefile | 27 +++++ .../llvm/lib/libMCLinkerMipsCodeGen/Makefile | 24 ++++ .../lib/libMCLinkerMipsTargetInfo/Makefile | 15 +++ .../bsd/llvm/lib/libMCLinkerObject/Makefile | 17 +++ .../bsd/llvm/lib/libMCLinkerSupport/Makefile | 33 ++++++ .../bsd/llvm/lib/libMCLinkerTarget/Makefile | 24 ++++ .../llvm/lib/libMCLinkerX86CodeGen/Makefile | 25 ++++ .../lib/libMCLinkerX86TargetInfo/Makefile | 15 +++ external/bsd/llvm/link.mk | 8 +- share/mk/bsd.own.mk | 4 +- tools/Makefile | 5 +- tools/llvm-lib/libMCLinkerADT/Makefile | 3 + tools/llvm-lib/libMCLinkerARMCodeGen/Makefile | 3 + .../libMCLinkerARMTargetInfo/Makefile | 3 + tools/llvm-lib/libMCLinkerCodeGen/Makefile | 3 + tools/llvm-lib/libMCLinkerCore/Makefile | 3 + tools/llvm-lib/libMCLinkerFragment/Makefile | 3 + tools/llvm-lib/libMCLinkerLD/Makefile | 3 + tools/llvm-lib/libMCLinkerMC/Makefile | 3 + .../llvm-lib/libMCLinkerMipsCodeGen/Makefile | 3 + .../libMCLinkerMipsTargetInfo/Makefile | 3 + tools/llvm-lib/libMCLinkerObject/Makefile | 3 + tools/llvm-lib/libMCLinkerSupport/Makefile | 3 + tools/llvm-lib/libMCLinkerTarget/Makefile | 3 + tools/llvm-lib/libMCLinkerX86CodeGen/Makefile | 3 + .../libMCLinkerX86TargetInfo/Makefile | 3 + tools/llvm-mcld/Makefile | 7 ++ 44 files changed, 721 insertions(+), 12 deletions(-) create mode 100644 external/bsd/llvm/bin/llvm-mcld/Makefile create mode 100644 external/bsd/llvm/config/mclinker/mcld/Config/Config.h create mode 100644 external/bsd/llvm/config/mclinker/mcld/Config/Linkers.def create mode 100644 external/bsd/llvm/config/mclinker/mcld/Config/Targets.def create mode 100644 external/bsd/llvm/lib/libMCLinkerADT/Makefile create mode 100644 external/bsd/llvm/lib/libMCLinkerARMCodeGen/Makefile create mode 100644 external/bsd/llvm/lib/libMCLinkerARMTargetInfo/Makefile create mode 100644 external/bsd/llvm/lib/libMCLinkerCodeGen/Makefile create mode 100644 external/bsd/llvm/lib/libMCLinkerCore/Makefile create mode 100644 external/bsd/llvm/lib/libMCLinkerFragment/Makefile create mode 100644 external/bsd/llvm/lib/libMCLinkerLD/Makefile create mode 100644 external/bsd/llvm/lib/libMCLinkerMC/Makefile create mode 100644 external/bsd/llvm/lib/libMCLinkerMipsCodeGen/Makefile create mode 100644 external/bsd/llvm/lib/libMCLinkerMipsTargetInfo/Makefile create mode 100644 external/bsd/llvm/lib/libMCLinkerObject/Makefile create mode 100644 external/bsd/llvm/lib/libMCLinkerSupport/Makefile create mode 100644 external/bsd/llvm/lib/libMCLinkerTarget/Makefile create mode 100644 external/bsd/llvm/lib/libMCLinkerX86CodeGen/Makefile create mode 100644 external/bsd/llvm/lib/libMCLinkerX86TargetInfo/Makefile create mode 100644 tools/llvm-lib/libMCLinkerADT/Makefile create mode 100644 tools/llvm-lib/libMCLinkerARMCodeGen/Makefile create mode 100644 tools/llvm-lib/libMCLinkerARMTargetInfo/Makefile create mode 100644 tools/llvm-lib/libMCLinkerCodeGen/Makefile create mode 100644 tools/llvm-lib/libMCLinkerCore/Makefile create mode 100644 tools/llvm-lib/libMCLinkerFragment/Makefile create mode 100644 tools/llvm-lib/libMCLinkerLD/Makefile create mode 100644 tools/llvm-lib/libMCLinkerMC/Makefile create mode 100644 tools/llvm-lib/libMCLinkerMipsCodeGen/Makefile create mode 100644 tools/llvm-lib/libMCLinkerMipsTargetInfo/Makefile create mode 100644 tools/llvm-lib/libMCLinkerObject/Makefile create mode 100644 tools/llvm-lib/libMCLinkerSupport/Makefile create mode 100644 tools/llvm-lib/libMCLinkerTarget/Makefile create mode 100644 tools/llvm-lib/libMCLinkerX86CodeGen/Makefile create mode 100644 tools/llvm-lib/libMCLinkerX86TargetInfo/Makefile create mode 100644 tools/llvm-mcld/Makefile diff --git a/distrib/sets/lists/comp/mi b/distrib/sets/lists/comp/mi index b52117d98e5c..dc776921ae51 100644 --- a/distrib/sets/lists/comp/mi +++ b/distrib/sets/lists/comp/mi @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.1806 2013/02/22 15:14:29 jmmv Exp $ +# $NetBSD: mi,v 1.1807 2013/02/27 21:25:06 joerg Exp $ # # Note: don't delete entries from here - mark them as "obsolete" instead. # @@ -47,6 +47,7 @@ ./usr/bin/gettext comp-c-bin ./usr/bin/gettextize comp-obsolete obsolete ./usr/bin/gprof comp-debug-bin binutils +./usr/bin/ld.mcld comp-c-bin mclinker ./usr/bin/lex comp-c-bin ./usr/bin/lint comp-c-bin ./usr/bin/llvm-tblgen comp-c-bin llvm diff --git a/distrib/sets/sets.subr b/distrib/sets/sets.subr index c6a0af506429..de2d7bffab1d 100644 --- a/distrib/sets/sets.subr +++ b/distrib/sets/sets.subr @@ -1,4 +1,4 @@ -# $NetBSD: sets.subr,v 1.144 2013/02/15 19:49:48 jmmv Exp $ +# $NetBSD: sets.subr,v 1.145 2013/02/27 21:25:05 joerg Exp $ # # @@ -179,7 +179,7 @@ SUBST="${SUBST};s#@MACHINE@#${MACHINE}#g" # In each file, a record consists of a path and a System Package name, # separated by whitespace. E.g., # -# # $NetBSD: sets.subr,v 1.144 2013/02/15 19:49:48 jmmv Exp $ +# # $NetBSD: sets.subr,v 1.145 2013/02/27 21:25:05 joerg Exp $ # . base-sys-root [keyword[,...]] # ./altroot base-sys-root # ./bin base-sys-root @@ -234,6 +234,7 @@ SUBST="${SUBST};s#@MACHINE@#${MACHINE}#g" # man ${MKMAN} != no # manpages ${MKMANPAGES} != no # manz ${MKMANZ} != no +# mclinker ${MKMCLINKER} != no # mdns ${MKMDNS} != no # nls ${MKNLS} != no # nvi ${MKNVI} != no diff --git a/external/bsd/llvm/Makefile b/external/bsd/llvm/Makefile index 73decf134fd1..a9721d604293 100644 --- a/external/bsd/llvm/Makefile +++ b/external/bsd/llvm/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.2 2012/06/17 16:51:31 joerg Exp $ +# $NetBSD: Makefile,v 1.3 2013/02/27 21:25:08 joerg Exp $ .include @@ -20,4 +20,12 @@ checkout: svn co -r ${COMPILER_RT_REVISION} ${SVN_ROOT}/compiler-rt/trunk \ ${COMPILER_RT_SRCDIR} +checkout-mclinker: + if [ -d ${MCLINKER_SRCDIR}/.git ]; then \ + cd ${MCLINKER_SRCDIR}; git pull ${MCLINKER_ROOT} ; \ + else \ + git clone ${MCLINKER_ROOT} ${MCLINKER_SRCDIR}; \ + fi + cd ${MCLINKER_SRCDIR} && git checkout ${MCLINKER_REVISION} + .include diff --git a/external/bsd/llvm/Makefile.inc b/external/bsd/llvm/Makefile.inc index 0d148c9a724d..09b1e6edf23c 100644 --- a/external/bsd/llvm/Makefile.inc +++ b/external/bsd/llvm/Makefile.inc @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.inc,v 1.46 2013/02/19 12:35:41 joerg Exp $ +# $NetBSD: Makefile.inc,v 1.47 2013/02/27 21:25:08 joerg Exp $ .if !defined(LLVM_TOPLEVEL_MK) LLVM_TOPLEVEL_MK= @@ -12,21 +12,27 @@ LLVM_REVISION= ${COMMON_REVISION} CLANG_REVISION= ${COMMON_REVISION} COMPILER_RT_REVISION= ${COMMON_REVISION} +MCLINKER_REVISION= a5d978e2561fe37b84aa18b83cbd5fff8b6475a0 +MCLINKER_ROOT= https://code.google.com/p/mclinker/ + LLVM_VERSION= 3.3 CLANG_VERSION= 3.3 LLVM_SRCDIR:= ${.PARSEDIR}/dist/llvm CLANG_SRCDIR:= ${.PARSEDIR}/dist/clang COMPILER_RT_SRCDIR:= ${.PARSEDIR}/dist/compiler-rt +MCLINKER_SRCDIR:= ${.PARSEDIR}/dist/mclinker LLVM_TOPLEVEL:= ${.PARSEDIR} CPPFLAGS+= -I. -I${LLVM_SRCDIR}/include -I${CLANG_SRCDIR}/include \ + -I${MCLINKER_SRCDIR}/include \ -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS \ -D__STDC_FORMAT_MACROS .if defined(HOSTLIB) || defined(HOSTPROG) LLVM_INCLUDE_CONFIG= ${LLVM_TOOLCONF_OBJDIR}/config/include CLANG_INCLUDE_CONFIG= ${LLVM_TOOLCONF_OBJDIR}/config/tools/clang/include +MCLINKER_INCLUDE_CONFIG= ${LLVM_TOPLEVEL}/config/mclinker LLVM_INCLUDE_OBJDIR!= cd ${NETBSDSRCDIR}/tools/llvm-include && ${PRINTOBJDIR} LLVM_TOOLCONF_OBJDIR!= cd ${NETBSDSRCDIR}/tools/llvm && ${PRINTOBJDIR} HOST_CPPFLAGS+= ${CPPFLAGS} @@ -34,12 +40,13 @@ HOST_CXXFLAGS+= -O2 -g -fno-rtti -fno-exceptions .else LLVM_INCLUDE_CONFIG= ${LLVM_TOPLEVEL}/config CLANG_INCLUDE_CONFIG= ${LLVM_TOPLEVEL}/config +MCLINKER_INCLUDE_CONFIG= ${LLVM_TOPLEVEL}/config/mclinker LLVM_INCLUDE_OBJDIR!= cd ${LLVM_TOPLEVEL}/include && ${PRINTOBJDIR} CXXFLAGS+= -fno-rtti -fno-exceptions .endif CPPFLAGS+= -I${LLVM_INCLUDE_OBJDIR} -I${LLVM_INCLUDE_CONFIG} \ - -I${CLANG_INCLUDE_CONFIG} + -I${CLANG_INCLUDE_CONFIG} -I${MCLINKER_INCLUDE_CONFIG} LLVM_CONFIGURE_ARGS= \ --enable-targets=x86,powerpc,sparc,aarch64,arm,mips \ diff --git a/external/bsd/llvm/bin/Makefile b/external/bsd/llvm/bin/Makefile index 7e6ea77a3728..0a79aa4f4f86 100644 --- a/external/bsd/llvm/bin/Makefile +++ b/external/bsd/llvm/bin/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.7 2013/01/23 15:02:54 joerg Exp $ +# $NetBSD: Makefile,v 1.8 2013/02/27 21:25:08 joerg Exp $ .include @@ -6,6 +6,11 @@ SUBDIR= clang \ clang-tblgen \ tblgen +.if ${MKMCLINKER} != "no" +SUBDIR+= \ + llvm-mcld +.endif + .if defined(LLVM_DEVELOPER) SUBDIR+= \ bugpoint \ diff --git a/external/bsd/llvm/bin/llvm-mcld/Makefile b/external/bsd/llvm/bin/llvm-mcld/Makefile new file mode 100644 index 000000000000..cd9e79854470 --- /dev/null +++ b/external/bsd/llvm/bin/llvm-mcld/Makefile @@ -0,0 +1,76 @@ +# $NetBSD: Makefile,v 1.1 2013/02/27 21:25:08 joerg Exp $ + +PROG_CXX= ld.mcld +NOMAN= yes + +.include + +.PATH: ${MCLINKER_SRCDIR}/tools/llvm-mcld + +SRCS= llvm-mcld.cpp + +MCLINKER_LIBS+= \ + ARMTargetInfo \ + ARMCodeGen \ + MipsTargetInfo \ + MipsCodeGen \ + X86TargetInfo \ + X86CodeGen \ + Target \ + CodeGen \ + Core \ + Object \ + Fragment \ + MC \ + ADT \ + Support \ + LD \ + +LLVM_LIBS+= \ + AsmParser \ + BitReader \ + AArch64CodeGen \ + AArch64TargetInfo \ + AArch64AsmParser \ + AArch64MCTargetDesc \ + AArch64AsmPrinter \ + AArch64Utils \ + ARMCodeGen \ + ARMTargetInfo \ + ARMAsmParser \ + ARMMCTargetDesc \ + ARMAsmPrinter \ + MipsCodeGen \ + MipsTargetInfo \ + MipsAsmParser \ + MipsDisassembler \ + MipsMCTargetDesc \ + MipsAsmPrinter \ + PowerPCCodeGen \ + PowerPCTargetInfo \ + PowerPCMCTargetDesc \ + PowerPCAsmPrinter \ + SparcCodeGen \ + SparcTargetInfo \ + SparcMCTargetDesc \ + X86CodeGen \ + X86TargetInfo \ + X86MCTargetDesc \ + X86AsmParser \ + X86AsmPrinter \ + X86Utils \ + SelectionDAG \ + CodeGen \ + Target \ + ScalarOpts \ + TransformsUtils \ + Analysis \ + AsmPrinter \ + MCParser \ + MC \ + IR \ + Support + +.include "${.PARSEDIR}/../../link.mk" + +.include diff --git a/external/bsd/llvm/config/mclinker/mcld/Config/Config.h b/external/bsd/llvm/config/mclinker/mcld/Config/Config.h new file mode 100644 index 000000000000..59fe65ad6054 --- /dev/null +++ b/external/bsd/llvm/config/mclinker/mcld/Config/Config.h @@ -0,0 +1,108 @@ +/* include/mcld/Config/Config.h. Generated from Config.h.in by configure. */ +/* include/mcld/Config/Config.h.in. Generated from configure.ac by autoheader. */ + + +//===- Config.h.in --------------------------------------------------------===// +// +// The MCLinker Project +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +#ifndef MCLD_CONFIG_H +#define MCLD_CONFIG_H + + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_FCNTL_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define if you have POSIX threads libraries and header files. */ +#define HAVE_PTHREAD 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#define LT_OBJDIR ".libs/" + +/* Define if this is Unixish platform */ +#define MCLD_ON_UNIX 1 + +/* Define if this is Win32ish platform */ +/* #undef MCLD_ON_WIN32 */ + +/* MCLINKER version */ +#define MCLD_VERSION "2.1.0.0-NanHu" + +/* Name of package */ +#define PACKAGE "mclinker" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "mclinker@googlegroups.com" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "MCLinker" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "MCLinker NanHu" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "mclinker" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "NanHu" + +/* Define to necessary symbol if this constant uses a non-standard name on + your system. */ +/* #undef PTHREAD_CREATE_JOINABLE */ + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Define for standalone Android linker */ +/* #undef TARGET_BUILD */ + +/* Version number of package */ +#define VERSION "NanHu" + + +#define MCLD_REGION_CHUNK_SIZE 32 +#define MCLD_NUM_OF_INPUTS 32 +#define MCLD_SECTIONS_PER_INPUT 16 +#define MCLD_SYMBOLS_PER_INPUT 128 +#define MCLD_RELOCATIONS_PER_INPUT 1024 + +#endif + diff --git a/external/bsd/llvm/config/mclinker/mcld/Config/Linkers.def b/external/bsd/llvm/config/mclinker/mcld/Config/Linkers.def new file mode 100644 index 000000000000..3dcde575152f --- /dev/null +++ b/external/bsd/llvm/config/mclinker/mcld/Config/Linkers.def @@ -0,0 +1,28 @@ +//===- llvm/Config/Linkers.def - MCLinkers ----------------------*- C++ -*-===// +// +// The MCLinker Project +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file enumerates all of the linkers supported by this build of MCLinker. +// Clients of this file should define the MCLD_LINKER macro to be a function-like +// macro with a single parameter (the name of the target whose exe/dso can be +// generated); including this file will then enumerate all of the targets with +// linkers. +// +// The set of targets supported by MCLD is generated at configuration +// time, at which point this header is generated. Do not modify this +// header directly. +// +//===----------------------------------------------------------------------===// + +#ifndef MCLD_LINKER +# error Please define the macro MCLD_LINKER(TargetName) +#endif + +MCLD_LINKER(Mips) MCLD_LINKER(ARM) MCLD_LINKER(X86) + +#undef MCLD_LINKER diff --git a/external/bsd/llvm/config/mclinker/mcld/Config/Targets.def b/external/bsd/llvm/config/mclinker/mcld/Config/Targets.def new file mode 100644 index 000000000000..c97faf0e9bef --- /dev/null +++ b/external/bsd/llvm/config/mclinker/mcld/Config/Targets.def @@ -0,0 +1,28 @@ +/*===- llvm/Config/Targets.def - MCLD Target Architectures ------*- C++ -*-===*\ +|* *| +|* The MCLinker Project *| +|* *| +|* This file is distributed under the University of Illinois Open Source *| +|* License. See LICENSE.TXT for details. *| +|* *| +|*===----------------------------------------------------------------------===*| +|* *| +|* This file enumerates all of the target architectures supported by *| +|* this build of MCLD. Clients of this file should define the *| +|* MCLD_TARGET macro to be a function-like macro with a single *| +|* parameter (the name of the target); including this file will then *| +|* enumerate all of the targets. *| +|* *| +|* The set of targets supported by MCLD is generated at configuration *| +|* time, at which point this header is generated. Do not modify this *| +|* header directly. *| +|* *| +\*===----------------------------------------------------------------------===*/ + +#ifndef MCLD_TARGET +# error Please define the macro MCLD_TARGET(TargetName) +#endif + +MCLD_TARGET(Mips) MCLD_TARGET(ARM) MCLD_TARGET(X86) + +#undef MCLD_TARGET diff --git a/external/bsd/llvm/lib/Makefile b/external/bsd/llvm/lib/Makefile index aa8ff340b80e..4851261b4e09 100644 --- a/external/bsd/llvm/lib/Makefile +++ b/external/bsd/llvm/lib/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.28 2013/02/19 12:35:42 joerg Exp $ +# $NetBSD: Makefile,v 1.29 2013/02/27 21:25:09 joerg Exp $ .include @@ -118,4 +118,25 @@ SUBDIR+= \ libclangTooling .endif +.if ${MKMCLINKER} != "no" +SUBDIR+= \ + libMCLinkerADT \ + libMCLinkerCodeGen \ + libMCLinkerCore \ + libMCLinkerFragment \ + libMCLinkerLD \ + libMCLinkerMC \ + libMCLinkerObject \ + libMCLinkerSupport \ + libMCLinkerTarget + +SUBDIR+= \ + libMCLinkerARMCodeGen libMCLinkerARMTargetInfo +SUBDIR+= \ + libMCLinkerMipsCodeGen libMCLinkerMipsTargetInfo +SUBDIR+= \ + libMCLinkerX86CodeGen libMCLinkerX86TargetInfo + +.endif + .include diff --git a/external/bsd/llvm/lib/libMCLinkerADT/Makefile b/external/bsd/llvm/lib/libMCLinkerADT/Makefile new file mode 100644 index 000000000000..b50583eabace --- /dev/null +++ b/external/bsd/llvm/lib/libMCLinkerADT/Makefile @@ -0,0 +1,15 @@ +# $NetBSD: Makefile,v 1.1 2013/02/27 21:25:09 joerg Exp $ + +LIB= MCLinkerADT + +.include + +.PATH: ${MCLINKER_SRCDIR}/lib/ADT + +SRCS= StringEntry.cpp + +.if defined(HOSTLIB) +.include +.else +.include +.endif diff --git a/external/bsd/llvm/lib/libMCLinkerARMCodeGen/Makefile b/external/bsd/llvm/lib/libMCLinkerARMCodeGen/Makefile new file mode 100644 index 000000000000..00ac2f140e4f --- /dev/null +++ b/external/bsd/llvm/lib/libMCLinkerARMCodeGen/Makefile @@ -0,0 +1,28 @@ +# $NetBSD: Makefile,v 1.1 2013/02/27 21:25:09 joerg Exp $ + +LIB= MCLinkerARMCodeGen + +.include + +.PATH: ${MCLINKER_SRCDIR}/lib/Target/ARM + +SRCS= ARMDiagnostic.cpp \ + ARMELFDynamic.cpp \ + ARMELFMCLinker.cpp \ + ARMEmulation.cpp \ + ARMGOT.cpp \ + ARMLDBackend.cpp \ + ARMMCLinker.cpp \ + ARMPLT.cpp \ + ARMRelocator.cpp \ + ARMTargetMachine.cpp \ + ARMToARMStub.cpp \ + ARMToTHMStub.cpp \ + THMToARMStub.cpp \ + THMToTHMStub.cpp + +.if defined(HOSTLIB) +.include +.else +.include +.endif diff --git a/external/bsd/llvm/lib/libMCLinkerARMTargetInfo/Makefile b/external/bsd/llvm/lib/libMCLinkerARMTargetInfo/Makefile new file mode 100644 index 000000000000..92ab484bc30d --- /dev/null +++ b/external/bsd/llvm/lib/libMCLinkerARMTargetInfo/Makefile @@ -0,0 +1,15 @@ +# $NetBSD: Makefile,v 1.1 2013/02/27 21:25:09 joerg Exp $ + +LIB= MCLinkerARMTargetInfo + +.include + +.PATH: ${MCLINKER_SRCDIR}/lib/Target/ARM/TargetInfo + +SRCS= ARMTargetInfo.cpp + +.if defined(HOSTLIB) +.include +.else +.include +.endif diff --git a/external/bsd/llvm/lib/libMCLinkerCodeGen/Makefile b/external/bsd/llvm/lib/libMCLinkerCodeGen/Makefile new file mode 100644 index 000000000000..41861d56453e --- /dev/null +++ b/external/bsd/llvm/lib/libMCLinkerCodeGen/Makefile @@ -0,0 +1,16 @@ +# $NetBSD: Makefile,v 1.1 2013/02/27 21:25:09 joerg Exp $ + +LIB= MCLinkerCodeGen + +.include + +.PATH: ${MCLINKER_SRCDIR}/lib/CodeGen + +SRCS= MCLDTargetMachine.cpp \ + MCLinker.cpp + +.if defined(HOSTLIB) +.include +.else +.include +.endif diff --git a/external/bsd/llvm/lib/libMCLinkerCore/Makefile b/external/bsd/llvm/lib/libMCLinkerCore/Makefile new file mode 100644 index 000000000000..c72bdbbef13e --- /dev/null +++ b/external/bsd/llvm/lib/libMCLinkerCore/Makefile @@ -0,0 +1,25 @@ +# $NetBSD: Makefile,v 1.1 2013/02/27 21:25:09 joerg Exp $ + +LIB= MCLinkerCore + +.include + +.PATH: ${MCLINKER_SRCDIR}/lib/Core + +SRCS= AttributeOption.cpp \ + BitcodeOption.cpp \ + Environment.cpp \ + GeneralOptions.cpp \ + InputTree.cpp \ + IRBuilder.cpp \ + LinkerConfig.cpp \ + Linker.cpp \ + Module.cpp \ + ScriptOptions.cpp \ + TargetOptions.cpp + +.if defined(HOSTLIB) +.include +.else +.include +.endif diff --git a/external/bsd/llvm/lib/libMCLinkerFragment/Makefile b/external/bsd/llvm/lib/libMCLinkerFragment/Makefile new file mode 100644 index 000000000000..f6e344bb985f --- /dev/null +++ b/external/bsd/llvm/lib/libMCLinkerFragment/Makefile @@ -0,0 +1,23 @@ +# $NetBSD: Makefile,v 1.1 2013/02/27 21:25:10 joerg Exp $ + +LIB= MCLinkerFragment + +.include + +.PATH: ${MCLINKER_SRCDIR}/lib/Fragment + +SRCS= AlignFragment.cpp \ + FillFragment.cpp \ + Fragment.cpp \ + FragmentLinker.cpp \ + FragmentRef.cpp \ + NullFragment.cpp \ + RegionFragment.cpp \ + Relocation.cpp \ + Stub.cpp + +.if defined(HOSTLIB) +.include +.else +.include +.endif diff --git a/external/bsd/llvm/lib/libMCLinkerLD/Makefile b/external/bsd/llvm/lib/libMCLinkerLD/Makefile new file mode 100644 index 000000000000..354af8f33045 --- /dev/null +++ b/external/bsd/llvm/lib/libMCLinkerLD/Makefile @@ -0,0 +1,63 @@ +# $NetBSD: Makefile,v 1.1 2013/02/27 21:25:10 joerg Exp $ + +LIB= MCLinkerLD + +.include + +.PATH: ${MCLINKER_SRCDIR}/lib/LD + +SRCS= Archive.cpp \ + ArchiveReader.cpp \ + BranchIsland.cpp \ + BranchIslandFactory.cpp \ + BSDArchiveReader.cpp \ + Diagnostic.cpp \ + DiagnosticEngine.cpp \ + DiagnosticInfos.cpp \ + DiagnosticLineInfo.cpp \ + DiagnosticPrinter.cpp \ + DWARFLineInfo.cpp \ + DynObjReader.cpp \ + EhFrame.cpp \ + EhFrameHdr.cpp \ + EhFrameReader.cpp \ + ELFBinaryReader.cpp \ + ELFDynObjFileFormat.cpp \ + ELFDynObjReader.cpp \ + ELFExecFileFormat.cpp \ + ELFFileFormat.cpp \ + ELFObjectReader.cpp \ + ELFObjectWriter.cpp \ + ELFReader.cpp \ + ELFReaderIf.cpp \ + ELFSegment.cpp \ + ELFSegmentFactory.cpp \ + ELFWriter.cpp \ + GNUArchiveReader.cpp \ + GroupReader.cpp \ + LDContext.cpp \ + LDFileFormat.cpp \ + LDReader.cpp \ + LDSection.cpp \ + LDSymbol.cpp \ + LDWriter.cpp \ + MsgHandler.cpp \ + NamePool.cpp \ + ObjectWriter.cpp \ + RelocationFactory.cpp \ + Relocator.cpp \ + RelocData.cpp \ + ResolveInfo.cpp \ + Resolver.cpp \ + SectionData.cpp \ + SectionRules.cpp \ + SectionSymbolSet.cpp \ + StaticResolver.cpp \ + StubFactory.cpp \ + TextDiagnosticPrinter.cpp + +.if defined(HOSTLIB) +.include +.else +.include +.endif diff --git a/external/bsd/llvm/lib/libMCLinkerMC/Makefile b/external/bsd/llvm/lib/libMCLinkerMC/Makefile new file mode 100644 index 000000000000..3c6280b09578 --- /dev/null +++ b/external/bsd/llvm/lib/libMCLinkerMC/Makefile @@ -0,0 +1,27 @@ +# $NetBSD: Makefile,v 1.1 2013/02/27 21:25:10 joerg Exp $ + +LIB= MCLinkerMC + +.include + +.PATH: ${MCLINKER_SRCDIR}/lib/MC + +SRCS= Attribute.cpp \ + AttributeSet.cpp \ + CommandAction.cpp \ + ContextFactory.cpp \ + FileAction.cpp \ + InputAction.cpp \ + InputBuilder.cpp \ + InputFactory.cpp \ + MCLDDirectory.cpp \ + MCLDInput.cpp \ + SearchDirs.cpp \ + SymbolCategory.cpp \ + ZOption.cpp + +.if defined(HOSTLIB) +.include +.else +.include +.endif diff --git a/external/bsd/llvm/lib/libMCLinkerMipsCodeGen/Makefile b/external/bsd/llvm/lib/libMCLinkerMipsCodeGen/Makefile new file mode 100644 index 000000000000..24eb3a54a6cd --- /dev/null +++ b/external/bsd/llvm/lib/libMCLinkerMipsCodeGen/Makefile @@ -0,0 +1,24 @@ +# $NetBSD: Makefile,v 1.1 2013/02/27 21:25:10 joerg Exp $ + +LIB= MCLinkerMipsCodeGen + +.include + +.PATH: ${MCLINKER_SRCDIR}/lib/Target/Mips + +SRCS= MipsDiagnostic.cpp \ + MipsELFDynamic.cpp \ + MipsELFMCLinker.cpp \ + MipsEmulation.cpp \ + MipsGOT.cpp \ + MipsLDBackend.cpp \ + MipsMCLinker.cpp \ + MipsRelocator.cpp \ + MipsTargetMachine.cpp + + +.if defined(HOSTLIB) +.include +.else +.include +.endif diff --git a/external/bsd/llvm/lib/libMCLinkerMipsTargetInfo/Makefile b/external/bsd/llvm/lib/libMCLinkerMipsTargetInfo/Makefile new file mode 100644 index 000000000000..cbce4a659fe6 --- /dev/null +++ b/external/bsd/llvm/lib/libMCLinkerMipsTargetInfo/Makefile @@ -0,0 +1,15 @@ +# $NetBSD: Makefile,v 1.1 2013/02/27 21:25:10 joerg Exp $ + +LIB= MCLinkerMipsTargetInfo + +.include + +.PATH: ${MCLINKER_SRCDIR}/lib/Target/Mips/TargetInfo + +SRCS= MipsTargetInfo.cpp + +.if defined(HOSTLIB) +.include +.else +.include +.endif diff --git a/external/bsd/llvm/lib/libMCLinkerObject/Makefile b/external/bsd/llvm/lib/libMCLinkerObject/Makefile new file mode 100644 index 000000000000..a2c1ea87a1f3 --- /dev/null +++ b/external/bsd/llvm/lib/libMCLinkerObject/Makefile @@ -0,0 +1,17 @@ +# $NetBSD: Makefile,v 1.1 2013/02/27 21:25:10 joerg Exp $ + +LIB= MCLinkerObject + +.include + +.PATH: ${MCLINKER_SRCDIR}/lib/Object + +SRCS= ObjectBuilder.cpp \ + ObjectLinker.cpp \ + SectionMap.cpp + +.if defined(HOSTLIB) +.include +.else +.include +.endif diff --git a/external/bsd/llvm/lib/libMCLinkerSupport/Makefile b/external/bsd/llvm/lib/libMCLinkerSupport/Makefile new file mode 100644 index 000000000000..4bc5dd2b5840 --- /dev/null +++ b/external/bsd/llvm/lib/libMCLinkerSupport/Makefile @@ -0,0 +1,33 @@ +# $NetBSD: Makefile,v 1.1 2013/02/27 21:25:11 joerg Exp $ + +LIB= MCLinkerSupport + +.include + +.PATH: ${MCLINKER_SRCDIR}/lib/Support + +SRCS= CommandLine.cpp \ + Directory.cpp \ + FileHandle.cpp \ + FileSystem.cpp \ + HandleToArea.cpp \ + LEB128.cpp \ + MemoryArea.cpp \ + MemoryAreaFactory.cpp \ + MemoryRegion.cpp \ + MsgHandling.cpp \ + Path.cpp \ + raw_mem_ostream.cpp \ + raw_ostream.cpp \ + RealPath.cpp \ + RegionFactory.cpp \ + Space.cpp \ + SystemUtils.cpp \ + TargetRegistry.cpp \ + ToolOutputFile.cpp + +.if defined(HOSTLIB) +.include +.else +.include +.endif diff --git a/external/bsd/llvm/lib/libMCLinkerTarget/Makefile b/external/bsd/llvm/lib/libMCLinkerTarget/Makefile new file mode 100644 index 000000000000..e46871cc3dd1 --- /dev/null +++ b/external/bsd/llvm/lib/libMCLinkerTarget/Makefile @@ -0,0 +1,24 @@ +# $NetBSD: Makefile,v 1.1 2013/02/27 21:25:11 joerg Exp $ + +LIB= MCLinkerTarget + +.include + +.PATH: ${MCLINKER_SRCDIR}/lib/Target + +SRCS= ELFDynamic.cpp \ + ELFEmulation.cpp \ + ELFMCLinker.cpp \ + GNUInfo.cpp \ + GNULDBackend.cpp \ + GOT.cpp \ + OutputRelocSection.cpp \ + PLT.cpp \ + Target.cpp \ + TargetLDBackend.cpp + +.if defined(HOSTLIB) +.include +.else +.include +.endif diff --git a/external/bsd/llvm/lib/libMCLinkerX86CodeGen/Makefile b/external/bsd/llvm/lib/libMCLinkerX86CodeGen/Makefile new file mode 100644 index 000000000000..cc47ec4b560f --- /dev/null +++ b/external/bsd/llvm/lib/libMCLinkerX86CodeGen/Makefile @@ -0,0 +1,25 @@ +# $NetBSD: Makefile,v 1.1 2013/02/27 21:25:11 joerg Exp $ + +LIB= MCLinkerX86CodeGen + +.include + +.PATH: ${MCLINKER_SRCDIR}/lib/Target/X86 + +SRCS= X86Diagnostic.cpp \ + X86ELFDynamic.cpp \ + X86ELFMCLinker.cpp \ + X86Emulation.cpp \ + X86GOT.cpp \ + X86GOTPLT.cpp \ + X86LDBackend.cpp \ + X86MCLinker.cpp \ + X86PLT.cpp \ + X86Relocator.cpp \ + X86TargetMachine.cpp + +.if defined(HOSTLIB) +.include +.else +.include +.endif diff --git a/external/bsd/llvm/lib/libMCLinkerX86TargetInfo/Makefile b/external/bsd/llvm/lib/libMCLinkerX86TargetInfo/Makefile new file mode 100644 index 000000000000..44b194525d76 --- /dev/null +++ b/external/bsd/llvm/lib/libMCLinkerX86TargetInfo/Makefile @@ -0,0 +1,15 @@ +# $NetBSD: Makefile,v 1.1 2013/02/27 21:25:11 joerg Exp $ + +LIB= MCLinkerX86TargetInfo + +.include + +.PATH: ${MCLINKER_SRCDIR}/lib/Target/X86/TargetInfo + +SRCS= X86TargetInfo.cpp + +.if defined(HOSTLIB) +.include +.else +.include +.endif diff --git a/external/bsd/llvm/link.mk b/external/bsd/llvm/link.mk index 24e24eedc9e7..a51a5b048c58 100644 --- a/external/bsd/llvm/link.mk +++ b/external/bsd/llvm/link.mk @@ -1,4 +1,4 @@ -# $NetBSD: link.mk,v 1.2 2012/05/31 18:53:33 joerg Exp $ +# $NetBSD: link.mk,v 1.3 2013/02/27 21:25:08 joerg Exp $ .include @@ -8,6 +8,12 @@ LIB_BASE= ${NETBSDSRCDIR}/tools/llvm-lib LIB_BASE= ${LLVM_TOPLEVEL}/lib .endif +.for l in ${MCLINKER_LIBS} +MCLINKER_OBJDIR.${l}!= cd ${LIB_BASE}/libMCLinker${l} && ${PRINTOBJDIR} +LDADD+= -L${MCLINKER_OBJDIR.${l}} -lMCLinker${l} +DPADD+= ${MCLINKER_OBJDIR.${l}}/libMCLinker${l}.a +.endfor + .for l in ${CLANG_LIBS} CLANG_OBJDIR.${l}!= cd ${LIB_BASE}/lib${l} && ${PRINTOBJDIR} LDADD+= -L${CLANG_OBJDIR.${l}} -l${l} diff --git a/share/mk/bsd.own.mk b/share/mk/bsd.own.mk index 2bfa12d0c965..5b029f7a216c 100644 --- a/share/mk/bsd.own.mk +++ b/share/mk/bsd.own.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.own.mk,v 1.724 2013/02/15 19:49:49 jmmv Exp $ +# $NetBSD: bsd.own.mk,v 1.725 2013/02/27 21:25:08 joerg Exp $ # This needs to be before bsd.init.mk .if defined(BSD_MK_COMPAT_FILE) @@ -891,7 +891,7 @@ _MKVARS.no= \ MKCATPAGES MKCRYPTO_RC5 MKDEBUG \ MKDEBUGLIB MKDTRACE MKEXTSRC \ MKKYUA \ - MKMANZ MKOBJDIRS \ + MKMANZ MKMCLINKER MKOBJDIRS \ MKLLVM MKPCC \ MKPIGZGZIP \ MKREPRO \ diff --git a/tools/Makefile b/tools/Makefile index 9eec793fbc5f..19ebb3cca6e5 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.167 2013/02/05 07:27:02 matt Exp $ +# $NetBSD: Makefile,v 1.168 2013/02/27 21:25:11 joerg Exp $ .include .include @@ -132,6 +132,9 @@ SUBDIR+= \ llvm-include .WAIT \ llvm-lib .WAIT \ llvm-clang +.if ${MKMCLINKER} != "no" +SUBDIR+= llvm-mcld +.endif .endif .if ${MKMAN} != "no" || ${MKDOC} != "no" || ${MKHTML} != "no" diff --git a/tools/llvm-lib/libMCLinkerADT/Makefile b/tools/llvm-lib/libMCLinkerADT/Makefile new file mode 100644 index 000000000000..c6a09e4ec4ae --- /dev/null +++ b/tools/llvm-lib/libMCLinkerADT/Makefile @@ -0,0 +1,3 @@ +# $NetBSD: Makefile,v 1.1 2013/02/27 21:25:11 joerg Exp $ + +.include diff --git a/tools/llvm-lib/libMCLinkerARMCodeGen/Makefile b/tools/llvm-lib/libMCLinkerARMCodeGen/Makefile new file mode 100644 index 000000000000..874d47b315d1 --- /dev/null +++ b/tools/llvm-lib/libMCLinkerARMCodeGen/Makefile @@ -0,0 +1,3 @@ +# $NetBSD: Makefile,v 1.1 2013/02/27 21:25:12 joerg Exp $ + +.include diff --git a/tools/llvm-lib/libMCLinkerARMTargetInfo/Makefile b/tools/llvm-lib/libMCLinkerARMTargetInfo/Makefile new file mode 100644 index 000000000000..874d47b315d1 --- /dev/null +++ b/tools/llvm-lib/libMCLinkerARMTargetInfo/Makefile @@ -0,0 +1,3 @@ +# $NetBSD: Makefile,v 1.1 2013/02/27 21:25:12 joerg Exp $ + +.include diff --git a/tools/llvm-lib/libMCLinkerCodeGen/Makefile b/tools/llvm-lib/libMCLinkerCodeGen/Makefile new file mode 100644 index 000000000000..874d47b315d1 --- /dev/null +++ b/tools/llvm-lib/libMCLinkerCodeGen/Makefile @@ -0,0 +1,3 @@ +# $NetBSD: Makefile,v 1.1 2013/02/27 21:25:12 joerg Exp $ + +.include diff --git a/tools/llvm-lib/libMCLinkerCore/Makefile b/tools/llvm-lib/libMCLinkerCore/Makefile new file mode 100644 index 000000000000..874d47b315d1 --- /dev/null +++ b/tools/llvm-lib/libMCLinkerCore/Makefile @@ -0,0 +1,3 @@ +# $NetBSD: Makefile,v 1.1 2013/02/27 21:25:12 joerg Exp $ + +.include diff --git a/tools/llvm-lib/libMCLinkerFragment/Makefile b/tools/llvm-lib/libMCLinkerFragment/Makefile new file mode 100644 index 000000000000..874d47b315d1 --- /dev/null +++ b/tools/llvm-lib/libMCLinkerFragment/Makefile @@ -0,0 +1,3 @@ +# $NetBSD: Makefile,v 1.1 2013/02/27 21:25:12 joerg Exp $ + +.include diff --git a/tools/llvm-lib/libMCLinkerLD/Makefile b/tools/llvm-lib/libMCLinkerLD/Makefile new file mode 100644 index 000000000000..874d47b315d1 --- /dev/null +++ b/tools/llvm-lib/libMCLinkerLD/Makefile @@ -0,0 +1,3 @@ +# $NetBSD: Makefile,v 1.1 2013/02/27 21:25:12 joerg Exp $ + +.include diff --git a/tools/llvm-lib/libMCLinkerMC/Makefile b/tools/llvm-lib/libMCLinkerMC/Makefile new file mode 100644 index 000000000000..874d47b315d1 --- /dev/null +++ b/tools/llvm-lib/libMCLinkerMC/Makefile @@ -0,0 +1,3 @@ +# $NetBSD: Makefile,v 1.1 2013/02/27 21:25:12 joerg Exp $ + +.include diff --git a/tools/llvm-lib/libMCLinkerMipsCodeGen/Makefile b/tools/llvm-lib/libMCLinkerMipsCodeGen/Makefile new file mode 100644 index 000000000000..38fbac4db74a --- /dev/null +++ b/tools/llvm-lib/libMCLinkerMipsCodeGen/Makefile @@ -0,0 +1,3 @@ +# $NetBSD: Makefile,v 1.1 2013/02/27 21:25:13 joerg Exp $ + +.include diff --git a/tools/llvm-lib/libMCLinkerMipsTargetInfo/Makefile b/tools/llvm-lib/libMCLinkerMipsTargetInfo/Makefile new file mode 100644 index 000000000000..38fbac4db74a --- /dev/null +++ b/tools/llvm-lib/libMCLinkerMipsTargetInfo/Makefile @@ -0,0 +1,3 @@ +# $NetBSD: Makefile,v 1.1 2013/02/27 21:25:13 joerg Exp $ + +.include diff --git a/tools/llvm-lib/libMCLinkerObject/Makefile b/tools/llvm-lib/libMCLinkerObject/Makefile new file mode 100644 index 000000000000..38fbac4db74a --- /dev/null +++ b/tools/llvm-lib/libMCLinkerObject/Makefile @@ -0,0 +1,3 @@ +# $NetBSD: Makefile,v 1.1 2013/02/27 21:25:13 joerg Exp $ + +.include diff --git a/tools/llvm-lib/libMCLinkerSupport/Makefile b/tools/llvm-lib/libMCLinkerSupport/Makefile new file mode 100644 index 000000000000..38fbac4db74a --- /dev/null +++ b/tools/llvm-lib/libMCLinkerSupport/Makefile @@ -0,0 +1,3 @@ +# $NetBSD: Makefile,v 1.1 2013/02/27 21:25:13 joerg Exp $ + +.include diff --git a/tools/llvm-lib/libMCLinkerTarget/Makefile b/tools/llvm-lib/libMCLinkerTarget/Makefile new file mode 100644 index 000000000000..38fbac4db74a --- /dev/null +++ b/tools/llvm-lib/libMCLinkerTarget/Makefile @@ -0,0 +1,3 @@ +# $NetBSD: Makefile,v 1.1 2013/02/27 21:25:13 joerg Exp $ + +.include diff --git a/tools/llvm-lib/libMCLinkerX86CodeGen/Makefile b/tools/llvm-lib/libMCLinkerX86CodeGen/Makefile new file mode 100644 index 000000000000..38fbac4db74a --- /dev/null +++ b/tools/llvm-lib/libMCLinkerX86CodeGen/Makefile @@ -0,0 +1,3 @@ +# $NetBSD: Makefile,v 1.1 2013/02/27 21:25:13 joerg Exp $ + +.include diff --git a/tools/llvm-lib/libMCLinkerX86TargetInfo/Makefile b/tools/llvm-lib/libMCLinkerX86TargetInfo/Makefile new file mode 100644 index 000000000000..38fbac4db74a --- /dev/null +++ b/tools/llvm-lib/libMCLinkerX86TargetInfo/Makefile @@ -0,0 +1,3 @@ +# $NetBSD: Makefile,v 1.1 2013/02/27 21:25:13 joerg Exp $ + +.include diff --git a/tools/llvm-mcld/Makefile b/tools/llvm-mcld/Makefile new file mode 100644 index 000000000000..b817f0e08832 --- /dev/null +++ b/tools/llvm-mcld/Makefile @@ -0,0 +1,7 @@ +# $NetBSD: Makefile,v 1.1 2013/02/27 21:25:14 joerg Exp $ + +HOSTPROGNAME= ld.mcld +HOSTPROG_CXX= ld.mcld +HOST_SRCDIR= external/bsd/llvm/bin/llvm-mcld + +.include "${.CURDIR}/../Makefile.host"