1. 18 3月, 2014 1 次提交
    • R
      x32: fix struct statfs · 797f9a32
      rofl0r 提交于
      the omission of the padding was uncovered by the latest regression
      statvfs regression test added to libc-test.
      797f9a32
  2. 17 3月, 2014 1 次提交
    • B
      superh: fix dynamic linking of __fpscr_values · 611eabd4
      Bobby Bingham 提交于
      Applications ended up with copy relocations for this array, which
      resulted in libc's references to this array pointing to the
      application's copy.  The dynamic linker, however, can require this array
      before the application is relocated, and therefore before the
      application's copy of this array is initialized.  This resulted in
      garbage being loaded into FPSCR before executing main, which violated
      the ABI.
      
      We fix this by putting the array in crt1 and making the libc copy
      private.  This prevents libc's reference to the array from pointing to
      an uninitialized copy in the application.
      611eabd4
  3. 13 3月, 2014 1 次提交
    • S
      fix statfs struct on mips · 7673acd3
      Szabolcs Nagy 提交于
      The mips statfs struct layout is different than on other archs, so the
      statfs, fstatfs, statvfs and fstatvfs APIs were broken on mips.
      Now the ordering is fixed, the types are kept consistent with other archs.
      7673acd3
  4. 12 3月, 2014 4 次提交
    • S
      fix semid_ds structure on mips · 3ceb89ed
      Szabolcs Nagy 提交于
      This used to be broken when all archs had the same semid_ds definition:
      there is no padding around the time_t members on mips.
      3ceb89ed
    • R
      fix socket.h struct msghdr member types on powerpc · 514c2dd2
      Rich Felker 提交于
      these were incorrectly copied from the kernel, whose ABI matches the
      POSIX requirements but with the wrong underlying types and wrong
      signedness.
      514c2dd2
    • R
      fix sysvipc structures on powerpc · ad66ae93
      Rich Felker 提交于
      these have been wrong for a long time and were never detected or
      corrected. powerpc needs some gratuitous extra padding/reserved slots
      in ipc_perm, big-endian ordering for the padding of time_t slots that
      was intended by the kernel folks to allow a transition to 64-bit
      time_t, and some minor gratuitous reordering of struct members.
      ad66ae93
    • R
      move struct semid_ds to from shared sys/sem.h to bits · f6e2f7e1
      Rich Felker 提交于
      the definition was found to be incorrect at least for powerpc, and
      fixing this cleanly requires making the definition arch-specific. this
      will allow cleaning up the definition for other archs to make it more
      specific, and reversing some of the ugliness (time_t hacks) introduced
      with the x32 port.
      
      this first commit simply copies the existing definition to each arch
      without any changes. this is intentional, to make it easier to review
      changes made on a per-arch basis.
      f6e2f7e1
  5. 08 3月, 2014 1 次提交
  6. 06 3月, 2014 1 次提交
    • R
      x32: fix sysinfo() · dae8ca73
      rofl0r 提交于
      the kernel uses long longs in the struct, but the documentation
      says they're long. so we need to fixup the mismatch between the
      userspace and kernelspace structs.
      since the struct offers a mem_unit member, we can avoid truncation
      by adjusting that value.
      dae8ca73
  7. 28 2月, 2014 3 次提交
  8. 25 2月, 2014 2 次提交
    • S
      mips: add mips-sf subarch support (soft-float) · e5bb165b
      Szabolcs Nagy 提交于
      Userspace emulated floating-point (gcc -msoft-float) is not compatible
      with the default mips abi (assumes an FPU or in kernel emulation of it).
      Soft vs hard float abi should not be mixed, __mips_soft_float is checked
      in musl's configure script and there is no runtime check. The -sf subarch
      does not save/restore floating-point registers in setjmp/longjmp and only
      provides dummy fenv implementation.
      e5bb165b
    • R
      fixup general __syscall breakage introduced in x32 port · dbed3924
      rofl0r 提交于
      the reordering of headers caused some risc archs to not see
      the __syscall declaration anymore.
      this caused build errors on mips with any compiler,
      and on arm and microblaze with clang.
      
      we now declare it locally just like the powerpc port does.
      dbed3924
  9. 24 2月, 2014 3 次提交
  10. 23 2月, 2014 5 次提交
  11. 16 1月, 2014 1 次提交
  12. 12 1月, 2014 3 次提交
  13. 09 1月, 2014 2 次提交
  14. 02 12月, 2013 1 次提交
  15. 24 11月, 2013 1 次提交
  16. 21 11月, 2013 1 次提交
    • R
      fix the nominal type of LDBL_* limits on archs with ld64 · 326e5c2e
      Rich Felker 提交于
      previously these macros wrongly had type double rather than long
      double. I see no way an application could detect the error in C99, but
      C11's _Generic can trivially detect it.
      
      at the same time, even though these archs do not have excess
      precision, the number of decimal places used to represent these
      constants has been increased to 21 to be consistent with the decimal
      representations used for the DBL_* macros.
      326e5c2e
  17. 27 9月, 2013 2 次提交
  18. 22 9月, 2013 1 次提交
    • R
      fix arm atomic store and generate simpler/less-bloated/faster code · 35a6801c
      Rich Felker 提交于
      atomic store was lacking a barrier, which was fine for legacy arm with
      no real smp and kernel-emulated cas, but unsuitable for more modern
      systems. the kernel provides another "kuser" function, at 0xffff0fa0,
      which could be used for the barrier, but using that would drop support
      for kernels 2.6.12 through 2.6.14 unless an extra conditional were
      added to check for barrier availability. just using the barrier in the
      kernel cas is easier, and, based on my reading of the assembly code in
      the kernel, does not appear to be significantly slower.
      
      at the same time, other atomic operations are adapted to call the
      kernel cas function directly rather than using a_cas; due to small
      differences in their interface contracts, this makes the generated
      code much simpler.
      35a6801c
  19. 15 9月, 2013 2 次提交
    • S
      support configurable page size on mips, powerpc and microblaze · b20760c0
      Szabolcs Nagy 提交于
      PAGE_SIZE was hardcoded to 4096, which is historically what most
      systems use, but on several archs it is a kernel config parameter,
      user space can only know it at execution time from the aux vector.
      
      PAGE_SIZE and PAGESIZE are not defined on archs where page size is
      a runtime parameter, applications should use sysconf(_SC_PAGE_SIZE)
      to query it. Internally libc code defines PAGE_SIZE to libc.page_size,
      which is set to aux[AT_PAGESZ] in __init_libc and early in __dynlink
      as well. (Note that libc.page_size can be accessed without GOT, ie.
      before relocations are done)
      
      Some fpathconf settings are hardcoded to 4096, these should be actually
      queried from the filesystem using statfs.
      b20760c0
    • R
      fix mips sysv ipc bits headers · 9b35ed3f
      Rich Felker 提交于
      msg.h was wrong for big-endian (wrong endiannness padding).
      shm.h was just plain wrong (mips is not supposed to have padding).
      
      both changes were tested using libc-test on qemu-system-mips.
      9b35ed3f
  20. 19 8月, 2013 1 次提交
  21. 17 8月, 2013 2 次提交
    • R
      fix detection of arm hardfloat · 4918c2bb
      Rich Felker 提交于
      it turns out that __SOFTFP__ does not indicate the ABI in use but
      rather that fpu instructions are not to be used at all. this is
      specified in ARM's documentation so I'm unclear on how I previously
      got the wrong idea. unfortunately, this resulted in the 0.9.12 release
      producing a dynamic linker with the wrong name. fortunately, there do
      not yet seem to be any public toolchain builds using the wrong name.
      
      the __ARM_PCS_VFP macro does not seem to be official from ARM, and in
      fact it was missing from the very earliest gcc versions (around 4.5.x)
      that added -mfloat-abi=hard. it would be possible on such versions to
      perform some ugly linker-based tests instead in hopes that the linker
      will reject ABI-mismatching object files, if there is demand for
      supporting such versions. I would probably prefer to document which
      versions are broken and warn users to manually add -D__ARM_PCS_VFP if
      using such a version.
      
      there's definitely an argument to be made that the fenv macros should
      be exposed even in -mfloat-abi=softfp mode. for now, I have chosen not
      to expose them in this case, since the math library will not
      necessarily have the capability to raise exceptions (it depends on the
      CFLAGS used to compile it), and since exceptions are officially
      excluded from the ARM EABI, which the plain "arm" arch aims to
      follow.
      4918c2bb
    • R
      support floating point environment (fenv) on armhf (hard float) subarchs · 7318c62e
      Rich Felker 提交于
      patch by nsz. I've tested it on an armhf machine and it seems to be
      working correctly.
      7318c62e
  22. 16 8月, 2013 1 次提交
    • R
      add function types to arm crt assembly · badaa04a
      Rich Felker 提交于
      without these, calls may be resolved incorrectly if the calling code
      has been compiled to thumb instead of arm. it's not clear to me at
      this point whether crt_arch.h is even working if crt1.c is built as
      thumb; this needs testing. but the _init and _fini issues were known
      to cause crashes in static-linked apps when libc was built as thumb,
      and this commit should fix that issue.
      badaa04a