#9 Fix s390x LTO issue on makesrna: force alignment on DNAstr definition in makesdna.c
Merged 2 months ago by luya. Opened 2 months ago by mtasaka.
rpms/ mtasaka/blender s390x-fix  into  rawhide

@@ -0,0 +1,35 @@ 

+ From aa31976394c6439b5baa823e578f5122a9cf3685 Mon Sep 17 00:00:00 2001

+ From: Mamoru TASAKA <mtasaka@fedoraproject.org>

+ Date: Sat, 27 Nov 2021 23:22:55 +0900

+ Subject: [PATCH] Fix T93425: makesdna: force DNAstr to be 4 bytes aligned.

+ 

+ init_structDNA() in dna_gen.c expects that the input sdna->data is 4-bytes aligned.

+ DNAstr[] buffer written by makesdna is used for this data, so make DNAstr forcely

+ 4-bytes aligned.

+ ---

+  source/blender/makesdna/intern/makesdna.c | 8 +++++++-

+  1 file changed, 7 insertions(+), 1 deletion(-)

+ 

+ diff --git a/source/blender/makesdna/intern/makesdna.c b/source/blender/makesdna/intern/makesdna.c

+ index 114c0b4..d709582 100644

+ --- a/source/blender/makesdna/intern/makesdna.c

+ +++ b/source/blender/makesdna/intern/makesdna.c

+ @@ -1555,8 +1555,14 @@ int main(int argc, char **argv)

+          base_directory = BASE_HEADER;

+        }

+  

+ +#ifdef __GNUC__

+ +#define FORCE_ALIGN_4 " __attribute__((aligned(4))) "

+ +#else

+ +#define FORCE_ALIGN_4 " "

+ +#endif

+ +

+        fprintf(file_dna, "extern const unsigned char DNAstr[];\n");

+ -      fprintf(file_dna, "const unsigned char DNAstr[] = {\n");

+ +      fprintf(file_dna, "const unsigned char " FORCE_ALIGN_4 "DNAstr[] = {\n");

+        if (make_structDNA(base_directory, file_dna, file_dna_offsets, file_dna_verify)) {

+          /* error */

+          fclose(file_dna);

+ -- 

+ 2.33.1

+ 

file modified
+4 -2
@@ -58,6 +58,9 @@ 

  

  # Patch for build with OIIO 2.3+

  Patch3:         blender-oiio-2.3.patch

+ # https://developer.blender.org/T93425

+ # Force makesdna: force DNAstr to be 4 bytes aligned : fixes s390x LTO issue

+ Patch4:         blender-2.93.5-0001-Fix-T93425-makesdna-force-DNAstr-to-be-4-bytes-align.patch

  

  # Development stuff

  BuildRequires:  boost-devel
@@ -203,8 +206,7 @@ 

  Obsoletes:      blender-fonts <  1:2.91.0-5

  

  # Starting from 2.90, Blender support only 64-bits architectures

- ExclusiveArch:  x86_64 aarch64 ppc64le

- # s390x is excluded due https://bugzilla.redhat.com/show_bug.cgi?id=1874398

+ ExclusiveArch:  x86_64 aarch64 ppc64le s390x

  

  %description

  Blender is the essential software solution you need for 3D, from modeling,

(upstream T93425) (bug 1874398)

Pull-Request has been merged by luya

2 months ago