[packages/elfutils] - fix building on x32

baggins baggins at pld-linux.org
Fri Mar 27 22:56:38 CET 2020


commit 637c190866e4e6dc673239af8ce148598ffdfdc8
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Fri Mar 27 22:56:22 2020 +0100

    - fix building on x32

 elfutils.spec |  7 ++-----
 x32.patch     | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 65 insertions(+), 5 deletions(-)
---
diff --git a/elfutils.spec b/elfutils.spec
index 3395f11..f8b05c4 100644
--- a/elfutils.spec
+++ b/elfutils.spec
@@ -19,6 +19,7 @@ Patch3:		%{name}-align.patch
 Patch4:		%{name}-paxflags.patch
 Patch5:		%{name}-sparc.patch
 Patch6:		%{name}-cxx.patch
+Patch7:		x32.patch
 URL:		https://sourceware.org/elfutils/
 BuildRequires:	autoconf >= 2.63
 BuildRequires:	automake >= 1:1.11
@@ -182,14 +183,10 @@ Plik nagłówkowy biblioteki debuginfod.
 %patch4 -p1
 %patch5 -p1
 %patch6 -p1
+%patch7 -p1
 
 %{__rm} po/stamp-po
 
-# temporarily disable failing tests (depending on arch)
-%ifarch x32
-%{__sed} -i -e 's/run-backtrace-native-biarch.sh//' tests/Makefile.am
-%endif
-
 # make sure this is not even tried on arch it has no chance to run
 %ifarch %{ix86}
 %{__sed} -i -e 's/run-disasm-x86-64.sh//' tests/Makefile.am
diff --git a/x32.patch b/x32.patch
new file mode 100644
index 0000000..44baa61
--- /dev/null
+++ b/x32.patch
@@ -0,0 +1,63 @@
+diff -ur elfutils-0.178/debuginfod/debuginfod-client.c elfutils-0.178-x32/debuginfod/debuginfod-client.c
+--- elfutils-0.178/debuginfod/debuginfod-client.c	2019-11-26 23:48:42.000000000 +0100
++++ elfutils-0.178-x32/debuginfod/debuginfod-client.c	2020-03-27 22:47:53.398098750 +0100
+@@ -170,7 +170,11 @@
+   if (fd < 0)
+     return -errno;
+ 
++#if defined(__x86_64__) && defined(__ILP32__)
++  if (dprintf(fd, "%lld", cache_clean_default_interval_s) < 0)
++#else
+   if (dprintf(fd, "%ld", cache_clean_default_interval_s) < 0)
++#endif
+     return -errno;
+ 
+   /* init max age config file.  */
+@@ -178,7 +178,11 @@
+       && (fd = open(maxage_path, O_CREAT | O_RDWR, 0666)) < 0)
+     return -errno;
+ 
++#if defined(__x86_64__) && defined(__ILP32__)
++  if (dprintf(fd, "%lld", cache_default_max_unused_age_s) < 0)
++#else
+   if (dprintf(fd, "%ld", cache_default_max_unused_age_s) < 0)
++#endif
+     return -errno;
+ 
+   return 0;
+@@ -204,7 +204,11 @@
+       if (interval_file == NULL)
+         return -errno;
+ 
++#if defined(__x86_64__) && defined(__ILP32__)
++      int rc = fprintf(interval_file, "%lld", cache_clean_default_interval_s);
++#else
+       int rc = fprintf(interval_file, "%ld", cache_clean_default_interval_s);
++#endif
+       fclose(interval_file);
+ 
+       if (rc < 0)
+@@ -214,7 +214,11 @@
+   /* Check timestamp of interval file to see whether cleaning is necessary.  */
+   time_t clean_interval;
+   interval_file = fopen(interval_path, "r");
++#if defined(__x86_64__) && defined(__ILP32__)
++  if (fscanf(interval_file, "%lld", &clean_interval) != 1)
++#else
+   if (fscanf(interval_file, "%ld", &clean_interval) != 1)
++#endif
+     clean_interval = cache_clean_default_interval_s;
+   fclose(interval_file);
+ 
+@@ -227,7 +227,11 @@
+   max_unused_file = fopen(max_unused_path, "r");
+   if (max_unused_file)
+     {
++#if defined(__x86_64__) && defined(__ILP32__)
++      if (fscanf(max_unused_file, "%lld", &max_unused_age) != 1)
++#else
+       if (fscanf(max_unused_file, "%ld", &max_unused_age) != 1)
++#endif
+         max_unused_age = cache_default_max_unused_age_s;
+       fclose(max_unused_file);
+     }
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/elfutils.git/commitdiff/637c190866e4e6dc673239af8ce148598ffdfdc8



More information about the pld-cvs-commit mailing list