summaryrefslogtreecommitdiff
path: root/lang
diff options
context:
space:
mode:
authormarino <marino>2012-11-22 22:45:15 +0000
committermarino <marino>2012-11-22 22:45:15 +0000
commitabba483de1f3ba7f3b15e3ea4deb284be03e56ad (patch)
tree126cffe752d67c53aded224b70c71cf6cf7bcd13 /lang
parent8b649ce65066909e8ec0a09c5132c63fd6866ddc (diff)
downloadpkgsrc-abba483de1f3ba7f3b15e3ea4deb284be03e56ad.tar.gz
lang/clang: Fix binary generation on latest DragonFly
Clang was hardwired to search for crt* stuff and libstdc++ at /usr/lib/gcc41. This worked for most people even when DragonFly moved to gcc 4.4 as the primary base compiler since gcc 4.1 was usually also on the system. With the release of DragonFly 3.2, gcc 4.7 replaced gcc 4.1 and clang stopped compiling due to not being able to find libraries and crt* objects. The new patches make clang driver first look for gcc 4.7 and failing to find that: gcc 4.4. The other patches were "de-fuzzed". Revision bump was necessary because clang did build, it just didn't work. Patches submitted upstream: http://llvm.org/bugs/show_bug.cgi?id=14417
Diffstat (limited to 'lang')
-rw-r--r--lang/clang/Makefile4
-rw-r--r--lang/clang/distinfo8
-rw-r--r--lang/clang/patches/patch-ac12
-rw-r--r--lang/clang/patches/patch-ad6
-rw-r--r--lang/clang/patches/patch-tools_clang_lib_Driver_ToolChains.cpp18
-rw-r--r--lang/clang/patches/patch-tools_clang_lib_Driver_Tools.cpp33
6 files changed, 67 insertions, 14 deletions
diff --git a/lang/clang/Makefile b/lang/clang/Makefile
index 8e85d0f7331..60221c7b96b 100644
--- a/lang/clang/Makefile
+++ b/lang/clang/Makefile
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.15 2012/10/03 21:56:18 wiz Exp $
+# $NetBSD: Makefile,v 1.16 2012/11/22 22:45:15 marino Exp $
DISTNAME= clang-3.1
-PKGREVISION= 1
+PKGREVISION= 2
CATEGORIES= lang
MASTER_SITES= http://llvm.org/releases/${PKGVERSION_NOREV}/
DISTFILES= llvm-${PKGVERSION_NOREV}.src.tar.gz \
diff --git a/lang/clang/distinfo b/lang/clang/distinfo
index 25a0f50c668..957dab6f762 100644
--- a/lang/clang/distinfo
+++ b/lang/clang/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.11 2012/05/25 09:06:52 marino Exp $
+$NetBSD: distinfo,v 1.12 2012/11/22 22:45:15 marino Exp $
SHA1 (clang-3.1.src.tar.gz) = 19f33b187a50d22fda2a6f9ed989699a9a9efd62
RMD160 (clang-3.1.src.tar.gz) = 5ae09d3d69d4f1e50e07f6bf3474da96e6a84feb
@@ -7,6 +7,8 @@ SHA1 (llvm-3.1.src.tar.gz) = 234c96e73ef81aec9a54da92fc2a9024d653b059
RMD160 (llvm-3.1.src.tar.gz) = ceb0ef36ab6109da7a8568b04de759752dbee5a7
Size (llvm-3.1.src.tar.gz) = 11077429 bytes
SHA1 (patch-ab) = 140ac84d513cf20c9eb30a9e8e2f6b87bdd074fe
-SHA1 (patch-ac) = 252f6a1f2cb79fed19668310c72d1079b47eca3c
-SHA1 (patch-ad) = 4cd7223d1660a4e8d81b33b6c99efbb680664164
+SHA1 (patch-ac) = 676fbc85e25a8d338a7ac13f79af53666b27da4a
+SHA1 (patch-ad) = 2767a9931b157552f8d6796641e23cce7979dc3d
SHA1 (patch-projects_sample_autoconf_config.sub) = 7e8449c46ed0c3e5530235d33a35f7f4e083d0b0
+SHA1 (patch-tools_clang_lib_Driver_ToolChains.cpp) = 80b9890fdc5b4932c4b9301c50809b80212d0e48
+SHA1 (patch-tools_clang_lib_Driver_Tools.cpp) = 9dcb364d1fd31ddb5672ad4d8b247dab1fe179c6
diff --git a/lang/clang/patches/patch-ac b/lang/clang/patches/patch-ac
index 32e319c6805..1bd60f399b1 100644
--- a/lang/clang/patches/patch-ac
+++ b/lang/clang/patches/patch-ac
@@ -1,8 +1,8 @@
-$NetBSD: patch-ac,v 1.4 2011/04/07 09:26:33 adam Exp $
+$NetBSD: patch-ac,v 1.5 2012/11/22 22:45:15 marino Exp $
---- Makefile.rules.orig 2011-03-25 06:26:58.000000000 +0000
+--- Makefile.rules.orig 2012-05-15 22:06:08.000000000 +0000
+++ Makefile.rules
-@@ -564,11 +564,6 @@ ifneq ($(HOST_OS), $(filter $(HOST_OS),
+@@ -625,11 +625,6 @@ ifneq ($(HOST_OS), $(filter $(HOST_OS),
ifneq ($(HOST_OS), Darwin)
ifdef TOOLNAME
LD.Flags += $(RPATH) -Wl,'$$ORIGIN/../lib'
@@ -14,7 +14,7 @@ $NetBSD: patch-ac,v 1.4 2011/04/07 09:26:33 adam Exp $
endif
else
ifneq ($(DARWIN_MAJVERS),4)
-@@ -746,9 +741,6 @@ endif
+@@ -821,9 +816,6 @@ endif
# in the file so they get built before dependencies
#---------------------------------------------------------
@@ -24,7 +24,7 @@ $NetBSD: patch-ac,v 1.4 2011/04/07 09:26:33 adam Exp $
# To create other directories, as needed, and timestamp their creation
%/.dir:
$(Verb) $(MKDIR) $* > /dev/null
-@@ -876,7 +868,9 @@ install-local::
+@@ -958,7 +950,9 @@ install-local::
uninstall-local::
$(Echo) UnInstall circumvented with NO_INSTALL
else
@@ -35,7 +35,7 @@ $NetBSD: patch-ac,v 1.4 2011/04/07 09:26:33 adam Exp $
$(Echo) Installing Configuration Files To $(DESTDIR)$(PROJ_etcdir)
$(Verb)for file in $(CONFIG_FILES); do \
if test -f $(PROJ_OBJ_DIR)/$${file} ; then \
-@@ -1298,7 +1292,7 @@ install-local:: $(DestArchiveLib)
+@@ -1380,7 +1374,7 @@ install-local:: $(DestArchiveLib)
$(DestArchiveLib): $(LibName.A) $(DESTDIR)$(PROJ_libdir)
$(Echo) Installing $(BuildMode) Archive Library $(DestArchiveLib)
$(Verb) $(MKDIR) $(DESTDIR)$(PROJ_libdir)
diff --git a/lang/clang/patches/patch-ad b/lang/clang/patches/patch-ad
index c40754f2354..10e55d8d6ac 100644
--- a/lang/clang/patches/patch-ad
+++ b/lang/clang/patches/patch-ad
@@ -1,8 +1,8 @@
-$NetBSD: patch-ad,v 1.3 2010/10/21 13:52:16 adam Exp $
+$NetBSD: patch-ad,v 1.4 2012/11/22 22:45:15 marino Exp $
---- Makefile.config.in.orig 2010-08-06 07:41:54.000000000 +0000
+--- Makefile.config.in.orig 2012-05-15 22:06:08.000000000 +0000
+++ Makefile.config.in
-@@ -83,11 +83,11 @@ LLVMMAKE := $(LLVM_SRC_ROOT)/make
+@@ -96,11 +96,11 @@ endif
PROJ_bindir := $(PROJ_prefix)/bin
PROJ_libdir := $(PROJ_prefix)/lib
PROJ_datadir := $(PROJ_prefix)/share
diff --git a/lang/clang/patches/patch-tools_clang_lib_Driver_ToolChains.cpp b/lang/clang/patches/patch-tools_clang_lib_Driver_ToolChains.cpp
new file mode 100644
index 00000000000..ce3308de284
--- /dev/null
+++ b/lang/clang/patches/patch-tools_clang_lib_Driver_ToolChains.cpp
@@ -0,0 +1,18 @@
+$NetBSD: patch-tools_clang_lib_Driver_ToolChains.cpp,v 1.1 2012/11/22 22:45:15 marino Exp $
+
+DragonFly no longer has gcc 4.1 in base, so clang stopped working.
+We prefer to use gcc 4.7 if available due to a better libstdc++.
+The fallback is gcc 4.4 which has been available for several years.
+
+--- tools/clang/lib/Driver/ToolChains.cpp.orig 2012-05-12 00:16:02.000000000 +0000
++++ tools/clang/lib/Driver/ToolChains.cpp
+@@ -2307,7 +2307,8 @@ DragonFly::DragonFly(const Driver &D, co
+
+ getFilePaths().push_back(getDriver().Dir + "/../lib");
+ getFilePaths().push_back("/usr/lib");
+- getFilePaths().push_back("/usr/lib/gcc41");
++ getFilePaths().push_back("/usr/lib/gcc47");
++ getFilePaths().push_back("/usr/lib/gcc44");
+ }
+
+ Tool &DragonFly::SelectTool(const Compilation &C, const JobAction &JA,
diff --git a/lang/clang/patches/patch-tools_clang_lib_Driver_Tools.cpp b/lang/clang/patches/patch-tools_clang_lib_Driver_Tools.cpp
new file mode 100644
index 00000000000..bca832b3d3c
--- /dev/null
+++ b/lang/clang/patches/patch-tools_clang_lib_Driver_Tools.cpp
@@ -0,0 +1,33 @@
+$NetBSD: patch-tools_clang_lib_Driver_Tools.cpp,v 1.1 2012/11/22 22:45:15 marino Exp $
+
+DragonFly no longer has gcc 4.1 in base, so clang stopped working.
+We prefer to use gcc 4.7 if available due to a better libstdc++.
+The fallback is gcc 4.4 which has been available for several years.
+
+--- tools/clang/lib/Driver/Tools.cpp.orig 2012-04-18 21:32:25.000000000 +0000
++++ tools/clang/lib/Driver/Tools.cpp
+@@ -5499,14 +5499,21 @@ void dragonfly::Link::ConstructJob(Compi
+ !Args.hasArg(options::OPT_nodefaultlibs)) {
+ // FIXME: GCC passes on -lgcc, -lgcc_pic and a whole lot of
+ // rpaths
+- CmdArgs.push_back("-L/usr/lib/gcc41");
++ CmdArgs.push_back("-L/usr/lib/gcc47");
++ CmdArgs.push_back("-L/usr/lib/gcc44");
+
+ if (!Args.hasArg(options::OPT_static)) {
+ CmdArgs.push_back("-rpath");
+- CmdArgs.push_back("/usr/lib/gcc41");
++ CmdArgs.push_back("/usr/lib/gcc47");
+
+ CmdArgs.push_back("-rpath-link");
+- CmdArgs.push_back("/usr/lib/gcc41");
++ CmdArgs.push_back("/usr/lib/gcc47");
++
++ CmdArgs.push_back("-rpath");
++ CmdArgs.push_back("/usr/lib/gcc44");
++
++ CmdArgs.push_back("-rpath-link");
++ CmdArgs.push_back("/usr/lib/gcc44");
+
+ CmdArgs.push_back("-rpath");
+ CmdArgs.push_back("/usr/lib");