1. 09 9月, 2020 1 次提交
  2. 05 9月, 2020 1 次提交
  3. 03 9月, 2020 1 次提交
  4. 20 8月, 2020 1 次提交
  5. 19 8月, 2020 1 次提交
  6. 17 8月, 2020 1 次提交
  7. 05 2月, 2020 2 次提交
  8. 31 1月, 2020 1 次提交
    • R
      remove legacy clock_gettime and gettimeofday from public syscall.h · 5a105f19
      Rich Felker 提交于
      some nontrivial number of applications have historically performed
      direct syscalls for these operations rather than using the public
      functions. such usage is invalid now that time_t is 64-bit and these
      syscalls no longer match the types they are used with, and it was
      already harmful before (by suppressing use of vdso).
      
      since syscall() has no type safety, incorrect usage of these syscalls
      can't be caught at compile-time. so, without manually inspecting or
      running additional tools to check sources, the risk of such errors
      slipping through is high.
      
      this patch renames the syscalls on 32-bit archs to clock_gettime32 and
      gettimeofday_time32, so that applications using the original names
      will fail to build without being fixed.
      
      note that there are a number of other syscalls that may also be unsafe
      to use directly after the time64 switchover, but (1) these are the
      main two that seem to be in widespread use, and (2) most of the others
      continue to have valid usage with a null timeval/timespec argument, as
      the argument is an optional timeout or similar.
      5a105f19
  9. 31 12月, 2019 2 次提交
    • S
      add clone3 syscall number from linux v5.3 · fa765ca5
      Szabolcs Nagy 提交于
      the syscall number is reserved on all targets, but it is not wired up
      on all targets, see
      
        linux commit 8f6ccf6159aed1f04c6d179f61f6fb2691261e84
        Merge tag 'clone3-v5.3' of ... brauner/linux
      
        linux commit 8f3220a806545442f6f26195bc491520f5276e7c
        arch: wire-up clone3() syscall
      
        linux commit 7f192e3cd316ba58c88dfa26796cf77789dd9872
        fork: add clone3
      fa765ca5
    • S
      add pidfd_open syscall number from linux v5.3 · a4528911
      Szabolcs Nagy 提交于
      see
      
        linux commit 7615d9e1780e26e0178c93c55b73309a5dc093d7
        arch: wire-up pidfd_open()
      
        linux commit 32fcb426ec001cb6d5a4a195091a8486ea77e2df
        pid: add pidfd_open()
      a4528911
  10. 03 11月, 2019 4 次提交
    • R
      move time_t and suseconds_t definitions to common alltypes.h.in · d6dcfe4d
      Rich Felker 提交于
      now that all 32-bit archs have 64-bit time_t (and suseconds_t), the
      arch-provided _Int64 macro (long or long long, as appropriate) can be
      used to define them, and arch-specific definitions are no longer
      needed.
      d6dcfe4d
    • R
      move time64 ioctl numbers to generic bits/ioctl.h · b60fdf13
      Rich Felker 提交于
      now that all 32-bit archs have 64-bit time types, the values for the
      time-related ioctls can be shared. the mechanism for this is an
      arch/generic version of the bits header. archs which don't use the
      generic header still need to duplicate the definitions.
      
      x32, which does not use the new time64 values of the macros, already
      has its own overrides, so this commit does not affect it.
      b60fdf13
    • R
      move time64 socket options from arch bits to top-level sys/socket.h · c71dbb24
      Rich Felker 提交于
      now that all 32-bit archs have 64-bit time types, the values for the
      time-related socket option macros can be treated as universal for
      32-bit archs. the sys/socket.h mechanism for this predates
      arch/generic and is instead in the top-level header.
      
      x32, which does not use the new time64 values of the macros, already
      has its own overrides, so this commit does not affect it.
      c71dbb24
    • R
      switch all existing 32-bit archs to 64-bit time_t · 38143339
      Rich Felker 提交于
      this commit preserves ABI fully for existing interface boundaries
      between libc and libc consumers (applications or libraries), by
      retaining existing symbol names for the legacy 32-bit interfaces and
      redirecting sources compiled against the new headers to alternate
      symbol names. this does not necessarily, however, preserve the
      pairwise ABI of libc consumers with one another; where they use
      time_t-derived types in their interfaces with one another, it may be
      necessary to synchronize updates with each other.
      
      the intent is that ABI resulting from this commit already be stable
      and permanent, but it will not be officially so until a release is
      made. changes to some header-defined types that do not play any role
      in the ABI between libc and its consumers may still be subject to
      change.
      
      mechanically, the changes made by this commit for each 32-bit arch are
      as follows:
      
      - _REDIR_TIME64 is defined to activate the symbol redirections in
        public headers
      
      - COMPAT_SRC_DIRS is defined in arch.mak to activate build of ABI
        compat shims to serve as definitions for the original symbol names
      
      - time_t and suseconds_t definitions are changed to long long (64-bit)
      
      - IPC_STAT definition is changed to add the IPC_TIME64 bit (0x100),
        triggering conversion of semid_ds, shmid_ds, and msqid_ds split
        low/high time bits into new time_t members
      
      - structs semid_ds, shmid_ds, msqid_ds, and stat are modified to add
        new 64-bit time_t/timespec members at the end, maintaining existing
        layout of other members.
      
      - socket options (SO_*) and ioctl (sockios) command macros are
        redefined to use the kernel's "_NEW" values.
      
      in addition, on archs where vdso clock_gettime is used, the
      VDSO_CGT_SYM macro definition in syscall_arch.h is changed to use a
      new time64 vdso function if available, and a new VDSO_CGT32_SYM macro
      is added for use as fallback on kernels lacking time64.
      38143339
  11. 18 10月, 2019 5 次提交
    • R
      move pthread types out of per-arch alltypes.h · 2d3083e7
      Rich Felker 提交于
      policy has long been that these definitions are purely a function of
      whether long/pointer is 32- or 64-bit, and that they are not allowed
      to vary per-arch. move the definition to the shared alltypes.h.in
      fragment, using integer constant expressions in terms of sizeof to
      vary the array dimensions appropriately. I'm not sure whether this is
      more or less ugly than using preprocessor conditionals and two sets of
      definitions here, but either way is a lot less ugly than repeating the
      same thing for every arch.
      2d3083e7
    • R
      define LONG_MAX via arch alltypes.h, strip down bits/limits.h · 7cc79d10
      Rich Felker 提交于
      LLONG_MAX is uniform for all archs we support and plenty of header and
      code level logic assumes it is, so it does not make sense for limits.h
      bits mechanism to pretend it's variable.
      
      LONG_BIT can be defined in terms of LONG_MAX; there's no reason to put
      it in bits.
      
      by moving LONG_MAX definition to __LONG_MAX in alltypes.h and moving
      LLONG_MAX out of bits, there are now no plain-C limits that are
      defined in the bits header, so the bits header only needs to be
      included in the POSIX or extended profiles. this allows the feature
      test macro logic to be removed from the bits header, facilitating a
      long-term goal of getting such logic out of bits.
      
      having __LONG_MAX in alltypes.h will allow further generalization of
      headers.
      
      archs without a constant PAGESIZE no longer need bits/limits.h at all.
      7cc79d10
    • R
      remove use of endian.h from arch reloc.h headers, clean up · 4d3a162d
      Rich Felker 提交于
      building on commit 97d35a55,
      __BYTE_ORDER is now available wherever alltypes.h is included. since
      reloc.h is only used from src/internal/dynlink.h, it can be assumed
      that __BYTE_ORDER is exposed. reloc.h is not permitted to be included
      in other contexts, and generally, like most arch headers, lacks
      inclusion guards that would allow such usage. the mips64 version
      mistakenly included such guards; they are removed for consistency.
      4d3a162d
    • R
      move __BYTE_ORDER definition to alltypes.h · 97d35a55
      Rich Felker 提交于
      this change is motivated by the intersection of several factors.
      presently, despite being a nonstandard header, endian.h is exposing
      the unprefixed byte order macros and functions only if _BSD_SOURCE or
      _GNU_SOURCE is defined. this is to accommodate use of endian.h from
      other headers, including bits headers, which need to define structure
      layout in terms of endianness. with time64 switch-over, even more
      headers will need to do this.
      
      at the same time, the resolution of Austin Group issue 162 makes
      endian.h a standard header for POSIX-future, requiring that it expose
      the unprefixed macros and the functions even in standards-conforming
      profiles. changes to meet this new requirement would break existing
      internal usage of endian.h by causing it to violate namespace where
      it's used.
      
      instead, have the arch's alltypes.h define __BYTE_ORDER, either as a
      fixed constant or depending on the right arch-specific predefined
      macros for determining endianness. explicit literals 1234 and 4321 are
      used instead of __LITTLE_ENDIAN and __BIG_ENDIAN so that there's no
      danger of getting the wrong result if a macro is undefined and
      implicitly evaluates to 0 at the preprocessor level.
      
      the powerpc (32-bit) bits/endian.h being removed had logic for varying
      endianness, but our powerpc arch has never supported that and has
      always been big-endian-only. this logic is not carried over to the new
      __BYTE_ORDER definition in alltypes.h.
      97d35a55
    • R
      remove per-arch definitions for va_list · 00ec11d1
      Rich Felker 提交于
      now that commit f7f10797 removed the
      legacy i386 conditional definition, va_list is in no way
      arch-specific, and has no reason to be in the future. move it to the
      shared part of alltypes.h.in
      00ec11d1
  12. 11 9月, 2019 1 次提交
    • S
      add new syscall numbers from linux v5.2 · b6076309
      Szabolcs Nagy 提交于
      new mount api syscalls were added, same numers on all targets, see
      
        linux commit a07b20004793d8926f78d63eb5980559f7813404
        vfs: syscall: Add open_tree(2) to reference or clone a mount
      
        linux commit 2db154b3ea8e14b04fee23e3fdfd5e9d17fbc6ae
        vfs: syscall: Add move_mount(2) to move mounts around
      
        linux commit 24dcb3d90a1f67fe08c68a004af37df059d74005
        vfs: syscall: Add fsopen() to prepare for superblock creation
      
        linux commit ecdab150fddb42fe6a739335257949220033b782
        vfs: syscall: Add fsconfig() for configuring and managing a context
      
        linux commit 93766fbd2696c2c4453dd8e1070977e9cd4e6b6d
        vfs: syscall: Add fsmount() to create a mount for a superblock
      
        linux commit cf3cba4a429be43e5527a3f78859b1bfd9ebc5fb
        vfs: syscall: Add fspick() to select a superblock for reconfiguration
      
        linux commit 9c8ad7a2ff0bfe58f019ec0abc1fb965114dde7d
        uapi, x86: Fix the syscall numbering of the mount API syscalls [ver #2]
      
        linux commit d8076bdb56af5e5918376cd1573a6b0007fc1a89
        uapi: Wire up the mount API syscalls on non-x86 arches [ver #2]
      b6076309
  13. 02 8月, 2019 1 次提交
    • R
      move IPC_STAT definition to a new bits/ipcstat.h file · 006a75a9
      Rich Felker 提交于
      otherwise, 32-bit archs that could otherwise share the generic
      bits/ipc.h would need to duplicate the struct ipc_perm definition,
      obscuring the fact that it's the same. sysvipc is not widely used and
      these headers are not commonly included, so there is no performance
      gain to be had by limiting the number of indirectly included files
      here.
      
      files with the existing time32 definition of IPC_STAT are added to all
      current 32-bit archs now, so that when it's changed the change will
      show up as a change rather than addition of a new file where it's less
      obvious that the value is changing vs the generic one that was used
      before.
      006a75a9
  14. 30 7月, 2019 4 次提交
  15. 19 7月, 2019 1 次提交
    • R
      decouple struct stat from kernel type · 01ae3fc6
      Rich Felker 提交于
      presently, all archs/ABIs have struct stat matching the kernel
      stat[64] type, except mips/mipsn32/mips64 which do conversion hacks in
      syscall_arch.h to work around bugs in the kernel type. this patch
      completely decouples them and adds a translation step to the success
      path of fstatat. at present, this is just a gratuitous copying, but it
      opens up multiple possibilities for future support for 64-bit time_t
      on 32-bit archs and for cleaned-up/unified ABIs.
      
      for clarity, the mips hacks are not yet removed in this commit, so the
      mips kstat structs still correspond to the output of the hacks in
      their syscall_arch.h files, not the raw kernel type. a subsequent
      commit will fix this.
      01ae3fc6
  16. 16 7月, 2019 1 次提交
    • R
      fix build failure on arm building C code in thumb1 mode · 980f80f7
      Rich Felker 提交于
      a fully thumb1 build is not supported because some asm files are
      incompatible with thumb1, but apparently it works to compile the C
      code as thumb1
      
      commit 06fbefd1 caused this regression
      but introducing use of the clz instruction, which is not supported in
      arm mode prior to v5, and not supported in thumb prior to thumb2
      (v6t2). commit 1b9406b0 fixed the
      issue only for arm mode pre-v5 but left thumb1 broken.
      980f80f7
  17. 02 7月, 2019 1 次提交
    • S
      add new syscall numbers from linux v5.1 · f3f96f2d
      Szabolcs Nagy 提交于
      syscall numbers are now synced up across targets (starting from 403 the
      numbers are the same on all targets other than an arch specific offset)
      
      IPC syscalls sem*, shm*, msg* got added where they were missing (except
      for semop: only semtimedop got added), the new semctl, shmctl, msgctl
      imply IPC_64, see
      
        linux commit 0d6040d4681735dfc47565de288525de405a5c99
        arch: add split IPC system calls where needed
      
      new 64bit time_t syscall variants got added on 32bit targets, see
      
        linux commit 48166e6ea47d23984f0b481ca199250e1ce0730a
        y2038: add 64-bit time_t syscalls to all 32-bit architectures
      
      new async io syscalls got added, see
      
        linux commit 2b188cc1bb857a9d4701ae59aa7768b5124e262e
        Add io_uring IO interface
      
        linux commit edafccee56ff31678a091ddb7219aba9b28bc3cb
        io_uring: add support for pre-mapped user IO buffers
      
      a new syscall got added that uses the fd of /proc/<pid> as a stable
      handle for processes: allows sending signals without pid reuse issues,
      intended to eventually replace rt_sigqueueinfo, kill, tgkill and
      rt_tgsigqueueinfo, see
      
        linux commit 3eb39f47934f9d5a3027fe00d906a45fe3a15fad
        signal: add pidfd_send_signal() syscall
      
      on some targets (arm, m68k, s390x, sh) some previously missing syscall
      numbers got added as well.
      f3f96f2d
  18. 14 3月, 2019 1 次提交
  19. 10 12月, 2018 1 次提交
  20. 17 10月, 2018 1 次提交
    • R
      make thread-pointer-loading asm non-volatile · a4a3e4db
      Rich Felker 提交于
      this will allow the compiler to cache and reuse the result, meaning we
      no longer have to take care not to load it more than once for the sake
      of archs where the load may be expensive.
      
      depends on commit 1c84c999 for
      correctness, since otherwise the compiler could hoist loads during
      stage 3 of dynamic linking before the initial thread-pointer setup.
      a4a3e4db
  21. 02 10月, 2018 1 次提交
    • R
      add TLSDESC support for 32-bit arm · 0beb9dfb
      Rich Felker 提交于
      unlike other asm where the baseline ISA is used, these functions are
      hot paths and use ISA-level specializations.
      
      call-clobbered vfp registers are saved before calling __tls_get_new,
      since there is no guarantee it won't use them. while setjmp/longjmp
      have to use hwcap to decide whether to the fpu is in use, since
      application code could be using vfp registers even if libc was
      compiled as pure softfloat, __tls_get_new is part of libc and can be
      assumed not to have access to vfp registers if tlsdesc.S does not.
      thus it suffices just to check the predefined preprocessor macros. the
      check for __ARM_PCS_VFP is redundant; !__SOFTFP__ must always be true
      if the target ISA level includes fpu instructions/registers.
      0beb9dfb
  22. 21 9月, 2018 1 次提交
  23. 06 9月, 2018 1 次提交
    • R
      define and use internal macros for hidden visibility, weak refs · 9b95fd09
      Rich Felker 提交于
      this cleans up what had become widespread direct inline use of "GNU C"
      style attributes directly in the source, and lowers the barrier to
      increased use of hidden visibility, which will be useful to recovering
      some of the efficiency lost when the protected visibility hack was
      dropped in commit dc2f368e, especially
      on archs where the PLT ABI is costly.
      9b95fd09
  24. 20 6月, 2018 1 次提交
    • R
      work around broken kernel struct ipc_perm on some big endian archs · 0cd2be23
      Rich Felker 提交于
      the mode member of struct ipc_perm is specified by POSIX to have type
      mode_t, which is uniformly defined as unsigned int. however, Linux
      defines it with type __kernel_mode_t, and defines __kernel_mode_t as
      unsigned short on some archs. since there is a subsequent padding
      field, treating it as a 32-bit unsigned int works on little endian
      archs, but the order is backwards on big endian archs with the
      erroneous definition.
      
      since multiple archs are affected, remedy the situation with fixup
      code in the affected functions (shmctl, semctl, and msgctl) rather
      than repeating the same shims in syscall_arch.h for every affected
      arch.
      0cd2be23
  25. 03 6月, 2018 1 次提交
    • S
      fix TLS layout of TLS variant I when there is a gap above TP · 610c5a85
      Szabolcs Nagy 提交于
      In TLS variant I the TLS is above TP (or above a fixed offset from TP)
      but on some targets there is a reserved gap above TP before TLS starts.
      
      This matters for the local-exec tls access model when the offsets of
      TLS variables from the TP are hard coded by the linker into the
      executable, so the libc must compute these offsets the same way as the
      linker.  The tls offset of the main module has to be
      
      	alignup(GAP_ABOVE_TP, main_tls_align).
      
      If there is no TLS in the main module then the gap can be ignored
      since musl does not use it and the tls access models of shared
      libraries are not affected.
      
      The previous setup only worked if (tls_align & -GAP_ABOVE_TP) == 0
      (i.e. TLS did not require large alignment) because the gap was
      treated as a fixed offset from TP.  Now the TP points at the end
      of the pthread struct (which is aligned) and there is a gap above
      it (which may also need alignment).
      
      The fix required changing TP_ADJ and __pthread_self on affected
      targets (aarch64, arm and sh) and in the tlsdesc asm the offset to
      access the dtv changed too.
      610c5a85
  26. 02 5月, 2018 1 次提交
    • R
      work around arm gcc's rejection of r7 asm constraints in thumb mode · e3c682ab
      Rich Felker 提交于
      in thumb mode, r7 is the ABI frame pointer register, and unless frame
      pointer is disabled, gcc insists on treating it as a fixed register,
      refusing to spill it to satisfy constraints. unfortunately, r7 is also
      used in the syscall ABI for passing the syscall number.
      
      up til now we just treated this as a requirement to disable frame
      pointer when generating code as thumb, but it turns out gcc forcibly
      enables frame pointer, and the fixed register constraint that goes
      with it, for functions which contain VLAs. this produces an
      unacceptable arch-specific constraint that (non-arm-specific) source
      files making syscalls cannot use VLAs.
      
      as a workaround, avoid r7 register constraints when producing thumb
      code and instead save/restore r7 in a temp register as part of the asm
      block. at some point we may want/need to support armv6-m/thumb1, so
      the asm has been tweaked to be thumb1-compatible while also
      near-optimal for thumb2: it allows the temp and/or syscall number to
      be in high registers (necessary since r0-r5 may all be used for
      syscalll args) and in thumb2 mode allows the syscall number to be an
      8-bit immediate.
      e3c682ab
  27. 20 4月, 2018 2 次提交