ports/162540: [patch] lang/phc: respect CXX (plugins) + clang fix

Jan Beich jbeich at tormail.net
Sun Nov 13 21:00:27 UTC 2011


>Number:         162540
>Category:       ports
>Synopsis:       [patch] lang/phc: respect CXX (plugins) + clang fix
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Nov 13 21:00:24 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator:     Jan Beich
>Release:        FreeBSD 10.0-CURRENT amd64
>Organization:
>Environment:
# slightly different from pointyhat
$ export PATH=~/.bin:$PATH
$ for cc in CC cc c++ gcc g++ cpp; do ln -s /usr/bin/false ~/.bin/${cc}; done
>Description:
And allow building with clang, which uses c99 mode by default.
>How-To-Repeat:
http://pointyhat.freebsd.org/errorlogs/amd64-errorlogs/e.9-exp.20110723205754/phc-0.1.7.log

$ make CC=clang CXX=clang++
[...]
gmake[2]: Entering directory `/usr/ports/lang/phc/work/phc-0.1.7'
clang++  -O2 -pipe -rdynamic   -o phc ...
lex.yy.o: In function `PHP_lex(Object**, void*)':
/usr/ports/lang/phc/work/phc-0.1.7/generated_src/php_scanner.lex:200: undefined reference to `in_word_set'
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
gmake[2]: *** [phc] Error 1

$ make CC=clang CXX=clang++
[...]
gmake[2]: Entering directory `/usr/ports/lang/phc/work/phc-0.1.7/plugins/tutorials'
../../phc_compile_plugin -I../.. -I../../include -O0 -ggdb3 -o Expand_includes.so Expand_includes.cpp
In file included from Expand_includes.cpp:2:
In file included from ../../include/phc/Tree_transform.h:8:
In file included from ../../include/phc/ast.h:13:
../../include/phc/lib/List.h:123:3: error: use of undeclared identifier 'insert'
                insert(end(), other->begin(), other->end());
                ^
                this->
Expand_includes.cpp:45:9: note: in instantiation of member function 'List<AST_statement *, std::allocator<AST_statement *>
      >::push_back_all' requested here
                        out->push_back_all(run->statements);
                             ^
/usr/include/c++/4.2/bits/stl_list.h:793:7: note: must qualify identifier to find this declaration in dependent base class
      insert(iterator __position, const value_type& __x);
      ^
/usr/include/c++/4.2/bits/stl_list.h:808:7: note: must qualify identifier to find this declaration in dependent base class
      insert(iterator __position, size_type __n, const value_type& __x)
      ^
/usr/include/c++/4.2/bits/stl_list.h:829:9: note: must qualify identifier to find this declaration in dependent base class
        insert(iterator __position, _InputIterator __first,
        ^
1 error generated.
>Fix:
--- cxx.diff begins here ---
Index: lang/phc/Makefile
===================================================================
RCS file: /a/.csup/ports/lang/phc/Makefile,v
retrieving revision 1.6
diff -u -p -r1.6 Makefile
--- lang/phc/Makefile	17 Sep 2009 21:31:48 -0000	1.6
+++ lang/phc/Makefile	13 Nov 2011 20:09:06 -0000
@@ -16,5 +16,12 @@ COMMENT=	A compiler for the PHP language
 
 USE_GMAKE=	yes
 GNU_CONFIGURE=	yes
+CFLAGS+=	-fgnu89-inline
+
+post-patch:	.SILENT
+	${REINPLACE_CMD} 's/g++/$$CXX/' \
+		${WRKSRC}/phc_compile_plugin.in
+	${REINPLACE_CMD} 's/insert/this->&/' \
+		${WRKSRC}/include/phc/lib/List.h
 
 .include <bsd.port.mk>
--- cxx.diff ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list