You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openoffice.apache.org by Don Lewis <tr...@apache.org> on 2017/11/26 23:28:30 UTC

Re: svn commit: r1815700 - /openoffice/trunk/main/framework/Library_fwk.mk

On 18 Nov, jim@apache.org wrote:
> Author: jim
> Date: Sat Nov 18 22:24:42 2017
> New Revision: 1815700
> 
> URL: http://svn.apache.org/viewvc?rev=1815700&view=rev
> Log:
> Force compilation with -O1 flag instead of -O2
> 
> Modified:
>     openoffice/trunk/main/framework/Library_fwk.mk
> 
> Modified: openoffice/trunk/main/framework/Library_fwk.mk
> URL: http://svn.apache.org/viewvc/openoffice/trunk/main/framework/Library_fwk.mk?rev=1815700&r1=1815699&r2=1815700&view=diff
> ==============================================================================
> --- openoffice/trunk/main/framework/Library_fwk.mk (original)
> +++ openoffice/trunk/main/framework/Library_fwk.mk Sat Nov 18 22:24:42 2017
> @@ -61,6 +61,10 @@ $(eval $(call gb_Library_add_linked_libs
>  	$(gb_STDLIBS) \
>  ))
>  
> +ifeq ($(OS),MACOSX)
> +gb_COMPILEROPTFLAGS := -O1
> +endif
> +
>  $(eval $(call gb_Library_add_exception_objects,fwk,\
>  	framework/source/accelerators/acceleratorcache \
>  	framework/source/accelerators/acceleratorconfiguration \
> 
> 

I'd like to propose the patch below as an alternative:
 * FreeBSD 10 / amd64 also has this problem.  It just depends on the
   machine architecture and clang version.

 * The patch below only changes the optimization for one file, not
   everything in this library.

 * Hardwiring -O1 does the wrong thing for debug builds, which want to
   totally disable optimization so that the values of variables are not
   optimized out.

Admittedly this patch is a bit ugly because gbuild doesn't currently
have a way to set target-specific optimization flags.  The problem is
that it passes $(gb_COMPILEROPTFLAGS) as a function call argument, which
is evaluated globally and not in a target-specific context.  This should
be fixable.

What does 'cc --version' report on the Mac for the different releases
that work / don't work properly?  I'd like to bring $(CCNUMVER) to
gbuild so that these sorts of tweaks are only enabled for the compiler
versions that need it.

--- framework/Library_fwk.mk.orig	2017-10-11 11:40:20 UTC
+++ framework/Library_fwk.mk
@@ -186,4 +186,11 @@ $(eval $(call gb_Library_add_exception_objects,fwk,\
 	framework/source/xml/imagesdocumenthandler \
 ))
 
+# i126622 - Base 4.1.2 does not open Tables and Queries in Mac OSX
+# Also affects FreeBSD 10.3 with clang 3.4.1.
+# Appears to be a clang optimization bug in versions less than 3.8.0
+ifeq ($(COM)$(CPUNAME),CLANGX86_64)
+$(call gb_CxxObject_get_target,framework/source/loadenv/loadenv):	CXXFLAGS := $(gb_LinkTarget_CXXFLAGS) $(gb_LinkTarget_EXCEPTIONFLAGS) $(gb_COMPILERNOOPTFLAGS)
+endif
+
 # vim: set noet sw=4 ts=4:


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@openoffice.apache.org
For additional commands, e-mail: dev-help@openoffice.apache.org


Re: svn commit: r1815700 - /openoffice/trunk/main/framework/Library_fwk.mk

Posted by Jim Jagielski <ji...@jaguNET.com>.
I just went ahead and activated it for MACOSX. We can always
adjust as needed.

> On Nov 27, 2017, at 1:30 PM, Don Lewis <tr...@apache.org> wrote:
> 
> On 27 Nov, Jim Jagielski wrote:
>> % cc --version 
>> Apple LLVM version 7.3.0 (clang-703.0.31)
>> Target: x86_64-apple-darwin16.7.0
>> Thread model: posix
>> InstalledDir: /Applications/Xcode7.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
> 
> How inconvenient.  It looks like Apple uses their own version numbering.
> The very latest release on llvm.org is 5.0.0.  I found this table that
> maps between Xcode versions, Apple clang versions, and LLVM versions.
> Based on my FreeBSD testing results (11.0 w/LLVM 3.8.0 works), Xcode 7.3
> or higher should work properly on the Mac.
> 
> If we want to start using CCNUMVER to control these workarounds, we'll
> have to use different thresholds for clang on Apple vs. clang anywhere
> else.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@openoffice.apache.org
> For additional commands, e-mail: dev-help@openoffice.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@openoffice.apache.org
For additional commands, e-mail: dev-help@openoffice.apache.org


Re: svn commit: r1815700 - /openoffice/trunk/main/framework/Library_fwk.mk

Posted by Don Lewis <tr...@apache.org>.
On 27 Nov, Jim Jagielski wrote:
> % cc --version 
> Apple LLVM version 7.3.0 (clang-703.0.31)
> Target: x86_64-apple-darwin16.7.0
> Thread model: posix
> InstalledDir: /Applications/Xcode7.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

How inconvenient.  It looks like Apple uses their own version numbering.
The very latest release on llvm.org is 5.0.0.  I found this table that
maps between Xcode versions, Apple clang versions, and LLVM versions.
Based on my FreeBSD testing results (11.0 w/LLVM 3.8.0 works), Xcode 7.3
or higher should work properly on the Mac.

If we want to start using CCNUMVER to control these workarounds, we'll
have to use different thresholds for clang on Apple vs. clang anywhere
else.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@openoffice.apache.org
For additional commands, e-mail: dev-help@openoffice.apache.org


Re: svn commit: r1815700 - /openoffice/trunk/main/framework/Library_fwk.mk

Posted by Jim Jagielski <ji...@jaguNET.com>.
% cc --version 
Apple LLVM version 7.3.0 (clang-703.0.31)
Target: x86_64-apple-darwin16.7.0
Thread model: posix
InstalledDir: /Applications/Xcode7.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

Thx!

> On Nov 26, 2017, at 6:28 PM, Don Lewis <tr...@apache.org> wrote:
> 
> cc --version


Re: svn commit: r1815700 - /openoffice/trunk/main/framework/Library_fwk.mk

Posted by Don Lewis <tr...@apache.org>.
On 27 Nov, Damjan Jovanovic wrote:
> Who confirmed that it "also affects FreeBSD 10.3 with clang 3.4.1"?
> If it was me, I was wrong, as I said later in the same email thread.

I was able to confirm it.  I saw the link to the forum where a FreeBSD
user reported that the table wizard didn't work, but the FreeBSD version
was not specified.  I replied to the email thread that I was not able to
reproduce the problem on my FreeBSD 11.1 desktop.  After reading some of
the subsequent email traffic and this PR
https://bz.apache.org/ooo/show_bug.cgi?id=126622, in particular comment
#28 I decided to set up a FreeBSD 10.3 amd64 jail to try to reproduce
the bug since both Mac and FreeBSD use clang.  My testing showed that
base was broken in 10.3 on amd64, but works on i386.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@openoffice.apache.org
For additional commands, e-mail: dev-help@openoffice.apache.org


Re: svn commit: r1815700 - /openoffice/trunk/main/framework/Library_fwk.mk

Posted by Damjan Jovanovic <da...@apache.org>.
Who confirmed that it "also affects FreeBSD 10.3 with clang 3.4.1"?
If it was me, I was wrong, as I said later in the same email thread.

On Mon, Nov 27, 2017 at 9:34 AM, Don Lewis <tr...@apache.org> wrote:

> On 26 Nov, Don Lewis wrote:
> > On 26 Nov, Don Lewis wrote:
> >> On 18 Nov, jim@apache.org wrote:
> >>> Author: jim
> >>> Date: Sat Nov 18 22:24:42 2017
> >>> New Revision: 1815700
> >>>
> >>> URL: http://svn.apache.org/viewvc?rev=1815700&view=rev
> >>> Log:
> >>> Force compilation with -O1 flag instead of -O2
> >>>
> >>> Modified:
> >>>     openoffice/trunk/main/framework/Library_fwk.mk
> >>>
> >>> Modified: openoffice/trunk/main/framework/Library_fwk.mk
> >>> URL: http://svn.apache.org/viewvc/openoffice/trunk/main/
> framework/Library_fwk.mk?rev=1815700&r1=1815699&r2=1815700&view=diff
> >>> ============================================================
> ==================
> >>> --- openoffice/trunk/main/framework/Library_fwk.mk (original)
> >>> +++ openoffice/trunk/main/framework/Library_fwk.mk Sat Nov 18
> 22:24:42 2017
> >>> @@ -61,6 +61,10 @@ $(eval $(call gb_Library_add_linked_libs
> >>>     $(gb_STDLIBS) \
> >>>  ))
> >>>
> >>> +ifeq ($(OS),MACOSX)
> >>> +gb_COMPILEROPTFLAGS := -O1
> >>> +endif
> >>> +
> >>>  $(eval $(call gb_Library_add_exception_objects,fwk,\
> >>>     framework/source/accelerators/acceleratorcache \
> >>>     framework/source/accelerators/acceleratorconfiguration \
> >>>
> >>>
> >>
> >> I'd like to propose the patch below as an alternative:
> >>  * FreeBSD 10 / amd64 also has this problem.  It just depends on the
> >>    machine architecture and clang version.
> >>
> >>  * The patch below only changes the optimization for one file, not
> >>    everything in this library.
> >>
> >>  * Hardwiring -O1 does the wrong thing for debug builds, which want to
> >>    totally disable optimization so that the values of variables are not
> >>    optimized out.
> >>
> >> Admittedly this patch is a bit ugly because gbuild doesn't currently
> >> have a way to set target-specific optimization flags.  The problem is
> >> that it passes $(gb_COMPILEROPTFLAGS) as a function call argument, which
> >> is evaluated globally and not in a target-specific context.  This should
> >> be fixable.
> >>
> >> What does 'cc --version' report on the Mac for the different releases
> >> that work / don't work properly?  I'd like to bring $(CCNUMVER) to
> >> gbuild so that these sorts of tweaks are only enabled for the compiler
> >> versions that need it.
> >>
> >> --- framework/Library_fwk.mk.orig    2017-10-11 11:40:20 UTC
> >> +++ framework/Library_fwk.mk
> >> @@ -186,4 +186,11 @@ $(eval $(call gb_Library_add_exception_
> objects,fwk,\
> >>      framework/source/xml/imagesdocumenthandler \
> >>  ))
> >>
> >> +# i126622 - Base 4.1.2 does not open Tables and Queries in Mac OSX
> >> +# Also affects FreeBSD 10.3 with clang 3.4.1.
> >> +# Appears to be a clang optimization bug in versions less than 3.8.0
> >> +ifeq ($(COM)$(CPUNAME),CLANGX86_64)
> >> +$(call gb_CxxObject_get_target,framework/source/loadenv/loadenv):
>  CXXFLAGS := $(gb_LinkTarget_CXXFLAGS) $(gb_LinkTarget_EXCEPTIONFLAGS)
> $(gb_COMPILERNOOPTFLAGS)
> >> +endif
> >> +
> >>  # vim: set noet sw=4 ts=4:
> >
> > This patch is for 4.1.4.  It doesn't work on trunk, but the fix there
> > looks easier.  I'll post it once I have it tested.
>
> Here's the patch for trunk.  I turned out not to be any easier, just
> different.
>
> --- framework/Library_fwk.mk.orig       2016-08-29 00:45:25 UTC
> +++ framework/Library_fwk.mk
> @@ -190,4 +190,11 @@ $(eval $(call gb_Library_add_exception_objects,fwk,\
>         framework/source/xml/imagesdocumenthandler \
>  ))
>
> +# i126622 - Base 4.1.2 does not open Tables and Queries in Mac OSX
> +# Also affects FreeBSD 10.3 with clang 3.4.1.
> +# Appears to be a clang optimization bug in versions less than 3.8.0
> +ifeq ($(COM)$(CPUNAME),CLANGX86_64)
> +$(call gb_CxxObject_get_target,framework/source/loadenv/loadenv):
>  T_CXXFLAGS := $(gb_LinkTarget_CXXFLAGS) $(gb_LinkTarget_EXCEPTIONFLAGS)
> $(gb_COMPILERNOOPTFLAGS)
> +endif
> +
>  # vim: set noet sw=4 ts=4:
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@openoffice.apache.org
> For additional commands, e-mail: dev-help@openoffice.apache.org
>
>

Re: svn commit: r1815700 - /openoffice/trunk/main/framework/Library_fwk.mk

Posted by Don Lewis <tr...@apache.org>.
On 26 Nov, Don Lewis wrote:
> On 26 Nov, Don Lewis wrote:
>> On 18 Nov, jim@apache.org wrote:
>>> Author: jim
>>> Date: Sat Nov 18 22:24:42 2017
>>> New Revision: 1815700
>>> 
>>> URL: http://svn.apache.org/viewvc?rev=1815700&view=rev
>>> Log:
>>> Force compilation with -O1 flag instead of -O2
>>> 
>>> Modified:
>>>     openoffice/trunk/main/framework/Library_fwk.mk
>>> 
>>> Modified: openoffice/trunk/main/framework/Library_fwk.mk
>>> URL: http://svn.apache.org/viewvc/openoffice/trunk/main/framework/Library_fwk.mk?rev=1815700&r1=1815699&r2=1815700&view=diff
>>> ==============================================================================
>>> --- openoffice/trunk/main/framework/Library_fwk.mk (original)
>>> +++ openoffice/trunk/main/framework/Library_fwk.mk Sat Nov 18 22:24:42 2017
>>> @@ -61,6 +61,10 @@ $(eval $(call gb_Library_add_linked_libs
>>>  	$(gb_STDLIBS) \
>>>  ))
>>>  
>>> +ifeq ($(OS),MACOSX)
>>> +gb_COMPILEROPTFLAGS := -O1
>>> +endif
>>> +
>>>  $(eval $(call gb_Library_add_exception_objects,fwk,\
>>>  	framework/source/accelerators/acceleratorcache \
>>>  	framework/source/accelerators/acceleratorconfiguration \
>>> 
>>> 
>> 
>> I'd like to propose the patch below as an alternative:
>>  * FreeBSD 10 / amd64 also has this problem.  It just depends on the
>>    machine architecture and clang version.
>> 
>>  * The patch below only changes the optimization for one file, not
>>    everything in this library.
>> 
>>  * Hardwiring -O1 does the wrong thing for debug builds, which want to
>>    totally disable optimization so that the values of variables are not
>>    optimized out.
>> 
>> Admittedly this patch is a bit ugly because gbuild doesn't currently
>> have a way to set target-specific optimization flags.  The problem is
>> that it passes $(gb_COMPILEROPTFLAGS) as a function call argument, which
>> is evaluated globally and not in a target-specific context.  This should
>> be fixable.
>> 
>> What does 'cc --version' report on the Mac for the different releases
>> that work / don't work properly?  I'd like to bring $(CCNUMVER) to
>> gbuild so that these sorts of tweaks are only enabled for the compiler
>> versions that need it.
>> 
>> --- framework/Library_fwk.mk.orig	2017-10-11 11:40:20 UTC
>> +++ framework/Library_fwk.mk
>> @@ -186,4 +186,11 @@ $(eval $(call gb_Library_add_exception_objects,fwk,\
>>  	framework/source/xml/imagesdocumenthandler \
>>  ))
>>  
>> +# i126622 - Base 4.1.2 does not open Tables and Queries in Mac OSX
>> +# Also affects FreeBSD 10.3 with clang 3.4.1.
>> +# Appears to be a clang optimization bug in versions less than 3.8.0
>> +ifeq ($(COM)$(CPUNAME),CLANGX86_64)
>> +$(call gb_CxxObject_get_target,framework/source/loadenv/loadenv):	CXXFLAGS := $(gb_LinkTarget_CXXFLAGS) $(gb_LinkTarget_EXCEPTIONFLAGS) $(gb_COMPILERNOOPTFLAGS)
>> +endif
>> +
>>  # vim: set noet sw=4 ts=4:
> 
> This patch is for 4.1.4.  It doesn't work on trunk, but the fix there
> looks easier.  I'll post it once I have it tested.

Here's the patch for trunk.  I turned out not to be any easier, just
different.

--- framework/Library_fwk.mk.orig	2016-08-29 00:45:25 UTC
+++ framework/Library_fwk.mk
@@ -190,4 +190,11 @@ $(eval $(call gb_Library_add_exception_objects,fwk,\
 	framework/source/xml/imagesdocumenthandler \
 ))
 
+# i126622 - Base 4.1.2 does not open Tables and Queries in Mac OSX
+# Also affects FreeBSD 10.3 with clang 3.4.1.
+# Appears to be a clang optimization bug in versions less than 3.8.0
+ifeq ($(COM)$(CPUNAME),CLANGX86_64)
+$(call gb_CxxObject_get_target,framework/source/loadenv/loadenv):       T_CXXFLAGS := $(gb_LinkTarget_CXXFLAGS) $(gb_LinkTarget_EXCEPTIONFLAGS) $(gb_COMPILERNOOPTFLAGS)
+endif
+
 # vim: set noet sw=4 ts=4:


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@openoffice.apache.org
For additional commands, e-mail: dev-help@openoffice.apache.org


Re: svn commit: r1815700 - /openoffice/trunk/main/framework/Library_fwk.mk

Posted by Don Lewis <tr...@apache.org>.
On 26 Nov, Don Lewis wrote:
> On 18 Nov, jim@apache.org wrote:
>> Author: jim
>> Date: Sat Nov 18 22:24:42 2017
>> New Revision: 1815700
>> 
>> URL: http://svn.apache.org/viewvc?rev=1815700&view=rev
>> Log:
>> Force compilation with -O1 flag instead of -O2
>> 
>> Modified:
>>     openoffice/trunk/main/framework/Library_fwk.mk
>> 
>> Modified: openoffice/trunk/main/framework/Library_fwk.mk
>> URL: http://svn.apache.org/viewvc/openoffice/trunk/main/framework/Library_fwk.mk?rev=1815700&r1=1815699&r2=1815700&view=diff
>> ==============================================================================
>> --- openoffice/trunk/main/framework/Library_fwk.mk (original)
>> +++ openoffice/trunk/main/framework/Library_fwk.mk Sat Nov 18 22:24:42 2017
>> @@ -61,6 +61,10 @@ $(eval $(call gb_Library_add_linked_libs
>>  	$(gb_STDLIBS) \
>>  ))
>>  
>> +ifeq ($(OS),MACOSX)
>> +gb_COMPILEROPTFLAGS := -O1
>> +endif
>> +
>>  $(eval $(call gb_Library_add_exception_objects,fwk,\
>>  	framework/source/accelerators/acceleratorcache \
>>  	framework/source/accelerators/acceleratorconfiguration \
>> 
>> 
> 
> I'd like to propose the patch below as an alternative:
>  * FreeBSD 10 / amd64 also has this problem.  It just depends on the
>    machine architecture and clang version.
> 
>  * The patch below only changes the optimization for one file, not
>    everything in this library.
> 
>  * Hardwiring -O1 does the wrong thing for debug builds, which want to
>    totally disable optimization so that the values of variables are not
>    optimized out.
> 
> Admittedly this patch is a bit ugly because gbuild doesn't currently
> have a way to set target-specific optimization flags.  The problem is
> that it passes $(gb_COMPILEROPTFLAGS) as a function call argument, which
> is evaluated globally and not in a target-specific context.  This should
> be fixable.
> 
> What does 'cc --version' report on the Mac for the different releases
> that work / don't work properly?  I'd like to bring $(CCNUMVER) to
> gbuild so that these sorts of tweaks are only enabled for the compiler
> versions that need it.
> 
> --- framework/Library_fwk.mk.orig	2017-10-11 11:40:20 UTC
> +++ framework/Library_fwk.mk
> @@ -186,4 +186,11 @@ $(eval $(call gb_Library_add_exception_objects,fwk,\
>  	framework/source/xml/imagesdocumenthandler \
>  ))
>  
> +# i126622 - Base 4.1.2 does not open Tables and Queries in Mac OSX
> +# Also affects FreeBSD 10.3 with clang 3.4.1.
> +# Appears to be a clang optimization bug in versions less than 3.8.0
> +ifeq ($(COM)$(CPUNAME),CLANGX86_64)
> +$(call gb_CxxObject_get_target,framework/source/loadenv/loadenv):	CXXFLAGS := $(gb_LinkTarget_CXXFLAGS) $(gb_LinkTarget_EXCEPTIONFLAGS) $(gb_COMPILERNOOPTFLAGS)
> +endif
> +
>  # vim: set noet sw=4 ts=4:

This patch is for 4.1.4.  It doesn't work on trunk, but the fix there
looks easier.  I'll post it once I have it tested.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@openoffice.apache.org
For additional commands, e-mail: dev-help@openoffice.apache.org