Re: [PATCH][PUSHED] LibreOffice 3.6.0alpha built on clang
Julien, On pc Debian x86-64, I've got this kind of errors : /home/julien/compile- libreoffice/libo/connectivity/source/drivers/mozab/mozillasrc/MLdapAttributeMap.cxx:51:23: error: ISO C++ forbids declaration of 'typeof' with no type [-fpermissive] Could you try this patch and see if it fixes the error? It was an issue with gcc not recognising typeof, but __typeof__. I tested it on both gcc and clang this time. Regards, Wei Ming 0001-Connectivity-use-__typeof__-instead-of-NS_STDCALL_PR.patch Description: Binary data ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: LibreOffice 3.6.0alpha built on clang
Hi Julien, I began to run static analyzer and posted some output on the easyhack here : https://bugs.freedesktop.org/show_bug.cgi?id=39596 I'm getting the message scan-build: Removing directory '/tmp/scan-build-2012-02-20-1' because it contains no reports. How did you get scan-build to generate reports? Regards, --wm ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
License for my contributions
All my contributions will be licensed under MPL/LGPLv3+. Wei Ming ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
LibreOffice 3.6.0alpha built on clang
A big kudos to Kristian Rietveld for his hard work described here http://wiki.documentfoundation.org/Development/Building_LibreOffice_with_Clang So for what it's worth, here's the route I took (by no means ideal). I built LibO 3.6.0alpha using clang 3.1 on Ubuntu 11.04 Natty 32 bits and ./autogen.sh CC=clang CXX=clang++ It built eventually, but barely. I was even surprised that it executed successfully too. The main modifications I made were 1. stlport (stl/_locale.h new operator unrecognised). This was addressed by August Sodora (4th patch) here, although I patched it differently. http://lists.freedesktop.org/archives/libreoffice/2012-January/023182.html 2. nss (unix/os_Linux_x86.s asterix as comment character). Also mentioned by Stephen Bergmann here http://lists.freedesktop.org/archives/libreoffice/2012-January/023189.html 3. moz (missing this pointers/default constructor). Mentioned by Julien2412, Stephen and others. http://lists.freedesktop.org/archives/libreoffice/2012-February/025966.html 4. connectivity (typedef for CardPropertyGetter/Setter in connectivity/source/drivers/mozab/mozillasrc/MLdapAttributeMap.cxx). The patch was submitted here http://lists.freedesktop.org/archives/libreoffice/2012-February/026435.html Other issues. 5. cairo (disable mutexes). Julien ran into this, I decided to simply disable multi-threading in cairo (not too clear what this has to do with clang though) http://lists.freedesktop.org/archives/libreoffice/2012-February/026195.html 6. incompatible -std=c++0x option. Not sure what the deal is here, but I gather there's some discrepancy between what gcc and clang understand is the standard C++ library(tm). 7. Macros in sw are broken in the clang-build it seems. Yet to figure out why. 8. There was a bug which I attribute to clang. The warn_attribute_not_on_decl diagnostic was defined as an error instead of a warning. I can't remember when it comes up, but error message contained the phrase ... attribute ignored when parsing type 9. I'm not sure why I didn't run into the -fvisibility=hidden bug discovered by Stephen. I suspect this flag has been made optional(?). The bug is here http://llvm.org/bugs/show_bug.cgi?id=11250 Future plans I plan to try out the clang static analyzer, and if I survive that maybe I'll give KLEE a go. Apologies for the lengthy post. Regards, Wei Ming From 7dae78fc4759488a7dd97a3e781c24e42e86364a Mon Sep 17 00:00:00 2001 From: Wei Ming Khoo wei...@gmail.com Date: Sun, 19 Feb 2012 15:56:46 + Subject: [PATCH 1/6] stlport stl/_locale.h new operator unrecognized --- stlport/STLport-4.5-clang_locale_h.patch | 11 +++ stlport/makefile.mk |3 ++- 2 files changed, 13 insertions(+), 1 deletions(-) create mode 100644 stlport/STLport-4.5-clang_locale_h.patch diff --git a/stlport/STLport-4.5-clang_locale_h.patch b/stlport/STLport-4.5-clang_locale_h.patch new file mode 100644 index 000..8cbfbfc --- /dev/null +++ b/stlport/STLport-4.5-clang_locale_h.patch @@ -0,0 +1,11 @@ +--- misc/STLport-4.5/stlport/stl/_locale.h 2001-07-06 05:16:18.0 +0100 misc/build/STLport-4.5/stlport/stl/_locale.h 2012-02-18 18:17:18.338109337 + +@@ -120,7 +120,7 @@ + locale(const locale __loc, _Facet* __f) : _M_impl(0) + { + // _M_impl = this-_S_copy_impl(__loc._M_impl, __f != 0); +- new(this) locale(__loc._M_impl, __f != 0); ++ new locale(__loc._M_impl, __f != 0); + if (__f != 0) + this-_M_insert(__f, _Facet::id); + } diff --git a/stlport/makefile.mk b/stlport/makefile.mk index 9211a5e..3e4a8de 100644 --- a/stlport/makefile.mk +++ b/stlport/makefile.mk @@ -49,7 +49,8 @@ all: PATCH_FILES=\ STLport-4.5.patch \ STLport-4.5-gcc43_warnings.patch \ -STLport-4.5-cxx0x.patch +STLport-4.5-cxx0x.patch \ +STLport-4.5-clang_locale_h.patch .ELIF $(GUI)==WNT TARFILE_NAME=STLport-4.5-0119 TARFILE_MD5=7376930b0d3f3d77a685d94c4a3acda8 -- 1.7.4.1 From 2cf8e2806fb856d379b5f5ea3564b613bcbc8f8b Mon Sep 17 00:00:00 2001 From: Wei Ming Khoo wei...@gmail.com Date: Sun, 19 Feb 2012 16:00:53 + Subject: [PATCH 2/6] nss unix/os_Linux_x86.s asterix as comment character --- nss/makefile.mk |2 +- nss/nss-clang_os_Linux_x86_s_comments.patch | 178 +++ 2 files changed, 179 insertions(+), 1 deletions(-) create mode 100644 nss/nss-clang_os_Linux_x86_s_comments.patch diff --git a/nss/makefile.mk b/nss/makefile.mk index 4076025..744f944 100644 --- a/nss/makefile.mk +++ b/nss/makefile.mk @@ -48,7 +48,7 @@ VER_PATCH=8 TARFILE_NAME=nss-$(VER_MAJOR).$(VER_MINOR).$(VER_PATCH)-with-nspr-4.8.6 TARFILE_MD5=71474203939fafbe271e1263e61d083e TARFILE_ROOTDIR=nss-$(VER_MAJOR).$(VER_MINOR).$(VER_PATCH) -PATCH_FILES=nss.patch nss.aix.patch nss-config.patch nss-linux3.patch +PATCH_FILES=nss.patch nss.aix.patch nss-config.patch nss-linux3.patch
[PATCH] Clang-flagged error typedef for CardPropertyGetter/Setter in connectivity/source/drivers/mozab/mozillasrc/MLdapAttributeMap.cxx
clang flags this as /home/wmk26/libo-git/connectivity/source/drivers/mozab/mozillasrc/MLdapAttributeMap.cxx:91:91: error: cannot initialize a member subobject of type 'CardPropertyGetter' (aka 'nsresult (nsIAbCard::*)(PRUnichar **)') with an rvalue of type 'nsresult (nsIAbCard::*)(PRUnichar **) __attribute__((cdecl))' { FirstName, givenname, I did a grep for NS_STDCALL and chanced upon this comment in moz/unxlngi6.pro/misc/build/mozilla/xpcom/base/nscore.h /** * Macro for creating typedefs for pointer-to-member types which are * declared with stdcall. It is important to use this for any type which is * declared as stdcall (i.e. NS_IMETHOD). For example, instead of writing: * * typedef nsresult (nsIFoo::*someType)(nsISupports* arg); * * you should write: * * typedef * NS_STDCALL_FUNCPROTO(nsresult, someType, nsIFoo, typeFunc, (nsISupports*)); Hopefully the patch is correct. I didn't try building in with gcc, but clang seems to be pleased.. Regards, Wei Ming From 85fe9121b1a482d8b409ce8e4c9f8536fe1b213d Mon Sep 17 00:00:00 2001 From: Wei Ming Khoo wm...@cam.ac.uk Date: Fri, 17 Feb 2012 15:25:25 + Subject: [PATCH] Clang-flagged error for typedef of CardPropertyGetter/Setter --- .../drivers/mozab/mozillasrc/MLdapAttributeMap.cxx |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/connectivity/source/drivers/mozab/mozillasrc/MLdapAttributeMap.cxx b/connectivity/source/drivers/mozab/mozillasrc/MLdapAttributeMap.cxx index e15da07..4fbb10b 100644 --- a/connectivity/source/drivers/mozab/mozillasrc/MLdapAttributeMap.cxx +++ b/connectivity/source/drivers/mozab/mozillasrc/MLdapAttributeMap.cxx @@ -48,8 +48,8 @@ namespace connectivity { namespace mozab { // namespace { -typedef nsresult (NS_STDCALL nsIAbCard::*CardPropertyGetter)( PRUnichar** aFirstName ); -typedef nsresult (NS_STDCALL nsIAbCard::*CardPropertySetter)( const PRUnichar* aFirstName ); +typedef NS_STDCALL_FUNCPROTO(nsResult, CardPropertyGetter, nsIAbCard, GetFirstName, (PRUnichar**)); +typedef NS_STDCALL_FUNCPROTO(nsResult, CardPropertySetter, nsIAbCard, SetFirstName, (const PRUnichar*)); struct CardPropertyData { const sal_Char* pLDAPAttributeList; -- 1.7.4.1 ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Writing patches for git-ignored files
I followed the patching guidelines on http://wiki.documentfoundation.org/Development/Patch_Handling_Guidelines What is procedure for git-ignored files? E.g. ~/libo-git/moz$ git add unxlngi6.pro/misc/build/mozilla/xpcom/glue/nsBaseHashtable.h The following paths are ignored by one of your .gitignore files: moz/unxlngi6.pro Use -f if you really want to add them. fatal: no files added I'm assuming the '-f' option isn't the answer. Cheers, Wei Ming ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: Writing patches for git-ignored files
Hi Christian, Thanks for your reply. (with new build system you use something like make cmd=dmake patch previously you had to source the Environment file, but that was integrated to a config.mk) Issuing make cmd=dmake patch seemed to behave similar to make. ~/libo-git$ make cmd=dmake patch * * Running the post download checks. * checking build system type... i686-pc-linux-gnu checking host system type... i686-pc-linux-gnu cd instsetoo_native unset MAKEFLAGS \ /home/wmk26/libo-git/solenv/bin/build.pl -P1 --all -- -P1 = (1/138) Building module solenv = ... I looked at Makefile and saw this bit # # custum command # ifneq ( $(MAKECMDGOALS),cmd) cmd: echo custum cmd ( $(cmd) ) endif So I tried ~/libo-git$ make cmd cmd=dmake patch echo custum cmd ( dmake patch ) custum cmd dmake: Error: -- Don't know how to make `patch' make: *** [cmd] Error 255 Am I on the right track? How do I target only one module? Regards, --wm ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice