* [PATCH] Add netbsd-stdint.h to several netbsd targets
@ 2017-09-03 15:17 Maya Rashish
2017-09-30 21:00 ` Krister Walfridsson
0 siblings, 1 reply; 2+ messages in thread
From: Maya Rashish @ 2017-09-03 15:17 UTC (permalink / raw)
To: gcc-patches; +Cc: krister.walfridsson, coypu
grouping netbsd.h netbsd-stdint.h netbsd-elf.h as "nbsd_tm_file",
similar to freebsd.
I've only tested some of the archs, but the change originates in
netbsd's copy of GCC, so it should be safe for the untested ones as
well.
---
gcc/config.gcc | 21 +++++++++++----------
1 file changed, 11 insertions(+), 10 deletions(-)
diff --git a/gcc/config.gcc b/gcc/config.gcc
index 428e99a10..efbb49226 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -799,6 +799,7 @@ case ${target} in
case ${enable_threads} in
"" | yes | posix) thread_file='posix' ;;
esac
+ nbsd_tm_file="netbsd.h netbsd-stdint.h netbsd-elf.h"
default_use_cxa_atexit=yes
;;
*-*-openbsd*)
@@ -1002,7 +1003,7 @@ alpha*-*-freebsd*)
extra_options="${extra_options} alpha/elf.opt"
;;
alpha*-*-netbsd*)
- tm_file="elfos.h ${tm_file} netbsd.h alpha/elf.h netbsd-elf.h alpha/netbsd.h"
+ tm_file="elfos.h ${tm_file} ${nbsd_tm_file} alpha/elf.h alpha/netbsd.h"
tmake_file="${tmake_file} alpha/t-alpha"
extra_options="${extra_options} netbsd.opt netbsd-elf.opt \
alpha/elf.opt"
@@ -1102,7 +1103,7 @@ arm*-*-freebsd*) # ARM FreeBSD EABI
with_tls=${with_tls:-gnu}
;;
arm*-*-netbsdelf*)
- tm_file="dbxelf.h elfos.h netbsd.h netbsd-elf.h arm/elf.h arm/aout.h ${tm_file} arm/netbsd-elf.h"
+ tm_file="dbxelf.h elfos.h ${nbsd_tm_file} arm/elf.h arm/aout.h ${tm_file} arm/netbsd-elf.h"
extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
tmake_file="${tmake_file} arm/t-arm"
target_cpu_cname="arm6"
@@ -1487,11 +1488,11 @@ x86_64-*-freebsd*)
tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${fbsd_tm_file} i386/x86-64.h i386/freebsd.h i386/freebsd64.h"
;;
i[34567]86-*-netbsdelf*)
- tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h netbsd.h netbsd-stdint.h netbsd-elf.h i386/netbsd-elf.h"
+ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${nbsd_tm_file} i386/netbsd-elf.h"
extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
;;
x86_64-*-netbsd*)
- tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h netbsd.h netbsd-stdint.h netbsd-elf.h i386/x86-64.h i386/netbsd64.h"
+ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${nbsd_tm_file} i386/x86-64.h i386/netbsd64.h"
extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
;;
i[34567]86-*-openbsd*)
@@ -2074,7 +2075,7 @@ riscv*-*-elf* | riscv*-*-rtems*)
;;
mips*-*-netbsd*) # NetBSD/mips, either endian.
target_cpu_default="MASK_ABICALLS"
- tm_file="elfos.h ${tm_file} mips/elf.h netbsd.h netbsd-elf.h mips/netbsd.h"
+ tm_file="elfos.h ${tm_file} mips/elf.h ${nbsd_tm_file} mips/netbsd.h"
extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
;;
mips*-img-linux*)
@@ -2390,7 +2391,7 @@ powerpc*-*-freebsd*)
esac
;;
powerpc-*-netbsd*)
- tm_file="${tm_file} dbxelf.h elfos.h netbsd.h netbsd-elf.h freebsd-spec.h rs6000/sysv4.h rs6000/netbsd.h"
+ tm_file="${tm_file} ${nbsd_tm_file} dbxelf.h elfos.h freebsd-spec.h rs6000/sysv4.h rs6000/netbsd.h"
extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
tmake_file="${tmake_file} rs6000/t-netbsd"
extra_options="${extra_options} rs6000/sysv4.opt"
@@ -2732,7 +2733,7 @@ sh-*-elf* | sh[12346l]*-*-elf* | \
fi
tm_file="${tm_file} gnu-user.h linux.h glibc-stdint.h sh/linux.h" ;;
sh*-*-netbsd*)
- tm_file="${tm_file} netbsd.h netbsd-elf.h sh/netbsd-elf.h"
+ tm_file="${tm_file} ${nbsd_tm_file} sh/netbsd-elf.h"
extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
;;
@@ -2892,7 +2893,7 @@ sparc-*-linux*)
fi
;;
sparc-*-netbsdelf*)
- tm_file="${tm_file} dbxelf.h elfos.h sparc/sysv4.h netbsd.h netbsd-elf.h sparc/netbsd-elf.h"
+ tm_file="${tm_file} dbxelf.h elfos.h sparc/sysv4.h ${nbsd_tm_file} sparc/netbsd-elf.h"
extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
extra_options="${extra_options} sparc/long-double-switch.opt"
tmake_file="${tmake_file} sparc/t-sparc"
@@ -2940,7 +2941,7 @@ sparc64-*-freebsd*|ultrasparc-*-freebsd*)
;;
sparc64-*-netbsd*)
tm_file="sparc/biarch64.h ${tm_file}"
- tm_file="${tm_file} dbxelf.h elfos.h sparc/sysv4.h netbsd.h netbsd-elf.h sparc/netbsd-elf.h"
+ tm_file="${tm_file} dbxelf.h elfos.h sparc/sysv4.h ${nbsd_tm_file} sparc/netbsd-elf.h"
extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
extra_options="${extra_options} sparc/long-double-switch.opt"
tmake_file="${tmake_file} sparc/t-sparc sparc/t-netbsd64"
@@ -3044,7 +3045,7 @@ vax-*-linux*)
extra_options="${extra_options} vax/elf.opt"
;;
vax-*-netbsdelf*)
- tm_file="${tm_file} elfos.h netbsd.h netbsd-elf.h vax/elf.h vax/netbsd-elf.h"
+ tm_file="${tm_file} elfos.h ${nbsd_tm_file} vax/elf.h vax/netbsd-elf.h"
extra_options="${extra_options} netbsd.opt netbsd-elf.opt vax/elf.opt"
;;
vax-*-openbsd*)
--
2.14.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] Add netbsd-stdint.h to several netbsd targets
2017-09-03 15:17 [PATCH] Add netbsd-stdint.h to several netbsd targets Maya Rashish
@ 2017-09-30 21:00 ` Krister Walfridsson
0 siblings, 0 replies; 2+ messages in thread
From: Krister Walfridsson @ 2017-09-30 21:00 UTC (permalink / raw)
To: Maya Rashish; +Cc: gcc-patches
[-- Attachment #1: Type: text/plain, Size: 495 bytes --]
On Sun, Sep 3, 2017 at 5:16 PM, Maya Rashish <coypu@sdf.org> wrote:
> grouping netbsd.h netbsd-stdint.h netbsd-elf.h as "nbsd_tm_file",
> similar to freebsd.
I found a small bug in the patch -- the NetBSD stdint.h have different
definitions for 8- and 16-bit "fast" types than what is in the
netbsd-stditn.h, so the vax-*-netbsdelf* need to work around that.
The patch is also missing to update m68k*-*-netbsdelf*.
I have fixed those two issues, and committed the attached patch.
/Krister
[-- Attachment #2: r253323.patch --]
[-- Type: application/octet-stream, Size: 6892 bytes --]
Index: gcc/ChangeLog
===================================================================
--- gcc/ChangeLog (revision 253322)
+++ gcc/ChangeLog (revision 253323)
@@ -1,3 +1,25 @@
+2017-09-30 Krister Walfridsson <krister.walfridsson@gmail.com>
+ Maya Rashish <coypu@sdf.org>
+
+ * config.gcc (*-*-netbsd*): New variable nbsd_tm_file containing
+ netbsd.h, netbsd-stdint.h, and netbsd-elf.h.
+ (alpha*-*-netbsd*) Use nbsd_tm_file.
+ (arm*-*-netbsdelf*) Likewise.
+ (i[34567]86-*-netbsdelf*) Likewise.
+ (x86_64-*-netbsd*) Likewise.
+ (mips*-*-netbsd*) Likewise.
+ (powerpc-*-netbsd*) Likewise.
+ (sh*-*-netbsd*) Likewise.
+ (sparc-*-netbsdelf*) Likewise.
+ (sparc64-*-netbsd*) Likewise.
+ (m68k*-*-netbsdelf*) Use nbsd_tm_file and add CHAR_FAST8/SHORT_FAST16
+ to tm_defines.
+ (vax-*-netbsdelf*) Likewise.
+ * config/netbsd-stdint.h (INT_FAST8_TYPE): Check CHAR_FAST8.
+ (UINT_FAST8_TYPE) Likewise.
+ (INT_FAST16_TYPE) Check CHAR_FAST16.
+ (UINT_FAST16_TYPE) Likewise.
+
2017-09-30 Jakub Jelinek <jakub@redhat.com>
PR target/82361
Index: gcc/config.gcc
===================================================================
--- gcc/config.gcc (revision 253322)
+++ gcc/config.gcc (revision 253323)
@@ -801,6 +801,7 @@
case ${enable_threads} in
"" | yes | posix) thread_file='posix' ;;
esac
+ nbsd_tm_file="netbsd.h netbsd-stdint.h netbsd-elf.h"
default_use_cxa_atexit=yes
;;
*-*-openbsd*)
@@ -1004,7 +1005,7 @@
extra_options="${extra_options} alpha/elf.opt"
;;
alpha*-*-netbsd*)
- tm_file="elfos.h ${tm_file} netbsd.h alpha/elf.h netbsd-elf.h alpha/netbsd.h"
+ tm_file="elfos.h ${tm_file} ${nbsd_tm_file} alpha/elf.h alpha/netbsd.h"
tmake_file="${tmake_file} alpha/t-alpha"
extra_options="${extra_options} netbsd.opt netbsd-elf.opt \
alpha/elf.opt"
@@ -1104,7 +1105,7 @@
with_tls=${with_tls:-gnu}
;;
arm*-*-netbsdelf*)
- tm_file="dbxelf.h elfos.h netbsd.h netbsd-elf.h arm/elf.h arm/aout.h ${tm_file} arm/netbsd-elf.h"
+ tm_file="dbxelf.h elfos.h ${nbsd_tm_file} arm/elf.h arm/aout.h ${tm_file} arm/netbsd-elf.h"
extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
tmake_file="${tmake_file} arm/t-arm"
target_cpu_cname="arm6"
@@ -1489,11 +1490,11 @@
tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${fbsd_tm_file} i386/x86-64.h i386/freebsd.h i386/freebsd64.h"
;;
i[34567]86-*-netbsdelf*)
- tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h netbsd.h netbsd-stdint.h netbsd-elf.h i386/netbsd-elf.h"
+ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${nbsd_tm_file} i386/netbsd-elf.h"
extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
;;
x86_64-*-netbsd*)
- tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h netbsd.h netbsd-stdint.h netbsd-elf.h i386/x86-64.h i386/netbsd64.h"
+ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${nbsd_tm_file} i386/x86-64.h i386/netbsd64.h"
extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
;;
i[34567]86-*-openbsd*)
@@ -1931,9 +1932,9 @@
m68k*-*-netbsdelf*)
default_m68k_cpu=68020
default_cf_cpu=5475
- tm_file="${tm_file} dbxelf.h elfos.h netbsd.h netbsd-elf.h m68k/netbsd-elf.h"
+ tm_file="${tm_file} dbxelf.h elfos.h ${nbsd_tm_file} m68k/netbsd-elf.h"
extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
- tm_defines="${tm_defines} MOTOROLA=1"
+ tm_defines="${tm_defines} MOTOROLA=1 CHAR_FAST8=1 SHORT_FAST16=1"
;;
m68k*-*-openbsd*)
default_m68k_cpu=68020
@@ -2060,7 +2061,7 @@
;;
mips*-*-netbsd*) # NetBSD/mips, either endian.
target_cpu_default="MASK_ABICALLS"
- tm_file="elfos.h ${tm_file} mips/elf.h netbsd.h netbsd-elf.h mips/netbsd.h"
+ tm_file="elfos.h ${tm_file} mips/elf.h ${nbsd_tm_file} mips/netbsd.h"
extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
;;
mips*-img-linux*)
@@ -2376,7 +2377,7 @@
esac
;;
powerpc-*-netbsd*)
- tm_file="${tm_file} dbxelf.h elfos.h netbsd.h netbsd-elf.h freebsd-spec.h rs6000/sysv4.h rs6000/netbsd.h"
+ tm_file="${tm_file} dbxelf.h elfos.h ${nbsd_tm_file} freebsd-spec.h rs6000/sysv4.h rs6000/netbsd.h"
extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
tmake_file="${tmake_file} rs6000/t-netbsd"
extra_options="${extra_options} rs6000/sysv4.opt"
@@ -2707,7 +2708,7 @@
fi
tm_file="${tm_file} gnu-user.h linux.h glibc-stdint.h sh/linux.h" ;;
sh*-*-netbsd*)
- tm_file="${tm_file} netbsd.h netbsd-elf.h sh/netbsd-elf.h"
+ tm_file="${tm_file} ${nbsd_tm_file} sh/netbsd-elf.h"
extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
;;
@@ -2867,7 +2868,7 @@
fi
;;
sparc-*-netbsdelf*)
- tm_file="${tm_file} dbxelf.h elfos.h sparc/sysv4.h netbsd.h netbsd-elf.h sparc/netbsd-elf.h"
+ tm_file="${tm_file} dbxelf.h elfos.h sparc/sysv4.h ${nbsd_tm_file} sparc/netbsd-elf.h"
extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
extra_options="${extra_options} sparc/long-double-switch.opt"
tmake_file="${tmake_file} sparc/t-sparc"
@@ -2915,7 +2916,7 @@
;;
sparc64-*-netbsd*)
tm_file="sparc/biarch64.h ${tm_file}"
- tm_file="${tm_file} dbxelf.h elfos.h sparc/sysv4.h netbsd.h netbsd-elf.h sparc/netbsd-elf.h"
+ tm_file="${tm_file} dbxelf.h elfos.h sparc/sysv4.h ${nbsd_tm_file} sparc/netbsd-elf.h"
extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
extra_options="${extra_options} sparc/long-double-switch.opt"
tmake_file="${tmake_file} sparc/t-sparc sparc/t-netbsd64"
@@ -3019,8 +3020,9 @@
extra_options="${extra_options} vax/elf.opt"
;;
vax-*-netbsdelf*)
- tm_file="${tm_file} elfos.h netbsd.h netbsd-elf.h vax/elf.h vax/netbsd-elf.h"
+ tm_file="${tm_file} elfos.h ${nbsd_tm_file} vax/elf.h vax/netbsd-elf.h"
extra_options="${extra_options} netbsd.opt netbsd-elf.opt vax/elf.opt"
+ tm_defines="${tm_defines} CHAR_FAST8=1 SHORT_FAST16=1"
;;
vax-*-openbsd*)
tm_file="vax/vax.h vax/openbsd1.h openbsd.h openbsd-stdint.h openbsd-libpthread.h vax/openbsd.h"
Index: gcc/config/netbsd-stdint.h
===================================================================
--- gcc/config/netbsd-stdint.h (revision 253322)
+++ gcc/config/netbsd-stdint.h (revision 253323)
@@ -42,12 +42,28 @@
#define UINT_LEAST32_TYPE UINT32_TYPE
#define UINT_LEAST64_TYPE UINT64_TYPE
+#ifdef CHAR_FAST8
+#define INT_FAST8_TYPE (LONG_TYPE_SIZE == 64 ? "int" : "signed char")
+#else
#define INT_FAST8_TYPE INT32_TYPE
+#endif
+#ifdef SHORT_FAST16
+#define INT_FAST16_TYPE (LONG_TYPE_SIZE == 64 ? "int" : "short int")
+#else
#define INT_FAST16_TYPE INT32_TYPE
+#endif
#define INT_FAST32_TYPE INT32_TYPE
#define INT_FAST64_TYPE INT64_TYPE
+#ifdef CHAR_FAST8
+#define UINT_FAST8_TYPE "unsigned char"
+#else
#define UINT_FAST8_TYPE UINT32_TYPE
+#endif
+#ifdef SHORT_FAST16
+#define UINT_FAST16_TYPE "short unsigned int"
+#else
#define UINT_FAST16_TYPE UINT32_TYPE
+#endif
#define UINT_FAST32_TYPE UINT32_TYPE
#define UINT_FAST64_TYPE UINT64_TYPE
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-09-30 21:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-03 15:17 [PATCH] Add netbsd-stdint.h to several netbsd targets Maya Rashish
2017-09-30 21:00 ` Krister Walfridsson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).