pkgsrc-Bugs archive

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

pkg/54499: databases/gigabase build on macosx



>Number:         54499
>Category:       pkg
>Synopsis:       databases/gigabase build on macosx
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Aug 28 14:25:00 +0000 2019
>Originator:     clement bouvier
>Release:        current
>Organization:
>Environment:
macOS mojave 10.14.6
>Description:
database/gigabase does not build on macosx.

After making __APPLE__ preprocessor correct on different files.
Some tests files cannot be built:

testddl.cpp:105:1: error: call to constructor of 'dbUserFunction' is ambiguous
USER_FUNC(sin);
^~~~~~~~~~~~~~
./query.h:712:44: note: expanded from macro 'USER_FUNC'
#define USER_FUNC(f) static dbUserFunction f##_descriptor(&f, STRLITERAL(#f))
                                           ^              ~~~~~~~~~~~~~~~~~~
<scratch space>:219:1: note: expanded from here
sin_descriptor
^
./query.h:830:5: note: candidate constructor
    dbUserFunction(real8 (__cdecl *f)(db_int8), char_t* name) {
    ^
./query.h:833:5: note: candidate constructor
    dbUserFunction(real8 (__cdecl *f)(real8), char_t* name) {
    ^
testddl.cpp:106:1: error: call to constructor of 'dbUserFunction' is ambiguous
USER_FUNC(cos);
^~~~~~~~~~~~~~
./query.h:712:44: note: expanded from macro 'USER_FUNC'
#define USER_FUNC(f) static dbUserFunction f##_descriptor(&f, STRLITERAL(#f))

These errors can be also found on smartOS:
http://us-east.manta.joyent.com/pkgsrc/public/reports/upstream-trunk64/20190828.0210/gigabase-3.82/build.log

Also:

testtimeseries.cpp:50:14: error: 'fmax' is missing exception specification 'throw()'
inline float fmax(float x, float y) { return x > y ? x : y; }
             ^
                                    throw()
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/math.h:1217:46: note: previous declaration is here
inline _LIBCPP_INLINE_VISIBILITY float       fmax(float __lcpp_x, float __lcpp_y) _NOEXCEPT             {return ::fmaxf(__lcpp_x, __lcpp_y);}
                                             ^
testtimeseries.cpp:51:14: error: 'fmin' is missing exception specification 'throw()'
inline float fmin(float x, float y) { return x < y ? x : y; }
             ^
                                    throw()
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/math.h:1238:46: note: previous declaration is here
inline _LIBCPP_INLINE_VISIBILITY float       fmin(float __lcpp_x, float __lcpp_y) _NOEXCEPT             {return ::fminf(__lcpp_x, __lcpp_y);}


 
>How-To-Repeat:
build databases/gigabase on macOS or smartOS.
>Fix:
THa package supposes that macOS is a FreeBSD (version 5) like.
But This definition lead to compile error with clang.

In file included from class.cpp:13:
In file included from ./gigabase.h:18:
In file included from ./database.h:14:
In file included from ./class.h:14:
In file included from ./stdtp.h:129:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/stdio.h:102:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/__config:270:12: fatal error: 'sys/endian.h' file not found
#  include <sys/endian.h>

The patch avoid confusing macosx with freeBSD.

Also, different test files do not build.
A more recent version of the package (the last one, 3.91) remove some compiler errors but not all.
The patch backports some tests and avoid overrriding some function in the math.h header.

Index: distinfo
===================================================================
RCS file: /cvsroot/pkgsrc/databases/gigabase/distinfo,v
retrieving revision 1.4
diff -u -r1.4 distinfo
--- distinfo	3 Nov 2015 01:56:11 -0000	1.4
+++ distinfo	28 Aug 2019 14:08:18 -0000
@@ -6,3 +6,10 @@
 Size (gigabase-3.82.tar.gz) = 1746054 bytes
 SHA1 (patch-aa) = b36dceea6f9c69e7b315923bea7e3bbf377607c8
 SHA1 (patch-class.h) = 86f10c351d52b562bf5e311110a1547140e2284d
+SHA1 (patch-cliproto.h) = 5c61a1b2354ae9d07cc93036c8431c952e91dd8f
+SHA1 (patch-compiler.h) = 354d72eff05485183041fe6551e653c6dae84be2
+SHA1 (patch-stdtp.h) = 67e5740a75aefa465dffb5f3651a7094a7c228a5
+SHA1 (patch-sync.h) = 7caeac823ee4430abd82fd5977b8ade2ddd82558
+SHA1 (patch-testddl.cpp) = 9cfca3ea3508883b064449c76b66cc472b403480
+SHA1 (patch-testtimeseries.cpp) = a46e3b6f4ef67c005275d65d6ab58c8e04b49d01
+SHA1 (patch-unisock.cpp) = b3c4a2f74a711ddfc955d9c63cfd62659914cdc0
Index: patches/patch-cliproto.h
===================================================================
RCS file: patches/patch-cliproto.h
diff -N patches/patch-cliproto.h
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ patches/patch-cliproto.h	28 Aug 2019 14:08:18 -0000
@@ -0,0 +1,15 @@
+$NetBSD$
+
+* Avoid confusing macosx and freebsd
+
+--- cliproto.h.orig	2011-02-28 08:41:44.000000000 +0000
++++ cliproto.h
+@@ -145,7 +145,7 @@ static const int gb2cli_type_mapping[] =
+ };
+ 
+ 
+-#if defined(__FreeBSD__)
++#if defined(__FreeBSD__) || defined(__APPLE__)
+ END_GIGABASE_NAMESPACE
+ #include <sys/param.h>
+ #include <netinet/in.h>
Index: patches/patch-compiler.h
===================================================================
RCS file: patches/patch-compiler.h
diff -N patches/patch-compiler.h
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ patches/patch-compiler.h	28 Aug 2019 14:08:18 -0000
@@ -0,0 +1,15 @@
+$NetBSD$
+
+* Avoid confusing macosx and freebsd
+
+--- compiler.h.orig	2011-02-28 08:41:44.000000000 +0000
++++ compiler.h
+@@ -27,7 +27,7 @@ BEGIN_GIGABASE_NAMESPACE
+ struct CompileErrorException {};
+ struct OutOfBoundsException {};
+ #else
+-#if defined(__osf__) || defined(__FreeBSD__)
++#if defined(__osf__) || defined(__FreeBSD__) || defined(__APPLE__)
+ #define longjmp(b,s) _longjmp(b,s) // do not restore signal context
+ #define setjmp(b)  _setjmp(b)
+ #endif
Index: patches/patch-stdtp.h
===================================================================
RCS file: patches/patch-stdtp.h
diff -N patches/patch-stdtp.h
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ patches/patch-stdtp.h	28 Aug 2019 14:08:18 -0000
@@ -0,0 +1,21 @@
+$NetBSD$
+
+* Avoid confusing macosx and freebsd.
+
+--- stdtp.h.orig	2011-02-28 08:41:44.000000000 +0000
++++ stdtp.h
+@@ -53,10 +53,11 @@
+ #define _WINCE
+ #endif
+ 
+-#if defined(__APPLE__) && !defined(__FreeBSD__)
++// MAC OS X is not FreeBSD
++//#if defined(__APPLE__) && !defined(__FreeBSD__)
+ // MAC OS X is Free BSD
+-#define __FreeBSD__ 5
+-#endif
++//#define __FreeBSD__ 5
++//#endif
+ 
+ #ifdef __SYMBIAN32__
+ #include <unistd.h>
Index: patches/patch-sync.h
===================================================================
RCS file: patches/patch-sync.h
diff -N patches/patch-sync.h
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ patches/patch-sync.h	28 Aug 2019 14:08:18 -0000
@@ -0,0 +1,15 @@
+$NetBSD$
+
+* Avoid confusing macosx and freebsd
+
+--- sync.h.orig	2011-02-28 08:41:44.000000000 +0000
++++ sync.h
+@@ -557,7 +557,7 @@ END_GIGABASE_NAMESPACE
+ #include <linux/smp.h>
+ BEGIN_GIGABASE_NAMESPACE
+ inline int dbThread::numberOfProcessors() { return smp_num_cpus; }
+-#elif defined(__FreeBSD__) || defined(__bsdi__) || defined(__OpenBSD__) || defined(__NetBSD__)
++#elif defined(__FreeBSD__) || defined(__bsdi__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__APPLE__)
+ #if defined(__bsdi__) || defined(__OpenBSD__)
+ END_GIGABASE_NAMESPACE
+ #include <sys/param.h>
Index: patches/patch-testddl.cpp
===================================================================
RCS file: patches/patch-testddl.cpp
diff -N patches/patch-testddl.cpp
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ patches/patch-testddl.cpp	28 Aug 2019 14:08:18 -0000
@@ -0,0 +1,20 @@
+$NetBSD$
+
+* Avoid constructor ambiguity with math standard cos and sin.
+
+--- testddl.cpp.orig	2011-02-28 08:41:44.000000000 +0000
++++ testddl.cpp
+@@ -102,8 +102,11 @@ class Record : public Base {
+ 
+ REGISTER(Record);
+ 
+-USER_FUNC(sin);
+-USER_FUNC(cos);
++static double mysin(double x) { return sin(x); }
++static double mycos(double x) { return cos(x); }
++
++USER_FUNC(mysin);
++USER_FUNC(mycos);
+ 
+ int __cdecl main()
+ {
Index: patches/patch-testtimeseries.cpp
===================================================================
RCS file: patches/patch-testtimeseries.cpp
diff -N patches/patch-testtimeseries.cpp
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ patches/patch-testtimeseries.cpp	28 Aug 2019 14:08:18 -0000
@@ -0,0 +1,17 @@
+$NetBSD$
+
+* Avoid fmin and fmax math standard overrride.
+
+--- testtimeseries.cpp.orig	2011-02-28 08:41:44.000000000 +0000
++++ testtimeseries.cpp
+@@ -47,8 +47,8 @@ REGISTER_TEMPLATE(DailyBlock);
+ REGISTER(Stock);
+ 
+ inline int random(unsigned mod) { return rand() % mod; }
+-inline float fmax(float x, float y) { return x > y ? x : y; }
+-inline float fmin(float x, float y) { return x < y ? x : y; }
++//inline float fmax(float x, float y) { return x > y ? x : y; }
++//inline float fmin(float x, float y) { return x < y ? x : y; }
+ 
+ int main(int argc, char* argv[])
+ {
Index: patches/patch-unisock.cpp
===================================================================
RCS file: patches/patch-unisock.cpp
diff -N patches/patch-unisock.cpp
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ patches/patch-unisock.cpp	28 Aug 2019 14:08:18 -0000
@@ -0,0 +1,15 @@
+$NetBSD$
+
+* Avoid confusing macosx and freebsd
+
+--- unisock.cpp.orig	2011-02-28 08:41:44.000000000 +0000
++++ unisock.cpp
+@@ -167,7 +167,7 @@ char* unix_socket::get_peer_name()
+         return NULL;
+     }
+     struct sockaddr_in insock;
+-#if defined(__linux__) || (defined(__FreeBSD__) && __FreeBSD__ > 3) || defined(_AIX43) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(HPUX11) || defined (__DragonFly__) || defined(_SOCKLEN_T)
++#if defined(__linux__) || (defined(__FreeBSD__) && __FreeBSD__ > 3) || defined(_AIX43) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(HPUX11) || defined (__DragonFly__) || defined(__APPLE__) || defined(_SOCKLEN_T)
+     socklen_t len = sizeof(insock);
+ #elif defined(_AIX41)
+     size_t len = sizeof(insock);



Home | Main Index | Thread Index | Old Index