NetBSD Problem Report #53268

From www@NetBSD.org  Mon May  7 14:46:03 2018
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 5562C7A1B7
	for <gnats-bugs@gnats.NetBSD.org>; Mon,  7 May 2018 14:46:03 +0000 (UTC)
Message-Id: <20180507144601.D752B7A1FB@mollari.NetBSD.org>
Date: Mon,  7 May 2018 14:46:01 +0000 (UTC)
From: nervoso@k1.com.br
Reply-To: nervoso@k1.com.br
To: gnats-bugs@NetBSD.org
Subject: libreoffice does not build with clang
X-Send-Pr-Version: www-1.0

>Number:         53268
>Category:       pkg
>Synopsis:       libreoffice does not build with clang
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    ryoon
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon May 07 14:50:00 +0000 2018
>Last-Modified:  Tue May 08 09:40:37 +0000 2018
>Originator:     sergio lenzi
>Release:        8.0 rc1, and all clang built netbsd
>Organization:
K1 sistemas
>Environment:
NetBSD netbsd.netbsd 8.0_RC1 NetBSD 8.0_RC1 (LZT) #0: Sat May  5 02:36:38 BRT 2018  NetBSD@VMS.lenzicasa:/home/NetBSD/BUILD/8.0/i386-clang/obj/sys/arch/i386/compile/GENERIC i386
>Description:
Clang does not have some builtins in the bridges/source/cpp_uno/gcc3_linux_intel/uno2cpp.cxx so it fails on build
>How-To-Repeat:
in /etc/mk.conf
USE_NATIVE_GCC=         yes
CC=                     clang
PKGSRC_COMPILER=        clang
CLANGBASE=              /usr
HAVE_LLVM=              yes

than 
cd /usr/pkgsrc/misc/libreoffice
make
>Fix:
patch on /usr/pkgsrc/misc/libreoffice


Index: distinfo
===================================================================
RCS file: /cvsroot/pkgsrc/misc/libreoffice/distinfo,v
retrieving revision 1.52
diff -u -r1.52 distinfo
--- distinfo	17 Mar 2018 01:19:25 -0000	1.52
+++ distinfo	7 May 2018 14:02:55 -0000
@@ -206,7 +206,7 @@
 Size (libreoffice/xmlsec1-1.2.25.tar.gz) = 1839160 bytes
 SHA1 (patch-Makefile.in) = 5bb39185b12d57b69c72771a3afc214ac243e694
 SHA1 (patch-autogen.sh) = eedd0091745cf6a32ee9b33227502baaa661270e
-SHA1 (patch-bridges_source_cpp__uno_gcc3__linux__intel_share.hxx) = c1f5a013b88e847dd9ecfb4e4abe78b1b5965a0b
+SHA1 (patch-bridges_source_cpp__uno_gcc3__linux__intel_share.hxx) = 21a2ebf7577a3644d58055c3ab0bef373f336a7c
 SHA1 (patch-bridges_source_cpp__uno_gcc3__linux__x86-64_share.hxx) = f7eaf2748c66a27a772fdbdb370a4c6b3bdafca4
 SHA1 (patch-configure.ac) = 13024963b8d5ee21b2b8268bf6e1d442e5838454
 SHA1 (patch-desktop_scripts_soffice.sh) = b5b2ccf7830d160fd4a1bb087610a1b766b25f08
Index: patches/patch-bridges_source_cpp__uno_gcc3__linux__intel_share.hxx
===================================================================
RCS file: /cvsroot/pkgsrc/misc/libreoffice/patches/patch-bridges_source_cpp__uno_gcc3__linux__intel_share.hxx,v
retrieving revision 1.1
diff -u -r1.1 patch-bridges_source_cpp__uno_gcc3__linux__intel_share.hxx
--- patches/patch-bridges_source_cpp__uno_gcc3__linux__intel_share.hxx	24 Dec 2016 21:45:03 -0000	1.1
+++ patches/patch-bridges_source_cpp__uno_gcc3__linux__intel_share.hxx	7 May 2018 14:02:55 -0000
@@ -1,11 +1,40 @@
-$NetBSD: patch-bridges_source_cpp__uno_gcc3__linux__intel_share.hxx,v 1.1 2016/12/24 21:45:03 ryoon Exp $
-
---- bridges/source/cpp_uno/gcc3_linux_intel/share.hxx.orig	2016-12-23 11:16:40.411146983 +0000
-+++ bridges/source/cpp_uno/gcc3_linux_intel/share.hxx
-@@ -35,6 +35,15 @@
+diff -up bridges/source/cpp_uno/gcc3_linux_intel/share.hxx.orig bridges/source/cpp_uno/gcc3_linux_intel/share.hxx
+--- bridges/source/cpp_uno/gcc3_linux_intel/share.hxx.orig	2017-10-25 08:10:14.232665480 -0200
++++ bridges/source/cpp_uno/gcc3_linux_intel/share.hxx	2017-10-25 08:26:59.633720525 -0200
+@@ -33,10 +33,43 @@
+ #include <uno/any2.h>
+ #include "uno/mapping.h"

- namespace CPPU_CURRENT_NAMESPACE
+-namespace CPPU_CURRENT_NAMESPACE
++#ifdef __clang__
++
++namespace __cxxabiv1
  {
++    struct __class_type_info : public std::type_info
++    {
++        explicit __class_type_info( const char *__n ) : type_info( __n ) { }
++        virtual ~__class_type_info();
++    };
++
++    struct __si_class_type_info : public __class_type_info
++    {
++        explicit __si_class_type_info( const char *__n, const __class_type_info *__b ) :
++            __class_type_info( __n ), __base_type( __b ) { }
++        virtual ~__si_class_type_info();
++        const __class_type_info *__base_type;
++    };
+ 
+-void dummy_can_throw_anything( char const * );
++extern "C" void *__cxa_allocate_exception( std::size_t thrown_size ) _NOEXCEPT;
++
++extern "C" _LIBCPP_NORETURN void __cxa_throw(
++    void *thrown_exception, std::type_info *tinfo, void (*dest) (void *) );
++}
++
++#else
++
++namespace CPPU_CURRENT_NAMESPACE
++{
 +#if defined(__NetBSD__)
 +struct _Unwind_Exception
 +{
@@ -16,5 +45,47 @@
 +} __attribute__((__aligned__));
 +#endif

- void dummy_can_throw_anything( char const * );
+ // ----- following decl from libstdc++-v3/libsupc++/unwind-cxx.h
+ 
+@@ -98,6 +131,8 @@ extern "C" void __cxa_throw(
+ }
+ #endif
+ 
++#endif
++
+ extern "C" void privateSnippetExecutorGeneral();
+ extern "C" void privateSnippetExecutorVoid();
+ extern "C" void privateSnippetExecutorHyper();
+@@ -108,12 +143,17 @@ extern "C" void privateSnippetExecutorCl
+ namespace CPPU_CURRENT_NAMESPACE
+ {
+ 
++void dummy_can_throw_anything( char const * );
++
+ void raiseException(
+     uno_Any * pUnoExc, uno_Mapping * pUno2Cpp );
+ 
+ void fillUnoException(
++#ifdef __clang__
++    __cxxabiv1::__cxa_exception * header, uno_Any *, uno_Mapping * pCpp2Uno );
++#else
+     __cxa_exception * header, uno_Any *, uno_Mapping * pCpp2Uno );
+-
++#endif
+ }
+ 
+ namespace x86
+diff -up bridges/source/cpp_uno/gcc3_linux_intel/uno2cpp.cxx.orig bridges/source/cpp_uno/gcc3_linux_intel/uno2cpp.cxx
+--- bridges/source/cpp_uno/gcc3_linux_intel/uno2cpp.cxx.orig	2017-10-25 08:36:13.618435875 -0200
++++ bridges/source/cpp_uno/gcc3_linux_intel/uno2cpp.cxx	2017-10-25 08:46:18.835501168 -0200
+@@ -198,8 +198,8 @@ static void cpp_call(
+      catch (...)
+      {
+          // fill uno exception
+-         fillUnoException(
+-             reinterpret_cast< CPPU_CURRENT_NAMESPACE::__cxa_eh_globals * >(
++         gcc3::fillUnoException(
++             reinterpret_cast< __cxxabiv1::__cxa_eh_globals * >(
+                  __cxxabiv1::__cxa_get_globals())->caughtExceptions,
+              *ppUnoExc, pThis->getBridge()->getCpp2Uno());


>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: pkg-manager->ryoon
Responsible-Changed-By: bsiegert@NetBSD.org
Responsible-Changed-When: Tue, 08 May 2018 09:40:37 +0000
Responsible-Changed-Why:
Over to maintainer.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.