This project is mirrored from git://sourceware.org/git/glibc.git. Pull mirroring updated .
  1. 27 Sep, 2021 6 commits
    • Fangrui Song's avatar
    • Adhemerval Zanella's avatar
      posix: Remove spawni.c · 8f42a986
      Adhemerval Zanella authored
      
      
      Although it provide an alternate implementation that communicates
      using pipe() instead of shared memory, no port uses and it adds extra
      burden for posix_spawn() extensions.
      Reviewed-by: Florian Weimer's avatarFlorian Weimer <fweimer@redhat.com>
      8f42a986
    • H.J. Lu's avatar
      Disable symbol hack in libc_nonshared.a · b0a33dc9
      H.J. Lu authored
      Don't reference __GI_memmove, __GI_memset, __GI_memcpy, __divdi3_internal,
      __udivdi3_internal and __moddi3_internal in libc_nonshared.a.
      b0a33dc9
    • Adhemerval Zanella's avatar
      linux: Revert the use of sched_getaffinity on get_nproc (BZ #28310) · 34229827
      Adhemerval Zanella authored
      The use of sched_getaffinity on get_nproc and
      sysconf (_SC_NPROCESSORS_ONLN) done in 903bc7dc (BZ #27645)
      breaks the top command in common hypervisor configurations and also
      other monitoring tools.
      
      The main issue using sched_getaffinity changed the symbols semantic
      from system-wide scope of online CPUs to per-process one (which can
      be changed with kernel cpusets or book parameters in VM).
      
      This patch reverts mostly of the 903bc7dc
      
      , with the
      exceptions:
      
        * No more cached values and atomic updates, since they are inherent
          racy.
      
        * No /proc/cpuinfo fallback, since /proc/stat is already used and
          it would require to revert more arch-specific code.
      
        * The alloca is replace with a static buffer of 1024 bytes.
      
      So the implementation first consult the sysfs, and fallbacks to procfs.
      
      Checked on x86_64-linux-gnu.
      Reviewed-by: Florian Weimer's avatarFlorian Weimer <fweimer@redhat.com>
      34229827
    • Adhemerval Zanella's avatar
      linux: Simplify get_nprocs · 33099d72
      Adhemerval Zanella authored
      This patch simplifies the memory allocation code and uses the sched
      routines instead of reimplement it.  This still uses a stack
      allocation buffer, so it can be used on malloc initialization code.
      
      Linux currently supports at maximum of 4096 cpus for most architectures:
      
      $ find -iname Kconfig | xargs git grep -A10 -w NR_CPUS | grep -w range
      arch/alpha/Kconfig-	range 2 32
      arch/arc/Kconfig-	range 2 4096
      arch/arm/Kconfig-	range 2 16 if DEBUG_KMAP_LOCAL
      arch/arm/Kconfig-	range 2 32 if !DEBUG_KMAP_LOCAL
      arch/arm64/Kconfig-	range 2 4096
      arch/csky/Kconfig-	range 2 32
      arch/hexagon/Kconfig-	range 2 6 if SMP
      arch/ia64/Kconfig-	range 2 4096
      arch/mips/Kconfig-	range 2 256
      arch/openrisc/Kconfig-	range 2 32
      arch/parisc/Kconfig-	range 2 32
      arch/riscv/Kconfig-	range 2 32
      arch/s390/Kconfig-	range 2 512
      arch/sh/Kconfig-	range 2 32
      arch/sparc/Kconfig-	range 2 32 if SPARC32
      arch/sparc/Kconfig-	range 2 4096 if SPARC64
      arch/um/Kconfig-	range 1 1
      arch/x86/Kconfig-# [NR_CPUS_RANGE_BEGIN ... NR_CPUS_RAN...
      33099d72
    • Adhemerval Zanella's avatar
      misc: Add __get_nprocs_sched · 11a02b03
      Adhemerval Zanella authored
      
      
      This is an internal function meant to return the number of avaliable
      processor where the process can scheduled, different than the
      __get_nprocs which returns a the system available online CPU.
      
      The Linux implementation currently only calls __get_nprocs(), which
      in tuns calls sched_getaffinity.
      Reviewed-by: Florian Weimer's avatarFlorian Weimer <fweimer@redhat.com>
      11a02b03
  2. 26 Sep, 2021 1 commit
    • Samuel Thibault's avatar
      htl: Fix sigset of main thread · 51463869
      Samuel Thibault authored
      d482ebfa ('htl: Keep thread signals blocked during its initialization')
      fixed not letting signals get delivered too early during thread creation,
      but it also affected the main thread, thus making it block signals by
      default.  We need to just let the main thread sigset as it is.
      51463869
  3. 25 Sep, 2021 2 commits
  4. 24 Sep, 2021 8 commits
    • Noah Goldstein's avatar
      benchtests: Improve reliability of memcmp benchmarks · a1c056c9
      Noah Goldstein authored
      
      
      No bug. Remove reallocation of bufs between implementation tests. Move
      initialization outside of foreach implementation test loop. Increase
      iteration count.
      
      Generally before this commit was seeing a great deal of variability
      between runs. The goal of this commit is to make the results more
      reliable.
      
      Benchtests build and bench-memcmp succeeding.
      Signed-off-by: Noah Goldstein's avatarNoah Goldstein <goldstein.w.n@gmail.com>
      a1c056c9
    • Joseph Myers's avatar
      Define __STDC_IEC_60559_BFP__ and __STDC_IEC_60559_COMPLEX__ · 8807e560
      Joseph Myers authored
      TS 18661-1 and C2X specify predefined macros __STDC_IEC_60559_BFP__
      and __STDC_IEC_60559_COMPLEX__, making __STDC_IEC_559__ and
      __STDC_IEC_559_COMPLEX__ obsolescent (but still included in the
      standard).  Now that we have all the functions from TS 18661-1, define
      these macros in stdc-predef.h, under the same conditions in which the
      older macros are defined, since support for the floating-point
      features in TS 18661-1 is now at the same level as that for those in
      C11 and before (all library functions and other library APIs present,
      but no standard pragma support).
      
      The macros are defined for now with their TS 18661-1 values.  C2X will
      give them new values (listed as yyyymmL in the working drafts until
      the final standard), at which point there will be the question of what
      value to use in stdc-predef.h (where it could depend on
      __STDC_VERSION__, but not on feature test macros defined by the user).
      My inclination then would be to use the C2X value unc...
      8807e560
    • Paul E. Murphy's avatar
      build-many-glibcs.py: add powerpc64le glibc variant without multiarch · 4ae2b8a4
      Paul E. Murphy authored
      This configuration tests the float128 to ldouble128 redirect support
      on powerpc64le without the extra wrappers needed to support ifunc
      on this target.
      4ae2b8a4
    • Joseph Myers's avatar
      Fix sysdeps/x86/fpu/s_ffma.c for 32-bit FMA processor case · b26901b2
      Joseph Myers authored
      It turns out the __SSE2_MATH__ conditional in sysdeps/x86/fpu/s_ffma.c
      does not cover all cases where the x86 fenv_private.h macros might
      manipulate one of the SSE and 387 floating-point state, while the
      actual fma implementation uses the other.  Specifically, in the 32-bit
      case, with a compiler not defaulting to -mfpmath=sse, but testing on a
      processor with hardware FMA support, the multiarch fma function
      implementations will end up using SSE, while the fenv_private.h macros
      will use the 387 state for double.  Change the conditional to use the
      default macros rather than the optimized ones in all cases except when
      the compiler inlines an fma instruction (in which case, since all
      those instructions are SSE instructions and -mfpmath=sse must be in
      effect for them to be inlined, the optimized macros will only use the
      SSE state and it's OK for them to only use the SSE state).
      
      Tested for x86_64 and x86.  H.J. reports in
      <https://sourceware.org/pipermail/libc-alpha/2021-September/131367.html>
      that it fixes the problems he observed.
      b26901b2
    • Florian Weimer's avatar
    • Fangrui Song's avatar
      i386: Port elf_machine_{load_address,dynamic} from x86-64 · 91e92272
      Fangrui Song authored
      
      
      This drops reliance on _GLOBAL_OFFSET_TABLE_[0] being the link-time
      address of _DYNAMIC.
      
      The code sequence length does not change.
      Reviewed-by: H.J. Lu's avatarH.J. Lu <hjl.tools@gmail.com>
      91e92272
    • Naohiro Tamura's avatar
      aarch64: Disable A64FX memcpy/memmove BTI unconditionally · 381b2961
      Naohiro Tamura authored
      This patch disables A64FX memcpy/memmove BTI instruction insertion
      unconditionally such as A64FX memset patch [1] for performance.
      
      [1] commit 07b42729
      
      Reviewed-by: default avatarSzabolcs Nagy <szabolcs.nagy@arm.com>
      381b2961
    • Stafford Horne's avatar
      xsysconf: Only fail on error results and errno set · 2efca218
      Stafford Horne authored
      When testing nptl/tst-pthread-attr-affinity-fail fails with:
      
          error: xsysconf.c:33: sysconf (83): Cannot allocate memory
          error: 1 test failures
      
      This happens as xsysconf checks the errno after running sysconf.
      Internally the sysconf request for _SC_NPROCESSORS_CONF on linux
      allocates memory.  But there is a problem, even though malloc succeeds
      errno is getting set to ENOMEM.
      
      POSIX allows successful calls to clobber errno.  So xsysconf just
      checking errno is wrong.  Fix xsysconf by only failing if we have an
      error result and errno is set.
      2efca218
  5. 23 Sep, 2021 5 commits
    • Tulio Magno Quites Machado Filho's avatar
      powerpc64le: Avoid conflicting types for f64xfmaf128 when IFUNC is not used · 54ff4f1e
      Tulio Magno Quites Machado Filho authored
      Avoid defining f64xfmaf128 twice when building s_fmaf128.c.
      This can be reproduced on powerpc64le whenever f128 functions do not
      have IFUNC enabled, e.g. using "--with-cpu=power8 --disable-multi-arch", or
      when using "-with-cpu=power9".
      
      Fixes: b3f27d81 ("Add narrowing fma functions")
      54ff4f1e
    • Joseph Myers's avatar
      Fix ffma use of round-to-odd on x86 · 4ed7a383
      Joseph Myers authored
      On 32-bit x86 with -mfpmath=sse, and on x86_64 with
      --disable-multi-arch, the tests of ffma and its aliases (fma narrowing
      from binary64 to binary32) fail.  This is probably the issue reported
      by H.J. in
      <https://sourceware.org/pipermail/libc-alpha/2021-September/131277.html>.
      
      The problem is the use of fenv_private.h macros in the round-to-odd
      implementation.  Those macros are set up to manipulate only one of the
      SSE and 387 floating-point state, whichever is relevant for the type
      indicated by the suffix on the macro name.  But x86 configurations
      sometimes use the ldbl-96 implementation of binary64 fma (that's where
      --disable-multi-arch is relevant for x86_64: it causes the ldbl-96
      implementation to be used, instead of an IFUNC implementation that
      falls back to the dbl-64 version), contrary to the expectations of
      those macros for functions operating on double when __SSE2_MATH__ is
      defined.
      
      This can be addressed by using the default versions of those macros
      (giving x86 its own version of s_ffma.c), as is done for the *f128
      macro variants where it depends on the details of how GCC was
      configured when building libgcc which floating-point state is affected
      by _Float128 arithmetic.  The issue only applies when __SSE2_MATH__ is
      defined, and doesn't apply when __FP_FAST_FMA is defined (because in
      that case, fma will be inlined by the compiler, meaning it's
      definitely an SSE operation; for the same reason, this is not an issue
      for narrowing sqrt, as hardware sqrt is always inlined in that
      implementation for x86), but in other cases it's safest to use the
      default versions of the fenv_private.h macros to ensure things work
      whichever fma implementation is used.
      
      Tested for x86_64 (with and without --disable-multi-arch) and x86
      (with and without -mfpmath=sse).
      4ed7a383
    • Florian Weimer's avatar
      vfprintf: Unify argument handling in process_arg · 475b0b92
      Florian Weimer authored
      Instead of checking a pointer argument for NULL, use helper macros
      defined differently in the non-positional and positional cases.
      This avoids frequent conditional checks and a GCC 12 warning
      about comparing pointers against NULL which cannot be NULL.
      475b0b92
    • Florian Weimer's avatar
      vfprintf: Handle floating-point cases outside of process_arg macro · 0a5e270b
      Florian Weimer authored
      A lot of the code is unique to the positional and non-positional
      code.  Also unify the decimal and hexadecimal cases via the new
      helper function __printf_fp_spec.
      0a5e270b
    • Florian Weimer's avatar
      nptl: Avoid setxid deadlock with blocked signals in thread exit [BZ #28361] · 2849e2f5
      Florian Weimer authored
      
      
      As part of the fix for bug 12889, signals are blocked during
      thread exit, so that application code cannot run on the thread that
      is about to exit.  This would cause problems if the application
      expected signals to be delivered after the signal handler revealed
      the thread to still exist, despite pthread_kill can no longer be used
      to send signals to it.  However, glibc internally uses the SIGSETXID
      signal in a way that is incompatible with signal blocking, due to the
      way the setxid handshake delays thread exit until the setxid operation
      has completed.  With a blocked SIGSETXID, the handshake can never
      complete, causing a deadlock.
      
      As a band-aid, restore the previous handshake protocol by not blocking
      SIGSETXID during thread exit.
      
      The new test sysdeps/pthread/tst-pthread-setuid-loop.c is based on
      a downstream test by Martin Osvald.
      Reviewed-by: Carlos O'Donell's avatarCarlos O'Donell <carlos@redhat.com>
      Tested-by: Carlos O'Donell's avatarCarlos O'Donell <carlos@redhat.com>
      2849e2f5
  6. 22 Sep, 2021 4 commits
    • Joseph Myers's avatar
      Add narrowing fma functions · b3f27d81
      Joseph Myers authored
      This patch adds the narrowing fused multiply-add functions from TS
      18661-1 / TS 18661-3 / C2X to glibc's libm: ffma, ffmal, dfmal,
      f32fmaf64, f32fmaf32x, f32xfmaf64 for all configurations; f32fmaf64x,
      f32fmaf128, f64fmaf64x, f64fmaf128, f32xfmaf64x, f32xfmaf128,
      f64xfmaf128 for configurations with _Float64x and _Float128;
      __f32fmaieee128 and __f64fmaieee128 aliases in the powerpc64le case
      (for calls to ffmal and dfmal when long double is IEEE binary128).
      Corresponding tgmath.h macro support is also added.
      
      The changes are mostly similar to those for the other narrowing
      functions previously added, especially that for sqrt, so the
      description of those generally applies to this patch as well.  As with
      sqrt, I reused the same test inputs in auto-libm-test-in as for
      non-narrowing fma rather than adding extra or separate inputs for
      narrowing fma.  The tests in libm-test-narrow-fma.inc also follow
      those for non-narrowing fma.
      
      The non-narrowing fma has a known bug (bug 6801) that it d...
      b3f27d81
    • H.J. Lu's avatar
      ld.so: Replace DL_RO_DYN_SECTION with dl_relocate_ld [BZ #28340] · b413280c
      H.J. Lu authored
      
      
      We can't relocate entries in dynamic section if it is readonly:
      
      1. Add a l_ld_readonly field to struct link_map to indicate if dynamic
      section is readonly and set it based on p_flags of PT_DYNAMIC segment.
      2. Replace DL_RO_DYN_SECTION with dl_relocate_ld to decide if dynamic
      section should be relocated.
      3. Remove DL_RO_DYN_TEMP_CNT.
      4. Don't use a static dynamic section to make readonly dynamic section
      in vDSO writable.
      5. Remove the temp argument from elf_get_dynamic_info.
      
      This fixes BZ #28340.
      Reviewed-by: Siddhesh Poyarekar's avatarSiddhesh Poyarekar <siddhesh@sourceware.org>
      b413280c
    • Joseph Myers's avatar
      Adjust new narrowing div/mul tests for IBM long double, update powerpc ULPs · 4eff749e
      Joseph Myers authored
      Testing for powerpc shows some of the new narrowing div/mul tests need
      XFAILing for IBM long double and some ULPs updates are needed for
      those tests.
      4eff749e
    • Paul Eggert's avatar
      Mention today's regex merge in SHARED-FILES · ed05f7dd
      Paul Eggert authored
      ed05f7dd
  7. 21 Sep, 2021 3 commits
    • Joseph Myers's avatar
      Fix f64xdivf128, f64xmulf128 spurious underflows (bug 28358) · 1356f38d
      Joseph Myers authored
      As described in bug 28358, the round-to-odd computations used in the
      libm functions that round their results to a narrower format can yield
      spurious underflow exceptions in the following circumstances: the
      narrowing only narrows the precision of the type and not the exponent
      range (i.e., it's narrowing _Float128 to _Float64x on x86_64, x86 or
      ia64), the architecture does after-rounding tininess detection (which
      applies to all those architectures), the result is inexact, tiny
      before rounding but not tiny after rounding (with the chosen rounding
      mode) for _Float64x (which is possible for narrowing mul, div and fma,
      not for narrowing add, sub or sqrt), so the underflow exception
      resulting from the toward-zero computation in _Float128 is spurious
      for _Float64x.
      
      Fixed by making ROUND_TO_ODD call feclearexcept (FE_UNDERFLOW) in the
      problem cases (as indicated by an extra argument to the macro); there
      is never any need to preserve underflow exceptions from this part of
      the computation, because the conversion of the round-to-odd value to
      the narrower type will underflow in exactly the cases in which the
      function should raise that exception, but it may be more efficient to
      avoid the extra manipulation of the floating-point environment when
      not needed.
      
      Tested for x86_64 and x86, and with build-many-glibcs.py.
      1356f38d
    • Paul Eggert's avatar
      regex: copy back from Gnulib · 0b5ca7c3
      Paul Eggert authored
      Copy regex-related files back from Gnulib, to fix a problem with
      static checking of regex calls noted by Martin Sebor.  This merges the
      following changes:
      
      * New macro __attribute_nonnull__ in misc/sys/cdefs.h, for use later
      when copying other files back from Gnulib.
      
      * Use __GNULIB_CDEFS instead of __GLIBC__ when deciding
      whether to include bits/wordsize.h etc.
      
      * Avoid duplicate entries in epsilon closure table.
      
      * New regex.h macro _REGEX_NELTS to let regexec say that its pmatch
      arg should contain nmatch elts.  Use that for regexec, instead of
      __attr_access (which is incorrect).
      
      * New regex.h macro _Attr_access_ which is like __attr_access except
      portable to non-glibc platforms.
      
      * Add some DEBUG_ASSERTs to pacify gcc -fanalyzer and to catch
      recently-fixed performance bugs if they recur.
      
      * Add Gnulib-specific stuff to port the dynarray- and lock-using parts
      of regex code to non-glibc platforms.
      
      * Fix glibc bug 11053.
      
      * Avoid some undefined behavior when popping an empty fail stack.
      0b5ca7c3
    • Florian Weimer's avatar
  8. 20 Sep, 2021 3 commits
    • Paul Clarke's avatar
      powerpc: Fix unrecognized instruction errors with recent GCC · 064b475a
      Paul Clarke authored
      
      
      Recent binutils commit b25f942e18d6ecd7ec3e2d2e9930eb4f996c258a
      changes the behavior of `.machine` directives to override, rather
      than augment, the base CPU. This can result in _reduced_ functionality
      when, for example, compiling for default machine "power8", but explicitly
      asking for ".machine power5", which loses Altivec instructions.
      
      In tst-ucontext-ppc64-vscr.c, while the instructions provoking the new
      error messages are bracketed by ".machine power5", which is ostensibly
      Power ISA 2.03 (POWER5), the POWER5 processor did not support the
      VSX subset, so these instructions are not recognized as "power5".
      
      Error: unrecognized opcode: `vspltisb'
      Error: unrecognized opcode: `vpkuwus'
      Error: unrecognized opcode: `mfvscr'
      Error: unrecognized opcode: `stvx'
      
      Manually adding the VSX subset via ".machine altivec" is sufficient.
      Reviewed-by: Tulio Magno Quites Machado Filho's avatarTulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
      064b475a
    • Florian Weimer's avatar
      elf: Include <sysdep.h> in elf/dl-debug-symbols.S · 7e84ac3a
      Florian Weimer authored
      
      
      This is necessary to generate assembler marker sections on some
      targets.
      Reviewed-by: default avatarSzabolcs Nagy <szabolcs.nagy@arm.com>
      7e84ac3a
    • Florian Weimer's avatar
      nptl: pthread_kill needs to return ESRCH for old programs (bug 19193) · 95dba35b
      Florian Weimer authored
      The fix for bug 19193 breaks some old applications which appear
      to use pthread_kill to probe if a thread is still running, something
      that is not supported by POSIX.
      95dba35b
  9. 19 Sep, 2021 1 commit
    • H.J. Lu's avatar
      Extend struct r_debug to support multiple namespaces [BZ #15971] · a93d9e03
      H.J. Lu authored
      Glibc does not provide an interface for debugger to access libraries
      loaded in multiple namespaces via dlmopen.
      
      The current rtld-debugger interface is described in the file:
      
      elf/rtld-debugger-interface.txt
      
      under the "Standard debugger interface" heading.  This interface only
      provides access to the first link-map (LM_ID_BASE).
      
      1. Bump r_version to 2 when multiple namespaces are used.  This triggers
      the GDB bug:
      
      https://sourceware.org/bugzilla/show_bug.cgi?id=28236
      
      
      
      2. Add struct r_debug_extended to extend struct r_debug into a linked-list,
      where each element correlates to an unique namespace.
      3. Initialize the r_debug_extended structure.  Bump r_version to 2 for
      the new namespace and add the new namespace to the namespace linked list.
      4. Add _dl_debug_update to return the address of struct r_debug' of a
      namespace.
      5. Add a hidden symbol, _r_debug_extended, for struct r_debug_extended.
      6. Provide the symbol, _r_debug, with size of struct r_debug, as an alias
      of _r_debug_extended, for programs which reference _r_debug.
      
      This fixes BZ #15971.
      Reviewed-by: Florian Weimer's avatarFlorian Weimer <fweimer@redhat.com>
      a93d9e03
  10. 17 Sep, 2021 2 commits
    • Joseph Myers's avatar
      Use $(pie-default) with conformtest · 885762aa
      Joseph Myers authored
      My glibc bot showed that my conformtest changes fail the build of the
      conformtest execution tests for x86_64-linux-gnu-static-pie, because
      linking the newly built object with the newly built libc and the
      associated options normally used for linking requires it to be built
      as PIE.  Add $(pie-default) to the compiler command used so that PIE
      options are used when required.
      
      There's a case for using the whole of $(CFLAGS-.o) (which includes
      $(pie-default)), but that raises questions of any impact from using
      optimization flags from CFLAGS in these tests.  So for now just use
      $(pie-default) as the key part of $(CFLAGS-.o) that's definitely
      needed.
      
      Tested with build-many-glibcs.py for x86_64-linux-gnu-static-pie.
      885762aa
    • Joseph Myers's avatar
      Run conform/ tests using newly built libc · f3eef963
      Joseph Myers authored
      Although the conform/ header tests are built using the headers of the
      glibc under test, the execution tests from conformtest (a few tests of
      the values of macros evaluating to string constants) are linked and
      run with system libc, not the newly built libc.
      
      Apart from preventing testing in cross environments, this can be a
      problem even for native testing.  Specifically, it can be useful to do
      native testing when building with a cross compiler that links with a
      libc that is not the system libc; for example, on x86_64, you can test
      all three ABIs that way if the kernel support is present, even if the
      host OS lacks 32-bit or x32 libraries or they are older than the
      libraries in the sysroot used by the compiler used to build glibc.
      This works for almost all tests, but not for these conformtest tests.
      
      Arrange for conformtest to link and run test programs similarly to
      other tests, with consequent refactoring of various variables in
      Makeconfig to allow passing relevant ...
      f3eef963
  11. 16 Sep, 2021 3 commits
    • Aurelien Jarno's avatar
      posix: Fix attribute access mode on getcwd [BZ #27476] · 63a788f4
      Aurelien Jarno authored
      There is a GNU extension that allows to call getcwd(NULL, >0). It is
      described in the documentation, but also directly in the unistd.h
      header, just above the declaration.
      
      Therefore the attribute access mode added in commit 06febd8c
      is not correct. Drop it.
      63a788f4
    • Joseph Myers's avatar
      Fix build-many-glibcs.py --strip for installed library renaming · 876e5154
      Joseph Myers authored
      The renaming of installed shared libraries to use the SONAME directly
      rather than linking to a versioned name stopped build-many-glibcs.py
      --strip (used to facilitate comparing binaries before and after
      changes that aren't meant to change any generated code in installed
      glibc shared libraries) from stripping most of the installed shared
      libraries, because it stripped only the *.so names.  Fix it to strip
      *.so* names instead and to detect the case of linker scripts using
      grep instead of hardcoding particular files that are linker scripts.
      
      Tested with build-many-glibcs.py --strip.
      876e5154
    • Naohiro Tamura's avatar
      benchtests: Fix validate_benchout.py exceptions · cb5088cf
      Naohiro Tamura authored and Siddhesh Poyarekar's avatar Siddhesh Poyarekar committed
      
      
      This patch fixed validate_benchout.py two exceptions,
      1) AttributeError
         if benchout_strings.schema.json is specified, and
      2) json.decoder.JSONDecodeError
         if benchout file is not JSON.
      
      $ ~/glibc/benchtests/scripts/validate_benchout.py bench-memset.out \
      ~/glibc/benchtests/scripts/benchout_strings.schema.json
      Traceback (most recent call last):
        File "/home/naohirot/glibc/benchtests/scripts/validate_benchout.py", line 86, in <module>
          sys.exit(main(sys.argv[1:]))
        File "/home/naohirot/glibc/benchtests/scripts/validate_benchout.py", line 69, in main
          bench.parse_bench(args[0], args[1])
        File "/home/naohirot/glibc/benchtests/scripts/import_bench.py", line 139, in parse_bench
          do_for_all_timings(bench, lambda b, f, v:
        File "/home/naohirot/glibc/benchtests/scripts/import_bench.py", line 107, in do_for_all_timings
          if 'timings' not in bench['functions'][func][k].keys():
      AttributeError: 'str' object has no attribute 'keys'
      
      $ ~/glibc/benchtests/scripts/validate_benchout.py bench-math-inlines.out \
      ~/glibc/benchtests/scripts/benchout_strings.schema.json
      Traceback (most recent call last):
        File "/home/naohirot/glibc/benchtests/scripts/validate_benchout.py", line 86, in <module>
          sys.exit(main(sys.argv[1:]))
        File "/home/naohirot/glibc/benchtests/scripts/validate_benchout.py", line 69, in main
          bench.parse_bench(args[0], args[1])
        File "/home/naohirot/glibc/benchtests/scripts/import_bench.py", line 137, in parse_bench
          bench = json.load(benchfile)
        File "/usr/lib/python3.6/json/__init__.py", line 299, in load
          parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
        File "/usr/lib/python3.6/json/__init__.py", line 354, in loads
          return _default_decoder.decode(s)
        File "/usr/lib/python3.6/json/decoder.py", line 342, in decode
          raise JSONDecodeError("Extra data", s, end)
      json.decoder.JSONDecodeError: Extra data: line 1 column 17 (char 16)
      Reviewed-by: Siddhesh Poyarekar's avatarSiddhesh Poyarekar <siddhesh@sourceware.org>
      cb5088cf
  12. 15 Sep, 2021 2 commits