pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pkg/54826: pkgsrc-2019Q4 libreoffice build failure on NetBSD/i386 9.0_RC1



>Number:         54826
>Category:       pkg
>Synopsis:       pkgsrc-2019Q4 libreoffice build failure on NetBSD/i386 9.0_RC1
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Jan 02 21:15:00 +0000 2020
>Originator:     Izumi Tsutsui
>Release:        NetBSD 9.0_RC1
>Organization:
>Environment:
System: NetBSD mirage 9.0_RC1 NetBSD 9.0_RC1 (GENERIC) #11: Thu Jan 2 14:19:17 JST 2020 tsutsui@mirage:/s/netbsd-9/src/sys/arch/i386/compile/GENERIC i386
Architecture: i386
Machine: i386
>Description:
There two problems.

(1) 64bit atomic ops

configure fails:
---
checking whether c++ supports C++17... yes (-std=gnu++17)
checking whether std::atomic can be used without link library... no
checking whether std::atomic needs -latomic... no
configure: error: in `/s/obj.i386/pkgsrc/misc/libreoffice/work.i386/libreoffice-6.3.3.2':
configure: error: cannot figure our how to use std::atomic
See `config.log' for more details
Error running configure at /s/obj.i386/pkgsrc/misc/libreoffice/work.i386/libreoffice-6.3.3.2/autogen.sh line 302.
*** Error code 25

Stop.
make[2]: stopped in /usr/pkgsrc/misc/libreoffice
*** Error code 1
---

(2) memalign not found

Even after (1) is workarounded, the next error is:
---
[build DEP] LNK:Executable/gengal.bin
[build LNK] Executable/gengal.bin
ld: /s/obj.i386/pkgsrc/misc/libreoffice/work.i386/libreoffice-6.3.3.2/instdir/program/libpdfiumlo.so: undefined reference to `memalign'
gmake[1]: *** [/s/obj.i386/pkgsrc/misc/libreoffice/work.i386/libreoffice-6.3.3.2/svx/Executable_gengal.mk:20: /s/obj.i386/pkgsrc/misc/libreoffice/work.i386/libreoffice-6.3.3.2/instdir/program/gengal.bin] Error 1
gmake: *** [Makefile:167: Executable_gengal] Error 2
*** Error code 2

Stop.
make[1]: stopped in /usr/pkgsrc/misc/libreoffice
*** Error code 1
---

>How-To-Repeat:
Build pkgsrc-2019Q4 misc/libreoffice on NetBSD/i386 9.0_RC1

>Fix:
(1) 64bit atomic ops

Adding "-march=i386" to CXXFLAGS works around,
as pkgsrc/www/firefox/mozilla.mk does.

---
Index: Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/misc/libreoffice/Makefile,v
retrieving revision 1.215
diff -u -p -r1.215 Makefile
--- Makefile	1 Dec 2019 04:59:43 -0000	1.215
+++ Makefile	2 Jan 2020 19:57:55 -0000
@@ -263,6 +263,11 @@ BUILD_MAKE_FLAGS+=	VERBOSE=true
 BUILDLINK_TRANSFORM+=	rm:-ldl
 .endif
 
+.if ${MACHINE_ARCH} == "i386"
+# For 64 bit atomic ops
+CXXFLAGS+=		-march=i586
+.endif
+
 INSTALLATION_DIRS=	bin share/applications
 
 .PHONY: debugrun
---

(2) memalign not found

The problem is the following definitions in
external/pdfium/third_party/libopenjpeg20/opj_malloc.h:

---
  #elif defined(__FreeBSD__)
    #define HAVE_POSIX_MEMALIGN
  /* Linux x86_64 and OSX always align allocations to 16 bytes */
  #elif !defined(__amd64__) && !defined(__APPLE__) && !defined(_AIX)
    #define HAVE_MEMALIGN*** Error code 1
---

This why there is no problem on NetBSD/amd64 9.0_RC1.

The following change to pkgsrc.patch.1 works around.

Index: patches/patch-external_pdfium_pkgsrc.patch.1
===================================================================
RCS file: /cvsroot/pkgsrc/misc/libreoffice/patches/patch-external_pdfium_pkgsrc.patch.1,v
retrieving revision 1.3
diff -u -p -r1.3 patch-external_pdfium_pkgsrc.patch.1
--- patches/patch-external_pdfium_pkgsrc.patch.1	15 Nov 2019 13:26:02 -0000	1.3
+++ patches/patch-external_pdfium_pkgsrc.patch.1	2 Jan 2020 19:57:59 -0000
@@ -4,9 +4,9 @@ $NetBSD: patch-external_pdfium_pkgsrc.pa
 * Do no conflict with FreeType 2.10.1 from pkgsrc
 * Add pkgsrc font path
 
---- external/pdfium/pkgsrc.patch.1.orig	2019-10-18 00:59:38.822575812 +0000
+--- external/pdfium/pkgsrc.patch.1.orig	2020-01-02 11:52:46.713477239 +0000
 +++ external/pdfium/pkgsrc.patch.1
-@@ -0,0 +1,54 @@
+@@ -0,0 +1,65 @@
 +--- pdfium/core/fxcrt/cfx_fileaccess_posix.h.orig	2019-05-10 17:07:53.000000000 +0000
 ++++ pdfium/core/fxcrt/cfx_fileaccess_posix.h
 +@@ -12,7 +12,7 @@
@@ -61,3 +61,14 @@ $NetBSD: patch-external_pdfium_pkgsrc.pa
 +   }
 +   return std::move(pInfo);
 + }
++--- pdfium/third_party/libopenjpeg20/opj_malloc.h.orig	2019-05-10 17:07:53.000000000 +0000
+++++ pdfium/third_party/libopenjpeg20/opj_malloc.h
++@@ -98,7 +98,7 @@ Allocate memory aligned to a 16 byte bou
++ #else /* Not _WIN32 */
++   #if defined(__sun)
++     #define HAVE_MEMALIGN
++-  #elif defined(__FreeBSD__)
+++  #elif defined(__FreeBSD__) || defined(__NetBSD__)
++     #define HAVE_POSIX_MEMALIGN
++   /* Linux x86_64 and OSX always align allocations to 16 bytes */
++   #elif !defined(__amd64__) && !defined(__APPLE__) && !defined(_AIX)

---
Izumi Tsutsui



Home | Main Index | Thread Index | Old Index