Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

Revision 8161194d68665648b93389adb333e741ba230497 authored by Mohammad Akhlaghi on 22 May 2023, 22:44:20 UTC, committed by Mohammad Akhlaghi on 23 May 2023, 06:42:11 UTC
Configuration: portability fixes in Less and WCSLIB
SUMMARY: no change is necessary in your project, unless you use the Fortran
features of WCSLIB in your project.

Until now, there were two compilation failures on recent macOS computers
with an M1 CPU: Less would crash because it couldn't find the relevant PCRE
(perl-compatible regular expression) libraries and WCSLIB would crash
because the LLVM compiler's Fortran features could not be built.

With this commit, both issues have been fixed by disabling the relevant
feature. Extensive comments have been placed in both places in case your
project needs these features, so please see the comments in the relevant
part of 'reproduce/software/make/basic.mk' for Less and
'reproduce/software/make/high-level.mk' for WCSLIB. In fact the previous
solution (where we would not have Fortran features in WCSLIB on macOS
systems was problematic and non-reproducibile (the features of WCSLIB
depended on the operating system!).

Another minor change was that for macOS, we now directly use the
version-string of WCSLIB to fix the internal linking issue there. As a
result, WCSLIB is no longer a "Version-dependent build" software (in
'reproduce/software/config/versions.conf'). Recall that these are software
that when changing the version, it is also necessary to inspect their build
recipe.

These two issues and their fix were discovered and fixed with the help of
James Robinson.
1 parent 644a236
  • Files
  • Changes
  • 8a3a871
  • /
  • reproduce
  • /
  • software
  • /
  • patches
  • /
  • util-linux-2.38.1-macos.patch
Raw File Download

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • revision
  • directory
  • content
revision badge
swh:1:rev:8161194d68665648b93389adb333e741ba230497
directory badge
swh:1:dir:b71bb41fe2944addb3b259e180595b86a14bd854
content badge
swh:1:cnt:d89422dea4ef05bb23abdac660830cf2d82b867a

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • revision
  • directory
  • content
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
util-linux-2.38.1-macos.patch
From 3671d4a878fb58aa953810ecf9af41809317294f Mon Sep 17 00:00:00 2001
From: Karel Zak <kzak@redhat.com>
Date: Mon, 4 Apr 2022 13:17:44 +0200
Subject: [PATCH] build-sys: improve dependences for lib/procfs.c

* add #ifdefs when use statfs() and include statfs.h or vfs.h

Addresses: https://github.com/util-linux/util-linux/issues/1634
Signed-off-by: Karel Zak <kzak@redhat.com>
---
 configure.ac           |  2 ++
 include/statfs_magic.h |  4 +++-
 lib/procfs.c           | 15 +++++++++++++--
 misc-utils/hardlink.c  |  2 +-
 4 files changed, 19 insertions(+), 4 deletions(-)

diff --git a/configure.ac b/configure.ac
index 3fba95336a5b60b277d90615089093901fec723e..11c86b9a70809cbade98539b17fb2e1186984ebb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -346,6 +346,7 @@ AC_CHECK_HEADERS([ \
 	sys/socket.h \
 	sys/sockio.h \
 	sys/stat.h \
+	sys/statfs.h \
 	sys/swap.h \
 	sys/syscall.h \
 	sys/sysmacros.h \
@@ -355,6 +356,7 @@ AC_CHECK_HEADERS([ \
 	sys/types.h \
 	sys/ucred.h \
 	sys/un.h \
+	sys/vfs.h \
 	sys/xattr.h \
 	unistd.h \
 	utmp.h \
diff --git a/include/statfs_magic.h b/include/statfs_magic.h
index b6b0225e865aeb3c04610ecab177f3e95f1cc61a..67ad0af2595862795299f0bcdb7baa5778742185 100644
--- a/include/statfs_magic.h
+++ b/include/statfs_magic.h
@@ -1,7 +1,9 @@
 #ifndef UTIL_LINUX_STATFS_MAGIC_H
 #define UTIL_LINUX_STATFS_MAGIC_H

-#include <sys/statfs.h>
+#ifdef HAVE_SYS_STATFS_H
+# include <sys/statfs.h>
+#endif

 /*
  * If possible then don't depend on internal libc __SWORD_TYPE type.
diff --git a/lib/procfs.c b/lib/procfs.c
index 4d6d25b6d78eba56aada4cd9acacee4d2e69f656..0d58857c83b378cb1cb3baf00f88f992ff8dce1e 100644
--- a/lib/procfs.c
+++ b/lib/procfs.c
@@ -6,9 +6,13 @@
  */
 #include <ctype.h>
 #include <unistd.h>
-#include <sys/vfs.h>
 #include <errno.h>

+#ifdef HAVE_SYS_VFS_H
+# include <sys/vfs.h>
+# include "statfs_magic.h"
+#endif
+
 #include "c.h"
 #include "pathnames.h"
 #include "procfs.h"
@@ -16,7 +20,6 @@
 #include "all-io.h"
 #include "debug.h"
 #include "strutils.h"
-#include "statfs_magic.h"

 static void procfs_process_deinit_path(struct path_cxt *pc);

@@ -356,6 +359,7 @@ int procfs_dirent_match_name(DIR *procfs, struct dirent *d, const char *name)
 	return 0;
 }

+#ifdef HAVE_SYS_VFS_H
 /* checks if fd is file in a procfs;
  * returns 1 if true, 0 if false or couldn't determine */
 int fd_is_procfs(int fd)
@@ -375,7 +379,14 @@ int fd_is_procfs(int fd)
 	} while (ret != 0);

 	return st.f_type == STATFS_PROC_MAGIC;
+	return 0;
 }
+#else
+int fd_is_procfs(int fd __attribute__((__unused__)))
+{
+	return 0;
+}
+#endif

 static char *strdup_procfs_file(pid_t pid, const char *name)
 {
diff --git a/misc-utils/hardlink.c b/misc-utils/hardlink.c
index dd55af12aab7903e6025d0a39ea020c2400300e8..08af2882c1359e41fba37377a08c9a18647b0f9f 100644
--- a/misc-utils/hardlink.c
+++ b/misc-utils/hardlink.c
@@ -38,7 +38,7 @@
 #include <ctype.h>		/* tolower() */
 #include <sys/ioctl.h>

-#if defined(HAVE_LINUX_FIEMAP_H)
+#if defined(HAVE_LINUX_FIEMAP_H) && defined(HAVE_SYS_VFS_H)
 # include <linux/fs.h>
 # include <linux/fiemap.h>
 # ifdef FICLONE
The diff you're trying to view is too large. Only the first 1000 changed files have been loaded.
Showing with 0 additions and 0 deletions (0 / 0 diffs computed)
swh spinner

Computing file changes ...

back to top

Software Heritage — Copyright (C) 2015–2026, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Content policy— Contact— JavaScript license information— Web API