This is the mail archive of the newlib@sourceware.org mailing list for the newlib 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] nvptx newlib port


On 04/06/2018 02:11 PM, Cesar Philippidis wrote:
> On 04/06/2018 02:08 PM, Joel Sherrill wrote:
>>
>>
>> On Fri, Apr 6, 2018 at 4:00 PM, Jeff Johnston <jjohnstn@redhat.com
>> <mailto:jjohnstn@redhat.com>> wrote:
>>
>>     Looks fine.  I might suggest you add a check in configure.host that
>>     issues
>>     an error or warning message if the elix-level is not set to 1 and
>>     --enable-global-io-streams is not set
>>     (if what you said above is required).  Other than that, I can check
>>     it in
>>     shortly.
>>
>>
>> Can those be forced in the configure magic and then not required
>> on the configure command line?
> 
> I'll see what I can do. Would it be OK to make that change in a follow
> up patch?

What's a portable way of adding errors and warnings to configure.host?
It looks like it's just a regular shell script, so I'm not sure if
AC_MSG_WARN or AC_MSG_ERROR will work in there.

Short of setting emitting warnings and errors, the attached patch
silently enable --enable-newlib-global-stdio-streams
--enable-newlib-elix-level=1 for nvptx targets if the user didn't
specify anything else. If that solution is sufficient, I can regenerate
a patch with the complete nvptx port.

Thanks,
Cesar

>From d7c950e3bd7945c13c4476c4b81058f75fce8ea4 Mon Sep 17 00:00:00 2001
From: Cesar Philippidis <cesar@codesourcery.com>
Date: Mon, 9 Apr 2018 11:04:58 -0700
Subject: [PATCH] Set configuration defaults for nvptx

---
 newlib/configure.host | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/newlib/configure.host b/newlib/configure.host
index 83b35d908..9ccf54573 100644
--- a/newlib/configure.host
+++ b/newlib/configure.host
@@ -27,6 +27,7 @@
 #   newlib_io_c99_formats --enable-newlib-io-c99-formats ("yes", "no", "")
 #   newlib_io_long_long --enable-newlib-io-long-long ("yes", "no", "")
 #   newlib_io_long_double --enable-newlib-io-long-double ("yes", "no", "")
+#   newlib_global_stdio_streams --enable-global-stdio-streams ("yes", "no, "")
 
 # It sets the following shell variables:
 #   newlib_cflags	Special CFLAGS to use when building
@@ -251,9 +252,7 @@ case "${host_cpu}" in
 	;;
   nvptx*)
 	machine_dir=nvptx
-	newlib_elix_level=1
 	newlib_cflags="${newlib_cflags} -DMALLOC_PROVIDED"
-	newlib_cflags="${newlib_cflags} -D_WANT_REENT_GLOBAL_STDIO_STREAMS"
 	;;
   or1k*|or1knd*)
 	machine_dir=or1k
@@ -923,3 +922,15 @@ fi
 if test -z "${have_crt0}" && test -n "${sys_dir}"; then
   have_crt0="yes"
 fi
+
+# Target-specific defaults
+case "${host_cpu}" in
+  nvptx*)
+	if [ "x${newlib_elix_level}" = "x0" ]; then
+		newlib_elix_level=1;
+	fi
+	if [[ -z ${newlib_global_stdio_streams} ]]; then
+		newlib_global_stdio_streams="yes";
+	fi
+	;;
+esac
-- 
2.14.3



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