openoffice-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From truck...@apache.org
Subject svn commit: r1829681 - in /openoffice/trunk/main/solenv: gbuild/platform/freebsd.mk inc/unxfbsdi.mk
Date Fri, 20 Apr 2018 23:17:21 GMT
Author: truckman
Date: Fri Apr 20 23:17:21 2018
New Revision: 1829681

URL: http://svn.apache.org/viewvc?rev=1829681&view=rev
Log:
Work around a bug in clang versions 3.6.x and 3.7.x on 32-bit Intel.
Using -Os optimization causes clang to generate bad DWARF CFI which
is needed for stack unwinding during exception handling.  See:
  <https://llvm.org/bugs/show_bug.cgi?id=24792>
Instead of using -Os, optimize using "-O2 -fno-unroll-loops" as a
reasonably close substitute.


Modified:
    openoffice/trunk/main/solenv/gbuild/platform/freebsd.mk
    openoffice/trunk/main/solenv/inc/unxfbsdi.mk

Modified: openoffice/trunk/main/solenv/gbuild/platform/freebsd.mk
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/solenv/gbuild/platform/freebsd.mk?rev=1829681&r1=1829680&r2=1829681&view=diff
==============================================================================
--- openoffice/trunk/main/solenv/gbuild/platform/freebsd.mk (original)
+++ openoffice/trunk/main/solenv/gbuild/platform/freebsd.mk Fri Apr 20 23:17:21 2018
@@ -146,7 +146,15 @@ ifeq ($(gb_DEBUGLEVEL),2)
 gb_COMPILEROPTFLAGS := -O0
 gb_COMPILEROPT1FLAGS := -O0
 else
+# Clang versions 3.6.x and 3.7.x generate bad DWARF CFI for stack unwinding
+# on 32-bit Intel when compiling with -Os optimization.  See
+# <https://llvm.org/bugs/show_bug.cgi?id=24792>
+# Work around this by using "-O2 -fno-unroll-loops" instead.
+ifeq ($(COM)$(CPUNAME)$(shell expr $(CCNUMVER) '>=' 000300060000 '&' $(CCNUMVER) '<'
000300080000),CLANGINTEL1)
+gb_COMPILEROPTFLAGS := -O2 -fno-unroll-loops
+else
 gb_COMPILEROPTFLAGS := -Os
+endif
 gb_COMPILEROPT1FLAGS := -O1
 endif
 

Modified: openoffice/trunk/main/solenv/inc/unxfbsdi.mk
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/solenv/inc/unxfbsdi.mk?rev=1829681&r1=1829680&r2=1829681&view=diff
==============================================================================
--- openoffice/trunk/main/solenv/inc/unxfbsdi.mk (original)
+++ openoffice/trunk/main/solenv/inc/unxfbsdi.mk Fri Apr 20 23:17:21 2018
@@ -33,7 +33,15 @@ ARCH_FLAGS*=-mtune=pentiumpro
 
 # Compiler flags for enabling optimizations
 .IF "$(PRODUCT)"!=""
+# Clang versions 3.6.x and 3.7.x generate bad DWARF CFI for stack unwinding
+# on 32-bit Intel when compiling with -Os optimization.  See
+# <https://llvm.org/bugs/show_bug.cgi?id=24792>
+# Work around this by using "-O2 -fno-unroll-loops" instead.
+.IF "$(COM)"=="CLANG" && "$(CCNUMVER)">="000300060000" && "$(CCNUMVER)"<="000300079999"
+CFLAGSOPT=-O2 -fno-unroll-loops -fno-strict-aliasing	# optimizing for products
+.ELSE
 CFLAGSOPT=-Os -fno-strict-aliasing		# optimizing for products
+.ENDIF
 .ELSE 	# "$(PRODUCT)"!=""
 CFLAGSOPT= 					# no optimizing for non products
 .ENDIF	# "$(PRODUCT)"!=""



Mime
View raw message