1. 06 12月, 2012 2 次提交
  2. 26 11月, 2012 2 次提交
  3. 24 11月, 2012 4 次提交
    • R
      begin sys/user.h and sys/reg.h fixes for ports · 4acc95e4
      Rich Felker 提交于
      aside from microblaze, these should be roughly correct for all archs
      now. some misc junk macros and typedefs are missing, which should
      probably be added for max compatibility with trace/debug tools.
      4acc95e4
    • R
      fix termios constants on mips · 144dc4f4
      Rich Felker 提交于
      144dc4f4
    • R
      sigcontext/mcontext cleanup for arch-specific bits · c72fc238
      Rich Felker 提交于
      with these changes, the members/types of mcontext_t and related stuff
      should closely match the glibc definitions. unlike glibc, however, the
      definitions here avoid using typedefs as much as possible and work
      directly with the underlying types, to minimize namespace pollution
      from signal.h in the default (_BSD_SOURCE) profile.
      
      this is a first step in improving compatibility with applications
      which poke at context/register information -- mainly debuggers, trace
      utilities, etc. additional definitions in ucontext.h and other headers
      may be needed later.
      
      if feature test macros are used to request a conforming namespace,
      mcontext_t is replaced with an opaque structure of the equivalent size
      and alignment; conforming programs cannot examine its contents anyway.
      c72fc238
    • R
  4. 22 11月, 2012 1 次提交
    • R
      add back NSIG, removed from powerpc in last commit, but for all archs · 65b98213
      Rich Felker 提交于
      unlike the previous definition, NSIG/_NSIG is supposed to be one more
      than the highest signal number. adding this will allow simplifying
      libc-internal code that makes signal-related syscalls, which can be
      done as a later step. some apps might use it too; while this usage is
      questionable, it's at least not insane.
      65b98213
  5. 19 11月, 2012 1 次提交
  6. 18 11月, 2012 1 次提交
    • R
      fcntl.h: O_SEARCH was missing for powerpc · 8d2887f8
      rofl0r 提交于
      put some macros that do not differ between architectures in the
      main header and remove from bits.
      restructure mips header so it has the same structure as the others.
      8d2887f8
  7. 16 11月, 2012 1 次提交
    • R
      disable SO_REUSEPORT in sys/socket.h · 91738d02
      Rich Felker 提交于
      although a number is reserved for it, this option is not implemented
      on Linux and does not work. defining it causes some applications to
      use it, and subsequently break due to its failure.
      91738d02
  8. 06 11月, 2012 1 次提交
  9. 19 10月, 2012 2 次提交
  10. 16 10月, 2012 1 次提交
    • R
      add support for TLS variant I, presently needed for arm and mips · 9ec4283b
      Rich Felker 提交于
      despite documentation that makes it sound a lot different, the only
      ABI-constraint difference between TLS variants II and I seems to be
      that variant II stores the initial TLS segment immediately below the
      thread pointer (i.e. the thread pointer points to the end of it) and
      variant I stores the initial TLS segment above the thread pointer,
      requiring the thread descriptor to be stored below. the actual value
      stored in the thread pointer register also tends to have per-arch
      random offsets applied to it for silly micro-optimization purposes.
      
      with these changes applied, TLS should be basically working on all
      supported archs except microblaze. I'm still working on getting the
      necessary information and a working toolchain that can build TLS
      binaries for microblaze, but in theory, static-linked programs with
      TLS and dynamic-linked programs where only the main executable uses
      TLS should already work on microblaze.
      
      alignment constraints have not yet been heavily tested, so it's
      possible that this code does not always align TLS segments correctly
      on archs that need TLS variant I.
      9ec4283b
  11. 05 10月, 2012 1 次提交
    • R
      dynamic-linked TLS support for everything but dlopen'd libs · 9c74856a
      Rich Felker 提交于
      currently, only i386 is tested. x86_64 and arm should probably work.
      the necessary relocation types for mips and microblaze have not been
      added because I don't understand how they're supposed to work, and I'm
      not even sure if it's defined yet on microblaze. I may be able to
      reverse engineer the requirements out of gcc/binutils output.
      9c74856a
  12. 22 9月, 2012 1 次提交
  13. 16 9月, 2012 1 次提交
    • R
      add O_EXEC open mode · 6d05d862
      Rich Felker 提交于
      the linux O_PATH mode provides the necessary semantics for both the
      O_SEARCH and O_EXEC modes defined and required by POSIX 2008.
      6d05d862
  14. 15 9月, 2012 1 次提交
    • R
      fix buggy constraints in mips inline syscall asm · 4221f154
      Rich Felker 提交于
      if same register is used for input/output, the compiler must be told.
      otherwise is generates random junk code that clobbers the result. in
      pure syscall-wrapper functions, nothing went wrong, but in more
      complex functions where register allocation is non-trivial, things
      broke badly.
      4221f154
  15. 14 9月, 2012 1 次提交
    • R
      add O_PATH/O_SEARCH support to fcntl.h · b238b37a
      Rich Felker 提交于
      I'm not 100% sure that Linux's O_PATH meets the POSIX requirements for
      O_SEARCH, but it seems very close if not perfect. and old kernels
      ignore it, so O_SEARCH will still work as desired as long as the
      caller has read permissions to the directory.
      b238b37a
  16. 11 9月, 2012 2 次提交
    • R
      improve mips syscall asm constraints to use immediates, if possible · cfc09b1e
      Rich Felker 提交于
      by using the "ir" constraint (immediate or register) and the carefully
      constructed instruction addu $2,$0,%2 which can take either an
      immediate or a register for %2, the new inline asm admits maximal
      optimization with no register spillage to the stack when the compiler
      successfully performs constant propagration, but still works by
      allocating a register when the syscall number cannot be recognized as
      a constant. in the case of syscalls with 0-3 arguments it barely
      matters, but for 4-argument syscalls, using an immediate for the
      syscall number avoids creating a stack frame for the syscall wrapper
      function.
      cfc09b1e
    • R
      eliminate assumption that mips syscall restart preserves r25 · b94067ee
      Rich Felker 提交于
      all past and current kernel versions have done so, but there seems to
      be no reason it's necessary and the sentiment from everyone I've asked
      has been that we should not rely on it. instead, use r7 (an argument
      register) which will necessarily be preserved upon syscall restart.
      however this only works for 0-3 argument syscalls, and we have to
      resort to the function call for 4-argument syscalls.
      b94067ee
  17. 09 9月, 2012 2 次提交
    • R
      inline syscall support for mips · 328810d3
      Rich Felker 提交于
      this drastically reduces the size of some functions which are purely
      syscall wrappers.
      
      disabled for clang due to known bugs satisfying register constraints.
      328810d3
    • R
      syscall organization overhaul · 208eb584
      Rich Felker 提交于
      now public syscall.h only exposes __NR_* and SYS_* constants and the
      variadic syscall function. no macros or inline functions, no
      __syscall_ret or other internal details, no 16-/32-bit legacy syscall
      renaming, etc. this logic has all been moved to src/internal/syscall.h
      with the arch-specific parts in arch/$(ARCH)/syscall_arch.h, and the
      amount of arch-specific stuff has been reduced to a minimum.
      
      changes still need to be reviewed/double-checked. minimal testing on
      i386 and mips has already been performed.
      208eb584
  18. 08 9月, 2012 1 次提交
    • R
      add clang-compatible thread-pointer code for mips · 9f65796c
      Rich Felker 提交于
      clang does not presently support the "v" constraint we want to use to
      get the result from $3, and trying to use register...__asm__("$3") to
      do the same invokes serious compiler bugs. so for now, i'm working
      around the issue with an extra temp register and putting $3 in the
      clobber list instead of using it as output. when the bugs in clang are
      fixed, this issue should be revisited to generate smaller/faster code
      like what gcc gets.
      9f65796c
  19. 03 9月, 2012 1 次提交
    • R
      avoid "inline" in public headers for strict c89 compatibility · fb247faf
      Rich Felker 提交于
      while musl itself requires a c99 compiler, some applications insist on
      being compiled with c89 compilers, and use of "inline" in the headers
      was breaking them. much of this had been avoided already by just
      skipping the inline keyword in pre-c99 compilers or modes, but this
      new unified solution is cleaner and may/should result in better code
      generation in the default gcc configuration.
      fb247faf
  20. 12 8月, 2012 1 次提交
  21. 11 8月, 2012 1 次提交
  22. 10 8月, 2012 1 次提交
  23. 08 8月, 2012 2 次提交
  24. 06 8月, 2012 3 次提交
    • R
      fix socket.h on mips · 7fee5f96
      Rich Felker 提交于
      why does mips have to be gratuitously incompatible in every possible
      imaginable way?
      7fee5f96
    • R
      more stuff lost committing mips dynamic linker · fa91df41
      Rich Felker 提交于
      fa91df41
    • R
      mips dynamic linker support · babf8201
      Rich Felker 提交于
      not heavily tested, but the basics are working. the basic concept is
      that the dynamic linker entry point code invokes a pure-PIC (no global
      accesses) C function in reloc.h to perform the early GOT relocations
      needed to make the dynamic linker itself functional, then invokes
      __dynlink like on other archs. since mips uses some ugly arch-specific
      hacks to optimize relocating the GOT (rather than just using the
      normal DT_REL[A] tables like on other archs), the dynamic linker has
      been modified slightly to support calling arch-specific relocation
      code in reloc.h.
      
      most of the actual mips-specific behavior was developed by reading the
      output of readelf on libc.so and simple executable files. i could not
      find good reference information on which relocation types need to be
      supported or their semantics, so it's possible that some legitimate
      usage cases will not work yet.
      babf8201
  25. 23 7月, 2012 1 次提交
  26. 13 7月, 2012 4 次提交
    • R
      fix broken mips a_fetch_add · 48d20136
      Rich Felker 提交于
      sc was overwriting the result
      48d20136
    • R
      mipsel (little endian) support · e1e4d6b2
      Rich Felker 提交于
      the fields in the mcontext_t are long long (for no good reason) even
      on 32-bit mips, so the offset of the instruction pointer (as a word)
      varies depending on endianness.
      e1e4d6b2
    • R
      workaround another sendmsg kernel bug on 64-bit machines · 96107564
      Rich Felker 提交于
      the kernel wrongly expects the cmsg length field to be size_t instead
      of socklen_t. in order to work around the issue, we have to impose a
      length limit and copy to a local buffer. the length limit should be
      more than sufficient for any real-world use; these headers are only
      used for passing file descriptors and permissions between processes
      over unix sockets.
      96107564
    • R
      fix redef of sigprocmask constants on mips · 90e123f4
      Rich Felker 提交于
      this fix is easier than trying to reorder the header stuff
      90e123f4