1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-24 09:25:01 +00:00

databases/mariadb102-server: Fix builds

- Fix build on aarch64 [1]
 - Fix build with clang6 (HEAD, 11-STABLE) [2]

PR:             227628 [1], 227244 [2]
Submitted by:   Naram Qashat <cyberbotx cyberbotx com> [1]
Submitted by:   dim
This commit is contained in:
Bernard Spil 2018-05-06 19:23:25 +00:00
parent 76d5bec4dc
commit a100dc86eb
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=469246
3 changed files with 110 additions and 2 deletions

View File

@ -22,8 +22,6 @@ LICENSE_NAME_PerconaFT= PerconaFT patents license
LICENSE_FILE_PerconaFT= ${WRKSRC}/storage/tokudb/PerconaFT/PATENTS
LICENSE_PERMS_PerconaFT= dist-mirror dist-sell pkg-mirror pkg-sell auto-accept
BROKEN_aarch64= fails to link: stacktrace.c: undefined reference to 'sbrk'
SUB_FILES= pkg-message
SLAVEDIRS= databases/mariadb102-client

View File

@ -0,0 +1,63 @@
--- storage/connect/tabjson.cpp.orig 2018-03-26 16:41:19 UTC
+++ storage/connect/tabjson.cpp
@@ -195,7 +195,7 @@ int JSONDISC::GetColumns(PGLOBAL g, PCSZ
tdp->Fn = GetStringTableOption(g, topt, "Filename", NULL);
if (!(tdp->Database = SetPath(g, db)))
- return NULL;
+ return 0;
tdp->Objname = GetStringTableOption(g, topt, "Object", NULL);
tdp->Base = GetIntegerTableOption(g, topt, "Base", 0) ? 1 : 0;
@@ -243,14 +243,14 @@ int JSONDISC::GetColumns(PGLOBAL g, PCSZ
tjsp = new(g) TDBJSON(tdp, new(g) MAPFAM(tdp));
if (tjsp->MakeDocument(g))
- return NULL;
+ return 0;
jsp = (tjsp->GetDoc()) ? tjsp->GetDoc()->GetValue(0) : NULL;
} else {
if (!(tdp->Lrecl = GetIntegerTableOption(g, topt, "Lrecl", 0)))
if (!mgo) {
sprintf(g->Message, "LRECL must be specified for pretty=%d", tdp->Pretty);
- return NULL;
+ return 0;
} else
tdp->Lrecl = 8192; // Should be enough
@@ -269,14 +269,14 @@ int JSONDISC::GetColumns(PGLOBAL g, PCSZ
tjnp = new(g) TDBJSN(tdp, new(g) CMGFAM(tdp));
#else
sprintf(g->Message, "Mongo %s Driver not available", "C");
- return NULL;
+ return 0;
#endif
} else if (tdp->Driver && toupper(*tdp->Driver) == 'J') {
#if defined(JAVA_SUPPORT)
tjnp = new(g) TDBJSN(tdp, new(g) JMGFAM(tdp));
#else
sprintf(g->Message, "Mongo %s Driver not available", "Java");
- return NULL;
+ return 0;
#endif
} else { // Driver not specified
#if defined(CMGO_SUPPORT)
@@ -285,7 +285,7 @@ int JSONDISC::GetColumns(PGLOBAL g, PCSZ
tjnp = new(g) TDBJSN(tdp, new(g) JMGFAM(tdp));
#else
sprintf(g->Message, MSG(NO_FEAT_SUPPORT), "MONGO");
- return NULL;
+ return 0;
#endif
} // endif Driver
@@ -304,7 +304,7 @@ int JSONDISC::GetColumns(PGLOBAL g, PCSZ
tjnp->SetG(G);
if (tjnp->OpenDB(g))
- return NULL;
+ return 0;
switch (tjnp->ReadDB(g)) {
case RC_EF:

View File

@ -0,0 +1,47 @@
--- mysys/stacktrace.c.orig 2018-03-26 16:41:18 UTC
+++ mysys/stacktrace.c
@@ -34,19 +34,19 @@
#include <execinfo.h>
#endif
+#ifdef __linux__
#define PTR_SANE(p) ((p) && (char*)(p) >= heap_start && (char*)(p) <= heap_end)
-
static char *heap_start;
-
-#if(defined HAVE_BSS_START) && !(defined __linux__)
extern char *__bss_start;
-#endif
+#else
+#define PTR_SANE(p) (p)
+#endif /* __linux */
void my_init_stacktrace()
{
-#if(defined HAVE_BSS_START) && !(defined __linux__)
+#ifdef __linux__
heap_start = (char*) &__bss_start;
-#endif
+#endif /* __linux__ */
}
#ifdef __linux__
@@ -149,15 +149,16 @@ static int safe_print_str(const char *ad
int my_safe_print_str(const char* val, int max_len)
{
+#ifdef __linux__
+/* Only needed by the linux version of PTR_SANE */
char *heap_end;
-#ifdef __linux__
// Try and make use of /proc filesystem to safely print memory contents.
if (!safe_print_str(val, max_len))
return 0;
-#endif
heap_end= (char*) sbrk(0);
+#endif
if (!PTR_SANE(val))
{