1. 22 Dec, 2019 1 commit
    • A. Wilcox's avatar
      netinet/ip.h: Add UAPI definition guard for iphdr · 7e690371
      A. Wilcox authored
      This ensures that the musl definition of 'struct iphdr' does not conflict
      with the Linux kernel UAPI definition of it.
      Some software, i.e. net-tools, will not compile against 5.4 kernel headers
      without this patch and the corresponding Linux kernel patch.
  2. 21 Dec, 2019 1 commit
  3. 08 Dec, 2019 20 commits
  4. 05 Nov, 2019 1 commit
    • Rich Felker's avatar
      fix build regression on mips64 due to endian.h removal · 90251cf7
      Rich Felker authored
      commit 4d3a162d overlooked that the
      mips64 reloc.h dependent on endian.h not only for setting the ABI ldso
      name to match the byte order, but also for use of the byte swapping
      macros. they are needed to override R_TYPE, R_SYM, and R_INFO, to
      compensate for a mips "quirk" of always using big endian order for
      symbol references in relocations.
      part of that commit canot be reverted because the original code was
      wrong: it's invalid to define _GNU_SOURCE or any feature test macro
      in reloc.h, or anywhere except at the top of a source file. however,
      thanks to commit 316730cd, the feature
      test macro is no longer needed to access the endian-swapping macros,
      so simply bringing back the #include directive suffices.
  5. 04 Nov, 2019 1 commit
  6. 03 Nov, 2019 1 commit
    • Rich Felker's avatar
      fix time64 link regression of dlsym stub for static-linked programs · 028092b6
      Rich Felker authored
      in commit 22daaea3, the
      __dlsym_redir_time64 function providing the backend for __dlsym_time64
      was defined only in the dynamic linker, and thus was undefined when
      static linking a program referencing dlsym. use the same stub_dlsym
      definition that provides __dlsym (the non-redirecting backend) for
      static linked programs to provide it, conditional on _REDIR_TIME64.
  7. 02 Nov, 2019 13 commits
    • Rich Felker's avatar
      move time_t and suseconds_t definitions to common alltypes.h.in · d6dcfe4d
      Rich Felker authored
      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
    • Rich Felker's avatar
      move time64 ioctl numbers to generic bits/ioctl.h · b60fdf13
      Rich Felker authored
      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.
    • Rich Felker's avatar
      move time64 socket options from arch bits to top-level sys/socket.h · c71dbb24
      Rich Felker authored
      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.
    • Rich Felker's avatar
      switch all existing 32-bit archs to 64-bit time_t · 38143339
      Rich Felker authored
      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
      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.
    • Rich Felker's avatar
      add x32 bits/ioctl_fix.h defining time-related sockios macros · 5127927f
      Rich Felker authored
      these definitions are copied from generic bits/ioctl.h, so that x32
      keeps the "_OLD" versions (which are already time64 on x32) when
      32-bit archs switch to 64-bit time_t.
    • Rich Felker's avatar
      add back x32 bits/socket.h defining time-related socket options · aad3e0c5
      Rich Felker authored
      these definitions are merely copied from the top-level sys/socket.h,
      so there is no functional change at this time. however, the top-level
      definitions will change to use the time64 "_NEW" versions on 32-bit
      archs when time_t is switched over to 64-bit. this commit ensures that
      change will be suppressed on x32.
    • Rich Felker's avatar
      move msghdr and cmsghdr out of bits/socket.h · a0252bc7
      Rich Felker authored
      these structures can now be defined generically in terms of endianness
      and long size. previously, the 32-bit archs all shared a common
      definition from the generic bits header, and each 64-bit arch had to
      repeat the 64-bit version, with endian conditionals if the arch had
      variants of each endianness.
      I would prefer getting rid of the preprocessor conditionals for
      padding and instead using unnamed bitfield members, like commit
      9b2921be did for struct timespec.
      however, at present sendmsg, recvmsg, and recvmmsg need access to the
      padding members by name to zero them. this could perhaps be cleaned up
      in the future.
    • Rich Felker's avatar
      fix x32 msghdr struct by removing x32 bits/socket.h · 573a4d2d
      Rich Felker authored
      being that it contains pointers and (from the kernel perspective,
      which is wrong) size_t members, x32 uses the 32-bit version of the
      structure, not a half-32-bit, half-64-bit layout like we had here. the
      x86_64 definition was inadvertently copied when x32 was first added.
      unlike errors in the opposite direction (missing padding), this error
      was not easily detected breakage, because the layout of the commonly
      used initial subset of members still matched. breakage could only be
      observed in the presence of control messages or flags.
    • Rich Felker's avatar
      make time-related socket options overridable by arch bits files · 0bbc04c9
      Rich Felker authored
      SO_RCVTIMEO and SO_SNDTIMEO already were, but only in aggregate with
      SO_DEBUG and all of the other low/traditional options that varied per
      arch. SO_TIMESTAMP* are newly overridable. the two groups have to be
      done separately since mips64 and powerpc64 will override the former
      but not the latter.
      at some point this should be cleaned up to use bits headers more
    • Rich Felker's avatar
      add framework for arch-provided makefile fragments, compat source dirs · de90f38e
      Rich Felker authored
      the immediate usage case for this is to let 32-bit archs moving to
      64-bit time_t via symbol redirection pull in wrapper shims that
      provide the old symbol names. in the future it may be used for other
      types of compatibility-only source files that are not relevant to all
    • Rich Felker's avatar
    • Rich Felker's avatar
      add time64 redirect for, and redirecting implementation of, dlsym · 22daaea3
      Rich Felker authored
      if symbols are being redirected to provide the new time64 ABI, dlsym
      must perform matching redirections; otherwise, it would poke a hole in
      the magic and return pointers to functions that are not safe to call
      from a caller using time64 types.
      rather than duplicating a table of redirections, use the time64
      symbols present in libc's symbol table to derive the decision for
      whether a particular symbol needs to be redirected.
    • Rich Felker's avatar
      add time32 ABI compat shims, compat source tree · c0450320
      Rich Felker authored
      these files provide the symbols for the traditional 32-bit time_t ABI
      on existing 32-bit archs by wrapping the real, internal versions of
      the corresponding functions, which always work with 64-bit time_t.
      they are written to be as agnostic as possible to the implementation
      details of the real functions, so that they can be written once and
      mostly forgotten, but they are aware of details of the old (and
      sometimes new) ABI, which is okay since ABI is fixed and cannot
      a new compat tree is added, separate from src, which the Makefile does
      not see or use now, but which archs will be able to add to the build
      process. we could also consider moving other things that are compat
      shims here, like functions which are purely for glibc-ABI-compat, with
      the goal of making it optional or just cleaning up the main src tree
      to make the distinction between actual implementation/API files and
      ABI-compat shims clear.
  8. 28 Oct, 2019 2 commits
    • Rich Felker's avatar
      make fstatat fill in old time32 stat fields too · 0961bb94
      Rich Felker authored
      here _REDIR_TIME64 is used as an indication that there's an old ABI,
      and thereby the old time32 timespec fields of struct stat.
      keeping struct stat compatible and providing both versions of the
      timespec fields is done so that ftw/nftw does not need painful compat
      shims, and (more importantly) so that similar interfaces between pairs
      of libc consumers (applications/libraries) will be less likely to
      break when one has been rebuilt for time64 but the other has not.
    • Rich Felker's avatar
      disable lfs64 aliases for remapped time64 functions · 50018f92
      Rich Felker authored
      these functions cannot provide the glibc lfs64-ABI-compatible symbols
      when time_t differs from what it was in that ABI. instead, the aliases
      need to be provided by the time32 compat shims or through some other