Bug 186173 - clang ports do not install <unwind.h>
Summary: clang ports do not install <unwind.h>
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Brooks Davis
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-27 16:00 UTC by Ivan Kosarev
Modified: 2014-06-17 15:57 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ivan Kosarev 2014-01-27 16:00:00 UTC
The ports of the clang compiler do not install the <unwind.h> header to the system include directory. This prevents some software relying on the header from building under FreeBSD with clang whereas it builds smoothly with gcc.

Fix: 

The fix is to the change this file:

/usr/ports/lang/clang33/work/llvm-3.3.src/tools/clang/lib/Headers/Makefile

so that it does copy the unwind.h header to the system directory. The line

HEADERS := $(notdir $(wildcard $(PROJ_SRC_DIR)/*intrin*.h) mm3dnow.h mm_malloc.h)

should be replaced with

HEADERS := $(notdir $(wildcard $(PROJ_SRC_DIR)/*intrin*.h) mm3dnow.h mm_malloc.h unwind.h)

A related patch:

http://svnweb.freebsd.org/ports?view=revision&revision=318207
How-To-Repeat: cd /usr/ports/lang/clang33
make
make install
ls /usr/local/llvm33/lib/clang/3.3/include | grep unwind
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2014-01-27 23:13:33 UTC
Responsible Changed
From-To: freebsd-ports-bugs->brooks

Over to maintainer.
Comment 2 dfilter service freebsd_committer freebsd_triage 2014-01-28 00:04:56 UTC
Author: brooks
Date: Tue Jan 28 00:04:46 2014
New Revision: 341489
URL: http://svnweb.freebsd.org/changeset/ports/341489
QAT: https://qat.redports.org/buildarchive/r341489/

Log:
  Attempt to add back support for scan-build.[1]
  
  Change ccc-analyzer's default compiler to clang.[2]
  
  Install unwind.h.[3]
  
  PR:		ports/185733 [1], ports/183802 [2], ports/186173 [3]

Added:
  head/lang/clang34/files/patch-tools_clang_tools_scan-build_ccc-analyzer   (contents, props changed)
Modified:
  head/lang/clang34/Makefile
  head/lang/clang34/files/patch-tools_clang_lib_Headers_Makefile
  head/lang/clang34/pkg-plist

Modified: head/lang/clang34/Makefile
==============================================================================
--- head/lang/clang34/Makefile	Tue Jan 28 00:04:20 2014	(r341488)
+++ head/lang/clang34/Makefile	Tue Jan 28 00:04:46 2014	(r341489)
@@ -2,6 +2,7 @@
 
 PORTNAME=	clang
 DISTVERSION=	3.4
+PORTREVISION=	1
 CATEGORIES=	lang devel
 MASTER_SITES=	http://llvm.org/releases/${PORTVERSION}/
 PKGNAMESUFFIX=	${LLVM_SUFFIX}
@@ -56,16 +57,22 @@ CONFIGURE_ARGS+=	--disable-docs
 
 PLIST_SUB+=		LLVM_SUFFIX=${LLVM_SUFFIX} \
 			PORTVERSION=${PORTVERSION}
-
-COMMANDS=	c-index-test \
+COMMANDS=	c++-analyzer \
+		c-index-test \
+		ccc-analyzer \
 		clang \
 		clang++ \
 		clang-check \
 		clang-cpp \
 		clang-format \
-		clang-tblgen
+		clang-tblgen \
+		scan-build \
+		scan-view
 FIRST_COMMAND=	${COMMANDS:C/^/XXXX/1:MXXXX*:C/^XXXX//}
 
+PORTDATA=	scanview.css \
+		sorttable.js
+
 .include <bsd.port.options.mk>
 
 .if ${PORT_OPTIONS:MASSERTS}
@@ -128,6 +135,15 @@ post-install:
 	    ${STAGEDIR}${LLVM_PREFIX}/bin/clang-cpp
 	${INSTALL_SCRIPT} ${WRKDIR}/llvm-wrapper.sh \
 	    ${STAGEDIR}${PREFIX}/bin/${FIRST_COMMAND}${LLVM_SUFFIX}
+	${INSTALL_SCRIPT} ${WRKSRC}/tools/clang/tools/scan-build/ccc-analyzer \
+	    ${WRKSRC}/tools/clang/tools/scan-build/c++-analyzer \
+	    ${WRKSRC}/tools/clang/tools/scan-build/scan-build \
+	    ${WRKSRC}/tools/clang/tools/scan-view/scan-view \
+	    ${STAGEDIR}${LLVM_PREFIX}/bin/
+	${MKDIR} ${STAGEDIR}${DATADIR}
+	${INSTALL_DATA} ${WRKSRC}/tools/clang/tools/scan-build/scanview.css \
+	    ${WRKSRC}/tools/clang/tools/scan-build/sorttable.js \
+	    ${STAGEDIR}${DATADIR}
 .for command in ${COMMANDS:C/^/XXXX/1:NXXXX*}
 	test -e ${STAGEDIR}${LLVM_PREFIX}/bin/${command}
 	${LN} -f ${STAGEDIR}${PREFIX}/bin/${FIRST_COMMAND}${LLVM_SUFFIX} \
@@ -139,6 +155,8 @@ post-install:
 .endif
 	${INSTALL_MAN} ${WRKSRC}/tools/clang/docs/tools/clang.1 \
 	    ${STAGEDIR}${MANPREFIX}/man/man1/clang${LLVM_SUFFIX}.1
+	${INSTALL_MAN} ${WRKSRC}/tools/clang/tools/scan-build/scan-build.1 \
+	    ${STAGEDIR}${MANPREFIX}/man/man1/scan-build${LLVM_SUFFIX}.1
 
 PLIST_FILE_LIST=	${COMMANDS:S|^|bin/|} \
 			lib/libclang*
@@ -156,6 +174,7 @@ build-plist:
 	    | ${SED} -e 's|${STAGEDIR}${PREFIX}/||' \
 	    -e 's|${LLVM_SUFFIX}|%%LLVM_SUFFIX%%|' | ${SORT} >> ${PLIST}
 	echo man/man1/clang%%LLVM_SUFFIX%%.1.gz >> ${PLIST}
+	echo man/man1/scan-build%%LLVM_SUFFIX%%.1.gz >> ${PLIST}
 	${FIND} ${STAGEDIR}${DOCSDIR} -type f | \
 	    ${SED} -e 's|${STAGEDIR}${DOCSDIR}|%%PORTDOCS%%%%DOCSDIR%%|' | \
 	    ${SORT} >> ${PLIST}

Modified: head/lang/clang34/files/patch-tools_clang_lib_Headers_Makefile
==============================================================================
--- head/lang/clang34/files/patch-tools_clang_lib_Headers_Makefile	Tue Jan 28 00:04:20 2014	(r341488)
+++ head/lang/clang34/files/patch-tools_clang_lib_Headers_Makefile	Tue Jan 28 00:04:46 2014	(r341489)
@@ -8,7 +8,7 @@ $FreeBSD$
  HeaderDir := $(PROJ_OBJ_ROOT)/$(BuildMode)/lib/clang/$(CLANG_VERSION)/include
  
 -HEADERS := $(notdir $(wildcard $(PROJ_SRC_DIR)/*.h))
-+HEADERS := $(notdir $(wildcard $(PROJ_SRC_DIR)/*intrin*.h) altivec.h cpuid.h mm3dnow.h mm_malloc.h)
++HEADERS := $(notdir $(wildcard $(PROJ_SRC_DIR)/*intrin*.h) altivec.h cpuid.h mm3dnow.h mm_malloc.h unwind.h)
  
  OBJHEADERS := $(addprefix $(HeaderDir)/, $(HEADERS))
  

Added: head/lang/clang34/files/patch-tools_clang_tools_scan-build_ccc-analyzer
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/lang/clang34/files/patch-tools_clang_tools_scan-build_ccc-analyzer	Tue Jan 28 00:04:46 2014	(r341489)
@@ -0,0 +1,14 @@
+
+$FreeBSD$
+
+--- tools/clang/tools/scan-build/ccc-analyzer.orig
++++ tools/clang/tools/scan-build/ccc-analyzer
+@@ -30,7 +30,7 @@
+ my $DefaultCCompiler;
+ my $DefaultCXXCompiler;
+ 
+-if (`uname -a` =~ m/Darwin/) { 
++if (`uname -a` =~ m/(Darwin|FreeBSD)/) { 
+   $DefaultCCompiler = 'clang';
+   $DefaultCXXCompiler = 'clang++';
+ } else {

Modified: head/lang/clang34/pkg-plist
==============================================================================
--- head/lang/clang34/pkg-plist	Tue Jan 28 00:04:20 2014	(r341488)
+++ head/lang/clang34/pkg-plist	Tue Jan 28 00:04:46 2014	(r341489)
@@ -1,17 +1,25 @@
+bin/c++-analyzer%%LLVM_SUFFIX%%
 bin/c-index-test%%LLVM_SUFFIX%%
+bin/ccc-analyzer%%LLVM_SUFFIX%%
 bin/clang%%LLVM_SUFFIX%%
 bin/clang++%%LLVM_SUFFIX%%
 bin/clang-check%%LLVM_SUFFIX%%
 bin/clang-cpp%%LLVM_SUFFIX%%
 bin/clang-format%%LLVM_SUFFIX%%
 bin/clang-tblgen%%LLVM_SUFFIX%%
+bin/scan-build%%LLVM_SUFFIX%%
+bin/scan-view%%LLVM_SUFFIX%%
+llvm%%LLVM_SUFFIX%%/bin/c++-analyzer
 llvm%%LLVM_SUFFIX%%/bin/c-index-test
+llvm%%LLVM_SUFFIX%%/bin/ccc-analyzer
 llvm%%LLVM_SUFFIX%%/bin/clang
 llvm%%LLVM_SUFFIX%%/bin/clang++
 llvm%%LLVM_SUFFIX%%/bin/clang-check
 llvm%%LLVM_SUFFIX%%/bin/clang-cpp
 llvm%%LLVM_SUFFIX%%/bin/clang-format
 llvm%%LLVM_SUFFIX%%/bin/clang-tblgen
+llvm%%LLVM_SUFFIX%%/bin/scan-build
+llvm%%LLVM_SUFFIX%%/bin/scan-view
 llvm%%LLVM_SUFFIX%%/include/clang-c/CXCompilationDatabase.h
 llvm%%LLVM_SUFFIX%%/include/clang-c/CXString.h
 llvm%%LLVM_SUFFIX%%/include/clang-c/Index.h
@@ -450,6 +458,7 @@ llvm%%LLVM_SUFFIX%%/lib/clang/3.4/includ
 llvm%%LLVM_SUFFIX%%/lib/clang/3.4/include/smmintrin.h
 llvm%%LLVM_SUFFIX%%/lib/clang/3.4/include/tbmintrin.h
 llvm%%LLVM_SUFFIX%%/lib/clang/3.4/include/tmmintrin.h
+llvm%%LLVM_SUFFIX%%/lib/clang/3.4/include/unwind.h
 llvm%%LLVM_SUFFIX%%/lib/clang/3.4/include/wmmintrin.h
 llvm%%LLVM_SUFFIX%%/lib/clang/3.4/include/x86intrin.h
 llvm%%LLVM_SUFFIX%%/lib/clang/3.4/include/xmmintrin.h
@@ -480,6 +489,7 @@ llvm%%LLVM_SUFFIX%%/lib/libclangStaticAn
 llvm%%LLVM_SUFFIX%%/lib/libclangStaticAnalyzerFrontend.a
 llvm%%LLVM_SUFFIX%%/lib/libclangTooling.a
 man/man1/clang%%LLVM_SUFFIX%%.1.gz
+man/man1/scan-build%%LLVM_SUFFIX%%.1.gz
 %%PORTDOCS%%%%DOCSDIR%%/html/clang/clang.html
 %%PORTDOCS%%%%DOCSDIR%%/html/clang/manpage.css
 %%PORTDOCS%%%%DOCSDIR%%/ps/clang.ps
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 3 Brooks Davis freebsd_committer freebsd_triage 2014-06-17 15:57:25 UTC
Fixed in clang33 today.