1. 14 Aug, 2019 1 commit
  2. 13 Aug, 2019 2 commits
  3. 09 Aug, 2019 1 commit
  4. 08 Aug, 2019 4 commits
  5. 07 Aug, 2019 1 commit
    • Michael Haubenwallner's avatar
      Cygwin: build_env: fix off-by-one bug when re-adding PATH · 472fbb8b
      Michael Haubenwallner authored
      Adding default winvar 'PATH=C:\cygwin64\binZ' to an environment that is
      already allocated for 'SYSTEMROOT=ZWINDIR=Z', we need to count that
      trailing (Z)ero as well.  Otherwise we trigger this assertion failure:
      
      $ /bin/env -i SYSTEMROOT= WINDIR= /bin/env
      assertion "(s - envblock) <= tl" failed: file "/home/corinna/src/cygwin/cygwin-3.0.7/cygwin-3.0.7-1.x86_64/src/newlib-cygwin/winsup/cygwin/environ.cc", line 1302, function: char** build_env(const char* const*, WCHAR*&, int&, bool, HANDLE)
      Aborted (core dumped)
      472fbb8b
  6. 06 Aug, 2019 1 commit
    • Corinna Vinschen's avatar
      Cygwin: exec: check execute bit prior to evaluating script · 98669a24
      Corinna Vinschen authored
      When the exec family of functions is called for a script-like
      file, the av::setup function handles the exec[vl]p case as
      well.  The execve case for files not starting with a she-bang
      is handled first by returning ENOEXEC.  Only after that, the
      file's executability is checked.
      
      This leads to the problem that ENOEXEC is returned for non-executable
      files as well.  A calling shell interprets this as a file it should try
      to run as script.  This is not desired for non-executable files.
      
      Fix this problem by checking the file for executability first.  Only
      after that, follow the other potential code paths.
      Signed-off-by: default avatarCorinna Vinschen <corinna@vinschen.de>
      98669a24
  7. 05 Aug, 2019 5 commits
    • Alexander Fedotov's avatar
      Align libgloss/arm and libc/sys/arm sources: miscellaneous fixes · bf56973e
      Alexander Fedotov authored
      1. Trim trailing spaces
      2. Align comments, function declarations and definitions
      bf56973e
    • Alexander Fedotov's avatar
      Align libgloss/arm and libc/sys/arm sources: Lite exit support · bd5596f4
      Alexander Fedotov authored
      Applied changes from commit 2404223d:
      
      	* arm/crt0.S (_mainCRTStartup): Weak reference to atexit and _fini
      		when lite exit is enabled.
      bd5596f4
    • Alexander Fedotov's avatar
      Align libgloss/arm and libc/sys/arm sources: HeapInfo and __heap_limit · dfffe683
      Alexander Fedotov authored
      Applied changes from commit 8d98f956:
      
      	* arm/crt0.S: Initialise __heap_limit when ARM_RDI_MONITOR is defined.
      	* arm/syscalls.c: define __heap_limit global symbol.
      	* arm/syscalls.c (_sbrk): Honour __heap_limit.
      
      Applied changes from commit 8d98f956:
      	Fixed semihosting for ARM when heapinfo not provided by debugger
      dfffe683
    • Alexander Fedotov's avatar
      Align libgloss/arm and libc/sys/arm sources: Fix GetCmdLine semihosting directives · 37e80fbb
      Alexander Fedotov authored
      Applied changes from the commit 9b116721:
      
      	When simulating arm code, the target program startup code (crt0) uses
      	semihosting invocations to get the command line from the simulator. The
      	simulator returns the command line and its size into the area passed in
      	parameter. (ARM 32-bit specifications :
      	http://infocenter.arm.com/help/topic/com.arm.doc.dui0058d/DUI0058.pdf
      	chapter "5.4.19 SYS_GET_CMDLINE").
      
      	The memory area pointed by the semihosting register argument is located
      	in .text section (usually not writtable (RX)).
      
      	If we run this code on a simulator that respects this rights properties
      	(qemu user-mode for instance), the command line will not be written to
      	the .text program memory, in particular the length of the string. The
      	program runs with an empty command line. This problem hasn't been seen
      	earlier probably because qemu user-mode is not so much used, but this can
      	happen with another simulator that refuse to write in a read-only segment.
      
      	With this modification, the command line can be correctly passed to the
      	target program.
      
      	Changes:
      	- newlib/libc/sys/arm/crt0.S : Arguments passed to the
      	AngelSWI_Reason_GetCmdLine semihosting invocation are placed into .data
      	section instead of .text
      37e80fbb
    • Mark Geisert's avatar
      Cygwin: Implement CPU_SET(3) macros · 362b98b4
      Mark Geisert authored
      This patch supplies an implementation of the CPU_SET(3) processor
      affinity macros as documented on the relevant Linux man page.
      
      There is a mostly superset implementation of cpusets under newlib's
      libc/sys/RTEMS/include/sys that has Linux and FreeBSD compatibility
      and is built on top of FreeBSD bitsets.  This Cygwin implementation
      and the RTEMS one could be combined if desired at some future point.
      362b98b4
  8. 02 Aug, 2019 1 commit
  9. 31 Jul, 2019 2 commits
  10. 30 Jul, 2019 1 commit
    • Faraz Shahbazker's avatar
      Align _end symbol to at least 4 in all MIPS scripts · 6661a677
      Faraz Shahbazker authored
      Left-over part of commit 84b2a020
      
      The _end marker must be aligned to 4-bytes to ensure that the last
      element written does not reach beyond the address of _end.  This is
      also necessary as the termination condition is an equality test
      instead of an ordered test so (_end - _fbss) must be a multiple of
      4-bytes.  The alignment is already correct for mti*.ld files, fix
      it for all remaining MIPS scripts that don't already align to at
      least 4.
      6661a677
  11. 26 Jul, 2019 3 commits
  12. 25 Jul, 2019 4 commits
    • Keith Packard's avatar
      fixup for riscv samples · 91d488e6
      Keith Packard authored
      91d488e6
    • Vaibhav Gupta's avatar
      b39cd00f
    • Corinna Vinschen's avatar
      Cygwin: Fix the address of myself · 3a72edc1
      Corinna Vinschen authored
      Introducing an independent Cygwin PID introduced a regression:
      
      The expectation is that the myself pinfo pointer always points to a
      specific address right in front of the loaded Cygwin DLL.
      
      However, the independent Cygwin PID changes broke this.  To create
      myself at the right address requires to call init with h0 set to
      INVALID_HANDLE_VALUE or an existing address:
      
      void
      pinfo::init (pid_t n, DWORD flag, HANDLE h0)
      {
        [...]
        if (!h0 || myself.h)
          [...]
        else
          {
            shloc = SH_MYSELF;
            if (h0 == INVALID_HANDLE_VALUE)       <-- !!!
              h0 = NULL;
          }
      
      The aforementioned commits changed that so h0 was always NULL, this way
      creating myself at an arbitrary address.
      
      This patch makes sure to set the handle to INVALID_HANDLE_VALUE again
      when creating a new process, so init knows that myself has to be created
      in the right spot.  While at it, fix a potential uninitialized handle
      value in child_info_spawn::handle_spawn.
      
      Fixes: b5e10037 ("Cygwin: processes: use dedicated Cygwin PID rather than Windows PID")
      Fixes: 88605243 ("Cygwin: fix child getting another pid after spawnve")
      Signed-off-by: default avatarCorinna Vinschen <corinna@vinschen.de>
      3a72edc1
    • Corinna Vinschen's avatar
      Cygwin: Don't change pgid to ctty pgid under debugger · 2232498c
      Corinna Vinschen authored
      _pinfo::set_ctty sets myself's pgid to the ctty pgid if the process has
      been started from a non-Cygwin process.  This isn't the right thing to
      do when started from GDB.  GDB starts the application via standard
      Windows means, not via Cygwin fork/exec, so it's treated as being
      a non-Cygwin parent.
      
      But we want the app running in it's own process group.  So skip this
      step when running under a debugger
      Signed-off-by: default avatarCorinna Vinschen <corinna-cygwin@cygwin.com>
      2232498c
  13. 24 Jul, 2019 8 commits
    • Corinna Vinschen's avatar
      a13145a3
    • Corinna Vinschen's avatar
      hash functions: use reentrant stat functions · 279805b2
      Corinna Vinschen authored
      _stat64 and _fstat64 are not exported from Cygwin.  Use the
      reentrant analogues, like everywhere else.
      Signed-off-by: default avatarCorinna Vinschen <corinna-cygwin@cygwin.com>
      279805b2
    • Jozef Lawrynowicz's avatar
      MSP430: Remove .init/.fini sections · 884b05b5
      Jozef Lawrynowicz authored
      The .init/.fini sections are not required for msp430-elf, and add unnecessary
      code bloat to the CRT library. These sections are specified as "unused" by
      the MSP430 EABI.
      
      .init existed to call __crt0_run_{init,preinit}_array which run through
      the functions in .{init,preinit}_array.
      __crt0_run_{init,preinit}_array are already dynamically included like the
      other crt0 functions, so these can be placed before the call to main,
      which ensures they are still called if needed.
      With these functions moved, .init has no purpose and can be removed.
      
      .fini existed to call __crt0_run_fini_array.
      However, the "__msp430_fini" symbol which marks the start of .fini has
      never been used, so no termination routines have ever been run for
      msp430. On returning from main(), _exit() is called which just loops
      forever.
      So there is no current expectation that __crt0_run_fini_array will
      get called by the CRT code. Further work is to ensure functions
      registered with atexit can be optionally called during program termination,
      and then __crt0_run_fini_array can be registered with atexit during
      program initialization.
      
      The mechanisms for supporting the "-minrt" option have also been removed.
      "-minrt" enabled a "minimum runtime environment" by removing calls to
      functions which run global static initializers and constructors. Since
      this behaviour is now dynamic, and these functions are only included
      when needed, the minrt versions of the CRT object files are no longer
      required.
      884b05b5
    • Ken Brown's avatar
      Cygwin: document the last bug fix · 6b843b82
      Ken Brown authored
      6b843b82
    • Ken Brown's avatar
      Cygwin: fhandler_termios::tcsetpgrp: check that argument is non-negative · 8a46b8ed
      Ken Brown authored
      Return -1 with EINVAL if pgid < 0.
      
      Previously tcsetpgrp() would blindly go ahead and set the pgid of the
      controlling terminal to a negative value, causing later calls to
      various functions to fail.
      
      For example, gdb has code like the following:
      
        tcsetpgrp (0, getpgid (inf->pid));
      
      If getpgid (inf->pid) fails (returns -1), then this code would set the
      pgid of fd 0 to -1, so that some later calls to getpgid() would also
      return -1.  This caused the problem reported here:
      
        https://cygwin.com/ml/cygwin/2019-07/msg00166.html.
      8a46b8ed
    • Corinna Vinschen's avatar
    • uchan-nos's avatar
      fix compile errors for efgcvt.c · 9cde0205
      uchan-nos authored
      9cde0205
    • Vaibhav Gupta's avatar
      Port ndbm · e50ad9fb
      Vaibhav Gupta authored
      e50ad9fb
  14. 23 Jul, 2019 1 commit
    • Alexander Fedotov's avatar
      Stack Pointer and Stack Limit initialization refactored. · 942f60d7
      Alexander Fedotov authored
      SP initialization changes:
        1. set default value in semihosting case as well
        2. moved existing SP & SL init code for processor modes in separate routine and made it as "hook"
        3. init SP for processor modes in Thumb mode as well
      
      Add new macro FN_RETURN, FN_EH_START and FN_EH_END.
      942f60d7
  15. 22 Jul, 2019 5 commits