On platforms where long is 32 bits, this change fixes a build failure:
/home/linux/arm/gdb/src/gdb/aarch64-linux-tdep.c: In function ‘const target_desc* aarch64_linux_core_read_description(gdbarch*, target_ops*, bfd*)’:
/home/linux/arm/gdb/src/gdb/arch/aarch64-gcs-linux.h:27:24: error: left shift count >= width of type [-Werror=shift-count-overflow]
27 | #define HWCAP_GCS (1UL << 32)
| ~~~~^~~~~
/home/linux/arm/gdb/src/gdb/aarch64-linux-tdep.c:1714:47: note: in expansion of macro ‘HWCAP_GCS’
1714 | features.gcs = features.gcs_linux = hwcap & HWCAP_GCS;
| ^~~~~~~~~
Suggested-by: Tom de Vries <tdevries@suse.de>
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=33372
/* Feature check for Guarded Control Stack. */
#ifndef HWCAP_GCS
-#define HWCAP_GCS (1UL << 32)
+#define HWCAP_GCS (1ULL << 32)
#endif
/* Make sure we only define these if the kernel header doesn't. */
/* Feature check for Guarded Control Stack. */
#ifndef HWCAP_GCS
-#define HWCAP_GCS (1UL << 32)
+#define HWCAP_GCS (1ULL << 32)
#endif
#ifndef PR_GET_SHADOW_STACK_STATUS
/* Feature check for Guarded Control Stack. */
#ifndef HWCAP_GCS
-#define HWCAP_GCS (1UL << 32)
+#define HWCAP_GCS (1ULL << 32)
#endif
#ifndef PR_GET_SHADOW_STACK_STATUS
/* Feature check for Guarded Control Stack. */
#ifndef HWCAP_GCS
-#define HWCAP_GCS (1UL << 32)
+#define HWCAP_GCS (1ULL << 32)
#endif
#ifndef PR_GET_SHADOW_STACK_STATUS
/* Feature check for Guarded Control Stack. */
#ifndef HWCAP_GCS
-#define HWCAP_GCS (1UL << 32)
+#define HWCAP_GCS (1ULL << 32)
#endif
#ifndef PR_GET_SHADOW_STACK_STATUS
/* Feature check for Guarded Control Stack. */
#ifndef HWCAP_GCS
- #define HWCAP_GCS (1UL << 32)
+ #define HWCAP_GCS (1ULL << 32)
#endif
int main (void) {