This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [RFC] Forcing 64-bits __OFF_T_TYPE and __INO_T_TYPE for new 32-bit architectures?
- From: "Manuel A. Fernandez Montecelo" <manuel dot montezelo at gmail dot com>
- To: libc-alpha at sourceware dot org
- Date: Mon, 6 Jun 2016 19:54:25 +0100
- Subject: Re: [RFC] Forcing 64-bits __OFF_T_TYPE and __INO_T_TYPE for new 32-bit architectures?
- Authentication-results: sourceware.org; auth=none
- References: <20160606185149 dot GA11555 at reva dot itsari dot org>
2016-06-06 19:51 Manuel A. Fernandez Montecelo:
Does this look like a reasonable approach?
https://github.com/manuelafm/riscv-gnu-toolchain/commit/764f5ac958618c1ca8761845864164365282ffbd
(also attached)
Sorry for the double posting. Attaching for real now.
--
Manuel A. Fernandez Montecelo <manuel.montezelo@gmail.com>
>From 764f5ac958618c1ca8761845864164365282ffbd Mon Sep 17 00:00:00 2001
From: "Manuel A. Fernandez Montecelo" <manuel.montezelo@gmail.com>
Date: Mon, 9 May 2016 22:40:39 +0100
Subject: [PATCH] Use the 64-bit ABI for offset and inode types
32-bit offsets (__OFF_T_TYPE) and file serial numbers (__INO_T_TYPE) are
deprecated for new 32-bit architectures.
This solution makes compulsory the 64-bit-like ABI for all RISC-V flavors, by:
a) creating an arch-specific file that includes "linux/generic/bits/typesizes.h"
b) overriding the macros so they match __INO64_T_TYPE and __OFF64_T_TYPE, and
setting __INO_T_MATCHES_INO64_T and __OFF_T_MATCHES_OFF64_T accordingly
---
.../sysdeps/unix/sysv/linux/riscv/bits/typesizes.h | 33 ++++++++++++++++++++++
1 file changed, 33 insertions(+)
create mode 100644 glibc/sysdeps/unix/sysv/linux/riscv/bits/typesizes.h
diff --git a/glibc/sysdeps/unix/sysv/linux/riscv/bits/typesizes.h b/glibc/sysdeps/unix/sysv/linux/riscv/bits/typesizes.h
new file mode 100644
index 0000000..71f3f5c
--- /dev/null
+++ b/glibc/sysdeps/unix/sysv/linux/riscv/bits/typesizes.h
@@ -0,0 +1,33 @@
+/* bits/typesizes.h -- underlying types for *_t. Based on generic Linux
+ ABI for Linux/RISC-V.
+
+ Copyright (C) 2011-2014 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _BITS_TYPES_H
+# error "Never include <bits/typesizes.h> directly; use <sys/types.h> instead."
+#endif
+
+/* Include the header for linux/generic, to get the same values by default */
+#include <sysdeps/unix/sysv/linux/generic/bits/typesizes.h>
+
+/* Overrides -- RISC-V 32 and 64-bits to use the 64-bit ABI. 32-bit offsets and
+ file (inode) serial numbers are deprecated for new 32-bit architectures */
+#define __INO_T_TYPE __UQUAD_TYPE
+#define __OFF_T_TYPE __SQUAD_TYPE
+#define __INO_T_MATCHES_INO64_T 1
+#define __OFF_T_MATCHES_OFF64_T 1
--
2.8.1