Potential cad/qcad sparc64 fix

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Potential cad/qcad sparc64 fix

Ingo Feinerer-2
Hi,

according to
http://build-failures.rhaalovely.net//sparc64/2019-08-18/cad/qcad.log
cad/qcad compilation fails on sparc64 with

cc1plus: error: one or more PCH files were found, but they were invalid
cc1plus: error: use -Winvalid-pch for more information
cc1plus: fatal error: qcadecmaapi: No such file or directory

My guess (I do not have a sparc64 system for testing) is that following
diff (see below) might fix this.

PCH files are PreCompiled Headers in Qt-land
(https://doc.qt.io/qt-5/qmake-precompiledheaders.html) which work only
"on some platforms and build environments". As NetBSD and FreeBSD ports
have a similar patch I hope this is the right fix.

Anyone willing with a sparc64 to test this?

Best regards,
Ingo

Index: Makefile
===================================================================
RCS file: /cvs/ports/cad/qcad/Makefile,v
retrieving revision 1.34
diff -u -p -r1.34 Makefile
--- Makefile 14 Aug 2019 06:56:50 -0000 1.34
+++ Makefile 22 Aug 2019 10:27:47 -0000
@@ -5,6 +5,7 @@ COMMENT = Qt-based 2D CAD system
 GH_ACCOUNT = qcad
 GH_PROJECT = qcad
 GH_TAGNAME = v3.23.0.0
+REVISION = 0
 
 SO_VERSION = 0.0
 QCAD_LIBS = qcadcore \
Index: patches/patch-src_scripting_ecmaapi_ecmaapi_pro
===================================================================
RCS file: patches/patch-src_scripting_ecmaapi_ecmaapi_pro
diff -N patches/patch-src_scripting_ecmaapi_ecmaapi_pro
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_scripting_ecmaapi_ecmaapi_pro 22 Aug 2019 10:27:47 -0000
@@ -0,0 +1,13 @@
+$OpenBSD$
+
+Index: src/scripting/ecmaapi/ecmaapi.pro
+--- src/scripting/ecmaapi/ecmaapi.pro.orig
++++ src/scripting/ecmaapi/ecmaapi.pro
+@@ -4,7 +4,6 @@ CONFIG += plugin
+ TARGET = $${RLIBNAME}ecmaapi
+ CONFIG -= warn_on
+ CONFIG += warn_off
+-CONFIG += precompile_header
+ PRECOMPILED_HEADER = stable.h
+ OTHER_FILES += ecmaapi.dox
+ DEFINES += QCADECMAAPI_LIBRARY

Reply | Threaded
Open this post in threaded view
|

Re: Potential cad/qcad sparc64 fix

kmos
On Thu, Aug 22, 2019 at 12:35:28PM +0200, Ingo Feinerer wrote:

> according to
> http://build-failures.rhaalovely.net//sparc64/2019-08-18/cad/qcad.log
> cad/qcad compilation fails on sparc64 with

> cc1plus: error: one or more PCH files were found, but they were invalid
> cc1plus: error: use -Winvalid-pch for more information
> cc1plus: fatal error: qcadecmaapi: No such file or directory

> My guess (I do not have a sparc64 system for testing) is that following
> diff (see below) might fix this.

> PCH files are PreCompiled Headers in Qt-land
> (https://doc.qt.io/qt-5/qmake-precompiledheaders.html) which work only
> "on some platforms and build environments". As NetBSD and FreeBSD ports
> have a similar patch I hope this is the right fix.

> Anyone willing with a sparc64 to test this?

It took all day on my sparc64, but unfortunately, it died at the end.

Can be seen at http://www.se.rit.edu/~kurt/qcad-error.txt

--Kurt

Reply | Threaded
Open this post in threaded view
|

Re: Potential cad/qcad sparc64 fix

Ingo Feinerer-2
On Thu, Aug 22, 2019 at 06:41:46PM -0400, Kurt Mosiejczuk wrote:

> On Thu, Aug 22, 2019 at 12:35:28PM +0200, Ingo Feinerer wrote:
> > according to
> > http://build-failures.rhaalovely.net//sparc64/2019-08-18/cad/qcad.log
> > cad/qcad compilation fails on sparc64 with
>
> > cc1plus: error: one or more PCH files were found, but they were invalid
> > cc1plus: error: use -Winvalid-pch for more information
> > cc1plus: fatal error: qcadecmaapi: No such file or directory
>
> > My guess (I do not have a sparc64 system for testing) is that following
> > diff (see below) might fix this.
>
> > PCH files are PreCompiled Headers in Qt-land
> > (https://doc.qt.io/qt-5/qmake-precompiledheaders.html) which work only
> > "on some platforms and build environments". As NetBSD and FreeBSD ports
> > have a similar patch I hope this is the right fix.
>
> > Anyone willing with a sparc64 to test this?
>
> It took all day on my sparc64, but unfortunately, it died at the end.
>
> Can be seen at http://www.se.rit.edu/~kurt/qcad-error.txt

Thanks a lot! This confirms that the first diff fixes the original
problem.

Below is a new diff that (hopefully) addresses all problems.

OK?

Index: Makefile
===================================================================
RCS file: /cvs/ports/cad/qcad/Makefile,v
retrieving revision 1.34
diff -u -p -r1.34 Makefile
--- Makefile 14 Aug 2019 06:56:50 -0000 1.34
+++ Makefile 23 Aug 2019 11:46:06 -0000
@@ -5,6 +5,7 @@ COMMENT = Qt-based 2D CAD system
 GH_ACCOUNT = qcad
 GH_PROJECT = qcad
 GH_TAGNAME = v3.23.0.0
+REVISION = 0
 
 SO_VERSION = 0.0
 QCAD_LIBS = qcadcore \
Index: patches/patch-src_3rdparty_opennurbs_opennurbs_zlib_cpp
===================================================================
RCS file: patches/patch-src_3rdparty_opennurbs_opennurbs_zlib_cpp
diff -N patches/patch-src_3rdparty_opennurbs_opennurbs_zlib_cpp
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_3rdparty_opennurbs_opennurbs_zlib_cpp 23 Aug 2019 11:46:06 -0000
@@ -0,0 +1,61 @@
+$OpenBSD$
+
+Index: src/3rdparty/opennurbs/opennurbs_zlib.cpp
+--- src/3rdparty/opennurbs/opennurbs_zlib.cpp.orig
++++ src/3rdparty/opennurbs/opennurbs_zlib.cpp
+@@ -293,11 +293,11 @@ size_t ON_BinaryArchive::WriteDeflate( // returns numb
+       // no uncompressed input is left - switch to finish mode
+       flush = Z_FINISH;
+     }
+-    zrc = z_deflate( &m_zlib.strm, flush );
++    zrc = deflate( &m_zlib.strm, flush );
+     if ( zrc < 0 )
+     {
+       // Something went haywire - bail out.
+-      ON_ERROR("ON_BinaryArchive::WriteDeflate - z_deflate failure");
++      ON_ERROR("ON_BinaryArchive::WriteDeflate - deflate failure");
+       rc = false;
+       break;
+     }
+@@ -491,11 +491,11 @@ bool ON_BinaryArchive::ReadInflate(
+       // no compressed input is left - switch to finish mode
+       flush = Z_FINISH;
+     }
+-    zrc = z_inflate( &m_zlib.strm, flush );
++    zrc = inflate( &m_zlib.strm, flush );
+     if ( zrc < 0 )
+     {
+       // Something went haywire - bail out.
+-      ON_ERROR("ON_BinaryArchive::ReadInflate - z_inflate failure");
++      ON_ERROR("ON_BinaryArchive::ReadInflate - inflate failure");
+       rc = false;
+       break;
+     }
+@@ -1151,11 +1151,11 @@ size_t ON_CompressedBuffer::DeflateHelper( // returns
+       // no uncompressed input is left - switch to finish mode
+       flush = Z_FINISH;
+     }
+-    zrc = z_deflate( &m_zlib.strm, flush );
++    zrc = deflate( &m_zlib.strm, flush );
+     if ( zrc < 0 )
+     {
+       // Something went haywire - bail out.
+-      ON_ERROR("ON_CompressedBuffer::DeflateHelper - z_deflate failure");
++      ON_ERROR("ON_CompressedBuffer::DeflateHelper - deflate failure");
+       rc = false;
+       break;
+     }
+@@ -1284,11 +1284,11 @@ bool ON_CompressedBuffer::InflateHelper(
+       // no compressed input is left - switch to finish mode
+       flush = Z_FINISH;
+     }
+-    zrc = z_inflate( &m_zlib.strm, flush );
++    zrc = inflate( &m_zlib.strm, flush );
+     if ( zrc < 0 )
+     {
+       // Something went haywire - bail out.
+-      ON_ERROR("ON_CompressedBuffer::InflateHelper - z_inflate failure");
++      ON_ERROR("ON_CompressedBuffer::InflateHelper - inflate failure");
+       rc = false;
+       break;
+     }
Index: patches/patch-src_3rdparty_opennurbs_opennurbs_zlib_h
===================================================================
RCS file: patches/patch-src_3rdparty_opennurbs_opennurbs_zlib_h
diff -N patches/patch-src_3rdparty_opennurbs_opennurbs_zlib_h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_3rdparty_opennurbs_opennurbs_zlib_h 23 Aug 2019 11:46:06 -0000
@@ -0,0 +1,23 @@
+$OpenBSD$
+
+Index: src/3rdparty/opennurbs/opennurbs_zlib.h
+--- src/3rdparty/opennurbs/opennurbs_zlib.h.orig
++++ src/3rdparty/opennurbs/opennurbs_zlib.h
+@@ -30,7 +30,7 @@
+
+ #if !defined(Z_PREFIX)
+ /* decorates zlib functions with a "z_" prefix to prevent symbol collision. */
+-#define Z_PREFIX
++//#define Z_PREFIX
+ #endif
+
+ #if !defined(MY_ZCALLOC)
+@@ -38,7 +38,7 @@
+ //#define MY_ZCALLOC
+ #endif
+
+-#include "./zlib/zlib.h"
++#include <zlib.h>
+
+ ON_BEGIN_EXTERNC
+ voidpf zcalloc (voidpf, unsigned, unsigned);
Index: patches/patch-src_scripting_ecmaapi_ecmaapi_pro
===================================================================
RCS file: patches/patch-src_scripting_ecmaapi_ecmaapi_pro
diff -N patches/patch-src_scripting_ecmaapi_ecmaapi_pro
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_scripting_ecmaapi_ecmaapi_pro 23 Aug 2019 11:46:06 -0000
@@ -0,0 +1,13 @@
+$OpenBSD$
+
+Index: src/scripting/ecmaapi/ecmaapi.pro
+--- src/scripting/ecmaapi/ecmaapi.pro.orig
++++ src/scripting/ecmaapi/ecmaapi.pro
+@@ -4,7 +4,6 @@ CONFIG += plugin
+ TARGET = $${RLIBNAME}ecmaapi
+ CONFIG -= warn_on
+ CONFIG += warn_off
+-CONFIG += precompile_header
+ PRECOMPILED_HEADER = stable.h
+ OTHER_FILES += ecmaapi.dox
+ DEFINES += QCADECMAAPI_LIBRARY

Reply | Threaded
Open this post in threaded view
|

Re: Potential cad/qcad sparc64 fix

kmos
On Fri, Aug 23, 2019 at 01:51:42PM +0200, Ingo Feinerer wrote:

> Below is a new diff that (hopefully) addresses all problems.

> OK?

It worked. The build finished this time. OK kmos

--Kurt

> Index: Makefile
> ===================================================================
> RCS file: /cvs/ports/cad/qcad/Makefile,v
> retrieving revision 1.34
> diff -u -p -r1.34 Makefile
> --- Makefile 14 Aug 2019 06:56:50 -0000 1.34
> +++ Makefile 23 Aug 2019 11:46:06 -0000
> @@ -5,6 +5,7 @@ COMMENT = Qt-based 2D CAD system
>  GH_ACCOUNT = qcad
>  GH_PROJECT = qcad
>  GH_TAGNAME = v3.23.0.0
> +REVISION = 0
>  
>  SO_VERSION = 0.0
>  QCAD_LIBS = qcadcore \
> Index: patches/patch-src_3rdparty_opennurbs_opennurbs_zlib_cpp
> ===================================================================
> RCS file: patches/patch-src_3rdparty_opennurbs_opennurbs_zlib_cpp
> diff -N patches/patch-src_3rdparty_opennurbs_opennurbs_zlib_cpp
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ patches/patch-src_3rdparty_opennurbs_opennurbs_zlib_cpp 23 Aug 2019 11:46:06 -0000
> @@ -0,0 +1,61 @@
> +$OpenBSD$
> +
> +Index: src/3rdparty/opennurbs/opennurbs_zlib.cpp
> +--- src/3rdparty/opennurbs/opennurbs_zlib.cpp.orig
> ++++ src/3rdparty/opennurbs/opennurbs_zlib.cpp
> +@@ -293,11 +293,11 @@ size_t ON_BinaryArchive::WriteDeflate( // returns numb
> +       // no uncompressed input is left - switch to finish mode
> +       flush = Z_FINISH;
> +     }
> +-    zrc = z_deflate( &m_zlib.strm, flush );
> ++    zrc = deflate( &m_zlib.strm, flush );
> +     if ( zrc < 0 )
> +     {
> +       // Something went haywire - bail out.
> +-      ON_ERROR("ON_BinaryArchive::WriteDeflate - z_deflate failure");
> ++      ON_ERROR("ON_BinaryArchive::WriteDeflate - deflate failure");
> +       rc = false;
> +       break;
> +     }
> +@@ -491,11 +491,11 @@ bool ON_BinaryArchive::ReadInflate(
> +       // no compressed input is left - switch to finish mode
> +       flush = Z_FINISH;
> +     }
> +-    zrc = z_inflate( &m_zlib.strm, flush );
> ++    zrc = inflate( &m_zlib.strm, flush );
> +     if ( zrc < 0 )
> +     {
> +       // Something went haywire - bail out.
> +-      ON_ERROR("ON_BinaryArchive::ReadInflate - z_inflate failure");
> ++      ON_ERROR("ON_BinaryArchive::ReadInflate - inflate failure");
> +       rc = false;
> +       break;
> +     }
> +@@ -1151,11 +1151,11 @@ size_t ON_CompressedBuffer::DeflateHelper( // returns
> +       // no uncompressed input is left - switch to finish mode
> +       flush = Z_FINISH;
> +     }
> +-    zrc = z_deflate( &m_zlib.strm, flush );
> ++    zrc = deflate( &m_zlib.strm, flush );
> +     if ( zrc < 0 )
> +     {
> +       // Something went haywire - bail out.
> +-      ON_ERROR("ON_CompressedBuffer::DeflateHelper - z_deflate failure");
> ++      ON_ERROR("ON_CompressedBuffer::DeflateHelper - deflate failure");
> +       rc = false;
> +       break;
> +     }
> +@@ -1284,11 +1284,11 @@ bool ON_CompressedBuffer::InflateHelper(
> +       // no compressed input is left - switch to finish mode
> +       flush = Z_FINISH;
> +     }
> +-    zrc = z_inflate( &m_zlib.strm, flush );
> ++    zrc = inflate( &m_zlib.strm, flush );
> +     if ( zrc < 0 )
> +     {
> +       // Something went haywire - bail out.
> +-      ON_ERROR("ON_CompressedBuffer::InflateHelper - z_inflate failure");
> ++      ON_ERROR("ON_CompressedBuffer::InflateHelper - inflate failure");
> +       rc = false;
> +       break;
> +     }
> Index: patches/patch-src_3rdparty_opennurbs_opennurbs_zlib_h
> ===================================================================
> RCS file: patches/patch-src_3rdparty_opennurbs_opennurbs_zlib_h
> diff -N patches/patch-src_3rdparty_opennurbs_opennurbs_zlib_h
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ patches/patch-src_3rdparty_opennurbs_opennurbs_zlib_h 23 Aug 2019 11:46:06 -0000
> @@ -0,0 +1,23 @@
> +$OpenBSD$
> +
> +Index: src/3rdparty/opennurbs/opennurbs_zlib.h
> +--- src/3rdparty/opennurbs/opennurbs_zlib.h.orig
> ++++ src/3rdparty/opennurbs/opennurbs_zlib.h
> +@@ -30,7 +30,7 @@
> +
> + #if !defined(Z_PREFIX)
> + /* decorates zlib functions with a "z_" prefix to prevent symbol collision. */
> +-#define Z_PREFIX
> ++//#define Z_PREFIX
> + #endif
> +
> + #if !defined(MY_ZCALLOC)
> +@@ -38,7 +38,7 @@
> + //#define MY_ZCALLOC
> + #endif
> +
> +-#include "./zlib/zlib.h"
> ++#include <zlib.h>
> +
> + ON_BEGIN_EXTERNC
> + voidpf zcalloc (voidpf, unsigned, unsigned);
> Index: patches/patch-src_scripting_ecmaapi_ecmaapi_pro
> ===================================================================
> RCS file: patches/patch-src_scripting_ecmaapi_ecmaapi_pro
> diff -N patches/patch-src_scripting_ecmaapi_ecmaapi_pro
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ patches/patch-src_scripting_ecmaapi_ecmaapi_pro 23 Aug 2019 11:46:06 -0000
> @@ -0,0 +1,13 @@
> +$OpenBSD$
> +
> +Index: src/scripting/ecmaapi/ecmaapi.pro
> +--- src/scripting/ecmaapi/ecmaapi.pro.orig
> ++++ src/scripting/ecmaapi/ecmaapi.pro
> +@@ -4,7 +4,6 @@ CONFIG += plugin
> + TARGET = $${RLIBNAME}ecmaapi
> + CONFIG -= warn_on
> + CONFIG += warn_off
> +-CONFIG += precompile_header
> + PRECOMPILED_HEADER = stable.h
> + OTHER_FILES += ecmaapi.dox
> + DEFINES += QCADECMAAPI_LIBRARY
>