guix-commits
[Top][All Lists]
Advanced

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

01/02: gnu: mariadb: Work around GCC ICE on armhf-linux.


From: Ludovic Courtès
Subject: 01/02: gnu: mariadb: Work around GCC ICE on armhf-linux.
Date: Sat, 28 Jul 2018 09:08:48 -0400 (EDT)

civodul pushed a commit to branch master
in repository guix.

commit 5193ae64ca0c3322364163d356a6d69173c3d233
Author: Ludovic Courtès <address@hidden>
Date:   Sat Jul 28 11:00:49 2018 +0200

    gnu: mariadb: Work around GCC ICE on armhf-linux.
    
    * gnu/packages/patches/mariadb-gcc-ice.patch: New file.
    * gnu/packages/databases.scm (mariadb)[arguments]: Conditionally add
    'apply-patch' phase.
    [native-inputs]: Conditionally add "gcc-ice-patch" input.
---
 gnu/local.mk                               |  1 +
 gnu/packages/databases.scm                 | 19 +++++++++++++++++--
 gnu/packages/patches/mariadb-gcc-ice.patch | 24 ++++++++++++++++++++++++
 3 files changed, 42 insertions(+), 2 deletions(-)

diff --git a/gnu/local.mk b/gnu/local.mk
index 612304b..80ffb9d 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -926,6 +926,7 @@ dist_patch_DATA =                                           
\
   %D%/packages/patches/mailutils-uninitialized-memory.patch    \
   %D%/packages/patches/make-glibc-compat.patch                 \
   %D%/packages/patches/make-impure-dirs.patch                  \
+  %D%/packages/patches/mariadb-gcc-ice.patch                   \
   %D%/packages/patches/mars-install.patch                      \
   %D%/packages/patches/mars-sfml-2.3.patch                     \
   %D%/packages/patches/maxima-defsystem-mkdir.patch            \
diff --git a/gnu/packages/databases.scm b/gnu/packages/databases.scm
index 382c74c..1433ca5 100644
--- a/gnu/packages/databases.scm
+++ b/gnu/packages/databases.scm
@@ -638,7 +638,7 @@ Language.")
                 "0bax748j4srsyhw5cs5jvwigndh0zwmf4r2cjvhja31ckx8jqccl"))))
     (build-system cmake-build-system)
     (arguments
-     '(#:configure-flags
+     `(#:configure-flags
        '("-DBUILD_CONFIG=mysql_release"
          ;; Linking with libarchive fails, like this:
 
@@ -665,6 +665,18 @@ Language.")
          "-DINSTALL_SHAREDIR=share/mysql")
        #:phases
        (modify-phases %standard-phases
+
+         ;; Apply this patch that's only needed on ARM.
+         ,@(if (and (not (%current-target-system))
+                    (string=? "armhf-linux" (%current-system)))
+               `((add-after 'unpack 'apply-patch
+                   (lambda* (#:key inputs #:allow-other-keys)
+                     (let ((patch (assoc-ref inputs "gcc-ice-patch")))
+                       (invoke "patch" "-p1" "--force"
+                               "--input" patch)
+                       #t))))
+               '())
+
          (add-before
           'configure 'pre-configure
           (lambda _
@@ -686,7 +698,10 @@ Language.")
               #t))))))
     (native-inputs
      `(("bison" ,bison)
-       ("perl" ,perl)))
+       ("perl" ,perl)
+       ,@(if (string=? "armhf-linux" (%current-system))
+             `(("gcc-ice-patch" ,(search-patch "mariadb-gcc-ice.patch")))
+             '())))
     (inputs
      `(("jemalloc" ,jemalloc)
        ("libaio" ,libaio)
diff --git a/gnu/packages/patches/mariadb-gcc-ice.patch 
b/gnu/packages/patches/mariadb-gcc-ice.patch
new file mode 100644
index 0000000..59b188f
--- /dev/null
+++ b/gnu/packages/patches/mariadb-gcc-ice.patch
@@ -0,0 +1,24 @@
+Work around this GCC ICE: <https://bugs.gnu.org/31708>.  It shows up
+only when doing native compiles on armhf-linux.
+
+--- mariadb-10.1.33/plugin/semisync/semisync_master.cc 2018-07-28 
02:13:12.604020250 +0200
++++ mariadb-10.1.33/plugin/semisync/semisync_master.cc 2018-07-28 
02:14:11.907753417 +0200
+@@ -847,6 +847,8 @@
+   return function_exit(kWho, 0);
+ }
+ 
++volatile const void *kSyncHeaderPtr = &ReplSemiSyncMaster::kSyncHeader;
++
+ int ReplSemiSyncMaster::reserveSyncHeader(unsigned char *header,
+                                         unsigned long size)
+ {
+@@ -873,7 +875,7 @@
+     /* Set the magic number and the sync status.  By default, no sync
+      * is required.
+      */
+-    memcpy(header, kSyncHeader, sizeof(kSyncHeader));
++    memcpy(header, (void *)kSyncHeaderPtr, sizeof(kSyncHeader));
+     hlen= sizeof(kSyncHeader);
+   }
+   return function_exit(kWho, hlen);
+



reply via email to

[Prev in Thread] Current Thread [Next in Thread]