This is the mail archive of the mailing list for the libstdc++ project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Use stdint-wrap.h on *-*-netbsd[56]*


On 18/09/15 13:59 +0100, Jonathan Wakely wrote:
This patch adjust config.gcc so that it installs <stdint.h> for NetBSD
5.x and 6.x, which is necessary for the C++ library because the host
<stdint.h> has:

#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS)
#include <machine/int_limits.h>

#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS)
#include <machine/int_const.h>

This means that contrary to the C++11 standard the stdint macros are
only defined when __STDC_CONSTANT_MACROS / __STDC_LIMIT_MACROS are

I first noted the problem earlier this year and opened

I rediscovered the problem when I broke netbsd bootstrap by including
<ext/random> during bootstrap with

That header uses UINT32_C, which is not defined without this patch.

NetBSD 7.x should be OK, because it knows about C++11 (see the link in
the PR for details).

Tested x86_64-unknown-netbsd5.1, OK for trunk?

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index affc5ba..9450dcb 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,7 @@
+2015-09-16  Jonathan Wakely  <>
+	* config.gcc (*-*-netbsd[5-6]*): Set use_gcc_stdint=wrap.
2015-09-15  Alan Lawrence  <>

	* config/aarch64/
diff --git a/gcc/config.gcc b/gcc/config.gcc
index 75807f5..394ded3 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -788,6 +788,14 @@ case ${target} in
+  # NetBSD 5.x and 6.x provide <stdint.h> but require
+  case ${target} in
+    *-*-netbsd[5-6]* | *-*-netbsdelf[5-6]*)
+      use_gcc_stdint=wrap
+      ;;
+  esac

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]