Commit Graph

13423 Commits

Author SHA1 Message Date
Corinna Vinschen b28edc7b86 Cygwin: drop all usages of WINAPI
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-08-04 22:13:59 +02:00
Corinna Vinschen 73aefcb5c2 Cygwin: clock.cc: Drop redundant Windows prototypes
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-08-04 22:13:59 +02:00
Corinna Vinschen e71628b889 Cygwin: drop obsolete _cygwin_noncygwin_dll_entry entry point
This was obsoleted more than 22 years ago. Time to drop it.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-08-04 22:13:59 +02:00
Ken Brown c2aa5b6d74 Cygwin: syscalls.cc: remove ".dll" from blessed_executable_suffixes
This reverts commit d9e9c7b5a7.  The latter added ".dll" to the
blessed_executable_suffixes array because on 32-bit Windows, the
GetBinaryType function would report that a 64-bit DLL is an
executable, contrary to the documentation of that function.

That anomaly does not exist on 64-bit Windows, so we can remove ".dll"
from the list.  Reverting the commit does, however, change the
behavior of the rename(2) syscall in the following unlikely situation:
Suppose we have an executable foo.exe and we make the call

  rename ("foo", "bar.dll");

Previously, foo.exe would be renamed to bar.dll.  So bar.dll would
then be an executable without the .exe extension.  The new behavior is
that foo.exe will be renamed to bar.dll.exe.  [Exception: If there
already existed an executable (not a DLL!) with the name bar.dll, then
.exe will not be appended.]
2022-08-04 15:51:39 -04:00
Corinna Vinschen 288788f91e Cygwin: Drop outdated IsWow64Process2 prototype
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-08-04 20:55:52 +02:00
Corinna Vinschen 12a3b696a4 Cygwin: drop outdated __MINGW64_VERSION_MAJOR checks
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-08-04 20:55:25 +02:00
Corinna Vinschen 7073ef4e8f Cygwin: drop __stdcall usage
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-08-04 20:54:09 +02:00
Corinna Vinschen 7718cb70d4 Cygwin: syscalls.cc: drop masking macros for standard IO functions
The actual reason for these wrappers are lost in time, there's no
hint even in the pre-2000 ChangeLog files.  Apparently they were
masking the prototypes or, alternatively, macros from newlib to
clash with the definitions in syscalls.cc.

They are not needed anymore, so just drop them.

This uncovered that the buffer pointer to pwrite is erronously
non-const.  Fix this on the way out.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-08-04 20:32:49 +02:00
Corinna Vinschen 9f6057d203 Cygwin: Drop export aliases and masking macros for stdio64 functions
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-08-04 17:30:48 +02:00
Corinna Vinschen cc88ef77e7 Cygwin: create sparse errmap array
To avoid linear searches for error codes, autogenerate errmap as
simple array of errno values indexed by Windows error codes.
Restrict to the first 9000 Windows error codes, we don't care for
most of them anyway.

Define errmap in its own file errmap.h to clean up errno.cc.

Change geterrno_from_win_error accordingly.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-08-04 15:16:48 +02:00
Markus Mützel ab31794e8a cacosh: Use approximation for large input.
Signed-off-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-08-04 12:55:52 +02:00
Markus Mützel d939b16adc casinh: Use approximation for large input.
Signed-off-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-08-04 12:55:17 +02:00
Corinna Vinschen 70c7e8c1ba Cygwin: net.cc: convert wsock_errmap into a simple array of error codes
Avoid linear searches for error codes by converting wsock_errmap
to a ordered array, indexed by WinSock error code (subtracted by
WSABASEERR.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-08-04 11:45:58 +02:00
Corinna Vinschen a8c1dd2ce0 Cygwin: net.cc: create own type host_errmap_t for host_errmap
This decouples host_errmap from the errmap_t definition which is
about to be changed in a followup patch.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-08-04 11:37:58 +02:00
Corinna Vinschen 8053ccd44b Cygwin: net.cc: constify gai_errmap
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-08-04 11:36:24 +02:00
Corinna Vinschen f418195dc9 Cygwin: fix/drop a few comments
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-08-03 18:14:39 +02:00
Corinna Vinschen b226e4228a Cygwin: __WORDSIZE: Drop 32 bit considerations
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-08-03 17:48:20 +02:00
Corinna Vinschen 7ad791c1ee Cygwin: drop macro and code for CYGWIN_VERSION_DLL_EPOCH
fix a comment in check_sanity_and_sync() on the way

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-08-03 16:16:14 +02:00
Corinna Vinschen c41f0e700a Cygwin: drop unused CYGWIN_VERSION_CYGWIN_CONV macro
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-08-03 16:09:00 +02:00
Corinna Vinschen dad3dd33ab Cygwin: version.h: document API_VERSION of the first 64 bit build
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-08-03 16:04:42 +02:00
Corinna Vinschen 12360f10ff Cygwin: drop macro and code for CYGWIN_VERSION_USE_PSEUDO_RELOC_IN_DLL
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-08-03 16:01:29 +02:00
Corinna Vinschen c874161ec5 Cygwin: drop macro and code for CYGWIN_VERSION_CHECK_FOR_OLD_CTYPE
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-08-03 15:59:37 +02:00
Corinna Vinschen fee7b24beb Cygwin: drop macro and code for CYGWIN_VERSION_CHECK_FOR_OLD_IFREQ
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-08-03 15:57:30 +02:00
Corinna Vinschen 57c3ca8d51 Cygwin: drop macro and code for CYGWIN_VERSION_CHECK_FOR_USING_WINSOCK1_VALUES
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-08-03 15:53:41 +02:00
Corinna Vinschen 741f9a61c6 Cygwin: drop macro and code for CYGWIN_VERSION_CHECK_FOR_USING_ANCIENT_MSGHDR
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-08-03 15:52:07 +02:00
Corinna Vinschen dcd78ece45 Cygwin: drop unused CYGWIN_VERSION_CHECK_FOR_USING_BIG_TYPES macro
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-08-03 15:50:52 +02:00
Corinna Vinschen c2743614bf Cygwin: drop macro and code for CYGWIN_VERSION_CHECK_FOR_OLD_O_NONBLOCK
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-08-03 15:48:56 +02:00
Corinna Vinschen 7de1be0472 Cygwin: drop unused CYGWIN_VERSION_CHECK_FOR_S_IEXEC macro
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-08-03 15:39:14 +02:00
Corinna Vinschen 8883f0ea39 Cygwin: drop macro and code for CYGWIN_VERSION_OLD_STDIO_CRLF_HANDLING
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-08-03 15:38:11 +02:00
Corinna Vinschen efa6611982 Cygwin: drop macro and code for CYGWIN_VERSION_DLL_MALLOC_ENV
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-08-03 15:35:34 +02:00
Corinna Vinschen 02b273a688 Cygwin: drop macro and code for CYGWIN_VERSION_DLL_IS_OLD_TERMIOS
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-08-03 15:35:29 +02:00
Corinna Vinschen 2902b3a09e Cygwin: drop requirement to build newlib's stdio64
Given that 64 bit Cygwin defines all file access types (off_t,
fpos_t, and derived types) as 64 bit anyway, there's no reason
left to rely on the stdio64 part of newlib.  Use base functions
and base types.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-08-03 13:41:35 +02:00
Takashi Yano 8b502d8635 Cygwin: path: Make some symlinks to /cygdrive/* work.
- Previously, some symbolic links to /cygdrive/* (e.g. /cygdrive/C,
  /cygdrive/./c, /cygdrive//c, etc.) did not work. This patch fixes
  the issue.
  Addresses: https://cygwin.com/pipermail/cygwin/2022-July/251994.html
2022-08-03 13:36:09 +09:00
Takashi Yano bfee9c6ab0 Cygwin: console: Modify ConEmu cygwin connector hook.
- Previously, LoadLibraryA() is hooked for ConEmu cygwin connector.
  With this patch, GetProcAddress() for "RequestTermConnector" is
  hooked instead which is more essential for ConEmu cygwin connector.
2022-08-02 07:52:52 +09:00
Takashi Yano d5229f8211 Cygwin: pty: Treat *.bat and *.cmd as a non-cygwin console app.
- If *.bat or *.cmd is executed directly from cygwin shell, pty
  failed to switch I/O pipe to that for native apps. This patch
  fixes the issue.
2022-07-31 17:55:42 +09:00
Takashi Yano 8d564b62b7 Cygwin: console: Avoid accessing NULL pointer via cygheap->ctty.
- Recent commit "Cygwin: console: Add missing input_mutex guard."
  has a problem that causes NULL pointer access if cygheap->ctty
  is NULL. This patch fixes the issue.
2022-07-29 21:59:11 +09:00
Jon Turney d4689b99c6
Cygwin: Set threadnames with SetThreadDescription()
gdb master recently learnt how to use GetThreadDescription() [1], so set
threadnames using SetThreadDescription() [available since Windows 10
1607] as well.

This is superior to using a special exception to indicate the thread
name to the debugger, because the thread name isn't missed if you don't
have a debugger attached at the time it's set.

It's not clear what the encoding of a thread name string is, we assume
UTF8 for the moment.

For the moment, continue to use the old method as well, for the benefit
of older gdb versions etc.

[1] https://sourceware.org/pipermail/gdb-patches/2022-April/187833.html
2022-07-29 11:58:43 +01:00
Corinna Vinschen f145174f80 Cygwin: uname: drop useless support for unsupported CPU arches
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-07-29 12:19:54 +02:00
Corinna Vinschen 87a9ca4a95 Cygwin: gmon.h: drop 32 bit considerations
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-07-29 12:19:18 +02:00
Corinna Vinschen 20adacdca2 Cygwin: profile.c: drop i686 register access
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-07-29 12:17:43 +02:00
Corinna Vinschen 7f42498be6 Cygwin: rename __cygwin_environ and drop env redirection via cur_environ()
Back in early Cygwin development a function based access to the
environment was exported, the internal environ in Cygwin was called
__cygwin_environ and cur_environ() was used to access the environment
indirectly .  The history of that necessity is not documented,
but kept in i686 for backward compatibility.

The x86_64 port eventually used __cygwin_environ directly and exported
it as DATA under the usual name environ.

We don't need the i686 workaround anymore, so just rename
__cygwin_environ to environ, drop the cur_environ() macro and
simply export environ under its own name.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-07-28 22:00:40 +02:00
Corinna Vinschen cea26c7570 Cygwin: perl scripts: drop support for i686
- rename "is64bit" to "is_x86_64"
- Always set sym_prefix to empty string and add a FIXME
- speclib: rename uscore to sym_prefix and fix bug in string handling

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-07-28 20:28:45 +02:00
Takashi Yano f2e39d5230 Cygwin: console: Add workaround for ConEmu cygwin connector.
- ConEmu cygwin connector conflicts with cons_master_thread since
  it does not use read() to read console input. With this patch,
  cons_master_thread is disabled in ConEmu cygwin connector.
2022-07-28 23:56:42 +09:00
Takashi Yano d4aacd50e6 Cygwin: console: Add missing input_mutex guard.
- Setting con.disable_master_thread flag should be guarded by
  input_mutex, however, it was not. This patch fixes that.
2022-07-28 23:56:34 +09:00
Corinna Vinschen 33395637a1 Cygwin: Fix previous attempt to drop i386 targets from hookapi
Somehow this patch looks like it was pushed before having been
finished.  Let's try again...

Fixes: e46f15c2d1 ("Cygwin: hookapi: drop handling i386 targets")
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-07-28 16:38:01 +02:00
Corinna Vinschen 5192d5ea51 Cygwin: _dll_crt0: minimize target-specific conditional code
Only the assembler snippet is really x86_64-specific, so minimize the
conditional code block to this snippet.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-07-14 20:08:58 +02:00
Corinna Vinschen e46f15c2d1 Cygwin: hookapi: drop handling i386 targets
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-07-14 20:06:09 +02:00
Corinna Vinschen 1f962581ff Cygwin: fix or delete a few comments to drop 32 bit references
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-07-14 18:32:53 +02:00
Corinna Vinschen 4ce1a1ddc4 Cygwin: drop cyglsa.h. LSA subauth is not supported anymore
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-07-14 12:48:39 +02:00
Corinna Vinschen cb4b49470f Cygwin: drop 32 bit target from linker script
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-07-14 12:33:21 +02:00