public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH 4/4][Ada,DJGPP] Ada support for DJGPP
@ 2016-07-30  5:47 Andris Pavenis
  2016-09-04 17:24 ` Andris Pavenis
  0 siblings, 1 reply; 11+ messages in thread
From: Andris Pavenis @ 2016-07-30  5:47 UTC (permalink / raw)
  To: GCC Patches; +Cc: DJ Delorie

[-- Attachment #1: Type: text/plain, Size: 818 bytes --]

This last patch (4/4) contains DJGPP related changes to adaint.c (except one which belongs to patch 
1/4).

ChangeLog entry:

2016-07-30 Andris Pavenis <andris.pavenis@iki.fi>

* ada/adaint.c: Include process.h, signal.h, dir.h and utime.h for DJGPP.
   (DIR_SEPARATOR) define to '\\' for DJGPP.
   (__gnat_get_maximum_file_name_length): decide return value depending on
   availability of LFN for DJGPP
   (__gnat_get_file_names_case_sensitive): return 0 for DJGPP unless
   overriden in environment
   (__gnat_get_default_identifier_character_set): return '1' for DJGPP
   (__gnat_is_absolute_path): Support MS-DOS style absolute paths for DJGPP.
   (__gnat_portable_spawn): Use spewnvp for DJGPP.
   (__gnat_portable_no_block_spawn): Use spawnvp for DJGPP.
   (__gnat_portable_wait): Return 0 for DJGPP.


Andris



[-- Attachment #2: 0004-DJGPP-Ada-DJGPP-support.patch --]
[-- Type: text/x-patch, Size: 3707 bytes --]

From 3f96c997eb087c5ee4b90d706919074e36ee9927 Mon Sep 17 00:00:00 2001
From: Andris Pavenis <andris.pavenis@iki.fi>
Date: Mon, 25 Jul 2016 20:08:26 +0300
Subject: [PATCH 4/4] [DJGPP, Ada] DJGPP support

* ada/adaint.c: Include process.h, signal.h, dir.h and utime.h for DJGPP.
  (DIR_SEPARATOR) define to '\\' for DJGPP.
  (__gnat_get_maximum_file_name_length): decide return value depending on
  availability of LFN for DJGPP
  (__gnat_get_file_names_case_sensitive): return 0 for DJGPP unless
  overriden in environment
  (__gnat_get_default_identifier_character_set): return '1' for DJGPP
  (__gnat_is_absolute_path): Support MS-DOS style absolute paths for DJGPP.
  (__gnat_portable_spawn): Use spewnvp for DJGPP.
  (__gnat_portable_no_block_spawn): Use spawnvp for DJGPP.
  (__gnat_portable_wait): Return 0 for DJGPP.



Signed-off-by: Andris Pavenis <andris.pavenis@iki.fi>
---
 gcc/ada/adaint.c | 32 ++++++++++++++++++++++++++------
 1 file changed, 26 insertions(+), 6 deletions(-)

diff --git a/gcc/ada/adaint.c b/gcc/ada/adaint.c
index f317865..1658acf 100644
--- a/gcc/ada/adaint.c
+++ b/gcc/ada/adaint.c
@@ -165,11 +165,16 @@ UINT CurrentCCSEncoding;
 #include <sys/wait.h>
 #endif
 
-#if defined (_WIN32)
-
+#if defined (__DJGPP__)
 #include <process.h>
 #include <signal.h>
 #include <dir.h>
+#include <utime.h>
+#undef DIR_SEPARATOR
+#define DIR_SEPARATOR '\\'
+
+#elif defined (_WIN32)
+
 #include <windows.h>
 #include <accctrl.h>
 #include <aclapi.h>
@@ -538,7 +543,11 @@ __gnat_try_lock (char *dir, char *file)
 int
 __gnat_get_maximum_file_name_length (void)
 {
+#if defined (__DJGPP__)
+  return (_use_lfn(".")) ? -1 : 8;
+#else
   return -1;
+#endif
 }
 
 /* Return nonzero if file names are case sensitive.  */
@@ -560,7 +569,7 @@ __gnat_get_file_names_case_sensitive (void)
 	{
 	  /* By default, we suppose filesystems aren't case sensitive on
 	     Windows and Darwin (but they are on arm-darwin).  */
-#if defined (WINNT) \
+#if defined (WINNT) || defined (__DJGPP__) \
   || (defined (__APPLE__) && !(defined (__arm__) || defined (__arm64__)))
 	  file_names_case_sensitive_cache = 0;
 #else
@@ -576,7 +585,7 @@ __gnat_get_file_names_case_sensitive (void)
 int
 __gnat_get_env_vars_case_sensitive (void)
 {
-#if defined (WINNT)
+#if defined (WINNT) || defined (__DJGPP__)
  return 0;
 #else
  return 1;
@@ -586,7 +595,11 @@ __gnat_get_env_vars_case_sensitive (void)
 char
 __gnat_get_default_identifier_character_set (void)
 {
+#if defined (__DJGPP__)
+  return 'p';
+#else
   return '1';
+#endif
 }
 
 /* Return the current working directory.  */
@@ -1646,7 +1659,7 @@ __gnat_is_absolute_path (char *name, int length)
 #else
   return (length != 0) &&
      (*name == '/' || *name == DIR_SEPARATOR
-#if defined (WINNT)
+#if defined (WINNT) || defined(__DJGPP__)
       || (length > 1 && ISALPHA (name[0]) && name[1] == ':')
 #endif
 	  );
@@ -2234,7 +2247,7 @@ __gnat_portable_spawn (char *args[] ATTRIBUTE_UNUSED)
 #if defined (__vxworks) || defined(__PikeOS__)
   return -1;
 
-#elif defined (_WIN32)
+#elif defined (__DJGPP__) || defined (_WIN32)
   /* args[0] must be quotes as it could contain a full pathname with spaces */
   char *args_0 = args[0];
   args[0] = (char *)xmalloc (strlen (args_0) + 3);
@@ -2606,6 +2619,12 @@ __gnat_portable_no_block_spawn (char *args[] ATTRIBUTE_UNUSED)
   /* Not supported.  */
   return -1;
 
+#elif defined(__DJGPP__)
+  if (spawnvp (P_WAIT, args[0], args) != 0)
+    return -1;
+  else
+    return 0;
+
 #elif defined (_WIN32)
 
   HANDLE h = NULL;
@@ -2649,6 +2668,7 @@ __gnat_portable_wait (int *process_status)
 
   pid = win32_wait (&status);
 
+#elif defined (__DJGPP__)
 #else
 
   pid = waitpid (-1, &status, 0);
-- 
2.7.4



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 4/4][Ada,DJGPP] Ada support for DJGPP
  2016-07-30  5:47 [PATCH 4/4][Ada,DJGPP] Ada support for DJGPP Andris Pavenis
@ 2016-09-04 17:24 ` Andris Pavenis
  2016-09-04 18:55   ` Arnaud Charlet
  0 siblings, 1 reply; 11+ messages in thread
From: Andris Pavenis @ 2016-09-04 17:24 UTC (permalink / raw)
  To: GCC Patches; +Cc: DJ Delorie

[-- Attachment #1: Type: text/plain, Size: 1085 bytes --]

On 07/30/2016 08:47 AM, Andris Pavenis wrote:
> This last patch (4/4) contains DJGPP related changes to adaint.c (except one which belongs to 
> patch 1/4).
>
> ChangeLog entry:
>
> 2016-07-30 Andris Pavenis <andris.pavenis@iki.fi>
>
> * ada/adaint.c: Include process.h, signal.h, dir.h and utime.h for DJGPP.
>   (DIR_SEPARATOR) define to '\\' for DJGPP.
>   (__gnat_get_maximum_file_name_length): decide return value depending on
>   availability of LFN for DJGPP
>   (__gnat_get_file_names_case_sensitive): return 0 for DJGPP unless
>   overriden in environment
>   (__gnat_get_default_identifier_character_set): return '1' for DJGPP
>   (__gnat_is_absolute_path): Support MS-DOS style absolute paths for DJGPP.
>   (__gnat_portable_spawn): Use spewnvp for DJGPP.
>   (__gnat_portable_no_block_spawn): Use spawnvp for DJGPP.
>   (__gnat_portable_wait): Return 0 for DJGPP.

New revision of patch is in the attachment.

Only 1 additional change:

include ctype.h and define ISALPHA to isalpha for DJGPP when IN_RTS is defined.

Updated ChangeLog entry is in the attachment.

Andris


[-- Attachment #2: 0004-DJGPP-Ada-Ada-support.patch --]
[-- Type: text/x-patch, Size: 4275 bytes --]

From 7d102a4d4d5d31d8225e69c3e53f3d4a234515ba Mon Sep 17 00:00:00 2001
From: Andris Pavenis <andris.pavenis@iki.fi>
Date: Sat, 3 Sep 2016 08:20:14 +0300
Subject: [PATCH 4/4] [DJGPP, Ada] Ada support

* ada/adaint.c: Include process.h, signal.h, dir.h and utime.h for DJGPP.
  ISALPHA: include <ctype.h> and define to isalpha for DJGPP when IN_RTS is defined.
  (DIR_SEPARATOR) define to '\\' for DJGPP.
  (__gnat_get_maximum_file_name_length): decide return value depending on
  availability of LFN for DJGPP
  (__gnat_get_file_names_case_sensitive): return 0 for DJGPP unless
  overriden in environment
  (__gnat_get_default_identifier_character_set): return '1' for DJGPP
  (__gnat_is_absolute_path): Support MS-DOS style absolute paths for DJGPP.
  (__gnat_portable_spawn): Use spewnvp for DJGPP.
  (__gnat_portable_no_block_spawn): Use spawnvp for DJGPP.
  (__gnat_portable_wait): Return 0 for DJGPP.



Signed-off-by: Andris Pavenis <andris.pavenis@iki.fi>
---
 gcc/ada/adaint.c | 45 ++++++++++++++++++++++++++++++++++++++-------
 1 file changed, 38 insertions(+), 7 deletions(-)

diff --git a/gcc/ada/adaint.c b/gcc/ada/adaint.c
index f317865..23fca5d 100644
--- a/gcc/ada/adaint.c
+++ b/gcc/ada/adaint.c
@@ -112,7 +112,18 @@
 extern "C" {
 #endif
 
-#if defined (__MINGW32__) || defined (__CYGWIN__)
+#if defined (__DJGPP__)
+
+/* For isalpha-like tests in the compiler, we're expected to resort to
+   safe-ctype.h/ISALPHA.  This isn't available for the runtime library
+   build, so we fallback on ctype.h/isalpha there.  */
+
+#ifdef IN_RTS
+#include <ctype.h>
+#define ISALPHA isalpha
+#endif
+
+#elif defined (__MINGW32__) || defined (__CYGWIN__)
 
 #include "mingw32.h"
 
@@ -165,11 +176,16 @@ UINT CurrentCCSEncoding;
 #include <sys/wait.h>
 #endif
 
-#if defined (_WIN32)
-
+#if defined (__DJGPP__)
 #include <process.h>
 #include <signal.h>
 #include <dir.h>
+#include <utime.h>
+#undef DIR_SEPARATOR
+#define DIR_SEPARATOR '\\'
+
+#elif defined (_WIN32)
+
 #include <windows.h>
 #include <accctrl.h>
 #include <aclapi.h>
@@ -538,7 +554,11 @@ __gnat_try_lock (char *dir, char *file)
 int
 __gnat_get_maximum_file_name_length (void)
 {
+#if defined (__DJGPP__)
+  return (_use_lfn(".")) ? -1 : 8;
+#else
   return -1;
+#endif
 }
 
 /* Return nonzero if file names are case sensitive.  */
@@ -560,7 +580,7 @@ __gnat_get_file_names_case_sensitive (void)
 	{
 	  /* By default, we suppose filesystems aren't case sensitive on
 	     Windows and Darwin (but they are on arm-darwin).  */
-#if defined (WINNT) \
+#if defined (WINNT) || defined (__DJGPP__) \
   || (defined (__APPLE__) && !(defined (__arm__) || defined (__arm64__)))
 	  file_names_case_sensitive_cache = 0;
 #else
@@ -576,7 +596,7 @@ __gnat_get_file_names_case_sensitive (void)
 int
 __gnat_get_env_vars_case_sensitive (void)
 {
-#if defined (WINNT)
+#if defined (WINNT) || defined (__DJGPP__)
  return 0;
 #else
  return 1;
@@ -586,7 +606,11 @@ __gnat_get_env_vars_case_sensitive (void)
 char
 __gnat_get_default_identifier_character_set (void)
 {
+#if defined (__DJGPP__)
+  return 'p';
+#else
   return '1';
+#endif
 }
 
 /* Return the current working directory.  */
@@ -1646,7 +1670,7 @@ __gnat_is_absolute_path (char *name, int length)
 #else
   return (length != 0) &&
      (*name == '/' || *name == DIR_SEPARATOR
-#if defined (WINNT)
+#if defined (WINNT) || defined(__DJGPP__)
       || (length > 1 && ISALPHA (name[0]) && name[1] == ':')
 #endif
 	  );
@@ -2234,7 +2258,7 @@ __gnat_portable_spawn (char *args[] ATTRIBUTE_UNUSED)
 #if defined (__vxworks) || defined(__PikeOS__)
   return -1;
 
-#elif defined (_WIN32)
+#elif defined (__DJGPP__) || defined (_WIN32)
   /* args[0] must be quotes as it could contain a full pathname with spaces */
   char *args_0 = args[0];
   args[0] = (char *)xmalloc (strlen (args_0) + 3);
@@ -2606,6 +2630,12 @@ __gnat_portable_no_block_spawn (char *args[] ATTRIBUTE_UNUSED)
   /* Not supported.  */
   return -1;
 
+#elif defined(__DJGPP__)
+  if (spawnvp (P_WAIT, args[0], args) != 0)
+    return -1;
+  else
+    return 0;
+
 #elif defined (_WIN32)
 
   HANDLE h = NULL;
@@ -2649,6 +2679,7 @@ __gnat_portable_wait (int *process_status)
 
   pid = win32_wait (&status);
 
+#elif defined (__DJGPP__)
 #else
 
   pid = waitpid (-1, &status, 0);
-- 
2.7.4


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 4/4][Ada,DJGPP] Ada support for DJGPP
  2016-09-04 17:24 ` Andris Pavenis
@ 2016-09-04 18:55   ` Arnaud Charlet
  2016-09-21 17:53     ` Andris Pavenis
  0 siblings, 1 reply; 11+ messages in thread
From: Arnaud Charlet @ 2016-09-04 18:55 UTC (permalink / raw)
  To: Andris Pavenis; +Cc: GCC Patches, DJ Delorie, Arnaud Charlet

> >This last patch (4/4) contains DJGPP related changes to adaint.c
> >(except one which belongs to patch 1/4).

This patch is quite intrusive. Are all these changes really needed?

>  char
>  __gnat_get_default_identifier_character_set (void)
>  {
> +#if defined (__DJGPP__)
> +  return 'p';
> +#else
>    return '1';
> +#endif
>  }

Why is this needed?

> -#elif defined (_WIN32)
> +#elif defined (__DJGPP__) || defined (_WIN32)
>    /* args[0] must be quotes as it could contain a full pathname with spaces
>    */
>    char *args_0 = args[0];
>    args[0] = (char *)xmalloc (strlen (args_0) + 3);
> @@ -2606,6 +2630,12 @@ __gnat_portable_no_block_spawn (char *args[]
> ATTRIBUTE_UNUSED)
>    /* Not supported.  */
>    return -1;
>  
> +#elif defined(__DJGPP__)
> +  if (spawnvp (P_WAIT, args[0], args) != 0)
> +    return -1;
> +  else
> +    return 0;
> +
>  #elif defined (_WIN32)
>  
>    HANDLE h = NULL;
> @@ -2649,6 +2679,7 @@ __gnat_portable_wait (int *process_status)
>  
>    pid = win32_wait (&status);
>  
> +#elif defined (__DJGPP__)
>  #else

You can't add an empty #elif without explaining it with a proper
comment.

Arno

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 4/4][Ada,DJGPP] Ada support for DJGPP
  2016-09-04 18:55   ` Arnaud Charlet
@ 2016-09-21 17:53     ` Andris Pavenis
  2016-09-25 17:33       ` Arnaud Charlet
  0 siblings, 1 reply; 11+ messages in thread
From: Andris Pavenis @ 2016-09-21 17:53 UTC (permalink / raw)
  To: Arnaud Charlet; +Cc: GCC Patches, DJ Delorie

[-- Attachment #1: Type: text/plain, Size: 1385 bytes --]

On 09/04/2016 09:52 PM, Arnaud Charlet wrote:
>>> This last patch (4/4) contains DJGPP related changes to adaint.c
>>> (except one which belongs to patch 1/4).
> This patch is quite intrusive. Are all these changes really needed?

New version of patch is in attachment.
>>   char
>>   __gnat_get_default_identifier_character_set (void)
>>   {
>> +#if defined (__DJGPP__)
>> +  return 'p';
>> +#else
>>     return '1';
>> +#endif
>>   }
> Why is this needed?
Removed in updated version of patch
>> -#elif defined (_WIN32)
>> +#elif defined (__DJGPP__) || defined (_WIN32)
>>     /* args[0] must be quotes as it could contain a full pathname with spaces
>>     */
>>     char *args_0 = args[0];
>>     args[0] = (char *)xmalloc (strlen (args_0) + 3);
>> @@ -2606,6 +2630,12 @@ __gnat_portable_no_block_spawn (char *args[]
>> ATTRIBUTE_UNUSED)
>>     /* Not supported.  */
>>     return -1;
>>   
>> +#elif defined(__DJGPP__)
>> +  if (spawnvp (P_WAIT, args[0], args) != 0)
>> +    return -1;
>> +  else
>> +    return 0;
>> +
>>   #elif defined (_WIN32)
>>   
>>     HANDLE h = NULL;
>> @@ -2649,6 +2679,7 @@ __gnat_portable_wait (int *process_status)
>>   
>>     pid = win32_wait (&status);
>>   
>> +#elif defined (__DJGPP__)
>>   #else
> You can't add an empty #elif without explaining it with a proper
> comment.
Comment with explanation added in attached version of patch

Andris


[-- Attachment #2: 0004-DJGPP-Ada-Ada-support.patch --]
[-- Type: text/x-patch, Size: 4069 bytes --]

From 49015a63e708824dbd80fb90520c33b8e1607c43 Mon Sep 17 00:00:00 2001
From: Andris Pavenis <andris.pavenis@iki.fi>
Date: Thu, 15 Sep 2016 19:31:54 +0300
Subject: [PATCH 4/4] [DJGPP, Ada] Ada support

* ada/adaint.c: Include process.h, signal.h, dir.h and utime.h for DJGPP.
  ISALPHA: include <ctype.h> and define to isalpha for DJGPP when IN_RTS is defined.
  (DIR_SEPARATOR) define to '\\' for DJGPP.
  (__gnat_get_maximum_file_name_length): decide return value depending on
  availability of LFN for DJGPP
  (__gnat_get_file_names_case_sensitive): return 0 for DJGPP unless
  overriden in environment
  (__gnat_is_absolute_path): Support MS-DOS style absolute paths for DJGPP.
  (__gnat_portable_spawn): Use spewnvp for DJGPP.
  (__gnat_portable_no_block_spawn): Use spawnvp for DJGPP.
  (__gnat_portable_wait): Return 0 for DJGPP.



Signed-off-by: Andris Pavenis <andris.pavenis@iki.fi>
---
 gcc/ada/adaint.c | 43 ++++++++++++++++++++++++++++++++++++-------
 1 file changed, 36 insertions(+), 7 deletions(-)

diff --git a/gcc/ada/adaint.c b/gcc/ada/adaint.c
index f317865..ed49ed7 100644
--- a/gcc/ada/adaint.c
+++ b/gcc/ada/adaint.c
@@ -112,7 +112,18 @@
 extern "C" {
 #endif
 
-#if defined (__MINGW32__) || defined (__CYGWIN__)
+#if defined (__DJGPP__)
+
+/* For isalpha-like tests in the compiler, we're expected to resort to
+   safe-ctype.h/ISALPHA.  This isn't available for the runtime library
+   build, so we fallback on ctype.h/isalpha there.  */
+
+#ifdef IN_RTS
+#include <ctype.h>
+#define ISALPHA isalpha
+#endif
+
+#elif defined (__MINGW32__) || defined (__CYGWIN__)
 
 #include "mingw32.h"
 
@@ -165,11 +176,16 @@ UINT CurrentCCSEncoding;
 #include <sys/wait.h>
 #endif
 
-#if defined (_WIN32)
-
+#if defined (__DJGPP__)
 #include <process.h>
 #include <signal.h>
 #include <dir.h>
+#include <utime.h>
+#undef DIR_SEPARATOR
+#define DIR_SEPARATOR '\\'
+
+#elif defined (_WIN32)
+
 #include <windows.h>
 #include <accctrl.h>
 #include <aclapi.h>
@@ -538,7 +554,11 @@ __gnat_try_lock (char *dir, char *file)
 int
 __gnat_get_maximum_file_name_length (void)
 {
+#if defined (__DJGPP__)
+  return (_use_lfn(".")) ? -1 : 8;
+#else
   return -1;
+#endif
 }
 
 /* Return nonzero if file names are case sensitive.  */
@@ -560,7 +580,7 @@ __gnat_get_file_names_case_sensitive (void)
 	{
 	  /* By default, we suppose filesystems aren't case sensitive on
 	     Windows and Darwin (but they are on arm-darwin).  */
-#if defined (WINNT) \
+#if defined (WINNT) || defined (__DJGPP__) \
   || (defined (__APPLE__) && !(defined (__arm__) || defined (__arm64__)))
 	  file_names_case_sensitive_cache = 0;
 #else
@@ -576,7 +596,7 @@ __gnat_get_file_names_case_sensitive (void)
 int
 __gnat_get_env_vars_case_sensitive (void)
 {
-#if defined (WINNT)
+#if defined (WINNT) || defined (__DJGPP__)
  return 0;
 #else
  return 1;
@@ -1646,7 +1666,7 @@ __gnat_is_absolute_path (char *name, int length)
 #else
   return (length != 0) &&
      (*name == '/' || *name == DIR_SEPARATOR
-#if defined (WINNT)
+#if defined (WINNT) || defined(__DJGPP__)
       || (length > 1 && ISALPHA (name[0]) && name[1] == ':')
 #endif
 	  );
@@ -2234,7 +2254,7 @@ __gnat_portable_spawn (char *args[] ATTRIBUTE_UNUSED)
 #if defined (__vxworks) || defined(__PikeOS__)
   return -1;
 
-#elif defined (_WIN32)
+#elif defined (__DJGPP__) || defined (_WIN32)
   /* args[0] must be quotes as it could contain a full pathname with spaces */
   char *args_0 = args[0];
   args[0] = (char *)xmalloc (strlen (args_0) + 3);
@@ -2606,6 +2626,12 @@ __gnat_portable_no_block_spawn (char *args[] ATTRIBUTE_UNUSED)
   /* Not supported.  */
   return -1;
 
+#elif defined(__DJGPP__)
+  if (spawnvp (P_WAIT, args[0], args) != 0)
+    return -1;
+  else
+    return 0;
+
 #elif defined (_WIN32)
 
   HANDLE h = NULL;
@@ -2649,6 +2675,9 @@ __gnat_portable_wait (int *process_status)
 
   pid = win32_wait (&status);
 
+#elif defined (__DJGPP__)
+  /* Child process has already ended in case of DJGPP.
+     No need to do anything. Just return success. */
 #else
 
   pid = waitpid (-1, &status, 0);
-- 
2.7.4


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 4/4][Ada,DJGPP] Ada support for DJGPP
  2016-09-21 17:53     ` Andris Pavenis
@ 2016-09-25 17:33       ` Arnaud Charlet
  2016-09-25 18:10         ` Andris Pavenis
  2016-10-10 15:16         ` Andris Pavenis
  0 siblings, 2 replies; 11+ messages in thread
From: Arnaud Charlet @ 2016-09-25 17:33 UTC (permalink / raw)
  To: Andris Pavenis; +Cc: GCC Patches, DJ Delorie

>  int
>  __gnat_get_maximum_file_name_length (void)
>  {
> +#if defined (__DJGPP__)
> +  return (_use_lfn(".")) ? -1 : 8;
> +#else
>    return -1;
> +#endif
>  }

Is the above change really necessary? Would be nice to get rid of this
extra code. The rest looks OK to me.

Arno

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 4/4][Ada,DJGPP] Ada support for DJGPP
  2016-09-25 17:33       ` Arnaud Charlet
@ 2016-09-25 18:10         ` Andris Pavenis
  2016-09-25 23:07           ` Arnaud Charlet
  2016-10-10 15:16         ` Andris Pavenis
  1 sibling, 1 reply; 11+ messages in thread
From: Andris Pavenis @ 2016-09-25 18:10 UTC (permalink / raw)
  To: Arnaud Charlet; +Cc: GCC Patches, DJ Delorie

On 09/25/2016 07:25 PM, Arnaud Charlet wrote:
>>   int
>>   __gnat_get_maximum_file_name_length (void)
>>   {
>> +#if defined (__DJGPP__)
>> +  return (_use_lfn(".")) ? -1 : 8;
>> +#else
>>     return -1;
>> +#endif
>>   }
> Is the above change really necessary? Would be nice to get rid of this
> extra code. The rest looks OK to me.
It is required for support of environment when LFN support is either not available or disabled for 
some reason (for example FreeDOS without LFN support loaded).

Andris

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 4/4][Ada,DJGPP] Ada support for DJGPP
  2016-09-25 18:10         ` Andris Pavenis
@ 2016-09-25 23:07           ` Arnaud Charlet
  2016-09-26  7:30             ` Andris Pavenis
  0 siblings, 1 reply; 11+ messages in thread
From: Arnaud Charlet @ 2016-09-25 23:07 UTC (permalink / raw)
  To: Andris Pavenis; +Cc: GCC Patches, DJ Delorie

> >Is the above change really necessary? Would be nice to get rid of this
> >extra code. The rest looks OK to me.
> It is required for support of environment when LFN support is either
> not available or disabled for some reason (for example FreeDOS
> without LFN support loaded).

Does it matter for GNAT usage/users in practice?

Arno

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 4/4][Ada,DJGPP] Ada support for DJGPP
  2016-09-25 23:07           ` Arnaud Charlet
@ 2016-09-26  7:30             ` Andris Pavenis
  0 siblings, 0 replies; 11+ messages in thread
From: Andris Pavenis @ 2016-09-26  7:30 UTC (permalink / raw)
  To: Arnaud Charlet; +Cc: GCC Patches, DJ Delorie

On 09/25/2016 09:10 PM, Arnaud Charlet wrote:
>>> Is the above change really necessary? Would be nice to get rid of this
>>> extra code. The rest looks OK to me.
>> It is required for support of environment when LFN support is either
>> not available or disabled for some reason (for example FreeDOS
>> without LFN support loaded).
> Does it matter for GNAT usage/users in practice?
>
> Arno

It may. I do not actually have information about environments used by poeple using DJGPP build. I'm 
providing compiler packages for them.

There are actually 2 levels of non-LFN support for DJGPP port of CCC:

1) ability to run user compiled programs (the ones which are compatible with required restrictions) 
without LFN support

2) the ability to compile using GCC in such environment

Submitted patches only addresses level 1. I'm not sure I'll ever submit changes for level 2. 
Absence of these changes does not prevent bootstrapping GCC iwhen LFN is available (like in recent 
Windows versions).

Discussed change belongs to level 1 (ability to run compiled programs without LFN support available).

Andris


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 4/4][Ada,DJGPP] Ada support for DJGPP
  2016-09-25 17:33       ` Arnaud Charlet
  2016-09-25 18:10         ` Andris Pavenis
@ 2016-10-10 15:16         ` Andris Pavenis
  2016-10-10 15:22           ` Arnaud Charlet
  1 sibling, 1 reply; 11+ messages in thread
From: Andris Pavenis @ 2016-10-10 15:16 UTC (permalink / raw)
  To: Arnaud Charlet; +Cc: GCC Patches, DJ Delorie

[-- Attachment #1: Type: text/plain, Size: 520 bytes --]

On 09/25/2016 07:25 PM, Arnaud Charlet wrote:
>>   int
>>   __gnat_get_maximum_file_name_length (void)
>>   {
>> +#if defined (__DJGPP__)
>> +  return (_use_lfn(".")) ? -1 : 8;
>> +#else
>>     return -1;
>> +#endif
>>   }
> Is the above change really necessary? Would be nice to get rid of this
> extra code. The rest looks OK to me.

It is be possible to leave this part out for now.

We could return to this part later separately.

Andris

PS. What about last versions of other 2 not yet approved patches (1 and 3)?


[-- Attachment #2: 0004-DJGPP-Ada-Ada-support.patch --]
[-- Type: text/x-patch, Size: 3637 bytes --]

From bd1698bff232bdc4258c70f49add1869276184db Mon Sep 17 00:00:00 2001
From: Andris Pavenis <andris.pavenis@iki.fi>
Date: Mon, 10 Oct 2016 18:14:52 +0300
Subject: [PATCH 4/4] [DJGPP, Ada] Ada support

* ada/adaint.c: Include process.h, signal.h, dir.h and utime.h for DJGPP.
  ISALPHA: include <ctype.h> and define to isalpha for DJGPP when IN_RTS is defined.
  (DIR_SEPARATOR) define to '\\' for DJGPP.
  (__gnat_get_file_names_case_sensitive): return 0 for DJGPP unless
  overriden in environment
  (__gnat_is_absolute_path): Support MS-DOS style absolute paths for DJGPP.
  (__gnat_portable_spawn): Use spewnvp for DJGPP.
  (__gnat_portable_no_block_spawn): Use spawnvp for DJGPP.
  (__gnat_portable_wait): Return 0 for DJGPP.
---
 gcc/ada/adaint.c | 39 ++++++++++++++++++++++++++++++++-------
 1 file changed, 32 insertions(+), 7 deletions(-)

diff --git a/gcc/ada/adaint.c b/gcc/ada/adaint.c
index f317865..17d6f1f 100644
--- a/gcc/ada/adaint.c
+++ b/gcc/ada/adaint.c
@@ -112,7 +112,18 @@
 extern "C" {
 #endif
 
-#if defined (__MINGW32__) || defined (__CYGWIN__)
+#if defined (__DJGPP__)
+
+/* For isalpha-like tests in the compiler, we're expected to resort to
+   safe-ctype.h/ISALPHA.  This isn't available for the runtime library
+   build, so we fallback on ctype.h/isalpha there.  */
+
+#ifdef IN_RTS
+#include <ctype.h>
+#define ISALPHA isalpha
+#endif
+
+#elif defined (__MINGW32__) || defined (__CYGWIN__)
 
 #include "mingw32.h"
 
@@ -165,11 +176,16 @@ UINT CurrentCCSEncoding;
 #include <sys/wait.h>
 #endif
 
-#if defined (_WIN32)
-
+#if defined (__DJGPP__)
 #include <process.h>
 #include <signal.h>
 #include <dir.h>
+#include <utime.h>
+#undef DIR_SEPARATOR
+#define DIR_SEPARATOR '\\'
+
+#elif defined (_WIN32)
+
 #include <windows.h>
 #include <accctrl.h>
 #include <aclapi.h>
@@ -560,7 +576,7 @@ __gnat_get_file_names_case_sensitive (void)
 	{
 	  /* By default, we suppose filesystems aren't case sensitive on
 	     Windows and Darwin (but they are on arm-darwin).  */
-#if defined (WINNT) \
+#if defined (WINNT) || defined (__DJGPP__) \
   || (defined (__APPLE__) && !(defined (__arm__) || defined (__arm64__)))
 	  file_names_case_sensitive_cache = 0;
 #else
@@ -576,7 +592,7 @@ __gnat_get_file_names_case_sensitive (void)
 int
 __gnat_get_env_vars_case_sensitive (void)
 {
-#if defined (WINNT)
+#if defined (WINNT) || defined (__DJGPP__)
  return 0;
 #else
  return 1;
@@ -1646,7 +1662,7 @@ __gnat_is_absolute_path (char *name, int length)
 #else
   return (length != 0) &&
      (*name == '/' || *name == DIR_SEPARATOR
-#if defined (WINNT)
+#if defined (WINNT) || defined(__DJGPP__)
       || (length > 1 && ISALPHA (name[0]) && name[1] == ':')
 #endif
 	  );
@@ -2234,7 +2250,7 @@ __gnat_portable_spawn (char *args[] ATTRIBUTE_UNUSED)
 #if defined (__vxworks) || defined(__PikeOS__)
   return -1;
 
-#elif defined (_WIN32)
+#elif defined (__DJGPP__) || defined (_WIN32)
   /* args[0] must be quotes as it could contain a full pathname with spaces */
   char *args_0 = args[0];
   args[0] = (char *)xmalloc (strlen (args_0) + 3);
@@ -2606,6 +2622,12 @@ __gnat_portable_no_block_spawn (char *args[] ATTRIBUTE_UNUSED)
   /* Not supported.  */
   return -1;
 
+#elif defined(__DJGPP__)
+  if (spawnvp (P_WAIT, args[0], args) != 0)
+    return -1;
+  else
+    return 0;
+
 #elif defined (_WIN32)
 
   HANDLE h = NULL;
@@ -2649,6 +2671,9 @@ __gnat_portable_wait (int *process_status)
 
   pid = win32_wait (&status);
 
+#elif defined (__DJGPP__)
+  /* Child process has already ended in case of DJGPP.
+     No need to do anything. Just return success. */
 #else
 
   pid = waitpid (-1, &status, 0);
-- 
2.7.4


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 4/4][Ada,DJGPP] Ada support for DJGPP
  2016-10-10 15:16         ` Andris Pavenis
@ 2016-10-10 15:22           ` Arnaud Charlet
  2016-10-10 15:57             ` Andris Pavenis
  0 siblings, 1 reply; 11+ messages in thread
From: Arnaud Charlet @ 2016-10-10 15:22 UTC (permalink / raw)
  To: Andris Pavenis; +Cc: GCC Patches, DJ Delorie

> >>  int
> >>  __gnat_get_maximum_file_name_length (void)
> >>  {
> >>+#if defined (__DJGPP__)
> >>+  return (_use_lfn(".")) ? -1 : 8;
> >>+#else
> >>    return -1;
> >>+#endif
> >>  }
> >Is the above change really necessary? Would be nice to get rid of this
> >extra code. The rest looks OK to me.
> 
> It is be possible to leave this part out for now.

OK without this part then.

> PS. What about last versions of other 2 not yet approved patches (1 and 3)?

There have been many back and forth and many updates, so I do not know where
we are on these. I'm pretty sure I OKed one of the other parts, but best
to resubmit them cleanly (so with latest patches, changelog, etc...).

Arno

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 4/4][Ada,DJGPP] Ada support for DJGPP
  2016-10-10 15:22           ` Arnaud Charlet
@ 2016-10-10 15:57             ` Andris Pavenis
  0 siblings, 0 replies; 11+ messages in thread
From: Andris Pavenis @ 2016-10-10 15:57 UTC (permalink / raw)
  To: Arnaud Charlet; +Cc: GCC Patches, DJ Delorie

On 10/10/2016 06:22 PM, Arnaud Charlet wrote:
>
>> PS. What about last versions of other 2 not yet approved patches (1 and 3)?
> There have been many back and forth and many updates, so I do not know where
> we are on these. I'm pretty sure I OKed one of the other parts, but best
> to resubmit them cleanly (so with latest patches, changelog, etc...).
There are no changes since submitting last versions of patches 1 and 3. So I just pointed to 
messages in mail archives
in separate e-mails.

Andris

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2016-10-10 15:57 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-30  5:47 [PATCH 4/4][Ada,DJGPP] Ada support for DJGPP Andris Pavenis
2016-09-04 17:24 ` Andris Pavenis
2016-09-04 18:55   ` Arnaud Charlet
2016-09-21 17:53     ` Andris Pavenis
2016-09-25 17:33       ` Arnaud Charlet
2016-09-25 18:10         ` Andris Pavenis
2016-09-25 23:07           ` Arnaud Charlet
2016-09-26  7:30             ` Andris Pavenis
2016-10-10 15:16         ` Andris Pavenis
2016-10-10 15:22           ` Arnaud Charlet
2016-10-10 15:57             ` Andris Pavenis

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).