From owner-freebsd-ports-bugs@FreeBSD.ORG Wed Sep 5 12:10:02 2012 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C14441065677 for ; Wed, 5 Sep 2012 12:10:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 9290A8FC15 for ; Wed, 5 Sep 2012 12:10:02 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q85CA2pH064457 for ; Wed, 5 Sep 2012 12:10:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q85CA2Hg064443; Wed, 5 Sep 2012 12:10:02 GMT (envelope-from gnats) Resent-Date: Wed, 5 Sep 2012 12:10:02 GMT Resent-Message-Id: <201209051210.q85CA2Hg064443@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, yamayan Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 51E661065673 for ; Wed, 5 Sep 2012 12:03:43 +0000 (UTC) (envelope-from nobody@red.freebsd.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id 3BB418FC18 for ; Wed, 5 Sep 2012 12:03:43 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.5/8.14.5) with ESMTP id q85C3g3P032301 for ; Wed, 5 Sep 2012 12:03:42 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.5/8.14.5/Submit) id q85C3gUZ032299; Wed, 5 Sep 2012 12:03:42 GMT (envelope-from nobody) Message-Id: <201209051203.q85C3gUZ032299@red.freebsd.org> Date: Wed, 5 Sep 2012 12:03:42 GMT From: yamayan To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: ports/171343: [patch] build www/firefox and mail/thunderbird with clang X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Sep 2012 12:10:02 -0000 >Number: 171343 >Category: ports >Synopsis: [patch] build www/firefox and mail/thunderbird with clang >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: Wed Sep 05 12:10:02 UTC 2012 >Closed-Date: >Last-Modified: >Originator: yamayan >Release: 10-CURRENT >Organization: >Environment: FreeBSD genius 10.0-CURRENT FreeBSD 10.0-CURRENT #0 r240071M: Mon Sep 3 23:05:03 JST 2012 root@genius:/usr/obj/usr/src/sys/NYANCO amd64 >Description: www/firefox and mail/thunderbird cannot build with clang. REASON: 1.visibility conflict(maybe clang bug?) 2.narrowing check(-Wc++11-narrowing) 3.literal check(-Wreserved-user-defined-literal) >How-To-Repeat: >Fix: 1: always use -fvisibility. force use -fvisibility and remove visibility bug check from configure.in IF CXX is clang (include CLANG_IS_CC) 2&3: add -Wno-c++11-narrowing -Wno-reserved-user-defined-literal to CXXFLAGS misc: add -stdlib=libc++ to CXXFLAGS if not exist Patch attached with submission follows: Index: www/firefox/Makefile =================================================================== --- www/firefox/Makefile (revision 303700) +++ www/firefox/Makefile (working copy) @@ -84,6 +84,14 @@ BUILD_DEPENDS+= yasm:${PORTSDIR}/devel/yasm .endif +CXX_NAME!= ${CXX} --version | ${AWK} 'NR == 1 { gsub(/[()]/, "", $$2); print $$2 }' +.if ${CXX_NAME} == "clang" +.if empty(CXXFLAGS:M-stdlib=libc++) +CXXFLAGS+= -stdlib=libc++ +.endif +CXXFLAGS+= -Wno-c++11-narrowing -Wno-reserved-user-defined-literal +.endif + pre-extract: .if ${PORT_OPTIONS:MPGO} @${ECHO} "*****************************************************************" Index: www/firefox/files/patch-js-src-configure.in =================================================================== --- www/firefox/files/patch-js-src-configure.in (revision 303700) +++ www/firefox/files/patch-js-src-configure.in (working copy) @@ -1,6 +1,67 @@ ---- js/src/configure.in.orig 2012-02-22 17:06:28.000000000 +0100 -+++ js/src/configure.in 2012-03-07 21:03:11.000000000 +0100 -@@ -5946,6 +5946,7 @@ _EGREP_PATTERN="${_EGREP_PATTERN}dummy_n +--- js/src/configure.in.orig 2012-08-31 01:09:30.026090542 +0900 ++++ js/src/configure.in 2012-09-03 23:52:29.575100085 +0900 +@@ -2828,60 +2828,7 @@ + rm -f conftest.[cs] + ]) + if test "$ac_cv_visibility_pragma" = "yes"; then +- AC_CACHE_CHECK(For gcc visibility bug with class-level attributes (GCC bug 26905), +- ac_cv_have_visibility_class_bug, +- [cat > conftest.c < /dev/null 2>&1 ; then +- ac_cv_have_visibility_class_bug=yes +- else +- if test `egrep -c '@PLT|\\$stub' conftest.S` = 0; then +- ac_cv_have_visibility_class_bug=yes +- fi +- fi +- rm -rf conftest.{c,S} +- ]) +- +- AC_CACHE_CHECK(For x86_64 gcc visibility bug with builtins (GCC bug 20297), +- ac_cv_have_visibility_builtin_bug, +- [cat > conftest.c < +-#pragma GCC visibility pop +- +-__attribute__ ((visibility ("default"))) void Func() { +- char c[[100]]; +- memset(c, 0, sizeof(c)); +-} +-EOF +- ac_cv_have_visibility_builtin_bug=no +- if ! ${CC-cc} ${CFLAGS} ${DSO_PIC_CFLAGS} ${DSO_LDOPTS} -O2 -S -o conftest.S conftest.c > /dev/null 2>&1 ; then +- ac_cv_have_visibility_builtin_bug=yes +- else +- if test `grep -c "@PLT" conftest.S` = 0; then +- ac_cv_visibility_builtin_bug=yes +- fi +- fi +- rm -f conftest.{c,S} +- ]) +- if test "$ac_cv_have_visibility_builtin_bug" = "no" -a \ +- "$ac_cv_have_visibility_class_bug" = "no"; then +- VISIBILITY_FLAGS='-I$(DIST)/system_wrappers_js -include $(topsrcdir)/config/gcc_hidden.h' +- WRAP_SYSTEM_INCLUDES=1 +- STL_FLAGS='-I$(DIST)/stl_wrappers' +- WRAP_STL_INCLUDES=1 +- else + VISIBILITY_FLAGS='-fvisibility=hidden' +- fi # have visibility pragma bug + fi # have visibility pragma + fi # have visibility(default) attribute + fi # have visibility(hidden) attribute +@@ -5002,6 +4949,7 @@ * C++ implementations should define these macros only when __STDC_LIMIT_MACROS * is defined before is included. */ #define __STDC_LIMIT_MACROS Index: www/firefox/files/patch-configure.in =================================================================== --- www/firefox/files/patch-configure.in (revision 303700) +++ www/firefox/files/patch-configure.in (working copy) @@ -1,6 +1,67 @@ ---- configure.in.orig 2012-05-23 20:56:34.000000000 +0200 -+++ configure.in 2012-05-27 18:18:25.000000000 +0200 -@@ -4230,6 +4233,9 @@ +--- configure.in.orig 2012-08-31 01:09:30.037089565 +0900 ++++ configure.in 2012-09-03 23:50:37.248102799 +0900 +@@ -3162,60 +3162,7 @@ + rm -f conftest.[cs] + ]) + if test "$ac_cv_visibility_pragma" = "yes"; then +- AC_CACHE_CHECK(For gcc visibility bug with class-level attributes (GCC bug 26905), +- ac_cv_have_visibility_class_bug, +- [cat > conftest.c < /dev/null 2>&1 ; then +- ac_cv_have_visibility_class_bug=yes +- else +- if test `egrep -c '@PLT|\\$stub' conftest.S` = 0; then +- ac_cv_have_visibility_class_bug=yes +- fi +- fi +- rm -rf conftest.{c,S} +- ]) +- +- AC_CACHE_CHECK(For x86_64 gcc visibility bug with builtins (GCC bug 20297), +- ac_cv_have_visibility_builtin_bug, +- [cat > conftest.c < +-#pragma GCC visibility pop +- +-__attribute__ ((visibility ("default"))) void Func() { +- char c[[100]]; +- memset(c, 0, sizeof(c)); +-} +-EOF +- ac_cv_have_visibility_builtin_bug=no +- if ! ${CC-cc} ${CFLAGS} ${DSO_PIC_CFLAGS} ${DSO_LDOPTS} -O2 -S -o conftest.S conftest.c > /dev/null 2>&1 ; then +- ac_cv_have_visibility_builtin_bug=yes +- else +- if test `grep -c "@PLT" conftest.S` = 0; then +- ac_cv_visibility_builtin_bug=yes +- fi +- fi +- rm -f conftest.{c,S} +- ]) +- if test "$ac_cv_have_visibility_builtin_bug" = "no" -a \ +- "$ac_cv_have_visibility_class_bug" = "no"; then +- VISIBILITY_FLAGS='-I$(DIST)/system_wrappers -include $(topsrcdir)/config/gcc_hidden.h' +- WRAP_SYSTEM_INCLUDES=1 +- STL_FLAGS='-I$(DIST)/stl_wrappers' +- WRAP_STL_INCLUDES=1 +- else + VISIBILITY_FLAGS='-fvisibility=hidden' +- fi # have visibility pragma bug + fi # have visibility pragma + fi # have visibility(default) attribute + fi # have visibility(hidden) attribute +@@ -4228,6 +4175,9 @@ if test -z "$LIBEVENT_DIR" -o "$LIBEVENT_DIR" = no; then MOZ_NATIVE_LIBEVENT= else @@ -10,7 +71,7 @@ if test "${LIBEVENT_DIR}" = "yes"; then LIBEVENT_DIR=/usr fi -@@ -4242,10 +4248,11 @@ else +@@ -4240,10 +4190,11 @@ AC_MSG_ERROR([--with-system-libevent requested but event.h not found])) AC_CHECK_LIB(event, event_init, [MOZ_NATIVE_LIBEVENT=1 Index: mail/thunderbird/Makefile =================================================================== --- mail/thunderbird/Makefile (revision 303700) +++ mail/thunderbird/Makefile (working copy) @@ -87,6 +87,14 @@ MOZ_OPTIONS+= --disable-calendar .endif +CXX_NAME!= ${CXX} --version | ${AWK} 'NR == 1 { gsub(/[()]/, "", $$2); print $$2 }' +.if ${CXX_NAME} == "clang" +.if empty(CXXFLAGS:M-stdlib=libc++) +CXXFLAGS+= -stdlib=libc++ +.endif +CXXFLAGS+= -Wno-c++11-narrowing -Wno-reserved-user-defined-literal +.endif + post-extract: @${SED} -e 's|@PORTNAME_ICON@|${PORTNAME_ICON}|;s|@MOZILLA@|${MOZILLA}|' \ <${FILESDIR}/thunderbird.desktop.in >${WRKDIR}/${MOZILLA_EXEC_NAME}.desktop Index: mail/thunderbird/files/patch-mozilla-configure.in =================================================================== --- mail/thunderbird/files/patch-mozilla-configure.in (revision 303700) +++ mail/thunderbird/files/patch-mozilla-configure.in (working copy) @@ -1,6 +1,67 @@ ---- mozilla/configure.in.orig 2012-05-23 20:56:34.000000000 +0200 -+++ mozilla/configure.in 2012-05-27 18:18:25.000000000 +0200 -@@ -4230,6 +4233,9 @@ +--- mozilla/configure.in.orig 2012-09-04 00:06:04.516101036 +0900 ++++ mozilla/configure.in 2012-09-04 00:09:58.814098477 +0900 +@@ -3162,60 +3162,7 @@ + rm -f conftest.[cs] + ]) + if test "$ac_cv_visibility_pragma" = "yes"; then +- AC_CACHE_CHECK(For gcc visibility bug with class-level attributes (GCC bug 26905), +- ac_cv_have_visibility_class_bug, +- [cat > conftest.c < /dev/null 2>&1 ; then +- ac_cv_have_visibility_class_bug=yes +- else +- if test `egrep -c '@PLT|\\$stub' conftest.S` = 0; then +- ac_cv_have_visibility_class_bug=yes +- fi +- fi +- rm -rf conftest.{c,S} +- ]) +- +- AC_CACHE_CHECK(For x86_64 gcc visibility bug with builtins (GCC bug 20297), +- ac_cv_have_visibility_builtin_bug, +- [cat > conftest.c < +-#pragma GCC visibility pop +- +-__attribute__ ((visibility ("default"))) void Func() { +- char c[[100]]; +- memset(c, 0, sizeof(c)); +-} +-EOF +- ac_cv_have_visibility_builtin_bug=no +- if ! ${CC-cc} ${CFLAGS} ${DSO_PIC_CFLAGS} ${DSO_LDOPTS} -O2 -S -o conftest.S conftest.c > /dev/null 2>&1 ; then +- ac_cv_have_visibility_builtin_bug=yes +- else +- if test `grep -c "@PLT" conftest.S` = 0; then +- ac_cv_visibility_builtin_bug=yes +- fi +- fi +- rm -f conftest.{c,S} +- ]) +- if test "$ac_cv_have_visibility_builtin_bug" = "no" -a \ +- "$ac_cv_have_visibility_class_bug" = "no"; then +- VISIBILITY_FLAGS='-I$(DIST)/system_wrappers -include $(topsrcdir)/config/gcc_hidden.h' +- WRAP_SYSTEM_INCLUDES=1 +- STL_FLAGS='-I$(DIST)/stl_wrappers' +- WRAP_STL_INCLUDES=1 +- else + VISIBILITY_FLAGS='-fvisibility=hidden' +- fi # have visibility pragma bug + fi # have visibility pragma + fi # have visibility(default) attribute + fi # have visibility(hidden) attribute +@@ -4228,6 +4175,9 @@ if test -z "$LIBEVENT_DIR" -o "$LIBEVENT_DIR" = no; then MOZ_NATIVE_LIBEVENT= else @@ -10,7 +71,7 @@ if test "${LIBEVENT_DIR}" = "yes"; then LIBEVENT_DIR=/usr fi -@@ -4242,10 +4248,11 @@ else +@@ -4240,10 +4190,11 @@ AC_MSG_ERROR([--with-system-libevent requested but event.h not found])) AC_CHECK_LIB(event, event_init, [MOZ_NATIVE_LIBEVENT=1 Index: mail/thunderbird/files/patch-configure.in =================================================================== --- mail/thunderbird/files/patch-configure.in (revision 303700) +++ mail/thunderbird/files/patch-configure.in (working copy) @@ -1,49 +1,61 @@ ---- configure.in.orig 2012-07-14 00:40:08.000000000 +0200 -+++ configure.in 2012-08-18 18:16:06.000000000 +0200 -@@ -3101,6 +3118,8 @@ - - AC_SUBST(VISIBILITY_FLAGS) - -+MOZ_COMPILER_OPTS -+ - dnl Checks for header files. - dnl ======================================================== - AC_HEADER_DIRENT -@@ -4067,29 +4086,29 @@ - - AC_CACHE_CHECK(for __attribute__((always_inline)), - ac_cv_attribute_always_inline, -- [AC_TRY_COMPILE([], -- [inline void f(void) __attribute__((always_inline));], -+ [AC_TRY_COMPILE([inline void f(void) __attribute__((always_inline));], -+ [], - ac_cv_attribute_always_inline=yes, - ac_cv_attribute_always_inline=no)]) - - AC_CACHE_CHECK(for __attribute__((malloc)), - ac_cv_attribute_malloc, -- [AC_TRY_COMPILE([], -- [void* f(int) __attribute__((malloc));], -+ [AC_TRY_COMPILE([void* f(int) __attribute__((malloc));], -+ [], - ac_cv_attribute_malloc=yes, - ac_cv_attribute_malloc=no)]) - - AC_CACHE_CHECK(for __attribute__((warn_unused_result)), - ac_cv_attribute_warn_unused, -- [AC_TRY_COMPILE([], -- [int f(void) __attribute__((warn_unused_result));], -+ [AC_TRY_COMPILE([int f(void) __attribute__((warn_unused_result));], -+ [], - ac_cv_attribute_warn_unused=yes, - ac_cv_attribute_warn_unused=no)]) - - AC_CACHE_CHECK(for __attribute__((noreturn)), - ac_cv_attribute_noreturn, -- [AC_TRY_COMPILE([], -- [void f(void) __attribute__((noreturn));], -+ [AC_TRY_COMPILE([void f(void) __attribute__((noreturn));], -+ [], - ac_cv_attribute_noreturn=yes, - ac_cv_attribute_noreturn=no)]) - +--- configure.in.orig 2012-09-03 23:57:30.597100577 +0900 ++++ configure.in 2012-09-03 23:58:33.004101257 +0900 +@@ -3037,58 +3037,7 @@ + rm -f conftest.[cs] + ]) + if test "$ac_cv_visibility_pragma" = "yes"; then +- AC_CACHE_CHECK(For gcc visibility bug with class-level attributes (GCC bug 26905), +- ac_cv_have_visibility_class_bug, +- [cat > conftest.c < /dev/null 2>&1 ; then +- ac_cv_have_visibility_class_bug=yes +- else +- if test `egrep -c '@PLT|\\$stub' conftest.S` = 0; then +- ac_cv_have_visibility_class_bug=yes +- fi +- fi +- rm -rf conftest.{c,S} +- ]) +- +- AC_CACHE_CHECK(For x86_64 gcc visibility bug with builtins (GCC bug 20297), +- ac_cv_have_visibility_builtin_bug, +- [cat > conftest.c < +-#pragma GCC visibility pop +- +-__attribute__ ((visibility ("default"))) void Func() { +- char c[[100]]; +- memset(c, 0, sizeof(c)); +-} +-EOF +- ac_cv_have_visibility_builtin_bug=no +- if ! ${CC-cc} ${CFLAGS} ${DSO_PIC_CFLAGS} ${DSO_LDOPTS} -O2 -S -o conftest.S conftest.c > /dev/null 2>&1 ; then +- ac_cv_have_visibility_builtin_bug=yes +- else +- if test `grep -c "@PLT" conftest.S` = 0; then +- ac_cv_visibility_builtin_bug=yes +- fi +- fi +- rm -f conftest.{c,S} +- ]) +- if test "$ac_cv_have_visibility_builtin_bug" = "no" -a \ +- "$ac_cv_have_visibility_class_bug" = "no"; then +- VISIBILITY_FLAGS='-I$(DIST)/system_wrappers -include $(MOZILLA_SRCDIR)/config/gcc_hidden.h' +- STL_FLAGS='-I$(DIST)/stl_wrappers' +- else + VISIBILITY_FLAGS='-fvisibility=hidden' +- fi # have visibility pragma bug + fi # have visibility pragma + fi # have visibility(default) attribute + fi # have visibility(hidden) attribute Index: mail/thunderbird/files/patch-mozilla-js-src-configure.in =================================================================== --- mail/thunderbird/files/patch-mozilla-js-src-configure.in (revision 303700) +++ mail/thunderbird/files/patch-mozilla-js-src-configure.in (working copy) @@ -1,6 +1,67 @@ ---- mozilla/js/src/configure.in.orig 2012-02-22 17:06:28.000000000 +0100 -+++ mozilla/js/src/configure.in 2012-03-07 21:03:11.000000000 +0100 -@@ -5946,6 +5946,7 @@ _EGREP_PATTERN="${_EGREP_PATTERN}dummy_n +--- mozilla/js/src/configure.in.orig 2012-09-04 00:06:04.501102901 +0900 ++++ mozilla/js/src/configure.in 2012-09-04 00:11:00.124099818 +0900 +@@ -2828,60 +2828,7 @@ + rm -f conftest.[cs] + ]) + if test "$ac_cv_visibility_pragma" = "yes"; then +- AC_CACHE_CHECK(For gcc visibility bug with class-level attributes (GCC bug 26905), +- ac_cv_have_visibility_class_bug, +- [cat > conftest.c < /dev/null 2>&1 ; then +- ac_cv_have_visibility_class_bug=yes +- else +- if test `egrep -c '@PLT|\\$stub' conftest.S` = 0; then +- ac_cv_have_visibility_class_bug=yes +- fi +- fi +- rm -rf conftest.{c,S} +- ]) +- +- AC_CACHE_CHECK(For x86_64 gcc visibility bug with builtins (GCC bug 20297), +- ac_cv_have_visibility_builtin_bug, +- [cat > conftest.c < +-#pragma GCC visibility pop +- +-__attribute__ ((visibility ("default"))) void Func() { +- char c[[100]]; +- memset(c, 0, sizeof(c)); +-} +-EOF +- ac_cv_have_visibility_builtin_bug=no +- if ! ${CC-cc} ${CFLAGS} ${DSO_PIC_CFLAGS} ${DSO_LDOPTS} -O2 -S -o conftest.S conftest.c > /dev/null 2>&1 ; then +- ac_cv_have_visibility_builtin_bug=yes +- else +- if test `grep -c "@PLT" conftest.S` = 0; then +- ac_cv_visibility_builtin_bug=yes +- fi +- fi +- rm -f conftest.{c,S} +- ]) +- if test "$ac_cv_have_visibility_builtin_bug" = "no" -a \ +- "$ac_cv_have_visibility_class_bug" = "no"; then +- VISIBILITY_FLAGS='-I$(DIST)/system_wrappers_js -include $(topsrcdir)/config/gcc_hidden.h' +- WRAP_SYSTEM_INCLUDES=1 +- STL_FLAGS='-I$(DIST)/stl_wrappers' +- WRAP_STL_INCLUDES=1 +- else + VISIBILITY_FLAGS='-fvisibility=hidden' +- fi # have visibility pragma bug + fi # have visibility pragma + fi # have visibility(default) attribute + fi # have visibility(hidden) attribute +@@ -5002,6 +4949,7 @@ * C++ implementations should define these macros only when __STDC_LIMIT_MACROS * is defined before is included. */ #define __STDC_LIMIT_MACROS >Release-Note: >Audit-Trail: >Unformatted: