clang, dbus, firefox+thunderbird

Beat Gaetzi beat at FreeBSD.org
Wed Jun 20 08:45:40 UTC 2012


2012/6/20 Boris Samorodov <bsam at passap.ru>:
> Hi All,
>
> Andrew, thanks for your time and help!
>
> 19.06.2012 21:14, Andrew W. Nosenko написал:
>
>> On Tue, Jun 19, 2012 at 6:16 PM, Boris Samorodov<bsam at passap.ru>  wrote:
>>>
>>> Hi List,
>>>
>>> I use clang compiled world (WITH_CLANG_IS_CC="YES" and
>>> WITH_LIBCPLUSPLUS="YES" at /etc/make.conf). The system
>>> is current:
>>> -----
>>> % uname -a
>>> FreeBSD bsam.wart.ru 10.0-CURRENT FreeBSD 10.0-CURRENT #16 r237055: Thu
>>> Jun
>>> 14 17:16:43 SAMT 2012     bsam at bsam.wart.ru:/usr/obj/usr/src/sys/BBX
>>>  i386
>>> -----
>>>
>>> While updating to the latest firefox I get an error:
>>> -----
>>> /usr/local/include/dbus-1.0/dbus/dbus-protocol.h:459:77: error: invalid
>>> suffix on literal; C++11 requires a space between literal and identifier
>>> [-Wreserved-user-defined-literal]
>>> #define DBUS_INTROSPECT_1_0_XML_DOCTYPE_DECL_NODE "<!DOCTYPE node PUBLIC
>>>
>>> \""DBUS_INTROSPECT_1_0_XML_PUBLIC_IDENTIFIER"\"\n\""DBUS_INTROSPECT_1_0_XML_SYSTEM_IDENTIFIER"\">\n"
>>>
>>>     ^
>>>
>>>
>>> /usr/local/include/dbus-1.0/dbus/dbus-protocol.h:459:126: error: invalid
>>> suffix on literal; C++11 requires a space between literal and identifier
>>> [-Wreserved-user-defined-literal]
>>> #define DBUS_INTROSPECT_1_0_XML_DOCTYPE_DECL_NODE "<!DOCTYPE node PUBLIC
>>>
>>> \""DBUS_INTROSPECT_1_0_XML_PUBLIC_IDENTIFIER"\"\n\""DBUS_INTROSPECT_1_0_XML_SYSTEM_IDENTIFIER"\">\n"
>>>
>>>                                                      ^
>>>
>>>
>>> 2 errors generated.
>>>
>>> -----
>>>
>>> OK, I did make config and deselect DBUS. Great, firefox compiles and
>>> installs (the latest one, 13.0.1). Then I try to upgrade thunderbird
>>> and get the same error. However there is no option DBUS to disable.
>>>
>>> What am I to do?
>>> Thanks!
>>
>>
>> It's because of  "User defined literals" (the new c++11 feature) and
>> your clang++ is in c++11 (or gnu++11?) mode by default.
>>
>> As workaround, you may try either: "downgrade" to something like gnu++
>> 98 (-std=gnu++98), or edit dbus-protocol.h header for make it c++11
>> compatible.  It's easy: just add spaces around
>> DBUS_INTROSPECT_1_0_XML_PUBLIC_IDENTIFIER and
>> DBUS_INTROSPECT_1_0_XML_SYSTEM_IDENTIFIER literals in the line 459
>> (just as compiler suggested).
>>
>> I.e. the line 459
>>
>>   #define DBUS_INTROSPECT_1_0_XML_DOCTYPE_DECL_NODE "<!DOCTYPE node
>> PUBLIC
>> \""DBUS_INTROSPECT_1_0_XML_PUBLIC_IDENTIFIER"\"\n\""DBUS_INTROSPECT_1_0_XML_SYSTEM_IDENTIFIER"\">\n"
>>
>> should be written as
>>
>>   #define DBUS_INTROSPECT_1_0_XML_DOCTYPE_DECL_NODE "<!DOCTYPE node
>> PUBLIC \"" DBUS_INTROSPECT_1_0_XML_PUBLIC_IDENTIFIER "\"\n\""
>> DBUS_INTROSPECT_1_0_XML_SYSTEM_IDENTIFIER "\">\n"
>
>
> You are right. And AFAIK a similar fix was committed to the ports tree
> while I was testing your suggestion.
>
> The fix helped clang to build firefox with DBUS on. However,
> thunderbird stopped building with another error. I'll create
> a new thread on the matter after some testing.

There are patches to build Thunderbird with clang:

http://lists.freebsd.org/pipermail/freebsd-gecko/2012-June/002273.html

Maybe you could give them a try.

Beat


More information about the freebsd-ports mailing list