Fwd: Re: [PATCH][REVIEW] gbuild conversion: idlc module -- build problems fixed

David Ostrovsky david.ostrovsky at gmx.de
Fri Apr 13 03:56:29 PDT 2012


Here is the corrected patch.
I fixed the build error with --enable-werror option enabled.

C problem:
I renamed rand to local_rand in eval.c

C++ problem
As on gbuild parser are not wrapped any more, I adjusted the warning 
suppression in parser.y (borrowed from rsc module).


-------- Original Message --------
Subject: 	Fwd: Re: [PATCH][REVIEW] gbuild conversion: idlc module -- 
problem with --enable-werror
Date: 	Fri, 13 Apr 2012 11:26:03 +0200
From: 	David Ostrovsky <david.ostrovsky at gmx.de>
To: 	Libreoffice-dev <libreoffice at lists.freedesktop.org>


my patch (that is apparently not pushed yet ;-) breaks the build with 
--enable-werror option enabled.
I didn't try it yersterday, sorry for that.

I have two error: in C and in C+ code.

I removed the patch and compiled idlc with old dmake with 
--enable-werror enabled.
It worked.

C-code error:

The dfference between the two is:
old dmake build: only -Werror option on C code is present,
new gbuild build: -Werror and -Wshadow are present.

The reason is here:

on dmake:
# -Wshadow does not work for C with nested uses of pthread_cleanup_push:
CFLAGSWARNBOTH=-Wall -Wextra -Wendif-labels

on gbuild:

gb_CFLAGS := \
     $(gb_CFLAGS_COMMON) \
     -fPIC \
     -Wdeclaration-after-statement \
     -Wshadow \

The C error that I'm getting is:

home/david/projects/libreoffice-core/git/libo/idlc/source/preproc/eval.c: In 
Funktion »eval«:
Fehler: Deklaration von »rand« überdeckt eine globale Deklaration 

Declaration of `rand` shadows a global declaration [-Werror=shadow]

With -Wshadow option commented out, the new build with my patch works again.
gb_CFLAGS := \
     $(gb_CFLAGS_COMMON) \
     -fPIC \
     -Wdeclaration-after-statement \
#    -Wshadow \

C++ error is about bison generated parser:

idlc/source/parser.y:261:13: Fehler: #pragma system_header außerhalb 
include-Datei ignoriert [-Werror]
source/parser.y: In Funktion »int yyparse()«:
source/parser.y:604:65: Fehler: Um Zuweisung, die als Wahrheitswert 
verwendet wird, werden Klammern empfohlen [-Werror=parentheses]

I'm investigating this.


-------- Original Message --------
Subject: 	Re: [PATCH][REVIEW] gbuild conversion: idlc module
Date: 	Thu, 12 Apr 2012 23:45:51 +0200
From: 	David Ostrovsky <david.ostrovsky at gmx.de>
To: 	David Tardon <dtardon at redhat.com>, Matús( Kukan 
<matus.kukan at gmail.com>
CC: 	Libreoffice-dev <libreoffice at lists.freedesktop.org>

Hi David,
hi Matus,

thank you for your comments on my patch. I changed it accordingly.

*@Matús(:* thank you for your help on IRC.

Special usage gnu_getopt lib in windows:
Matús( proposed the follow simple solution to include in 

ifeq ($(OS),WNT)
$(eval $(call gb_Executable_use_libraries,idlcpp,\
     gnu_getopt \


1. HAVE_GETOPT is allways NO on windows

2. gnu_getopt is registered already on windows: 
gb_Library_PLAINLIBS_NONE += [...] gnu_getopt [...]
here solenv/gbuild/platform/WNT_INTEL_GCC.mk
and here solenv/gbuild/platform/WNT_INTEL_MSC.mk

3. original make file snippet was only active on windows

.IF "$(GUI)$(COM)" == "WNTMSC"
.ELIF "$(GUI)$(COM)" == "WNTGCC"

Having said that, how could we simplify the gnu_getopt treatment in 


-------- Original Message --------
Subject: 	Re: [PATCH][REVIEW] gbuild conversion: idlc module
Date: 	Thu, 12 Apr 2012 06:33:19 +0200
From: 	David Tardon <dtardon at redhat.com>
To: 	David Ostrovsky <david.ostrovsky at gmx.de>
CC: 	Libreoffice-dev <libreoffice at lists.freedesktop.org>

On Wed, Apr 11, 2012 at 11:18:46PM +0200, David Ostrovsky wrote:
>  Hi,
>  this is gbuild conversion for idlc module.

Good. But it is not quite ready yet, see comments below.

>  diff --git a/Repository.mk b/Repository.mk
>  index 1a3851e..638f4f8 100644
>  --- a/Repository.mk
>  +++ b/Repository.mk
>  @@ -31,6 +31,8 @@ $(eval $(call gb_Helper_register_executables,NONE, \
>       bmp \
>       bmpsum \
>       cppunit/cppunittester \
>  +    idlc \
>  +    idlcpp \
>       g2g \
>       gencoll_rule \
>       genconv_dict \

Both binaries should be registered in layer SDKBIN (because of

>  +
>  +$(eval $(call gb_Executable_use_libraries,idlc,\
>  +    sal \
>  +    reg \

Originally idlc is linked with salhelper too. It is possible it is no
longer necessary, but it is also possible that it is necessary on a
different platform. (Nitpick: please, keep the libs sorted
alphabetically :-)

>  +))
>  +$(eval $(call gb_Executable_use_linked_libs,idlcpp,\
>  +    gnu_getopt \
>  +))

This is wrong: there is no unconditionally built library gnu_getopt. It
only worked for you because there is no function
gb_Executable_use_linked_libs either (it is called
gb_Executable_use_libraries) and your platform's libc has getopt .-)

You need to use gb_Executable_use_externals and add a new definition to
RepositoryExternals.mk for it, like:


# nothing needed
define gb_LinkTarget__use_gnu_getopt



define gb_LinkTarget__use_gnu_getopt
$(call gb_LinkTarget_use_libraries,$(1),\
     gnu_getopt \


$(eval $(call gb_Helper_register_libraries,PLAINLIBS_NONE,\
     gnu_getopt \



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20120413/ebc82893/attachment-0001.htm>

More information about the LibreOffice mailing list