From 8a166cafe0965f6bd72cd3d2f5372704f05cb5e8 Mon Sep 17 00:00:00 2001 From: Andrew Turner Date: Tue, 12 Feb 2013 05:56:00 +0000 Subject: [PATCH] Allow us to build clang for ARM EABI. Clang and llvm use the arm-gnueabi-freebsd10.0 triple for EABI. Use this when we are on arm or armv6 and are building for EABI. Reviewed by: dim --- lib/clang/clang.build.mk | 10 +++++++++- usr.bin/clang/bugpoint/Makefile | 2 ++ usr.bin/clang/clang-tblgen/Makefile | 4 +++- usr.bin/clang/llc/Makefile | 2 ++ usr.bin/clang/lli/Makefile | 2 ++ usr.bin/clang/llvm-ar/Makefile | 2 ++ usr.bin/clang/llvm-as/Makefile | 2 ++ usr.bin/clang/llvm-bcanalyzer/Makefile | 2 ++ usr.bin/clang/llvm-diff/Makefile | 2 ++ usr.bin/clang/llvm-dis/Makefile | 2 ++ usr.bin/clang/llvm-extract/Makefile | 2 ++ usr.bin/clang/llvm-link/Makefile | 2 ++ usr.bin/clang/llvm-mc/Makefile | 4 +++- usr.bin/clang/llvm-nm/Makefile | 2 ++ usr.bin/clang/llvm-objdump/Makefile | 4 +++- usr.bin/clang/llvm-prof/Makefile | 2 ++ usr.bin/clang/llvm-ranlib/Makefile | 2 ++ usr.bin/clang/llvm-rtdyld/Makefile | 4 +++- usr.bin/clang/macho-dump/Makefile | 4 +++- usr.bin/clang/opt/Makefile | 2 ++ usr.bin/clang/tblgen/Makefile | 2 ++ 21 files changed, 54 insertions(+), 6 deletions(-) diff --git a/lib/clang/clang.build.mk b/lib/clang/clang.build.mk index 0015e3d12bdb..6de044a3b6be 100644 --- a/lib/clang/clang.build.mk +++ b/lib/clang/clang.build.mk @@ -19,7 +19,15 @@ CFLAGS+= -fno-strict-aliasing TARGET_ARCH?= ${MACHINE_ARCH} BUILD_ARCH?= ${MACHINE_ARCH} -TARGET_TRIPLE?= ${TARGET_ARCH:C/amd64/x86_64/}-unknown-freebsd10.0 + +.if (${TARGET_ARCH} == "arm" || ${TARGET_ARCH} == "armv6") && \ + ${MK_ARM_EABI} != "no" +TARGET_ABI= gnueabi +.else +TARGET_ABI= unknown +.endif + +TARGET_TRIPLE?= ${TARGET_ARCH:C/amd64/x86_64/}-${TARGET_ABI}-freebsd10.0 BUILD_TRIPLE?= ${BUILD_ARCH:C/amd64/x86_64/}-unknown-freebsd10.0 CFLAGS+= -DLLVM_DEFAULT_TARGET_TRIPLE=\"${TARGET_TRIPLE}\" \ -DLLVM_HOSTTRIPLE=\"${BUILD_TRIPLE}\" \ diff --git a/usr.bin/clang/bugpoint/Makefile b/usr.bin/clang/bugpoint/Makefile index 410b91b55c95..a40d1e6d8fdf 100644 --- a/usr.bin/clang/bugpoint/Makefile +++ b/usr.bin/clang/bugpoint/Makefile @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + PROG_CXX=bugpoint SRCDIR= tools/bugpoint diff --git a/usr.bin/clang/clang-tblgen/Makefile b/usr.bin/clang/clang-tblgen/Makefile index 9e8af45d2ed3..b777f0731f23 100644 --- a/usr.bin/clang/clang-tblgen/Makefile +++ b/usr.bin/clang/clang-tblgen/Makefile @@ -1,7 +1,9 @@ # $FreeBSD$ -PROG_CXX=clang-tblgen NO_MAN= +.include + +PROG_CXX=clang-tblgen SRCDIR= tools/clang/utils/TableGen SRCS= ClangASTNodesEmitter.cpp \ diff --git a/usr.bin/clang/llc/Makefile b/usr.bin/clang/llc/Makefile index 3606fef1518d..7be4309c29b6 100644 --- a/usr.bin/clang/llc/Makefile +++ b/usr.bin/clang/llc/Makefile @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + PROG_CXX=llc SRCDIR= tools/llc diff --git a/usr.bin/clang/lli/Makefile b/usr.bin/clang/lli/Makefile index d6ecab512a15..4c56961ba5d2 100644 --- a/usr.bin/clang/lli/Makefile +++ b/usr.bin/clang/lli/Makefile @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + PROG_CXX=lli SRCDIR= tools/lli diff --git a/usr.bin/clang/llvm-ar/Makefile b/usr.bin/clang/llvm-ar/Makefile index 97ad058204d0..b7a4a130482e 100644 --- a/usr.bin/clang/llvm-ar/Makefile +++ b/usr.bin/clang/llvm-ar/Makefile @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + PROG_CXX=llvm-ar SRCDIR= tools/llvm-ar diff --git a/usr.bin/clang/llvm-as/Makefile b/usr.bin/clang/llvm-as/Makefile index 7e90878bb129..6d3fd8e60a51 100644 --- a/usr.bin/clang/llvm-as/Makefile +++ b/usr.bin/clang/llvm-as/Makefile @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + PROG_CXX=llvm-as SRCDIR= tools/llvm-as diff --git a/usr.bin/clang/llvm-bcanalyzer/Makefile b/usr.bin/clang/llvm-bcanalyzer/Makefile index 27788cc0a8b5..88032cf16960 100644 --- a/usr.bin/clang/llvm-bcanalyzer/Makefile +++ b/usr.bin/clang/llvm-bcanalyzer/Makefile @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + PROG_CXX=llvm-bcanalyzer SRCDIR= tools/llvm-bcanalyzer diff --git a/usr.bin/clang/llvm-diff/Makefile b/usr.bin/clang/llvm-diff/Makefile index aedaff02a996..1a130fbdaa00 100644 --- a/usr.bin/clang/llvm-diff/Makefile +++ b/usr.bin/clang/llvm-diff/Makefile @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + PROG_CXX=llvm-diff SRCDIR= tools/llvm-diff diff --git a/usr.bin/clang/llvm-dis/Makefile b/usr.bin/clang/llvm-dis/Makefile index d6e0157d7856..75a57383d7e6 100644 --- a/usr.bin/clang/llvm-dis/Makefile +++ b/usr.bin/clang/llvm-dis/Makefile @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + PROG_CXX=llvm-dis SRCDIR= tools/llvm-dis diff --git a/usr.bin/clang/llvm-extract/Makefile b/usr.bin/clang/llvm-extract/Makefile index 7489dd621952..8aac1ab7f3d6 100644 --- a/usr.bin/clang/llvm-extract/Makefile +++ b/usr.bin/clang/llvm-extract/Makefile @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + PROG_CXX=llvm-extract SRCDIR= tools/llvm-extract diff --git a/usr.bin/clang/llvm-link/Makefile b/usr.bin/clang/llvm-link/Makefile index bcd6a51cbd2e..b76c5f4d512f 100644 --- a/usr.bin/clang/llvm-link/Makefile +++ b/usr.bin/clang/llvm-link/Makefile @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + PROG_CXX=llvm-link SRCDIR= tools/llvm-link diff --git a/usr.bin/clang/llvm-mc/Makefile b/usr.bin/clang/llvm-mc/Makefile index c2106e1fe981..c3821c41e1bf 100644 --- a/usr.bin/clang/llvm-mc/Makefile +++ b/usr.bin/clang/llvm-mc/Makefile @@ -1,7 +1,9 @@ # $FreeBSD$ -PROG_CXX=llvm-mc NO_MAN= +.include + +PROG_CXX=llvm-mc SRCDIR= tools/llvm-mc SRCS= llvm-mc.cpp \ diff --git a/usr.bin/clang/llvm-nm/Makefile b/usr.bin/clang/llvm-nm/Makefile index 1ac3a3d5d59a..bff0cdf0da25 100644 --- a/usr.bin/clang/llvm-nm/Makefile +++ b/usr.bin/clang/llvm-nm/Makefile @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + PROG_CXX=llvm-nm SRCDIR= tools/llvm-nm diff --git a/usr.bin/clang/llvm-objdump/Makefile b/usr.bin/clang/llvm-objdump/Makefile index 38d23aedf6e8..b7e5031b7e6a 100644 --- a/usr.bin/clang/llvm-objdump/Makefile +++ b/usr.bin/clang/llvm-objdump/Makefile @@ -1,7 +1,9 @@ # $FreeBSD$ -PROG_CXX=llvm-objdump NO_MAN= +.include + +PROG_CXX=llvm-objdump SRCDIR= tools/llvm-objdump SRCS= llvm-objdump.cpp \ diff --git a/usr.bin/clang/llvm-prof/Makefile b/usr.bin/clang/llvm-prof/Makefile index b7b29cd8cf22..3dff62aaa8ac 100644 --- a/usr.bin/clang/llvm-prof/Makefile +++ b/usr.bin/clang/llvm-prof/Makefile @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + PROG_CXX=llvm-prof SRCDIR= tools/llvm-prof diff --git a/usr.bin/clang/llvm-ranlib/Makefile b/usr.bin/clang/llvm-ranlib/Makefile index 80e495cfb531..108ca7848f32 100644 --- a/usr.bin/clang/llvm-ranlib/Makefile +++ b/usr.bin/clang/llvm-ranlib/Makefile @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + PROG_CXX=llvm-ranlib SRCDIR= tools/llvm-ranlib diff --git a/usr.bin/clang/llvm-rtdyld/Makefile b/usr.bin/clang/llvm-rtdyld/Makefile index e899d7090030..b9b49ce5c99d 100644 --- a/usr.bin/clang/llvm-rtdyld/Makefile +++ b/usr.bin/clang/llvm-rtdyld/Makefile @@ -1,7 +1,9 @@ # $FreeBSD$ -PROG_CXX=llvm-rtdyld NO_MAN= +.include + +PROG_CXX=llvm-rtdyld SRCDIR= tools/llvm-rtdyld SRCS= llvm-rtdyld.cpp diff --git a/usr.bin/clang/macho-dump/Makefile b/usr.bin/clang/macho-dump/Makefile index cb170d651f3b..bafd15029cda 100644 --- a/usr.bin/clang/macho-dump/Makefile +++ b/usr.bin/clang/macho-dump/Makefile @@ -1,7 +1,9 @@ # $FreeBSD$ -PROG_CXX=macho-dump NO_MAN= +.include + +PROG_CXX=macho-dump SRCDIR= tools/macho-dump SRCS= macho-dump.cpp diff --git a/usr.bin/clang/opt/Makefile b/usr.bin/clang/opt/Makefile index 5afd58dd2e46..3af07d43c4a0 100644 --- a/usr.bin/clang/opt/Makefile +++ b/usr.bin/clang/opt/Makefile @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + PROG_CXX=opt SRCDIR= tools/opt diff --git a/usr.bin/clang/tblgen/Makefile b/usr.bin/clang/tblgen/Makefile index 90a5789cdf46..7cae5da9950d 100644 --- a/usr.bin/clang/tblgen/Makefile +++ b/usr.bin/clang/tblgen/Makefile @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + PROG_CXX=tblgen SRCDIR= utils/TableGen