From 43662fc50aa367f7f6544126f6a4a5fb889c0cca Mon Sep 17 00:00:00 2001 From: Renbo Date: Wed, 17 Apr 2024 15:53:04 +0800 Subject: [PATCH 1/5] update to util-linux-2.32.1-44.1.src.rpm Signed-off-by: Renbo --- ...scpu-avoid-EBUSY-on-cpuinfo_max_freq.patch | 108 ++++++ 1001-hwclock-make-glibc-2.31-compatible.patch | 161 --------- ...eoverse-N2-to-ARM-identifiers-tables.patch | 24 -- ...-cpu-frequency-from-cpuinfo-on-arm64.patch | 24 -- 1004-util-linux-add-sw.patch | 322 ------------------ dist | 2 +- util-linux.spec | 23 +- 7 files changed, 116 insertions(+), 548 deletions(-) create mode 100644 0099-lscpu-avoid-EBUSY-on-cpuinfo_max_freq.patch delete mode 100644 1001-hwclock-make-glibc-2.31-compatible.patch delete mode 100644 1002-add-Neoverse-N2-to-ARM-identifiers-tables.patch delete mode 100644 1003-fix-lscpu-to-get-cpu-frequency-from-cpuinfo-on-arm64.patch delete mode 100644 1004-util-linux-add-sw.patch diff --git a/0099-lscpu-avoid-EBUSY-on-cpuinfo_max_freq.patch b/0099-lscpu-avoid-EBUSY-on-cpuinfo_max_freq.patch new file mode 100644 index 0000000..6827125 --- /dev/null +++ b/0099-lscpu-avoid-EBUSY-on-cpuinfo_max_freq.patch @@ -0,0 +1,108 @@ +From e561e4740d8dd5419e5fb23ab186ae43fd572736 Mon Sep 17 00:00:00 2001 +From: Karel Zak +Date: Wed, 10 Jan 2024 12:08:17 +0100 +Subject: lscpu: avoid EBUSY on cpuinfo_max_freq + +Addresses: https://issues.redhat.com/browse/RHEL-13741 +--- + include/path.h | 4 ++++ + lib/path.c | 20 ++++++++++++++++++++ + sys-utils/lscpu.c | 18 ++++++++++++------ + 3 files changed, 36 insertions(+), 6 deletions(-) + +diff --git a/include/path.h b/include/path.h +index 4be01095c..965bdd047 100644 +--- a/include/path.h ++++ b/include/path.h +@@ -19,8 +19,12 @@ extern void path_read_str(char *result, size_t len, const char *path, ...) + __attribute__ ((__format__ (__printf__, 3, 4))); + extern int path_write_str(const char *str, const char *path, ...) + __attribute__ ((__format__ (__printf__, 2, 3))); ++ ++extern int __path_read_s32(int *result, const char *path, ...) ++ __attribute__ ((__format__ (__printf__, 2, 3))); + extern int path_read_s32(const char *path, ...) + __attribute__ ((__format__ (__printf__, 1, 2))); ++ + extern uint64_t path_read_u64(const char *path, ...) + __attribute__ ((__format__ (__printf__, 1, 2))); + +diff --git a/lib/path.c b/lib/path.c +index e8cfa557a..7217c9089 100644 +--- a/lib/path.c ++++ b/lib/path.c +@@ -145,6 +145,26 @@ path_read_str(char *result, size_t len, const char *path, ...) + result[len - 1] = '\0'; + } + ++/* like path_read_s32() but do not print any error message */ ++int __path_read_s32(int *result, const char *path, ...) ++{ ++ FILE *f; ++ va_list ap; ++ int rc; ++ ++ va_start(ap, path); ++ f = path_vfopen("r" UL_CLOEXECSTR, 0, path, ap); ++ va_end(ap); ++ ++ if (!f) ++ return -1; ++ ++ rc = fscanf(f, "%d", result); ++ fclose(f); ++ ++ return rc == 1 ? 0 : -1; ++} ++ + int + path_read_s32(const char *path, ...) + { +diff --git a/sys-utils/lscpu.c b/sys-utils/lscpu.c +index 01f8fba35..ed5543901 100644 +--- a/sys-utils/lscpu.c ++++ b/sys-utils/lscpu.c +@@ -1176,28 +1176,34 @@ static void + read_max_mhz(struct lscpu_desc *desc, int idx) + { + int num = real_cpu_num(desc, idx); ++ int mhz = 0; + + if (!path_exist(_PATH_SYS_CPU "/cpu%d/cpufreq/cpuinfo_max_freq", num)) + return; ++ if (__path_read_s32(&mhz, _PATH_SYS_CPU ++ "/cpu%d/cpufreq/cpuinfo_max_freq", num) != 0) ++ return; ++ + if (!desc->maxmhz) + desc->maxmhz = xcalloc(desc->ncpuspos, sizeof(char *)); +- xasprintf(&(desc->maxmhz[idx]), "%.4f", +- (float)path_read_s32(_PATH_SYS_CPU +- "/cpu%d/cpufreq/cpuinfo_max_freq", num) / 1000); ++ xasprintf(&(desc->maxmhz[idx]), "%.4f", (float) mhz / 1000); + } + + static void + read_min_mhz(struct lscpu_desc *desc, int idx) + { + int num = real_cpu_num(desc, idx); ++ int mhz = 0; + + if (!path_exist(_PATH_SYS_CPU "/cpu%d/cpufreq/cpuinfo_min_freq", num)) + return; ++ if (__path_read_s32(&mhz, _PATH_SYS_CPU ++ "/cpu%d/cpufreq/cpuinfo_min_freq", num) != 0) ++ return; ++ + if (!desc->minmhz) + desc->minmhz = xcalloc(desc->ncpuspos, sizeof(char *)); +- xasprintf(&(desc->minmhz[idx]), "%.4f", +- (float)path_read_s32(_PATH_SYS_CPU +- "/cpu%d/cpufreq/cpuinfo_min_freq", num) / 1000); ++ xasprintf(&(desc->minmhz[idx]), "%.4f", (float) mhz / 1000); + } + + static int +-- +2.43.0 + diff --git a/1001-hwclock-make-glibc-2.31-compatible.patch b/1001-hwclock-make-glibc-2.31-compatible.patch deleted file mode 100644 index d4908a6..0000000 --- a/1001-hwclock-make-glibc-2.31-compatible.patch +++ /dev/null @@ -1,161 +0,0 @@ -From e42f9f05a96c9e0129722b15fc638d4133ac1ecb Mon Sep 17 00:00:00 2001 -From: J William Piggott -Date: Tue, 19 Apr 2022 23:22:11 -0400 -Subject: [PATCH] hwclock: make glibc 2.31 compatible -______________________________________________________ -GNU C Library NEWS -- history of user-visible changes. -Version 2.31 -Deprecated and removed features, and other changes affecting compatibility: - -* The settimeofday function can still be used to set a system-wide time - zone when the operating system supports it. This is because the Linux - kernel reused the API, on some architectures, to describe a system-wide - time-zone-like offset between the software clock maintained by the kernel, - and the "RTC" clock that keeps time when the system is shut down. - - However, to reduce the odds of this offset being set by accident, - settimeofday can no longer be used to set the time and the offset - simultaneously. If both of its two arguments are non-null, the call - will fail (setting errno to EINVAL). - - Callers attempting to set this offset should also be prepared for the call - to fail and set errno to ENOSYS; this already happens on the Hurd and on - some Linux architectures. The Linux kernel maintainers are discussing a - more principled replacement for the reused API. After a replacement - becomes available, we will change settimeofday to fail with ENOSYS on all - platforms when its 'tzp' argument is not a null pointer. - - settimeofday itself is obsolescent according to POSIX. Programs that set - the system time should use clock_settime and/or the adjtime family of - functions instead. We may cease to make settimeofday available to newly - linked binaries after there is a replacement for Linux's time-zone-like - offset API. -______________________________________________________ - -hwclock(8) had one settimeofday(2) call where both args were set for ---hctosys when the RTC was ticking UTC. This allowed setting the system -time, timezone, and locking the warp_clock function with a single call. -That operation now takes 3 calls of settimeofday(2). - -Although this common operation now takes three calls, the overall logic -for the set_system_clock() function was simplified. - -Co-Author: Karel Zak -Signed-off-by: J William Piggott ---- - sys-utils/hwclock.c | 70 ++++++++++++++++++++++----------------------- - 1 file changed, 35 insertions(+), 35 deletions(-) - -diff --git a/sys-utils/hwclock.c b/sys-utils/hwclock.c -index b83e710..19e7410 100644 ---- a/sys-utils/hwclock.c -+++ b/sys-utils/hwclock.c -@@ -583,28 +583,28 @@ display_time(struct timeval hwctime) - * tz.tz_minuteswest argument and sets PCIL (see below). At boot settimeofday(2) - * has one-shot access to this function as shown in the table below. - * -- * +-------------------------------------------------------------------+ -- * | settimeofday(tv, tz) | -- * |-------------------------------------------------------------------| -- * | Arguments | System Time | PCIL | | warp_clock | -- * | tv | tz | set | warped | set | firsttime | locked | -- * |---------|---------|---------------|------|-----------|------------| -- * | pointer | NULL | yes | no | no | 1 | no | -- * | pointer | pointer | yes | no | no | 0 | yes | -- * | NULL | ptr2utc | no | no | no | 0 | yes | -- * | NULL | pointer | no | yes | yes | 0 | yes | -- * +-------------------------------------------------------------------+ -+ * +-------------------------------------------------------------------------+ -+ * | settimeofday(tv, tz) | -+ * |-------------------------------------------------------------------------| -+ * | Arguments | System Time | TZ | PCIL | | warp_clock | -+ * | tv | tz | set | warped | set | set | firsttime | locked | -+ * |---------|---------|---------------|-----|------|-----------|------------| -+ * | pointer | NULL | yes | no | no | no | 1 | no | -+ * | NULL | ptr2utc | no | no | yes | no | 0 | yes | -+ * | NULL | pointer | no | yes | yes | yes | 0 | yes | -+ * +-------------------------------------------------------------------------+ - * ptr2utc: tz.tz_minuteswest is zero (UTC). - * PCIL: persistent_clock_is_local, sets the "11 minute mode" timescale. - * firsttime: locks the warp_clock function (initialized to 1 at boot). -+ * Since glibc v2.31 settimeofday() will fail if both args are non NULL - * - * +---------------------------------------------------------------------------+ - * | op | RTC scale | settimeofday calls | - * |---------|-----------|-----------------------------------------------------| - * | systz | Local | 1) warps system time*, sets PCIL* and kernel tz | - * | systz | UTC | 1st) locks warp_clock* 2nd) sets kernel tz | -- * | hctosys | Local | 1st) sets PCIL* 2nd) sets system time and kernel tz | -- * | hctosys | UTC | 1) sets system time and kernel tz | -+ * | hctosys | Local | 1st) sets PCIL* & kernel tz 2nd) sets system time | -+ * | hctosys | UTC | 1st) locks warp* 2nd) sets tz 3rd) sets system time | - * +---------------------------------------------------------------------------+ - * * only on first call after boot - */ -@@ -615,41 +615,41 @@ set_system_clock(const struct hwclock_control *ctl, - struct tm broken; - int minuteswest; - int rc = 0; -- const struct timezone tz_utc = { 0 }; - - localtime_r(&newtime.tv_sec, &broken); - minuteswest = -get_gmtoff(&broken) / 60; - - if (ctl->verbose) { -- if (ctl->hctosys && !ctl->universal) -- printf(_("Calling settimeofday(NULL, %d) to set " -- "persistent_clock_is_local.\n"), minuteswest); -- if (ctl->systz && ctl->universal) -+ if (ctl->universal) { - puts(_("Calling settimeofday(NULL, 0) " -- "to lock the warp function.")); -+ "to lock the warp_clock function.")); -+ if (!( ctl->universal && !minuteswest )) -+ printf(_("Calling settimeofday(NULL, %d) " -+ "to set the kernel timezone.\n"), -+ minuteswest); -+ } else -+ printf(_("Calling settimeofday(NULL, %d) to warp " -+ "System time, set PCIL and the kernel tz.\n"), -+ minuteswest); -+ - if (ctl->hctosys) -- printf(_("Calling settimeofday(%ld.%06ld, %d)\n"), -- newtime.tv_sec, newtime.tv_usec, minuteswest); -- else { -- printf(_("Calling settimeofday(NULL, %d) "), minuteswest); -- if (ctl->universal) -- puts(_("to set the kernel timezone.")); -- else -- puts(_("to warp System time.")); -- } -+ printf(_("Calling settimeofday(%ld.%06ld, NULL) " -+ "to set the System time.\n"), -+ newtime.tv_sec, newtime.tv_usec); - } - - if (!ctl->testing) { -+ const struct timezone tz_utc = { 0 }; - const struct timezone tz = { minuteswest }; -- -- if (ctl->hctosys && !ctl->universal) /* set PCIL */ -- rc = settimeofday(NULL, &tz); -- if (ctl->systz && ctl->universal) /* lock warp_clock */ -+ /* If UTC RTC: lock warp_clock and PCIL */ -+ if (ctl->universal) - rc = settimeofday(NULL, &tz_utc); -- if (!rc && ctl->hctosys) -- rc = settimeofday(&newtime, &tz); -- else if (!rc) -+ /* Set kernel tz; if localtime RTC: warp_clock and set PCIL */ -+ if (!rc && !( ctl->universal && !minuteswest )) - rc = settimeofday(NULL, &tz); -+ /* Set the System Clock */ -+ if ((!rc || errno == ENOSYS) && ctl->hctosys) -+ rc = settimeofday(&newtime, NULL); - - if (rc) { - warn(_("settimeofday() failed")); --- -2.27.0 - diff --git a/1002-add-Neoverse-N2-to-ARM-identifiers-tables.patch b/1002-add-Neoverse-N2-to-ARM-identifiers-tables.patch deleted file mode 100644 index 9b6afb1..0000000 --- a/1002-add-Neoverse-N2-to-ARM-identifiers-tables.patch +++ /dev/null @@ -1,24 +0,0 @@ -From dc11290085e49ec47be148447104f50ce3e7244b Mon Sep 17 00:00:00 2001 -From: rpm-build -Date: Tue, 27 Sep 2022 11:21:16 +0800 -Subject: [PATCH] add Neoverse-N2 to ARM identifiers tables - ---- - sys-utils/lscpu-arm.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/sys-utils/lscpu-arm.c b/sys-utils/lscpu-arm.c -index 2b178a7..697a4b2 100644 ---- a/sys-utils/lscpu-arm.c -+++ b/sys-utils/lscpu-arm.c -@@ -80,6 +80,7 @@ static const struct id_part arm_part[] = { - { 0xd21, "Cortex-M33" }, - { 0xd41, "Cortex-A78" }, - { 0xd42, "Cortex-A78AE" }, -+ { 0xd49, "Neoverse-N2" }, - { 0xd4a, "Neoverse-E1" }, - { 0xd4b, "Cortex-A78C" }, - { -1, "unknown" }, --- -2.31.1 - diff --git a/1003-fix-lscpu-to-get-cpu-frequency-from-cpuinfo-on-arm64.patch b/1003-fix-lscpu-to-get-cpu-frequency-from-cpuinfo-on-arm64.patch deleted file mode 100644 index 1893c87..0000000 --- a/1003-fix-lscpu-to-get-cpu-frequency-from-cpuinfo-on-arm64.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 117b51eb538673be49bf0e619d2307a65963d1dd Mon Sep 17 00:00:00 2001 -From: rpm-build -Date: Tue, 27 Sep 2022 15:31:51 +0800 -Subject: [PATCH] fix lscpu to get cpu frequency from cpuinfo on arm64 - ---- - sys-utils/lscpu.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/sys-utils/lscpu.c b/sys-utils/lscpu.c -index 70a797d..a7014a0 100644 ---- a/sys-utils/lscpu.c -+++ b/sys-utils/lscpu.c -@@ -433,6 +433,7 @@ read_basicinfo(struct lscpu_desc *desc, struct lscpu_modifier *mod) - else if (lookup(buf, "stepping", &desc->stepping)) ; - else if (lookup(buf, "CPU variant", &desc->stepping)) ; /* aarch64 */ - else if (lookup(buf, "cpu MHz", &desc->mhz)) ; -+ else if (lookup(buf, "CPU MHz", &desc->mhz)) ; /* aarch64 */ - else if (lookup(buf, "cpu MHz dynamic", &desc->dynamic_mhz)) ; /* s390 */ - else if (lookup(buf, "cpu MHz static", &desc->static_mhz)) ; /* s390 */ - else if (lookup(buf, "flags", &desc->flags)) ; /* x86 */ --- -2.31.1 - diff --git a/1004-util-linux-add-sw.patch b/1004-util-linux-add-sw.patch deleted file mode 100644 index be7097a..0000000 --- a/1004-util-linux-add-sw.patch +++ /dev/null @@ -1,322 +0,0 @@ -From 0cea5b507f643f9159b3074236571faf3ed60c34 Mon Sep 17 00:00:00 2001 -From: wxiat -Date: Wed, 14 Jun 2023 15:03:54 +0800 -Subject: [PATCH] add sw - -Signed-off-by: rpm-build ---- - configure | 2 ++ - configure.ac | 2 ++ - include/pt-bsd.h | 4 ++-- - libfdisk/src/bsd.c | 16 ++++++++-------- - sys-utils/hwclock-rtc.c | 4 ++-- - sys-utils/hwclock.c | 12 ++++++------ - sys-utils/hwclock.h | 6 +++--- - sys-utils/lscpu.c | 2 +- - sys-utils/setarch.c | 4 ++++ - tests/ts/fdisk/bsd | 5 ++++- - 10 files changed, 34 insertions(+), 23 deletions(-) - -diff --git a/configure b/configure -index 2865523..a2ab58e 100755 ---- a/configure -+++ b/configure -@@ -30068,6 +30068,7 @@ else - case $host_cpu in - #( - alpha) syscall="442" ;; #( -+ sw_64) syscall="442" ;; #( - i*86) syscall="289" ;; #( - ia64*) syscall="1274" ;; #( - powerpc*) syscall="273" ;; #( -@@ -30172,6 +30173,7 @@ else - case $host_cpu in - #( - alpha) syscall="443" ;; #( -+ sw_64) syscall="443" ;; #( - i*86) syscall="290" ;; #( - ia64*) syscall="1275" ;; #( - powerpc*) syscall="274" ;; #( -diff --git a/configure.ac b/configure.ac -index 2450048..869b6e0 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -2024,6 +2024,7 @@ UL_BUILD_INIT([ionice]) - UL_REQUIRES_SYSCALL_CHECK([ionice], - [UL_CHECK_SYSCALL([ioprio_set], - [alpha], [442], -+ [sw_64], [442], - [i*86], [289], - [ia64*], [1274], - [powerpc*], [273], -@@ -2036,6 +2037,7 @@ UL_REQUIRES_SYSCALL_CHECK([ionice], - UL_REQUIRES_SYSCALL_CHECK([ionice], - [UL_CHECK_SYSCALL([ioprio_get], - [alpha], [443], -+ [sw_64], [443], - [i*86], [290], - [ia64*], [1275], - [powerpc*], [274], -diff --git a/include/pt-bsd.h b/include/pt-bsd.h -index 9bf47a5..8538a2c 100644 ---- a/include/pt-bsd.h -+++ b/include/pt-bsd.h -@@ -11,7 +11,7 @@ - #define BSD_LINUX_BOOTDIR "/usr/ucb/mdec" - - #if defined (__alpha__) || defined (__powerpc__) || \ -- defined (__ia64__) || defined (__hppa__) -+ defined (__ia64__) || defined (__hppa__) || defined (__sw_64__) - # define BSD_LABELSECTOR 0 - # define BSD_LABELOFFSET 64 - #else -@@ -137,7 +137,7 @@ struct bsd_disklabel { - #define BSD_FS_ADVFS 16 /* Digital Unix AdvFS */ - - /* this is annoying, but it's also the way it is :-( */ --#ifdef __alpha__ -+#if defined __alpha__ || defined __sw_64__ - #define BSD_FS_EXT2 8 /* ext2 file system */ - #else - #define BSD_FS_MSDOS 8 /* MS-DOS file system */ -diff --git a/libfdisk/src/bsd.c b/libfdisk/src/bsd.c -index 9ba3140..8d9668f 100644 ---- a/libfdisk/src/bsd.c -+++ b/libfdisk/src/bsd.c -@@ -55,7 +55,7 @@ static struct fdisk_parttype bsd_fstypes[] = { - {BSD_FS_V71K, "4.1BSD"}, - {BSD_FS_V8, "Eighth Edition"}, - {BSD_FS_BSDFFS, "4.2BSD"}, --#ifdef __alpha__ -+#if defined __alpha__ || defined __sw_64__ - {BSD_FS_EXT2, "ext2"}, - #else - {BSD_FS_MSDOS, "MS-DOS"}, -@@ -80,7 +80,7 @@ struct fdisk_bsd_label { - - struct dos_partition *dos_part; /* parent */ - struct bsd_disklabel bsd; /* on disk label */ --#if defined (__alpha__) -+#if defined (__alpha__) || defined (__sw_64__) - /* We access this through a u_int64_t * when checksumming */ - char bsdbuffer[BSD_BBSIZE] __attribute__((aligned(8))); - #else -@@ -120,7 +120,7 @@ static struct fdisk_parttype *bsd_partition_parttype( - } - - --#if defined (__alpha__) -+#if defined (__alpha__) || defined (__sw_64__) - static void alpha_bootblock_checksum (char *boot) - { - uint64_t *dp = (uint64_t *) boot, sum = 0; -@@ -605,7 +605,7 @@ int fdisk_bsd_edit_disklabel(struct fdisk_context *cxt) - struct bsd_disklabel *d = self_disklabel(cxt); - uintmax_t res; - --#if defined (__alpha__) || defined (__ia64__) -+#if defined (__alpha__) || defined (__ia64__) || defined (__sw_64__) - if (fdisk_ask_number(cxt, DEFAULT_SECTOR_SIZE, d->d_secsize, - UINT32_MAX, _("bytes/sector"), &res) == 0) - d->d_secsize = res; -@@ -710,7 +710,7 @@ int fdisk_bsd_write_bootstrap(struct fdisk_context *cxt) - sector = 0; - if (l->dos_part) - sector = dos_partition_get_start(l->dos_part); --#if defined (__alpha__) -+#if defined (__alpha__) || defined (__sw_64__) - alpha_bootblock_checksum(l->bsdbuffer); - #endif - if (lseek(cxt->dev_fd, (off_t) sector * DEFAULT_SECTOR_SIZE, SEEK_SET) == -1) { -@@ -760,7 +760,7 @@ static int bsd_initlabel (struct fdisk_context *cxt) - else - d -> d_type = BSD_DTYPE_ST506; - --#if !defined (__alpha__) -+#if !defined (__alpha__) && !defined (__sw_64__) - d -> d_flags = BSD_D_DOSPART; - #else - d -> d_flags = 0; -@@ -884,7 +884,7 @@ static int bsd_write_disklabel(struct fdisk_context *cxt) - memmove(&l->bsdbuffer[BSD_LABELSECTOR * DEFAULT_SECTOR_SIZE - + BSD_LABELOFFSET], d, sizeof(*d)); - --#if defined (__alpha__) && BSD_LABELSECTOR == 0 -+#if (defined (__alpha__) || defined (__sw_64__)) && BSD_LABELSECTOR == 0 - /* Write the checksum to the end of the first sector. */ - alpha_bootblock_checksum(l->bsdbuffer); - #endif -@@ -920,7 +920,7 @@ static int bsd_translate_fstype (int linux_type) - case 0x06: /* DOS 16-bit >=32M */ - case 0xe1: /* DOS access */ - case 0xe3: /* DOS R/O */ --#if !defined (__alpha__) -+#if !defined (__alpha__) && !defined (__sw_64__) - case 0xf2: /* DOS secondary */ - return BSD_FS_MSDOS; - #endif -diff --git a/sys-utils/hwclock-rtc.c b/sys-utils/hwclock-rtc.c -index ef95d98..ec612f5 100644 ---- a/sys-utils/hwclock-rtc.c -+++ b/sys-utils/hwclock-rtc.c -@@ -255,7 +255,7 @@ static int synchronize_to_clock_tick_rtc(const struct hwclock_control *ctl) - } else { - int rc; /* Return code from ioctl */ - /* Turn on update interrupts (one per second) */ --#if defined(__alpha__) || defined(__sparc__) -+#if defined(__alpha__) || defined(__sw_64__) || defined(__sparc__) - /* - * Not all alpha kernels reject RTC_UIE_ON, but probably - * they should. -@@ -387,7 +387,7 @@ struct clock_ops *probe_for_rtc_clock(const struct hwclock_control *ctl) - return &rtc_interface; - } - --#ifdef __alpha__ -+#if defined __alpha__ || defined __sw_64__ - /* - * Get the Hardware Clock epoch setting from the kernel. - */ -diff --git a/sys-utils/hwclock.c b/sys-utils/hwclock.c -index 19e7410..47aee63 100644 ---- a/sys-utils/hwclock.c -+++ b/sys-utils/hwclock.c -@@ -1024,7 +1024,7 @@ manipulate_clock(const struct hwclock_control *ctl, const time_t set_time, - * Get or set the kernel RTC driver's epoch on Alpha machines. - * ISA machines are hard coded for 1900. - */ --#if defined(__linux__) && defined(__alpha__) -+#if defined(__linux__) && defined(__alpha__) || defined(__sw_64__) - static void - manipulate_epoch(const struct hwclock_control *ctl) - { -@@ -1067,7 +1067,7 @@ usage(void) - puts(_(" -w, --systohc set the RTC from the system time")); - puts(_(" --systz send timescale configurations to the kernel")); - puts(_(" -a, --adjust adjust the RTC to account for systematic drift")); --#if defined(__linux__) && defined(__alpha__) -+#if defined(__linux__) && defined(__alpha__) || defined(__sw_64__) - puts(_(" --getepoch display the RTC epoch")); - puts(_(" --setepoch set the RTC epoch according to --epoch")); - #endif -@@ -1082,7 +1082,7 @@ usage(void) - printf(_( - " --directisa use the ISA bus instead of %1$s access\n"), _PATH_RTC_DEV); - puts(_(" --date