Add patches to fix s390x build issues.

This commit is contained in:
Jason Tibbitts 2019-09-23 12:15:44 -05:00
parent a00aa925db
commit c26d5e70ef
3 changed files with 62 additions and 3 deletions

View File

@ -0,0 +1,25 @@
From 94212fa2a92b5d01be5da8235f02423249dd7b2a Mon Sep 17 00:00:00 2001
From: bubnikv <bubnikv@gmail.com>
Date: Thu, 19 Sep 2019 08:56:47 +0200
Subject: [PATCH] Another fix of admesh on big endian architectures, fixes
#2879
---
src/admesh/stl_io.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/admesh/stl_io.cpp b/src/admesh/stl_io.cpp
index af9bb4f98..ddf377c78 100644
--- a/src/admesh/stl_io.cpp
+++ b/src/admesh/stl_io.cpp
@@ -151,8 +151,8 @@ bool stl_write_binary(stl_file *stl, const char *file, const char *label)
memcpy(buffer, &stl->stats.number_of_facets, 4);
stl_internal_reverse_quads(buffer, 4);
fwrite(buffer, 4, 1, fp);
- for (size_t i = 0; i < stl->stats.number_of_facets; ++ i) {
- memcpy(buffer, stl->facet_start + i, 50);
+ for (const stl_facet &facet : stl->facet_start) {
+ memcpy(buffer, &facet, 50);
// Convert to little endian.
stl_internal_reverse_quads(buffer, 48);
fwrite(buffer, SIZEOF_STL_FACET, 1, fp);

26
patch-endianness Normal file
View File

@ -0,0 +1,26 @@
diff --git a/src/admesh/stlinit.cpp b/src/admesh/stlinit.cpp
index 693aad0..390fe56 100644
--- a/src/admesh/stlinit.cpp
+++ b/src/admesh/stlinit.cpp
@@ -36,6 +36,10 @@
#error "SEEK_SET not defined"
#endif
+#ifndef BOOST_LITTLE_ENDIAN
+extern void stl_internal_reverse_quads(char *buf, size_t cnt);
+#endif /* BOOST_LITTLE_ENDIAN */
+
static FILE* stl_open_count_facets(stl_file *stl, const char *file)
{
// Open the file in binary mode first.
@@ -238,10 +242,6 @@ bool stl_open(stl_file *stl, const char *file)
return result;
}
-#ifndef BOOST_LITTLE_ENDIAN
-extern void stl_internal_reverse_quads(char *buf, size_t cnt);
-#endif /* BOOST_LITTLE_ENDIAN */
-
void stl_allocate(stl_file *stl)
{
// Allocate memory for the entire .STL file.

View File

@ -3,7 +3,7 @@
Name: prusa-slicer
Version: 2.1.0
Release: 1%{?dist}
Release: 2%{?dist}
Summary: 3D printing slicer optimized for Prusa printers
# The main PrusaSlicer code and resources are AGPLv3, with small parts as
@ -20,9 +20,14 @@ Source0: https://github.com/prusa3d/PrusaSlicer/archive/version_%version.
Source1: %name.desktop
Source2: %name.appdata.xml
# The source fails to build on s390x, so disable it temporarily; see
# Fix building on s390x
# https://github.com/prusa3d/PrusaSlicer/issues/2879
ExcludeArch: s390x
Patch0: https://github.com/prusa3d/PrusaSlicer/commit/94212fa2a92b5d01be5da8235f02423249dd7b2a.patch
# Try to fix more endian-related compilation errors
# https://github.com/prusa3d/PrusaSlicer/issues/2879
# https://github.com/prusa3d/PrusaSlicer/pull/2981
Patch1: patch-endianness
# Highly-parallel uild can run out of memory on PPC64le
%ifarch ppc64le
@ -395,6 +400,9 @@ make test ARGS=-V
%changelog
* Mon Sep 23 2019 Jason L Tibbitts III <tibbs@math.uh.edu> - 2.1.0-2
- Fix the s390x build and re-enable it.
* Fri Sep 13 2019 Jason L Tibbitts III <tibbs@math.uh.edu> - 2.1.0-1
- Update to 2.1.0.