You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by pf...@apache.org on 2015/08/05 03:14:29 UTC

svn commit: r1694132 - in /openoffice/trunk/main: ./ bridges/source/cpp_uno/gcc3_freebsd_intel/ bridges/source/cpp_uno/gcc3_freebsd_x86-64/ graphite/ solenv/gbuild/platform/ solenv/inc/ testtools/source/bridgetest/

Author: pfg
Date: Wed Aug  5 01:14:28 2015
New Revision: 1694132

URL: http://svn.apache.org/r1694132
Log:
FreeBSD build fixes.

This allows out the box builds with gcc and to
simplify the build with clang and also the FreeBSD port.

>From Don Lewis (FreeBSD port maintainer):

Because we need to use different CFLAGS for gcc and clang, I had to add
some compiler detection logic.  On most platforms, the value of $(COM)
is either set statically by set_soenv, or set_soenv parses the compiler
name to figure out which compiler is being used and then set $(COM)
appropriately.  The latter doesn't work for FreeBSD because cc could
either be gcc or clang.  For FreeBSD, I added the compiler detection
logic to configure, which then passes that to set_soenv, in a somewhat
hackish manner.

When building with ports gcc on FreeBSD, we need to pass the rpath for
the gcc runtime to the linker.  The FreeBSD port attempts to to this by
adding this information to LDFLAGS, which the openoffice configure
script then steps on, and in any case, this does not help the out of the
box build.  My solution is to add some logic to configure to generate
the necessary linker flags, which it then passes to set_soenv for
inclusion in FreeBSD*Env.Set.sh.

On FreeBSD, the out of the box build needs to pass $LIBINTL_PREFIX in
the environment to the build phase.  I added some code to configure to
figure out the value of this variable and to pass it to set_soenv for
inclusion in FreeBSD*Env.Set.sh so that this does not need to be done as
a extra step in the build.

Changing $(COM) from GCC to CLANG for clang builds caused a number
regressions elsewhere in the build framework.  These were mostly caused
by the framework checking for $(COM) == GCC and $(OS) == FREEBSD, with
$(COM) == CLANG case unhandled.  The fix was generally to just ignore
the value of $(COM) and only test the value of $(OS).  One special case
was the bridgetest regression test, which started dumping core on INTEL
32-bit when built with clang.  It turns out that this entire test is was
skipped for $(COM) == gcc, $(OS) == FREEBSD, and $(CPU) == I.  Rather
than also skipping this test when building with clang, I tracked down
the failure to a particular subtest involving polymorphic structures
that also fails on OS/2 and tweaked the code to also skip that subtest
on FREEBSD INTEL (32-bit).  Now bridgetest is run and passes on FreeBSD
with both gcc and clang, on both i386 and amd64.

Submitted by: Don Lewis

Modified:
    openoffice/trunk/main/bridges/source/cpp_uno/gcc3_freebsd_intel/makefile.mk
    openoffice/trunk/main/bridges/source/cpp_uno/gcc3_freebsd_x86-64/makefile.mk
    openoffice/trunk/main/configure.in
    openoffice/trunk/main/graphite/makefile.mk
    openoffice/trunk/main/set_soenv.in
    openoffice/trunk/main/solenv/gbuild/platform/freebsd.mk
    openoffice/trunk/main/solenv/inc/tg_compv.mk
    openoffice/trunk/main/solenv/inc/unx.mk
    openoffice/trunk/main/solenv/inc/unxfbsd.mk
    openoffice/trunk/main/testtools/source/bridgetest/bridgetest.cxx
    openoffice/trunk/main/testtools/source/bridgetest/makefile.mk

Modified: openoffice/trunk/main/bridges/source/cpp_uno/gcc3_freebsd_intel/makefile.mk
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/bridges/source/cpp_uno/gcc3_freebsd_intel/makefile.mk?rev=1694132&r1=1694131&r2=1694132&view=diff
==============================================================================
--- openoffice/trunk/main/bridges/source/cpp_uno/gcc3_freebsd_intel/makefile.mk (original)
+++ openoffice/trunk/main/bridges/source/cpp_uno/gcc3_freebsd_intel/makefile.mk Wed Aug  5 01:14:28 2015
@@ -34,7 +34,7 @@ ENABLE_EXCEPTIONS=TRUE
 
 # --- Files --------------------------------------------------------
 
-.IF "$(COM)$(OS)$(CPU)$(COMNAME)" == "GCCFREEBSDIgcc3"
+.IF "$(OS)$(CPU)$(COMNAME)" == "FREEBSDIgcc3"
 
 .IF "$(cppu_no_leak)" == ""
 CFLAGS += -DLEAK_STATIC_DATA

Modified: openoffice/trunk/main/bridges/source/cpp_uno/gcc3_freebsd_x86-64/makefile.mk
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/bridges/source/cpp_uno/gcc3_freebsd_x86-64/makefile.mk?rev=1694132&r1=1694131&r2=1694132&view=diff
==============================================================================
--- openoffice/trunk/main/bridges/source/cpp_uno/gcc3_freebsd_x86-64/makefile.mk (original)
+++ openoffice/trunk/main/bridges/source/cpp_uno/gcc3_freebsd_x86-64/makefile.mk Wed Aug  5 01:14:28 2015
@@ -34,7 +34,7 @@ ENABLE_EXCEPTIONS=TRUE
 
 # --- Files --------------------------------------------------------
 
-.IF "$(COM)$(OS)$(CPU)$(COMNAME)" == "GCCFREEBSDXgcc3"
+.IF "$(OS)$(CPU)$(COMNAME)" == "FREEBSDXgcc3"
 
 .IF "$(cppu_no_leak)" == ""
 CFLAGS += -DLEAK_STATIC_DATA

Modified: openoffice/trunk/main/configure.in
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/configure.in?rev=1694132&r1=1694131&r2=1694132&view=diff
==============================================================================
--- openoffice/trunk/main/configure.in (original)
+++ openoffice/trunk/main/configure.in Wed Aug  5 01:14:28 2015
@@ -1691,6 +1691,23 @@ if test "$_os" != "WINNT" -o "$WITH_MING
    AC_PROG_CC
 fi
 
+if test "$_os" = "FreeBSD"; then
+    FBSD_GCC_RPATH=
+    if $CC --version 2>&1 | grep clang > /dev/null ; then
+        COM_IS=CLANG
+    else
+        COM_IS=GCC
+        rpath=`$CC --print-file-name libstdc++.so`
+        rpath=`realpath $rpath`
+        rpath=`dirname $rpath`
+	if test "$rpath" != "/usr/lib" ; then
+            FBSD_GCC_RPATH="-Wl,-rpath=$rpath"
+	fi
+    fi
+    AC_SUBST(COM_IS)
+    AC_SUBST(FBSD_GCC_RPATH)
+fi
+
 COMPATH=`dirname "$CC"`
 if test "$COMPATH" = "." ; then
     AC_PATH_PROGS(COMPATH, $CC)
@@ -6829,6 +6846,18 @@ dnl ====================================
 SYSTEM_GETTEXT=YES
 AC_SUBST(SYSTEM_GETTEXT)
 
+if test "$_os" = "FreeBSD"; then
+    LIBINTL_PREFIX=
+    for dir in $CPPFLAGS; do
+      if dir=`expr -- $dir : '-I\(.*\)'`; then
+        if test -f "$dir/libintl.h" ; then
+          LIBINTL_PREFIX=`dirname $dir`
+        fi
+      fi
+    done
+    AC_SUBST(LIBINTL_PREFIX)
+fi
+
 dnl ===================================================================
 dnl always rely on the system version of pango
 dnl ===================================================================

Modified: openoffice/trunk/main/graphite/makefile.mk
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/graphite/makefile.mk?rev=1694132&r1=1694131&r2=1694132&view=diff
==============================================================================
--- openoffice/trunk/main/graphite/makefile.mk (original)
+++ openoffice/trunk/main/graphite/makefile.mk Wed Aug  5 01:14:28 2015
@@ -92,7 +92,7 @@ CFLAGS4MSC= $(CFLAGS2MSC:s/ -/ $(JUSTASL
 BUILD_FLAGS+= "CFLAGS4MSC=$(CFLAGS4MSC)" /F makefile.vc$(VCNUM) lib_dll
 .ENDIF
 
-.IF "$(COM)"=="GCC"
+.IF "$(COM)"=="GCC" || "$(OS)"=="FREEBSD"
 
 # Does linux want --disable-shared?
 .IF "x$(debug)"!="x"
@@ -137,7 +137,7 @@ OUT2LIB=engine$/release$/*.lib
 OUT2LIB=engine$/src$/.libs$/libgraphite*.a
 .ENDIF
 
-.IF "$(COM)"=="GCC"
+.IF "$(COM)"=="GCC" || "$(OS)"=="FREEBSD"
 BUILD_ACTION=$(GNUMAKE) -j$(EXTMAXPROCESS)
 .ENDIF
 

Modified: openoffice/trunk/main/set_soenv.in
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/set_soenv.in?rev=1694132&r1=1694131&r2=1694132&view=diff
==============================================================================
--- openoffice/trunk/main/set_soenv.in (original)
+++ openoffice/trunk/main/set_soenv.in Wed Aug  5 01:14:28 2015
@@ -358,7 +358,7 @@ elsif ( $platform =~ m/kfreebsd/ )
 }
 elsif ( $platform =~ m/freebsd/ ) 
 {     $BIG_SVX        = "TRUE";
-      $COM            = "GCC";
+      $COM            = "@COM_IS@";
       $COMPATH        = '@COMPATH@' . '/bin'; 
       $CVER           = "C300";
       $GUI            = "UNX";
@@ -1724,6 +1724,11 @@ if ( $platform =~ m/darwin/ )
     ToFile( "MACOSX_DEPLOYMENT_TARGET",       "@MACOSX_DEPLOYMENT_TARGET@",       "e" );
     ToFile( "MACOSX_SDK_PATH",       "@MACOSX_SDK_PATH@",       "e" );
 }
+if ( $platform =~ m/freebsd/ )
+{
+    ToFile( "FBSD_GCC_RPATH",       "@FBSD_GCC_RPATH@", "e" );
+    ToFile( "LIBINTL_PREFIX",       "@LIBINTL_PREFIX@", "e" );
+}
 
 #
 # Writing the variables to file.

Modified: openoffice/trunk/main/solenv/gbuild/platform/freebsd.mk
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/solenv/gbuild/platform/freebsd.mk?rev=1694132&r1=1694131&r2=1694132&view=diff
==============================================================================
--- openoffice/trunk/main/solenv/gbuild/platform/freebsd.mk (original)
+++ openoffice/trunk/main/solenv/gbuild/platform/freebsd.mk Wed Aug  5 01:14:28 2015
@@ -20,7 +20,6 @@
 #*************************************************************************
 
 GUI := UNX
-COM := GCC
 
 # BSD mktemp -t expects a prefix, not a pattern
 gb_MKTEMP ?= /usr/bin/mktemp -t gbuild.
@@ -95,8 +94,12 @@ gb_CXXFLAGS := \
 	-fno-use-cxa-atexit \
 	-fvisibility-inlines-hidden \
 	-fvisibility=hidden \
-	-pipe \
-	-DHAVE_STL_INCLUDE_PATH \
+	-pipe
+ifeq ($(COM),CLANG)
+gb_CXXFLAGS += -DHAVE_STL_INCLUDE_PATH
+else
+gb_CXXFLAGS += -DBOOST_TR1_DISABLE_INCLUDE_NEXT -DBOOST_TR1_GCC_INCLUDE_PATH=c++
+endif
 
 ifneq ($(EXTERNAL_WARNINGS_NOT_ERRORS),TRUE)
 gb_CFLAGS_WERROR := -Werror
@@ -110,7 +113,10 @@ gb_LinkTarget_LDFLAGS := -Wl,--sysroot=$
 endif
 gb_LinkTarget_EXCEPTIONFLAGS := \
 	-DEXCEPTIONS_ON \
-	-fexceptions \
+	-fexceptions
+ifeq ($(COM),GCC)
+gb_LinkTarget_EXCEPTIONFLAGS +=  -fno-enforce-eh-specs
+endif
 
 gb_LinkTarget_NOEXCEPTIONFLAGS := \
 	-DEXCEPTIONS_OFF \
@@ -121,7 +127,7 @@ gb_LinkTarget_LDFLAGS += \
 	-Wl,-z,combreloc \
 	-Wl,-z,defs \
 	$(subst -L../lib , ,$(SOLARLIB)) \
-	${FBSD_LDFLAGS} \
+	${FBSD_GCC_RPATH} \
 	 \
 
 ifeq ($(HAVE_LD_HASH_STYLE),TRUE)

Modified: openoffice/trunk/main/solenv/inc/tg_compv.mk
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/solenv/inc/tg_compv.mk?rev=1694132&r1=1694131&r2=1694132&view=diff
==============================================================================
--- openoffice/trunk/main/solenv/inc/tg_compv.mk (original)
+++ openoffice/trunk/main/solenv/inc/tg_compv.mk Wed Aug  5 01:14:28 2015
@@ -132,9 +132,14 @@ COMNAME=MipsPro
 .ENDIF
 
 .IF "$(COM)"=="CLANG"
+.IF "$(OS)" == "FREEBSD"
+COMID=gcc3
+COMNAME=gcc3
+.ELSE
 COMID=s5abi
 COMNAME=s5abi
 .ENDIF
+.ENDIF
 
 .IF "$(COMNAME)"==""
 

Modified: openoffice/trunk/main/solenv/inc/unx.mk
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/solenv/inc/unx.mk?rev=1694132&r1=1694131&r2=1694132&view=diff
==============================================================================
--- openoffice/trunk/main/solenv/inc/unx.mk (original)
+++ openoffice/trunk/main/solenv/inc/unx.mk Wed Aug  5 01:14:28 2015
@@ -139,7 +139,7 @@
 .INCLUDE : unxbsds.mk
 .ENDIF
 
-.IF "$(COM)$(OS)" == "GCCFREEBSD"
+.IF "$(OS)" == "FREEBSD"
 .INCLUDE : unxfbsd.mk
 .ENDIF
 

Modified: openoffice/trunk/main/solenv/inc/unxfbsd.mk
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/solenv/inc/unxfbsd.mk?rev=1694132&r1=1694131&r2=1694132&view=diff
==============================================================================
--- openoffice/trunk/main/solenv/inc/unxfbsd.mk (original)
+++ openoffice/trunk/main/solenv/inc/unxfbsd.mk Wed Aug  5 01:14:28 2015
@@ -49,7 +49,12 @@ JAVAFLAGSDEBUG=-g
 #LINKOUTPUT_FILTER=" |& $(SOLARENV)/bin/msg_filter"
 
 # _PTHREADS is needed for the stl
-CDEFS+=$(PTHREAD_CFLAGS) -D_PTHREADS -D_REENTRANT -DNEW_SOLAR -D_USE_NAMESPACE=1 -DSTLPORT_VERSION=450 -DHAVE_STL_INCLUDE_PATH
+CDEFS+=$(PTHREAD_CFLAGS) -D_PTHREADS -D_REENTRANT -DNEW_SOLAR -D_USE_NAMESPACE=1 -DSTLPORT_VERSION=450
+.IF "$(COM)"=="CLANG"
+CDEFS+=-DHAVE_STL_INCLUDE_PATH
+.ELSE
+CDEFS+=-DBOOST_TR1_DISABLE_INCLUDE_NEXT -DBOOST_TR1_GCC_INCLUDE_PATH=c++
+.ENDIF
 
 # enable visibility define in "sal/types.h"
 .IF "$(HAVE_GCC_VISIBILITY_FEATURE)" == "TRUE"
@@ -88,7 +93,11 @@ CFLAGSENABLESYMBOLS=-g # was temporarily
 # flags for the C++ Compiler
 CFLAGSCC= -pipe $(ARCH_FLAGS) 
 # Flags for enabling exception handling
+.IF "$(COM)"=="CLANG"
 CFLAGSEXCEPTIONS=-fexceptions
+.ELSE
+CFLAGSEXCEPTIONS=-fexceptions -fno-enforce-eh-specs
+.ENDIF
 # Flags for disabling exception handling
 CFLAGS_NO_EXCEPTIONS=-fno-exceptions
 
@@ -199,11 +208,11 @@ STDSHLCUIMT+=-ltcmalloc
 .ENDIF
 
 # libraries for linking applications
-STDLIBGUIMT+=-Wl,--as-needed $(PTHREAD_LIBS) -lm -Wl,--no-as-needed ${FBSD_LDFLAGS}
-STDLIBCUIMT+=-Wl,--as-needed $(PTHREAD_LIBS) -lm -Wl,--no-as-needed ${FBSD_LDFLAGS}
+STDLIBGUIMT+=-Wl,--as-needed $(PTHREAD_LIBS) -lm -Wl,--no-as-needed ${FBSD_GCC_RPATH}
+STDLIBCUIMT+=-Wl,--as-needed $(PTHREAD_LIBS) -lm -Wl,--no-as-needed ${FBSD_GCC_RPATH}
 # libraries for linking shared libraries
-STDSHLGUIMT+=-Wl,--as-needed $(PTHREAD_LIBS) -lm -Wl,--no-as-needed ${FBSD_LDFLAGS}
-STDSHLCUIMT+=-Wl,--as-needed $(PTHREAD_LIBS) -lm -Wl,--no-as-needed ${FBSD_LDFLAGS}
+STDSHLGUIMT+=-Wl,--as-needed $(PTHREAD_LIBS) -lm -Wl,--no-as-needed ${FBSD_GCC_RPATH}
+STDSHLCUIMT+=-Wl,--as-needed $(PTHREAD_LIBS) -lm -Wl,--no-as-needed ${FBSD_GCC_RPATH}
 
 X11LINK_DYNAMIC = -Wl,--as-needed -lXext -lX11 -Wl,--no-as-needed
 

Modified: openoffice/trunk/main/testtools/source/bridgetest/bridgetest.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/testtools/source/bridgetest/bridgetest.cxx?rev=1694132&r1=1694131&r2=1694132&view=diff
==============================================================================
--- openoffice/trunk/main/testtools/source/bridgetest/bridgetest.cxx (original)
+++ openoffice/trunk/main/testtools/source/bridgetest/bridgetest.cxx Wed Aug  5 01:14:28 2015
@@ -544,7 +544,12 @@ static sal_Bool performTest(
             } catch (...) {
                 bRet &= check(false, "getRaiseAttr2 threw wrong type");
             }
-#ifndef OS2 // see i120310 for details
+#if !defined(OS2) && !(defined(FREEBSD) && defined(INTEL))
+// see i120310 for OS2 details
+// FreeBSD i386 coredumps on this test in cpp_vtable_call():
+//  pTypeDescr appears to point to garbage, pMapFunctionIndexToMemberIndex
+//  points to unreadable memory, as does abase.pTypeName.  Refcounts
+//  don't look reasonable, etc.
             // Test instantiated polymorphic struct types:
             {
                 bRet &= check(

Modified: openoffice/trunk/main/testtools/source/bridgetest/makefile.mk
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/testtools/source/bridgetest/makefile.mk?rev=1694132&r1=1694131&r2=1694132&view=diff
==============================================================================
--- openoffice/trunk/main/testtools/source/bridgetest/makefile.mk (original)
+++ openoffice/trunk/main/testtools/source/bridgetest/makefile.mk Wed Aug  5 01:14:28 2015
@@ -134,8 +134,8 @@ ALLTAR: \
 
 runtest : $(DLLDEST)$/uno_types.rdb $(DLLDEST)$/uno_services.rdb makefile.mk \
         $(SHL1TARGETN) $(SHL2TARGETN) $(SHL3TARGETN)
-.IF "$(COM)$(OS)$(CPU)" == "GCCMACOSXP" || "$(COM)$(OS)$(CPU)" == "GCCFREEBSDI" || "$(OS)$(CPU)"=="SOLARISS"
-	@echo "Mac OSX PPC GCC ad FreeBDS/i386 fails this test! likely broken UNO bridge. Fix me."
+.IF "$(COM)$(OS)$(CPU)" == "GCCMACOSXP" || "$(OS)$(CPU)"=="SOLARISS"
+	@echo "Mac OSX PPC GCC and Solaris fails this test! likely broken UNO bridge. Fix me."
 .ELSE
         cd $(DLLDEST) && $(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/uno \
 		-ro uno_services.rdb -ro uno_types.rdb \