1. Jul 10, 2019
    • Jeff Johnston's avatar
      Set errno in expm1{,f} / log1p{,f} · 0d24a868
      Jeff Johnston authored
      2019-07-09  Joern Rennecke  <joern.rennecke@riscy-ip.com>
      
      	* libm/common/s_expm1.c ("math_config.h"): Include.
      	(expm1): Use __math_oflow to set errno.
      	* libm/common/s_log1p.c ("math_config.h"): Include.
      	(log1p): Use __math_divzero and __math_invalid to set errno.
      	* libm/common/sf_expm1.c ("math_config.h"): Include.
      	(expm1f): Use __math_oflow to set errno.
      	* libm/common/sf_log1p.c ("math_config.h"): Include.
      	(log1pf): Use __math_divzero and __math_invalid to set errno.
      0d24a868
  2. Jun 28, 2019
  3. Jun 27, 2019
  4. Jun 26, 2019
  5. Jun 24, 2019
    • Mark Geisert's avatar
      Cygwin: Implement sched_[gs]etaffinity() · 641ecb07
      Mark Geisert authored
      This patch set implements the Linux syscalls sched_getaffinity,
      sched_setaffinity, pthread_getaffinity_np, and pthread_setaffinity_np.
      Linux has a straightforward view of the cpu sets used in affinity masks.
      They are simply long (1024-bit) bit masks.  This code emulates that view
      while internally dealing with Windows' distribution of available CPUs among
      processor groups.
      641ecb07
  6. Jun 23, 2019
  7. Jun 14, 2019
    • Corinna Vinschen's avatar
      Rename <xlocale.h> back to <sys/_locale.h> · ad101bcb
      Corinna Vinschen authored
      libX11 provides <X11/Xlocale.h>.  The build of libX11 itself adds
      include/X11 to the compiler's include path.  This results in a name
      collision with /usr/include/xlocale.h on case-insensitive filesystems.
      
      Commit 90e35b1e renamed sys/_locale.h to xlocale.h in March 2017 under
      the assumption that we should provide the locale_t type in the same file
      as on Linux, FreeBSD, and Darwin.
      
      A few weeks later (June 2017), glibc removed the xlocale.h file in favor
      of bits/types/locale_t.h, which shouldn't be included directly anyway.
      
      For reference and the reasoning, see
      https://sourceware.org/git/?p=glibc.git;a=commit;h=f0be25b6336d
      
      Given the above, revert 90e35b1e and
      fix additional usage of xlocale.h.
      ad101bcb
  8. Jun 11, 2019
  9. Jun 08, 2019
    • Jeff Johnston's avatar
      Fix __getreent stack calculations for AMD GCN · eb429ad5
      Jeff Johnston authored
      From: Andrew Stubbs <ams@codesourcery.com>
      
      Fix a bug in which the high-part of 64-bit values are being corrupted, leading
      to erroneous stack overflow errors. The problem was only that the mixed-size
      calculations are being treated as signed when they should be unsigned.
      eb429ad5
    • Jeff Johnston's avatar
      Add gfortran support for AMD GCN · 007bc192
      Jeff Johnston authored
      From: Kwok Cheung Yeung <kcy@codesourcery.com>
      
      This patch adds enough support for constructors/destructors and OS functions
      to be able to link and run gfortran programs on AMD GCN.
      
      There's no actual ability to do I/O operations on this targets, besides
      "write" to stdout and stderr, so most of the functions are just stubs.
      007bc192
  10. Jun 07, 2019
    • trasz's avatar
      Mark inline functions with __unused; · 4feb21d7
      trasz authored
      prevents compiler warning when they end up being unused.
      
      Reviewed by:	kib
      Obtained from:	OpenBSD
      MFC after:	2 weeks
      Sponsored by:	Klara Inc.
      Differential Revision:	https://reviews.freebsd.org/D20185
      4feb21d7
    • pfg's avatar
      sys/sys: further adoption of SPDX licensing ID tags. · 160f9f0b
      pfg authored
      Mainly focus on files that use BSD 2-Clause license, however the tool I
      was using misidentified many licenses so this was mostly a manual - error
      prone - task.
      
      The Software Package Data Exchange (SPDX) group provides a specification
      to make it easier for automated tools to detect and summarize well known
      opensource licenses. We are gradually adopting the specification, noting
      that the tags are considered only advisory and do not, in any way,
      superceed or replace the license texts.
      160f9f0b
  11. Jun 06, 2019
    • Corinna Vinschen's avatar
      Cygwin: map beyond EOF on 64 bit and WOW64 as well · 605bdcd4
      Corinna Vinschen authored
      
      
      32 bit Cygwin performs a POSIX-compatible mapping after EOF which
      is not supported in this form on Windows.  The 64 bit Windows
      kernel never supported the AT_ROUND_TO_PAGE mapping flag, so we
      couldn't page-aligned map the space right after the file's EOF.
      So mapping beyond EOF was disabled in 64 bit Windows and WOW64.
      
      However,  if mmap works, a matching munmap should work as well,
      *and* it should not accidentally unmap unrelated memory.
      
      Therefore we enable mapping beyond EOF on 64 bit as well.  Since
      that mapping is always 64K aligned, the are between the last file
      page and the next 64K allocation boundary will be unallocated.
      There's no way around that.
      
      Signed-off-by: default avatarCorinna Vinschen <corinna@vinschen.de>
      605bdcd4
  12. Jun 05, 2019
    • Ben Wijen's avatar
      mkdir: always check-for-existence · b0c033bf
      Ben Wijen authored
      When using NtCreateFile when creating a directory that already exists,
      it will correctly return 'STATUS_OBJECT_NAME_COLLISION'.
      
      However using this function to create a directory (and all its parents)
      a normal use would be to start with mkdir(‘/cygdrive/c’) which translates
      to ‘C:\’ for which it'll instead return ‘STATUS_ACCESS_DENIED’.
      b0c033bf
  13. Jun 04, 2019
    • Yaakov Selkowitz's avatar
      cygcheck: expand common_apps list · 5c2a3661
      Yaakov Selkowitz authored
      An increasing number of tools are being included in Windows which have the
      same names as those included in Cygwin packages.  Indicating which one is
      first in PATH can be helpful in diagnosing behavioural discrepencies
      between them.
      
      Also, fix the alphabetization of ssh.
      5c2a3661
    • Corinna Vinschen's avatar
      Cygwin: Allow accessing 48 bit address space in Windows 8.1 or later · e1254add
      Corinna Vinschen authored
      64 bit Windows started out with a 44 bit address space due to a
      restriction of the AMD64 CPUs at the time.  Starting with Windows
      8.1, these CPUs are not supported anymore and Windows switched to
      the full 48 bit address space supported by AMD64.
      
      Cygwin didn't follow suit yet so mmaps are still restricted to
      the lower 44 bit address space.  Fix that by using a system-specific
      upper address for mmap allocations, 44 bit up to Windows 8, 48 bit
      starting with Windows 8.1.
      
      While at it, move the heap by another 8 Gigs to leave some space
      for a potential extension of DLL address space, and restrict the
      mmap lower address so the heap can grow to 32 Gigs before colliding
      with mmaps.
      e1254add
    • Michael Haubenwallner's avatar
      Cygwin: fork: Remember child not before success. · f03ea8e1
      Michael Haubenwallner authored
      Do not remember the child before it was successfully initialized, or we
      would need more sophisticated cleanup on child initialization failure,
      like cleaning up the process table and suppressing SIGCHILD delivery
      with multiple threads ("waitproc") involved.  Compared to that, the
      potential slowdown due to an extra yield () call should be negligible.
      f03ea8e1
    • Michael Haubenwallner's avatar
      Cygwin: fork: Always pause child after fixups. · a8c23e44
      Michael Haubenwallner authored
      Pause the child process after performing fork fixups even if there were
      no dynamically loaded dlls with extra data/bss transfers to wait for.
      This allows the parent process to cancel the current fork call even if
      the child process was successfully initialized already.
      
      This is a preparation for when the parent does remember the child no
      earlier than after successful child initialization.
      a8c23e44
    • Michael Haubenwallner's avatar
      Cygwin: dll_list: no recursive use of nt_max_path_buf · a9c27900
      Michael Haubenwallner authored
      Querying the ntlength and existence of the /var/run/cygfork directory in
      the very first Cygwin process should not use nt_max_path_buf, as that
      one is used by dll_list::alloc already.
      a9c27900
    • Michael Haubenwallner's avatar
      Cygwin: dll_list: stat_real_file_once with ntname · 6c9ad75a
      Michael Haubenwallner authored
      NtQueryVirtualMemory for MemorySectionName may return some old path even
      if the process was just started, for when some directory in between was
      renamed - maybe because the NT file cache is hot for the old path still.
      This was seen during gcc bootstrap, returning a MemorySectionName of
      ".../gcc/xgcc.exe" even if started as ".../prev-gcc/xgcc.exe", where the
      directory rename from "gcc" to "prev-gcc" was done the moment before.
      As we stat the module's real file right after loading now, there is no
      point in using NtQueryVirtualMemory with MemorySectionName any more, and
      we can use what GetModuleFileName returned instead.
      6c9ad75a
  14. Jun 03, 2019
    • Lucio Andrés Illanes Albornoz's avatar
      Fix vfwscanf(3) assignment suppression flag handling bug · d5daede2
      Lucio Andrés Illanes Albornoz authored
      newlib's vfwscanf(3) (or specifically, __SVFWSCANF_R()) fails to correctly set
      the assignment-suppressing character (`*') flag[1] which, when present in the
      formatting string, results in undefined behaviour comprising retrieving and
      dereferencing a pointer that was not supplied by the caller as such or at all.
      When compared to the vfscanf(3) implementation, this would appear to be over
      the missing goto match_failure statement preceded by the flags test seen below.
      Hence, this patch (re)introduces it.
      
      [1] <http://pubs.opengroup.org/onlinepubs/009695399/functions/fwscanf.html>
      
      --
      d5daede2
    • Jinke Fan's avatar
      Add support for Hygon Dhyana processor · ee7e49e1
      Jinke Fan authored
      -Add vendor identification
      -Support in get_cpu_cache
      
      Background:
          Chengdu Haiguang IC Design Co., Ltd (Hygon) is a Joint Venture
          between AMD and Haiguang Information Technology Co.,Ltd., aims at
          providing high performance x86 processor for China server market.
          Its first generation processor codename is Dhyana, which
          originates from AMD technology and shares most of the
          architecture with AMD's family 17h, but with different CPU Vendor
          ID("HygonGenuine")/Family series number(Family 18h).
      
      Related Hygon kernel patch can be found on:
      http://lkml.kernel.org/r/5ce86123a7b9dad925ac583d88d2f921040e859b.1538583282.git.puwen@hygon.cn
      
      
      
      Signed-off-by: default avatarJinke Fan <fanjinke@hygon.cn>
      ee7e49e1
    • Sebastian Huber's avatar
      Fix <sys/_types.h> issues with <stddef.h> · f5a5a23e
      Sebastian Huber authored
      
      
      A commit from 2016 tried to address this GCC provided <stddef.h> issue
      
          #if (defined (__FreeBSD__) && (__FreeBSD__ >= 5)) \
            || defined(__DragonFly__) \
            || defined(__FreeBSD_kernel__)
          /* __size_t is a typedef on FreeBSD 5, must not trash it. */
          #elif defined (__VMS__)
          /* __size_t is also a typedef on VMS.  */
          #else
          #define __size_t
          #endif
      
      with an include of <stddef.h> before <sys/_types.h> in <sys/types.h>.
      Is is not robust enough.  Do the include of <stddef.h> in <sys/_types.h>
      directly and request only the necessary types.
      
      Signed-off-by: default avatarSebastian Huber <sebastian.huber@embedded-brains.de>
      f5a5a23e