Compare commits

...

107 Commits
f29 ... master

Author SHA1 Message Date
DJ Delorie 61f15e90bc Auto-sync with upstream branch master
Upstream commit: 1a6566094d3097f4a3037ab5555cddc6cb11c3a3

- alpha: force old OSF1 syscalls for getegid, geteuid and getppid [BZ #24986]
- Fix http: URL in 'configure'
- Regenerate charmap-kw.h, locfile-kw.h
- Fix three GNU license URLs, along with trailing-newline issues.
- Prefer https to http for gnu.org and fsf.org URLs
2019-09-16 14:47:26 -04:00
Patsy Franklin 6129ad64d4 Auto-sync with upstream branch master
Upstream commit: 1b7f04070bd94f259e2ed24d6fb76309d64fb164.

- locale: Avoid zero-length array in _nl_category_names [BZ #24962]
- math: Replace const attribute with pure in totalorder* functions
- y2038: Introduce the __ASSUME_TIME64_SYSCALLS define
- Finish move of clock_* functions to libc. [BZ #24959]
- Update Alpha libm-test-ulps
- localedef: Use initializer for flexible array member [BZ #24950]
- Add misc/tst-mntent-autofs, testing autofs "ignore" filtering
- Use autofs "ignore" mount hint in getmntent_r/getmntent
- hurd: Fix build
- Use generic memset/memcpy/memmove in benchtests
- nptl: Move pthread_attr_getinheritsched implementation into libc
- hurd: Fix SS_ONSTACK support
- hurd: Remove optimizing anonymous maps as __vm_allocate.
- hurd: Fix poll and select POSIX compliancy details about errors
- hurd: Fix timeout handling in _hurd_select
- hurd getcwd: Allow unknown root directory
- hurd: Fix implementation of setitimer.
- hurd: Fix _hurd_select for single fd sets
- MIPS support for GNU hash
- sh: Split BE/LE abilist
- microblaze: Split BE/LE abilist
- arm: Split BE/LE abilist
- Correct the spelling of more contributors
- Fix posix/tst-regex by using UTF-8 and own test input
- [powerpc] fegetenv_status: simplify instruction generation
- [powerpc] fesetenv: optimize FPSCR access
- [powerpc] SET_RESTORE_ROUND improvements
- [powerpc] fe{en,dis}ableexcept, fesetmode: optimize FPSCR accesses
- [powerpc] fe{en,dis}ableexcept optimize bit translations
- misc: Use allocate_once in getmntent
- nptl: Move pthread_attr_setdetachstate implementation into libc
- login: pututxline could fail to overwrite existing entries [BZ #24902]
- Fix posix/tst-regex by using a dedicated input-file.
2019-09-06 07:38:07 -04:00
DJ Delorie 1fa217076e Move makedb from glibc-common to nss_db (#1704334)
The makedb program is only used to make databases for the nss_db
module, so it makes sense to only install them together.
2019-08-27 15:07:36 -04:00
DJ Delorie 5846004b81 Auto-sync with upstream branch master
Upstream commit: 1bced8cadc82077f0201801239e89eb24b68e9aa

- Don't put non-ASCII into installed headers
- Fix spellings of contributor names in comments and doc
- [MIPS] Raise highest supported EI_ABIVERSION value [SWBZ #24916]
- mips: Force RWX stack for hard-float builds that can run on pre-4.8 kernels
- linux: Make profil_counter a compat_symbol (SWBZ#17726)
- Refactor sigcontextinfo.h
- Add RTLD_SINGLE_THREAD_P on generic single-thread.h
- Chinese locales: Set first_weekday to 2 (swbug 24682).
- powerpc: Fix typos and field name in comments
- Mark IDN tests unsupported with libidn2 before 2.0.5.
- Document strftime %Ob and %OB as C2X features.
- Remove dead regex code
- Fix bad pointer / leak in regex code
- Don't use the argument to time.
- Add tgmath.h macros for narrowing functions.
- Update i386 libm-test-ulps
2019-08-26 14:24:15 -04:00
Carlos O'Donell 7e6e06c36d Auto-sync with upstream branch master
Upstream commit: d34d4c80226b3f5a1b51a8e5b005a52fba07d7ba

- Merge upstream nsswitch.conf and nscd.conf updates.
- Do not print backtraces on fatal glibc errors.
- elf: Self-dlopen failure with explict loader invocation (swbz#24900)
- login: Add nonstring attributes to struct utmp, struct utmpx (swbz#24899)
- login: Use struct flock64 in utmp (swbz#24880)
- login: Disarm timer after utmp lock acquisition (swbz#24879)
2019-08-20 17:03:01 -04:00
Carlos O'Donell 72195d4485 locale: Fix C.UTF-8 ranges.
The ellipsis range support only allows <Uxxxx> or <Uxxxxxxxx> as
valid unicode code points, otherwise it treats it as a symbol and
since we don't define the symbol the entire range is unused.
2019-08-16 10:07:58 -04:00
Florian Weimer 77335ae30e Source upload 2019-08-15 10:41:39 +02:00
Florian Weimer 76ac51ab78 Auto-sync with upstream branch master
Upstream commit: 341da5b4b6253de9a7581a066f33f89cacb44dec
2019-08-15 10:37:59 +02:00
Florian Weimer 293db26d85 Fix changelog version 2019-08-02 14:24:18 +02:00
Florian Weimer 525a40ce11 Lower the release number to 1 2019-08-02 14:23:17 +02:00
Florian Weimer 1ff5b17afe Auto-sync with upstream branch release/2.30/master
Upstream commit: be9a328c93834648e0bec106a1f86357d1a8c7e1

- malloc: Remove unwanted leading whitespace in malloc_info (swbz#24867)
- glibc 2.30 release
- iconv: Revert steps array reference counting changes (#1734680)
- Restore r31 setting in powerpc32 swapcontext
2019-08-02 14:16:34 +02:00
Florian Weimer a4d24cbe45 Fix memory leak in iconv_open (#1734680) 2019-07-31 11:53:38 +02:00
Florian Weimer b3c6eb0e4c Auto-sync with upstream branch master
Upstream commit: 8a814e20d443adc460a1030fa1a66aa9ae817483

- Drop glibc-rh1732406.patch, fix for the regression applied upstream.
- nptl: Use uintptr_t for address diagnostic in nptl/tst-pthread-getattr
- Linux: Move getdents64 to <dirent.h>
- test-container: Install with $(sorted-subdirs) (swbz#24794)
- gconv: Check reference count in __gconv_release_cache (#1732406)
- x86-64: Compile branred.c with -mprefer-vector-width=128 (swbz#24603)
- build-many-glibcs.py: Use Linux 5.2 by default
- Linux: Use in-tree copy of SO_ constants for !__USE_MISC (swbz#24532)
- test-container: Avoid copying unintended system libraries
2019-07-30 11:05:22 +02:00
Fedora Release Engineering 6144405435 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2019-07-25 03:41:31 +00:00
Florian Weimer c96359dd1c Revert libio change that causes crashes (#1732406) 2019-07-23 12:14:15 +02:00
DJ Delorie 8797f87802 Auto-sync with upstream branch master
Upstream commit: dcf36bcad3f283f77893d3b157ef7bb2c99419f2

- Add NEWS entry about the new AArch64 IFUNC resolver call ABI
- locale/C-translit.h.in: Cyrillic -> ASCII transliteration [BZ #2872]
- Linux: Update syscall-names.list to Linux 5.2
2019-07-22 14:06:01 -04:00
DJ Delorie 5f0fe918a5 Auto-sync with upstream branch master
Upstream commit: 3556658c5b8765480711b265abc901c67d5fc060

- Regenerate po/libc.pot for 2.30 release.
- nptl: Add POSIX-proposed _clock functions to hppa pthread.h
- nptl: Remove unnecessary forwarding of pthread_cond_clockwait from libc
- Afar locales: Months and days updated from CLDR (bug 21897).
- nl_BE locale: Use "copy "nl_NL"" in LC_NAME (bug 23996).
- nl_BE and nl_NL locales: Dutch salutations (bug 23996).
- ga_IE and en_IE locales: Revert first_weekday removal (bug 24200).
- nptl: Remove futex_supports_exact_relative_timeouts
- Update NEWS for new _clockwait and _clocklock functions
- nptl: Add POSIX-proposed pthread_mutex_clocklock
- nptl: Rename lll_timedlock to lll_clocklock and add clockid parameter
- nptl: Add POSIX-proposed pthread_rwlock_clockrdlock & pthread_rwlock_clockwrlock
- nptl: pthread_rwlock: Move timeout validation into _full functions
- nptl: Add POSIX-proposed pthread_cond_clockwait
- nptl: Add POSIX-proposed sem_clockwait
- nptl: Add clockid parameter to futex timed wait calls
- posix: Fix large mmap64 offset for mips64n32 (BZ#24699)
- nss_db: fix endent wrt NULL mappings [BZ #24695] [BZ #24696]
2019-07-18 15:15:24 -04:00
Carlos O'Donell c098079671 Auto-sync with upstream branch master
Upstream commit: 30ba0375464f34e4bf8129f3d3dc14d0c09add17

- Don't declare __malloc_check_init in <malloc.h> (bug 23352)
- nftw: fill in stat buf for dangling links [BZ #23501]
- dl-vdso: Add LINUX_4 HASH CODE to support nds32 vdso mechanism
- riscv: restore ABI compatibility (bug 24484)
- aarch64: new ifunc resolver ABI
- nptl: Remove vfork IFUNC-based forwarder from libpthread [BZ #20188]
- malloc: Add nptl, htl dependency for the subdirectory [BZ #24757]
- Call _dl_open_check after relocation [BZ #24259]
- Linux: Use mmap instead of malloc in dirent/tst-getdents64
- ld.so: Support moving versioned symbols between sonames [BZ #24741]
- io: Remove copy_file_range emulation [BZ #24744]
- Linux: Adjust gedents64 buffer size to int range [BZ #24740]
- powerpc: Use generic e_expf
- Linux: Add nds32 specific syscalls to syscall-names.list
- szl_PL locale: Fix a typo in the previous commit (bug 24652).
2019-07-10 12:49:03 -04:00
DJ Delorie 4a003b4922 Auto-sync with upstream branch master
Upstream commit: 2bd81b60d6ffdf7e0d22006d69f4b812b1c80513.

- szl_PL locale: Spelling corrections (swbz 24652).
- nl_{AW,NL}: Correct the thousands separator and grouping (swbz 23831).
- Add missing VDSO_{NAME,HASH}_* macros and use them for PREPARE_VERSION_KNOWN
- nptl: Convert various tests to use libsupport
- support: Invent verbose_printf macro
- support: Add xclock_now helper function.
2019-06-24 15:59:37 -04:00
Carlos O'Donell ca11f82b69 Revert glibc-fedora-memalign.patch addition.
The patch has been removed and will be added back once F31 branches.
No official build happened so we can just remove the NEVRA usage.
2019-06-24 10:59:03 -04:00
Carlos O'Donell b21f47f287 Reduce external fragmentation in memalign (swbz#14581). 2019-06-21 08:13:12 -04:00
Florian Weimer d53844dd72 Auto-sync with upstream branch master
Upstream commit: 21cc130b78a4db9113fb6695e2b951e697662440

- During exit, skip wide buffer handling for legacy stdio handles (#1722216)
- powerpc: add 'volatile' to asm
- powerpc: Fix static-linked version of __ppc_get_timebase_freq (swbz#24640)
- nl_AW locale: Correct the negative monetary format (swb#z24614)
- Fix gcc 9 build errors for make xcheck. (swbz#24556)
- dlfcn: Avoid one-element flexible array in Dl_serinfo (swbz#24166)
- elf: Refuse to dlopen PIE objects (swbz#24323)
- nl_NL locale: Correct the negative monetary format (swbz#24614)
- powerpc: Refactor powerpc64 lround/lroundf/llround/llroundf
- powerpc: refactor powerpc64 lrint/lrintf/llrint/llrintf
2019-06-21 09:40:58 +02:00
Florian Weimer 134a36d7f8 Remove comments on %endif, required by newer RPM 2019-06-17 15:45:58 +02:00
Florian Weimer a464847a25 Auto-sync with upstream branch master
Upstream commit: 48c3c1238925410b4e777dc94e2fde4cc9132d44

- Linux: Fix __glibc_has_include use for <sys/stat.h> and statx (#1721129)
- <sys/cdefs.h>: Inhibit macro expansion for __glibc_has_include
- Add IPV6_ROUTER_ALERT_ISOLATE from Linux 5.1 to bits/in.h
- aarch64: handle STO_AARCH64_VARIANT_PCS
- aarch64: add STO_AARCH64_VARIANT_PCS and DT_AARCH64_VARIANT_PCS
- powerpc: Remove optimized finite
- math: Use wordsize-64 version for finite
- powerpc: Remove optimized isinf
- math: Use wordsize-64 version for isinf
- powerpc: Remove optimized isnan
- math: Use wordsize-64 version for isnan
- benchtests: Add isnan/isinf/isfinite benchmark
- powerpc: copysign cleanup
- powerpc: consolidate rint
- libio: freopen of default streams crashes in old programs (swbz#24632)
- Linux: Deprecate <sys/sysctl.h> and sysctl
- <sys/stat.h>: Use Linux UAPI header for statx if available and useful
  (#1721129)
- <sys/cdefs.h>: Add __glibc_has_include macro
- Improve performance of memmem
- Improve performance of strstr
- Benchmark strstr hard needles
- Fix malloc tests build with GCC 10
2019-06-17 14:36:16 +02:00
Patsy Franklin 9c5a4265d8 Auto-sync with upstream branch master
Upstream commit: 51ea67d54882318c4fa5394c386f4816ddc22408

- powerpc: get_rounding_mode: utilize faster method to get rounding mode
- riscv: Do not use __has_include__
- powerpc: fegetexcept: utilize function instead of duplicating code
- iconv: Use __twalk_r in __gconv_release_shlib
- Fix iconv buffer handling with IGNORE error handler (swbz#18830)
2019-06-10 13:01:36 -04:00
Florian Weimer bd8d2430b4 Restore /usr/lib/locale/locale-archive under its original name (#1716710) 2019-06-05 12:20:08 +02:00
Florian Weimer 819bb4065c Add glibc version to locale-archive name (#1716710) 2019-06-04 16:02:20 +02:00
Carlos O'Donell 3aed6a961c Auto-sync with upstream branch master
Upstream commit: dc91a19e6f71e1523f4ac179191a29b2131d74bb

- Linux: Add oddly-named arm syscalls to syscall-names.list.
- arm: Remove ioperm/iopl/inb/inw/inl/outb/outw/outl support.
- Add INADDR_ALLSNOOPERS_GROUP from Linux 5.1 to netinet/in.h.
2019-06-03 16:07:16 -04:00
Carlos O'Donell 34927af202 Convert glibc_post_upgrade to lua. 2019-06-01 20:23:38 -04:00
Florian Weimer fcb4083893 Auto-sync with upstream branch master
Upstream commit: 9250e6610fdb0f3a6f238d2813e319a41fb7a810

- powerpc: Fix build failures with current GCC
- Remove unused get_clockfreq files
- powerpc: generic nearbyint/nearbyintf
- tt_RU: Add lang_name (swbz#24370)
- tt_RU: Fix orthographic mistakes in mon and abmon sections (swbz#24369)
- Add IGMP_MRDISC_ADV from Linux 5.1 to netinet/igmp.h.
2019-06-01 13:41:32 +02:00
Florian Weimer 50bcae98df Remove support for filtering glibc-all-langpacks (#1715891)
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2019-06-01 13:13:40 +02:00
Arjun Shankar 74725dd94e Auto-sync with upstream branch master
Upstream commit: 85188d8211698d1a255f0aec6529546db5c56de3

- Remove support for PowerPC SPE extension
- elf: Add tst-ldconfig-bad-aux-cache test
- Add F_SEAL_FUTURE_WRITE from Linux 5.1 to bits/fcntl-linux.h
- nss_dns: Check for proper A/AAAA address alignment
2019-05-27 14:46:58 +02:00
DJ Delorie 9701fdade7 Auto-sync with upstream branch master,
Upstream commit 46ae07324b1cd50fbf8f37a076d6babcfca7c510

- Improve string benchtest timing
- sysvipc: Add missing bit of semtimedop s390 consolidation
- wcsmbs: Fix data race in __wcsmbs_clone_conv [swbz #24584]
- libio: Fix gconv-related memory leak [swbz #24583]
- libio: Remove codecvt vtable [swbz #24588]
- support: Expose sbindir as support_sbindir_prefix
- support: Add missing EOL terminators on timespec
- support: Correct confusing comment
- sysvipc: Consolidate semtimedop s390
- sysvipc: Fix compat msgctl (swbz#24570)
- Add NT_ARM_PACA_KEYS and NT_ARM_PACG_KEYS from Linux 5.1 to elf.h.
- Small tcache improvements
- manual: Document O_DIRECTORY
- Update kernel-features.h files for Linux 5.1.
- nss_nis, nss_nisplus: Remove RES_USE_INET6 handling
- nss_files: Remove RES_USE_INET6 from hosts processing
- support: Report NULL blobs explicitly in TEST_COMPARE
- dlfcn: Guard __dlerror_main_freeres with __libc_once_get (once) [swbz# 24476]
- Add missing Changelog entry
2019-05-21 14:21:21 -04:00
Florian Weimer 6666c40188 Auto-sync with upstream branch master
Upstream commit: 32ff397533715988c19cbf3675dcbd727ec13e18

- Fix crash in _IO_wfile_sync (#1710460)
- nss: Turn __nss_database_lookup into a compatibility symbol
- support: Add support_install_rootsbindir
- iconv: Remove public declaration of __gconv_transliterate
- Linux: Add the tgkill function
- manual: Adjust twalk_r documentation.
- elf: Fix tst-pldd for non-default --prefix and/or --bindir (swbz#24544)
- support: Export bindir path on support_path
- configure: Make --bindir effective
- x86: Remove arch-specific low level lock implementation
- nptl: Assume LLL_LOCK_INITIALIZER is 0
- nptl: Small optimization for lowlevellock
- Add single-thread.h header
- locale: Update to Unicode 12.1.0 (swbz#24535)
- malloc: Fix tcache count maximum (swbz#24531)
- sem_close: Use __twalk_r
- support: Fix timespec printf
- nptl/tst-abstime: Use libsupport
- nptl: Convert some rwlock tests to use libsupport
- nptl: Use recent additions to libsupport in tst-sem5
- nptl: Convert tst-cond11.c to use libsupport
- support: Add timespec.h
- Move nptl/tst-eintr1 to xtests (swbz#24537)
- powerpc: trunc/truncf refactor
- powerpc: round/roundf refactor
- powerpc: floor/floorf refactor
- support: Add xclock_gettime
- malloc/tst-mallocfork2: Use process-shared barriers
- Update syscall-names.list for Linux 5.1
- Use GCC 9 in build-many-glibcs.py
- aarch64: thunderx2 memmove performance improvements
- misc/tst-tsearch: Additional explicit error checking
- elf: Fix elf/tst-pldd with --enable-hardcoded-path-in-tests (swbz#24506)
- misc: Add twalk_r function
2019-05-15 17:55:39 +02:00
Arjun Shankar 4124e42f39 Auto-sync with upstream branch master
Upstream commit: 20aa5819586ac7ad11f711bab64feda307965191

- semaphore.h: Add nonnull attributes
- powerpc: Remove power4 mpa optimization
- powerpc: Refactor ceil/ceilf
- Fix -O1 compilation errors with `__ddivl' and `__fdivl' [BZ #19444]
- Make mktime etc. compatible with __time64_t
2019-05-02 13:03:35 +02:00
Florian Weimer d9394d9d7e Auto-sync with upstream branch master
Upstream commit: c57afec0a9b318bb691e0f5fa4e9681cf30df7a4

- Increase BIND_NOW coverage (#1702671)
- Fix pldd hang (#1361689)
- riscv: remove DL_RO_DYN_SECTION (swbz#24484)
- locale: Add LOCPATH diagnostics to the locale program
- benchtests: Enable BIND_NOW if configured with --enable-bind-now
2019-04-26 13:51:28 +02:00
DJ Delorie 47192f413e Auto-sync with upstream branch master
Upstream commit: 25f7a3c96116a9102df8bf7b04ef160faa32416d

- malloc: make malloc fail with requests larger than PTRDIFF_MAX (BZ#23741)
- powerpc: Fix format issue from 3a16dd780eeba602
- powerpc: fma using builtins
- powerpc: Use generic fabs{f} implementations
- mips: Remove rt_sigreturn usage on context function
- powerpc: Remove rt_sigreturn usage on context function
- support: Add support_capture_subprogram
- stdlib/tst-secure-getenv: handle >64 groups
2019-04-22 15:33:30 -04:00
Florian Weimer 448365c7f7 Auto-sync with upstream branch master
Upstream commit: e3f454bac0f968216699ca405c127c858f0657c7

- nss_dns: Do not replace root domain with empty string
- alloc_buffer: Return unqualified pointer type in alloc_buffer_next
- malloc: Set and reset all hooks for tracing (swbz#16573)
2019-04-15 15:05:30 +02:00
Florian Weimer a54853472d Run valgrind smoke test against the install tree 2019-04-11 21:53:43 +02:00
Florian Weimer dcaaa78467 Do not use --g-libs with find-debuginfo.sh; it breaks valgrind (#1698824) 2019-04-11 12:18:48 +02:00
Florian Weimer 7b77f1b10f Strip debugging information from installed programs again (#1661510) 2019-04-10 10:26:43 +02:00
Carlos O'Donell b797613532 Auto-sync with upstream branch master
Upstream commit: 648279f4af423c4783ec1dfa63cb7b46a7640217

- Drop glibc-warning-fix.patch. Microbenchmark code fixed upstream.

- powerpc: Use generic wcscpy optimization
- powerpc: Use generic wcschr optimization
- powerpc: Use generic wcsrchr optimization
- aarch64: thunderx2 memcpy implementation cleanup and streamlining
- resolv: Remove support for RES_USE_INET6 and the inet6 option
- resolv: Remove RES_INSECURE1, RES_INSECURE2
2019-04-09 11:11:06 -04:00
Arjun Shankar e4dacdad3d Auto-sync with upstream branch master
Upstream commit: 8260f23616c1a2a4e609f989a195fba7690a42ca

- Fix strptime era handling, add more strftime tests [BZ #24394]
- time/tst-strftime2.c: Make the file easier to maintain
- time: Add tests for Minguo calendar [BZ #24293]
- ja_JP locale: Add entry for the new Japanese era [BZ #22964]
- Add Reiwa era tests to time/tst-strftime3.c
2019-04-04 03:07:08 +02:00
Arjun Shankar 539fe8abbd Update sources file 2019-04-01 18:33:52 +02:00
Arjun Shankar 7b2061df55 Auto-sync with upstream branch master
Upstream commit: 993e3107af67edefcfc79a62ae55f7b98aa5151e

- Add AArch64 HWCAPs from Linux 5.0
- tt_RU: Fix orthographic mistakes in day and abday sections [BZ #24296]
- iconv, localedef: avoid floating point rounding differences [BZ #24372]
- Fix parentheses error in iconvconfig.c and ld-collate.c [BZ #24372]
- S390: New configure check and hwcap values for new CPU architecture arch13
- S390: Add memmove, strstr, and memmem ifunc variants for arch13
- nptl: Remove pthread_clock_gettime pthread_clock_settime
- linux: Assume clock_getres CLOCK_{PROCESS,THREAD}_CPUTIME_ID
- Remove __get_clockfreq
- Do not use HP_TIMING_NOW for random bits
- hp-timing: Refactor rtld usage, add generic support
- Add NT_ARM_PAC_MASK and NT_MIPS_MSA from Linux 5.0 to elf.h
- Add UDP_GRO from Linux 5.0 to netinet/udp.h
- nptl: Convert tst-sem5 & tst-sem13 to use libsupport
- nptl/tst-rwlock14: Test pthread_rwlock_timedwrlock correctly
- nss/tst-nss-files-alias-leak: add missing opening quote in printf
- math: Enable some math builtins for clang
- powerpc: Use __builtin_{mffs,mtfsf}
- RISC-V: Fix `test' operand error with soft-float ABI being configured
2019-04-01 16:45:15 +02:00
Carlos O'Donell bfa3999fdd Fix %changelog date. 2019-03-20 22:41:20 -04:00
Carlos O'Donell 82a97343d6 Add warnings and notes to /etc/nsswitch.conf and /etc/nscd.conf. 2019-03-20 22:36:49 -04:00
DJ Delorie a84cd6b530 Auto-sync with upstream branch master
Upstream commit: 78919d3886c9543279ec755a701e279c62b44164

78919d3886 time/mktime.c: Update obsolete URL in comment.
b626c5aa5d Record CVE-2019-9169 in NEWS and ChangeLog [BZ #24114]
066ae81ec9 hurd: Fix comment style
e87d8ada29 hurd: Document how EINTR should be handled in critical sections
477e739b32 Update syscall-names.list for Linux 5.0.
238d60a1fb localedata: Add Minguo calendar support to Taiwanese locales [BZ #24293]
5b06f538c5 malloc: Check for large bin list corruption when inserting unsorted chunk
a0a0dc8317 Remove obsolete, never-implemented XSI STREAMS declarations
2019-03-18 13:23:22 -04:00
Florian Weimer fdf2115d36 Auto-sync with upstream branch master
Upstream commit: a0a0dc83173ce11ff45105fd32e5d14356cdfb9c

- Drop glibc-fedora-streams-rh436349.patch.  STREAMS was removed upstream.

- Remove obsolete, never-implemented XSI STREAMS declarations
- nss: Fix tst-nss-files-alias-truncated for default --as-needed linking
- scripts/check-obsolete-constructs.py: Process all headers as UTF-8.
- Use Linux 5.0 in build-many-glibcs.py.
- hurd: Add no-op version of __res_enable_icmp [BZ #24047]
- Move inttypes.h and stdint.h to stdlib.
- Use a proper C tokenizer to implement the obsolete typedefs test.
- Fix output of LD_SHOW_AUXV=1.
2019-03-14 16:18:47 +01:00
Florian Weimer 4d79a1a6dd Update sources 2019-03-13 17:44:44 +01:00
Florian Weimer 70ec0cd8b9 Auto-sync with upstream branch master
Upstream commit: 38b52865d4ccfee3647f27e969e539a4396a73b1

- Drop glibc-rh1670028.patch, applied upstream

- elf: Add DF_1_KMOD, DF_1_WEAKFILTER, DF_1_NOCOMMON to <elf.h>
- resolv: Enable full ICMP errors for UDP DNS sockets [BZ #24047]
- C-SKY: add elf header definition for elfutils
- C-SKY: mark lr as undefined to stop unwinding
- C-SKY: remove user_regs definition
- C-SKY: fix sigcontext miss match
- Bug 24307: Update to Unicode 12.0.0
- Break lines before not after operators, batch 4.
- check-wrapper-headers test: Adjust Fortran include file directory
- Fix location where math-vector-fortran.h is installed.
2019-03-13 13:33:01 +01:00
Jeroen van Meeuwen (Kolab Systems) 97506ad65a It's there now... 2019-03-08 13:24:23 +01:00
Jeroen van Meeuwen (Kolab Systems) 5b4007bb56 Fix bootstrapping glibc
Bootstrapping glibc will disable benchtests, but the if/endif clauses
excluded essentials from the bootstrapped build. Also, mtrace isn't built
when bootstrapping.
2019-03-08 13:24:23 +01:00
DJ Delorie 9f81c9aa6e Auto-sync with upstream branch master
Upstream commit: 0ddb7ea842abf63516b74d4b057c052afc6ba863.

- nptl: Assume __ASSUME_FUTEX_CLOCK_REALTIME support
- powerpc: Fix build of wcscpy with --disable-multi-arch
- elf: Remove remnants of MAP_ANON emulation
- S390: Increase function alignment to 16 bytes.
- ja_JP: Change the offset for Taisho gan-nen from 2 to 1 [BZ #24162]
- ldbl-opt: Reuse test cases from misc/ that check long double
- ldbl-opt: Add error and error_at_line (bug 23984)
- ldbl-opt: Add err, errx, verr, verrx, warn, warnx, vwarn, and vwarnx (bug 23984)
- ldbl-opt: Reuse argp tests that print long double
- ldbl-opt: Add argp_error and argp_failure (bug 23983)
- elf/tst-big-note: Improve accuracy of test [BZ #20419]
- S390: Fix introduction of __wcscpy and weak wcscpy symbols.
- __netlink_assert_response: Add more __libc_fatal newlines [BZ #20271]
- Add more spaces before '('.
- elf: Add tests with a local IFUNC resolver [BZ #23937]
- elf/Makefile: Run IFUNC tests if binutils supports IFUNC
- powerpc: Fix linknamespace introduced by 4d8015639a75
- hurd: Add renameat2 support for RENAME_NOREPLACE
- Fix -Wempty-body warnings in Hurd-specific code.
- Add some spaces before '('.
- wcsmbs: optimize wcsnlen
- wcsmbs: optimize wcsncpy
- wcsmbs: optimize wcsncat
- wcsmbs: optimize wcscpy
- wcsmbs: optimize wcscat
- wcsmbs: optimize wcpncpy
- wcsmbs: optimize wcpcpy
- Break further lines before not after operators.
- Add and move fall-through comments in system-specific code.
2019-03-06 15:56:00 -05:00
DJ Delorie 2300402532 Add .gdb_index to debug information
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1680765
by adding -i to find-debuginfo.sh flags.
2019-03-01 14:45:22 -05:00
Carlos O'Donell 8a209c638d Work around compiler warning in microbenchmarks.
Raised upstream:
https://www.sourceware.org/ml/libc-alpha/2019-02/msg00656.html
2019-02-28 02:09:46 -05:00
Carlos O'Donell 047399b0d0 Auto-sync with upstream branch master,
Upstream commit: e0cb7b6131ee5f2dca2938069b8b9590304e6f6b

- nss_files: Fix /etc/aliases null pointer dereference (swbz#24059)
- regex: fix read overrun (swbz#24114)
- libio: use stdout in puts and putchar, etc (swbz#24051)
- aarch64: Add AmpereComputing emag to tunable cpu list
- aarch64: Optimized memset specific to AmpereComputing emag
- aarch64: Optimized memchr specific to AmpereComputing emag
- Require GCC 6.2 or later to build glibc
- manual: Document lack of conformance of sched_* functions (swbz#14829)
- libio: Use stdin consistently for input functions (swbz#24153)
- x86-64 memcmp: Use unsigned Jcc instructions on size (swbz#24155)
- Fix handling of collating elements in fnmatch (swbz#17396,swbz#16976)
- arm: Use "nr" constraint for Systemtap probes (swbz#24164)
- Fix alignment of TLS variables for tls variant TLS_TCB_AT_TP (swbz#23403)
- Add compiler barriers for pthread_mutex_trylock (swbz#24180)
- rt: Turn forwards from librt to libc into compat symbols (swbz#24194)
- Linux: Add gettid system call wrapper (swbz#6399)
- nptl: Avoid fork handler lock for async-signal-safe fork (swbz#24161)
- elf: Ignore LD_AUDIT interfaces if la_version returns 0 (swbz#24122)
- nptl: Reinstate pthread_timedjoin_np as a cancellation point (swbz#24215)
- nptl: Fix invalid Systemtap probe in pthread_join (swbz#24211)
2019-02-26 09:31:34 -05:00
Florian Weimer 1c5b89063f Auto-sync with upstream branch release/2.29/master
Upstream commit: 067fc32968b601493f4b247a3ac00caeea3f3d61

- Drop glibc-rh1674280.patch.  Different fix applied upstream.  (#1674280)
- nptl: Fix invalid Systemtap probe in pthread_join (#1674280)
2019-02-19 08:33:22 +01:00
Florian Weimer b82e3b3f85 Hotfix for invalid Systemtap probe in pthread_join (#1674280) 2019-02-11 21:42:14 +01:00
Florian Weimer 8e6306e004 Remove LRA bug on POWER workaround, fixed in gcc-9.0.1-0.4.fc30 (#1673018) 2019-02-11 09:53:45 +01:00
Florian Weimer 5fff012634 Auto-sync with upstream branch release/2.29/master
Upstream commit: c096b008d2671028c21ac8cf01f18a2083e73c44

- nptl: Avoid fork handler lock for async-signal-safe fork (swbz#24161)
- nptl: Add compiler barriers in pthread_mutex_trylock (swbz#24180)
2019-02-11 09:51:14 +01:00
Florian Weimer 123aebc7d4 Work around LRA hang on ppc64le (#1673018) 2019-02-07 10:49:48 +01:00
Florian Weimer 109c797f85 Auto-sync with upstream branch release/2.29/master
Upstream commit: 2de15ac95713a238dc258eb8977ecdfca811fc19

- arm: Use "nr" constraint for Systemtap probes (#1196181)
2019-02-06 09:10:05 +01:00
Florian Weimer 0ba614c06d Eliminate %%glibcrelease macro
As a result, future mass rebuilds will increment the Release: field as
expected.
2019-02-01 13:38:20 +01:00
Carlos O'Donell de5b416635 Auto-sync with upstream branch release/2.29/master
Upstream commit: 86013ef5cea322b8f4b9c22f230c22cce369e947

- nptl: Fix pthread_rwlock_try*lock stalls (swbz#23844)
2019-01-31 22:15:26 -05:00
Fedora Release Engineering b4e36d719d - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2019-01-31 22:40:19 +00:00
DJ Delorie e7b9f886b0 Auto-sync with upstream branch master,
Upstream commit: e1e47c912a8e557508362715f7468091def3ec4f

- Update translations.
2019-01-28 16:12:03 -05:00
Florian Weimer 5d5d75dce2 Fix broken patch 2019-01-28 14:38:03 +01:00
Florian Weimer 88850a88bb resolv: Enable full ICMP error reporting in stub resolver (#1670028) 2019-01-28 14:28:25 +01:00
Florian Weimer 657df54449 Remove obsolete scriptlets (release bump) 2019-01-28 14:09:37 +01:00
Igor Gnatenko 1ebcbd5e46
Remove obsolete scriptlets
References: https://fedoraproject.org/wiki/Changes/RemoveObsoleteScriptlets
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2019-01-27 18:58:44 +01:00
Florian Weimer 70a46f30e1 Auto-sync with upstream branch master
Upstream commit: 83e6b59625f45db1eee93e5684091f740c52a083

- elf: Revert LD_AUDIT fix for modules with invalid version (swbz#24122)
- strftime: Pass the additional flags from %EY to %Ey (swbz#24096)
- strftime: Set the default width of %Ey to 2 (swbz#23758)
2019-01-25 11:55:20 +01:00
Florian Weimer 7c5e863b5b Auto-sync with upstream branch master
Upstream commit: 3367acdb344a1d7fcf8f53748d301d652c8911dd

- elf: Fix LD_AUDIT for modules with invalid version (swbz#24122)
- CVE-2016-10739: getaddrinfo: Fully parse IPv4 address strings (#1331390)
- resolv: Do not send queries for non-host-names in nss_dns (swbz#24112)
- malloc: Revert fastbins to old-style atomics
2019-01-24 13:01:30 +01:00
Florian Weimer 133c946b2f Use assembler to produce annobin notes for nonshared libraries (#1668822) 2019-01-23 17:22:30 +01:00
Carlos O'Donell ec674e19b8 Auto-sync with upstream branch master
Upstream commit: 008b598e2a495024f9777006716cfd8668f3db33

- x86-64: Optimize strcat/strncat, strcpy/strncpy and stpcpy/stpncpy with AVX2
- powerpc: Fix VSCR position in ucontext (swbz#24088)
- AArch64: Add ifunc support for Ares
- soft-fp: Properly check _FP_W_TYPE_SIZE (swbz#24066)
2019-01-16 11:51:15 -05:00
Florian Weimer 4265b0b8f6 Inherit -march=haswell flag from redhat-rpm-config 2019-01-10 12:29:48 +01:00
Arjun Shankar 062fb704db Update sources file 2019-01-07 19:07:19 +01:00
Arjun Shankar 1aba59b258 Auto-sync with upstream branch master
commit 2ef427168818ce04b03cecb7b739f9db0156e3e4

- Require GCC 5 or later to build glibc (swbz#23993)
- Only build libm with -fno-math-errno (swbz#24024)
- sysdeps/ieee754: prevent maybe-uninitialized errors with -O (swbz#19444)
- Multiple locales: Use the correct 12-hour time formats (swbz#10496)
- sq_AL: Use the correct date and time formats (swbz#10496, swbz#23724)
- en_US: define date_fmt (swbz#24046)
- Remove executable bit from localedata/locales/bi_VU (swbz#23995)
- malloc: Always call memcpy in _int_realloc (swbz#24027)
- ARM: fix kernel assisted atomics with GCC 8 (swbz#24034)
- S390: Unify 31/64bit mem{set,cmp,cpy,pcpy}, bzero with ifunc handling
- S390: Refactor ifunc handling for several str* and wc* functions
- posix: Clear close-on-exec for posix_spawn adddup2 (swbz#23640)
- termios: Define TIOCSER_TEMT with __USE_MISC (swbz#17783)
- termios: Consolidate Baud Rate Selection definitions (swbz#23783)
- Y2038: add __{localtime64,gmttime64,ctime64}[_r] functions
- Y2038: make __difftime compatible with 64-bit time
2019-01-07 17:22:11 +01:00
DJ Delorie 650d554f72 Auto-sync with upstream branch master,
commit 6bbfc5c09fc5b5e3d4a0cddbbd4e2e457767dae7.

- Add statx conditionals for wordsize-32 *xstat.c
- regex: fix storage-exhaustion error (swbz#18040)
- regex: fix heap-use-after-free error (swbz#18040)
- manual: Document thread/task IDs for Linux
2018-12-17 14:16:58 -05:00
Carlos O'Donell 60935671c3 Auto-sync with upstream branch master
Upstream commit: ade8b817fead73b302d08c88cd44ea2ea56793d4

- powerpc: missing CFI register information in __mpn_* functions (swbz#23614)
- rdlock stalls indefinitely on an unlocked pthread rwlock (swbz#23861)
2018-12-13 12:14:55 -05:00
Carlos O'Donell 7a4d7ca184 Auto-sync with upstream branch master
Upstream commit: 505b5b292293a5d6bd4046a6bc7f8c2381a33da4

- Fix powf overflow handling in non-nearest rounding mode (swbz#23961)
- test-container: move postclean outside of namespace changes (swbz#23948)
- Enable VDSO for static linking on mips (swbz#19767)
2018-12-11 12:33:20 -05:00
Florian Weimer 1d88b65b1d Auto-sync with upstream branch master
Upstream commit: 7b36d26b22d147ffc347f427f9fd584700578a94

- compat getdents64: Use correct offset for retry (swbz#23972)
- x86: Fix static analysis warning in tst-cet-property-2 (swbz#23490)
- malloc: Add another test for tcache double free check (swbz#23907)
- getcpu: New system call wrapper
- posix_spawn_file_actions_addfchdir_np: New function (swbz#17405)
- Preparations for the IBM long double transition
- Preparations for 64-bit time_t on 32-bit architectures
- Enable VDSO for static linking on arm (swbz#19767)
2018-12-10 16:51:13 +01:00
Florian Weimer b8873c0d8b Auto-sync with upstream branch master
Upstream commit: 7b36d26b22d147ffc347f427f9fd584700578a94

- CVE-2018-19591: if_nametoindex: Fix descriptor for overlong name (#1654000)
- Mutex: Add pthread mutex tunables
- stdlib: assert on NULL function pointer in atexit etc. (swbz#20544)
- Enable VDSO on i386 statically linked programs
- posix: Use posix_spawn on system
- posix: Use posix_spawn on popen (swbz#17490, swbz#22834)
- Fix _dl_profile_fixup data-dependency issue (swbz#23690)
- Enable VDSO for static linking on aarch64
2018-12-03 14:58:02 +01:00
Carlos O'Donell afea822158 Resolves: #1352973
- Move requirement on libgcc from glibc-devel to glibc (#1352973)
2018-11-29 16:40:16 -05:00
Carlos O'Donell 173c24248d Resolves: #1651260
- Add requires on explicit glibc version for glibc-nss-devel (#1651260)
2018-11-27 15:07:47 -05:00
Arjun Shankar 5ce3b68016 Auto-sync with upstream branch master
Upstream commit: ce035c6e909ad20ef2fe13c92eab4e69f6495b61

- Drop glibc-rh1652495.patch.  Applied upstream.
2018-11-27 12:20:28 +01:00
Florian Weimer fdcac6f8f4 Do not use parallel make for building locales (#1652228) 2018-11-26 14:58:44 +01:00
Florian Weimer 2f22666a8b malloc: Revert tcache double-free check (#1652495) 2018-11-22 11:05:13 +01:00
DJ Delorie 16caa0b760 Auto-sync with upstream branch master
Upstream commit: bcdaad21d4635931d1bd3b54a7894276925d081d

- malloc: tcache double free check
- [AArch64] Adjust writeback in non-zero memset
- Update config.guess and config.sub to current versions.
- support: Print timestamps in timeout handler
- Use STRFMON_LDBL_IS_DBL instead of __ldbl_is_dbl.
2018-11-20 14:38:52 -05:00
Florian Weimer 81ee17d92e Auto-sync with upstream branch master
Upstream commit: 346ef23f197a0c8ba807c344bd39101b711050ee
2018-11-16 11:20:25 +01:00
Florian Weimer 36c64b8ffa Auto-sync with upstream branch master
Upstream commit: 43257c335ad6b9e05fb882975e1776ff763164ee

- Disable CET for binaries created by older link editors (#1648297)
2018-11-09 12:00:27 +01:00
Florian Weimer 5ca0400677 Auto-sync with upstream branch master
Upstream commit: 00c86a37d1b63044e3169d1f2ebec23447c73f79
2018-11-07 14:47:43 +01:00
Florian Weimer 4232176d25 Auto-sync with upstream branch master
Upstream commit: 1df872fd74f730bcae3df201a229195445d2e18a

- libanl: Fix crash if first helper thread creation failed (#1646381)
2018-11-07 13:58:23 +01:00
Mike FABIAN c42d98baca Include Esperanto (eo) in glibc-all-langpacks (#1643756) 2018-11-01 11:55:20 +01:00
DJ Delorie 383945e966 Auto-sync with upstream branch master:
Upstream commit: c6982f7efc1c70fe2d6160a87ee44d871ac85ab0
2018-10-29 14:39:25 -04:00
Arjun Shankar a5ad6ecfc9 Auto-sync with upstream branch master:
Upstream commit: fe61f17cfc18f17befca3280e828bb40e8c772b0
2018-10-26 14:29:50 +02:00
Florian Weimer 6287bab02b Auto-sync with upstream branch master:
Upstream commit: a27a4f4721837a5fb36ace833764b06a64c5af1c
2018-10-24 11:46:30 +02:00
Florian Weimer 8e5fc280df Auto-sync with upstream branch master
Upstream commit: 72771e53753647111d31c5c4bf43d8901e6baf7e
2018-10-18 10:22:53 +02:00
Florian Weimer 3b14ffff2a Auto-sync with upstream branch master
Upstream commit: f841c97e515a1673485a2b12b3c280073d737890

- stdlib/tst-setcontext9 test suite failure on ppc64le (#1623519)
2018-09-27 12:52:00 +02:00
Florian Weimer 447d75c71c - Auto-sync with upstream branch master
Upstream commit: db9a8ad4ff3fc58e3773a9a4d0cabe3c1bc9c94c

- gethostid: Missing NULL check for gethostbyname_r result (#1631338)
- stdlib/tst-setcontext9 test suite failure (#1623519)
2018-09-20 13:27:33 +02:00
Florian Weimer a63c0b6456 Add python3-devel build dependency for downstream benefit 2018-09-05 11:35:41 +02:00
Florian Weimer c63972c3a9 Fix version in changelog 2018-09-05 11:35:10 +02:00
Carlos O'Donell 9588eec39f Resolves: #1625507
- Provide compatibility support for linking against libpthread_nonshared.a
  (#1625507)
2018-09-05 03:26:05 -04:00
Florian Weimer 723de53164 Remove workaround for valgrind bug (#1600034) 2018-08-29 13:06:17 +02:00
Florian Weimer fde5e92317 Auto-sync with upstream branch master
Upstream commit: ff6b24501f70da7d6375d6f5929262b9509db39e
2018-08-29 09:01:13 +02:00
Florian Weimer 02e1d4ee3e Auto-sync with upstream branch master
Upstream commit: 99ea93ca31795469d2a1f1570f17a5c39c2eb7e2

- nptl: Fix waiters-after-spinning case in pthread_cond_broadcast (#1622669)
- regex: Fix memory corruption when pattern and input contain NUL (#1622674)
2018-08-27 20:19:22 +02:00
Carlos O'Donell 60efd153e5 Auto-sync with upstream branch master
Upstream commit: aa42b3dbcb0326badf377fec2c7fb2f34fdabecd
2018-08-24 22:29:27 -04:00
16 changed files with 1092 additions and 2153 deletions

View File

@ -1,862 +0,0 @@
#define _GNU_SOURCE
#include <assert.h>
#include <dirent.h>
#include <errno.h>
#include <fcntl.h>
#include <locale.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <getopt.h>
#include <string.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <unistd.h>
#include "../locale/hashval.h"
#define __LC_LAST 13
#include "../locale/locarchive.h"
#include "../crypt/md5.h"
const char *alias_file = DATADIR "/locale/locale.alias";
const char *locar_file = PREFIX "/lib/locale/locale-archive";
const char *tmpl_file = PREFIX "/lib/locale/locale-archive.tmpl";
const char *loc_path = PREFIX "/lib/locale/";
/* Flags set by `--verbose` option. */
int be_quiet = 1;
int verbose = 0;
int max_locarchive_open_retry = 10;
const char *output_prefix;
/* Endianness should have been taken care of by localedef. We don't need to do
additional swapping. We need this variable exported however, since
locarchive.c uses it to determine if it needs to swap endianness of a value
before writing to or reading from the archive. */
bool swap_endianness_p = false;
static const char *locnames[] =
{
#define DEFINE_CATEGORY(category, category_name, items, a) \
[category] = category_name,
#include "../locale/categories.def"
#undef DEFINE_CATEGORY
};
static int
is_prime (unsigned long candidate)
{
/* No even number and none less than 10 will be passed here. */
unsigned long int divn = 3;
unsigned long int sq = divn * divn;
while (sq < candidate && candidate % divn != 0)
{
++divn;
sq += 4 * divn;
++divn;
}
return candidate % divn != 0;
}
unsigned long
next_prime (unsigned long seed)
{
/* Make it definitely odd. */
seed |= 1;
while (!is_prime (seed))
seed += 2;
return seed;
}
void
error (int status, int errnum, const char *message, ...)
{
va_list args;
va_start (args, message);
fflush (stdout);
fprintf (stderr, "%s: ", program_invocation_name);
vfprintf (stderr, message, args);
va_end (args);
if (errnum)
fprintf (stderr, ": %s", strerror (errnum));
putc ('\n', stderr);
fflush (stderr);
if (status)
exit (errnum == EROFS ? 0 : status);
}
void *
xmalloc (size_t size)
{
void *p = malloc (size);
if (p == NULL)
error (EXIT_FAILURE, errno, "could not allocate %zd bytes of memory", size);
return p;
}
static void
open_tmpl_archive (struct locarhandle *ah)
{
struct stat64 st;
int fd;
struct locarhead head;
const char *archivefname = ah->fname == NULL ? tmpl_file : ah->fname;
/* Open the archive. We must have exclusive write access. */
fd = open64 (archivefname, O_RDONLY);
if (fd == -1)
error (EXIT_FAILURE, errno, "cannot open locale archive template file \"%s\"",
archivefname);
if (fstat64 (fd, &st) < 0)
error (EXIT_FAILURE, errno, "cannot stat locale archive template file \"%s\"",
archivefname);
/* Read the header. */
if (TEMP_FAILURE_RETRY (read (fd, &head, sizeof (head))) != sizeof (head))
error (EXIT_FAILURE, errno, "cannot read archive header");
ah->fd = fd;
ah->mmaped = (head.sumhash_offset
+ head.sumhash_size * sizeof (struct sumhashent));
if (ah->mmaped > (unsigned long) st.st_size)
error (EXIT_FAILURE, 0, "locale archive template file truncated");
ah->mmaped = st.st_size;
ah->reserved = st.st_size;
/* Now we know how large the administrative information part is.
Map all of it. */
ah->addr = mmap64 (NULL, ah->mmaped, PROT_READ, MAP_SHARED, fd, 0);
if (ah->addr == MAP_FAILED)
error (EXIT_FAILURE, errno, "cannot map archive header");
}
/* Open the locale archive. */
extern void open_archive (struct locarhandle *ah, bool readonly);
/* Close the locale archive. */
extern void close_archive (struct locarhandle *ah);
/* Add given locale data to the archive. */
extern int add_locale_to_archive (struct locarhandle *ah, const char *name,
locale_data_t data, bool replace);
extern void add_alias (struct locarhandle *ah, const char *alias,
bool replace, const char *oldname,
uint32_t *locrec_offset_p);
extern struct namehashent *
insert_name (struct locarhandle *ah,
const char *name, size_t name_len, bool replace);
struct nameent
{
char *name;
struct locrecent *locrec;
};
struct dataent
{
const unsigned char *sum;
uint32_t file_offset;
};
static int
nameentcmp (const void *a, const void *b)
{
struct locrecent *la = ((const struct nameent *) a)->locrec;
struct locrecent *lb = ((const struct nameent *) b)->locrec;
uint32_t start_a = -1, end_a = 0;
uint32_t start_b = -1, end_b = 0;
int cnt;
for (cnt = 0; cnt < __LC_LAST; ++cnt)
if (cnt != LC_ALL)
{
if (la->record[cnt].offset < start_a)
start_a = la->record[cnt].offset;
if (la->record[cnt].offset + la->record[cnt].len > end_a)
end_a = la->record[cnt].offset + la->record[cnt].len;
}
assert (start_a != (uint32_t)-1);
assert (end_a != 0);
for (cnt = 0; cnt < __LC_LAST; ++cnt)
if (cnt != LC_ALL)
{
if (lb->record[cnt].offset < start_b)
start_b = lb->record[cnt].offset;
if (lb->record[cnt].offset + lb->record[cnt].len > end_b)
end_b = lb->record[cnt].offset + lb->record[cnt].len;
}
assert (start_b != (uint32_t)-1);
assert (end_b != 0);
if (start_a != start_b)
return (int)start_a - (int)start_b;
return (int)end_a - (int)end_b;
}
static int
dataentcmp (const void *a, const void *b)
{
if (((const struct dataent *) a)->file_offset
< ((const struct dataent *) b)->file_offset)
return -1;
if (((const struct dataent *) a)->file_offset
> ((const struct dataent *) b)->file_offset)
return 1;
return 0;
}
static int
sumsearchfn (const void *key, const void *ent)
{
uint32_t keyn = *(uint32_t *)key;
uint32_t entn = ((struct dataent *)ent)->file_offset;
if (keyn < entn)
return -1;
if (keyn > entn)
return 1;
return 0;
}
static void
compute_data (struct locarhandle *ah, struct nameent *name, size_t sumused,
struct dataent *files, locale_data_t data)
{
int cnt;
struct locrecent *locrec = name->locrec;
struct dataent *file;
data[LC_ALL].addr = ((char *) ah->addr) + locrec->record[LC_ALL].offset;
data[LC_ALL].size = locrec->record[LC_ALL].len;
for (cnt = 0; cnt < __LC_LAST; ++cnt)
if (cnt != LC_ALL)
{
data[cnt].addr = ((char *) ah->addr) + locrec->record[cnt].offset;
data[cnt].size = locrec->record[cnt].len;
if (data[cnt].addr >= data[LC_ALL].addr
&& data[cnt].addr + data[cnt].size
<= data[LC_ALL].addr + data[LC_ALL].size)
__md5_buffer (data[cnt].addr, data[cnt].size, data[cnt].sum);
else
{
file = bsearch (&locrec->record[cnt].offset, files, sumused,
sizeof (*files), sumsearchfn);
if (file == NULL)
error (EXIT_FAILURE, 0, "inconsistent template file");
memcpy (data[cnt].sum, file->sum, sizeof (data[cnt].sum));
}
}
}
static int
fill_archive (struct locarhandle *tmpl_ah,
const char *fname,
size_t install_langs_count, char *install_langs_list[],
size_t nlist, char *list[],
const char *primary)
{
struct locarhandle ah;
struct locarhead *head;
int result = 0;
struct nameent *names;
struct namehashent *namehashtab;
size_t cnt, used;
struct dataent *files;
struct sumhashent *sumhashtab;
size_t sumused;
struct locrecent *primary_locrec = NULL;
struct nameent *primary_nameent = NULL;
head = tmpl_ah->addr;
names = (struct nameent *) malloc (head->namehash_used
* sizeof (struct nameent));
files = (struct dataent *) malloc (head->sumhash_used
* sizeof (struct dataent));
if (names == NULL || files == NULL)
error (EXIT_FAILURE, errno, "could not allocate tables");
namehashtab = (struct namehashent *) ((char *) tmpl_ah->addr
+ head->namehash_offset);
sumhashtab = (struct sumhashent *) ((char *) tmpl_ah->addr
+ head->sumhash_offset);
for (cnt = used = 0; cnt < head->namehash_size; ++cnt)
if (namehashtab[cnt].locrec_offset != 0)
{
char * name;
int i;
assert (used < head->namehash_used);
name = tmpl_ah->addr + namehashtab[cnt].name_offset;
if (install_langs_count == 0)
{
/* Always intstall the entry. */
names[used].name = name;
names[used++].locrec
= (struct locrecent *) ((char *) tmpl_ah->addr +
namehashtab[cnt].locrec_offset);
}
else
{
/* Only install the entry if the user asked for it via
--install-langs. */
for (i = 0; i < install_langs_count; i++)
{
/* Add one for "_" and one for the null terminator. */
size_t len = strlen (install_langs_list[i]) + 2;
char *install_lang = (char *)xmalloc (len);
strcpy (install_lang, install_langs_list[i]);
if (strchr (install_lang, '_') == NULL)
strcat (install_lang, "_");
if (strncmp (name, install_lang, strlen (install_lang)) == 0)
{
names[used].name = name;
names[used++].locrec
= (struct locrecent *) ((char *)tmpl_ah->addr
+ namehashtab[cnt].locrec_offset);
}
free (install_lang);
}
}
}
/* Sort the names. */
qsort (names, used, sizeof (struct nameent), nameentcmp);
for (cnt = sumused = 0; cnt < head->sumhash_size; ++cnt)
if (sumhashtab[cnt].file_offset != 0)
{
assert (sumused < head->sumhash_used);
files[sumused].sum = (const unsigned char *) sumhashtab[cnt].sum;
files[sumused++].file_offset = sumhashtab[cnt].file_offset;
}
/* Sort by file locations. */
qsort (files, sumused, sizeof (struct dataent), dataentcmp);
/* Open the archive. This call never returns if we cannot
successfully open the archive. */
ah.fname = NULL;
if (fname != NULL)
ah.fname = fname;
open_archive (&ah, false);
if (primary != NULL)
{
for (cnt = 0; cnt < used; ++cnt)
if (strcmp (names[cnt].name, primary) == 0)
break;
if (cnt < used)
{
locale_data_t data;
compute_data (tmpl_ah, &names[cnt], sumused, files, data);
result |= add_locale_to_archive (&ah, primary, data, 0);
primary_locrec = names[cnt].locrec;
primary_nameent = &names[cnt];
}
}
for (cnt = 0; cnt < used; ++cnt)
if (&names[cnt] == primary_nameent)
continue;
else if ((cnt > 0 && names[cnt - 1].locrec == names[cnt].locrec)
|| names[cnt].locrec == primary_locrec)
{
const char *oldname;
struct namehashent *namehashent;
uint32_t locrec_offset;
if (names[cnt].locrec == primary_locrec)
oldname = primary;
else
oldname = names[cnt - 1].name;
namehashent = insert_name (&ah, oldname, strlen (oldname), true);
assert (namehashent->name_offset != 0);
assert (namehashent->locrec_offset != 0);
locrec_offset = namehashent->locrec_offset;
add_alias (&ah, names[cnt].name, 0, oldname, &locrec_offset);
}
else
{
locale_data_t data;
compute_data (tmpl_ah, &names[cnt], sumused, files, data);
result |= add_locale_to_archive (&ah, names[cnt].name, data, 0);
}
while (nlist-- > 0)
{
const char *fname = *list++;
size_t fnamelen = strlen (fname);
struct stat64 st;
DIR *dirp;
struct dirent64 *d;
int seen;
locale_data_t data;
int cnt;
/* First see whether this really is a directory and whether it
contains all the require locale category files. */
if (stat64 (fname, &st) < 0)
{
error (0, 0, "stat of \"%s\" failed: %s: ignored", fname,
strerror (errno));
continue;
}
if (!S_ISDIR (st.st_mode))
{
error (0, 0, "\"%s\" is no directory; ignored", fname);
continue;
}
dirp = opendir (fname);
if (dirp == NULL)
{
error (0, 0, "cannot open directory \"%s\": %s: ignored",
fname, strerror (errno));
continue;
}
seen = 0;
while ((d = readdir64 (dirp)) != NULL)
{
for (cnt = 0; cnt < __LC_LAST; ++cnt)
if (cnt != LC_ALL)
if (strcmp (d->d_name, locnames[cnt]) == 0)
{
unsigned char d_type;
/* We have an object of the required name. If it's
a directory we have to look at a file with the
prefix "SYS_". Otherwise we have found what we
are looking for. */
#ifdef _DIRENT_HAVE_D_TYPE
d_type = d->d_type;
if (d_type != DT_REG)
#endif
{
char fullname[fnamelen + 2 * strlen (d->d_name) + 7];
#ifdef _DIRENT_HAVE_D_TYPE
if (d_type == DT_UNKNOWN)
#endif
{
strcpy (stpcpy (stpcpy (fullname, fname), "/"),
d->d_name);
if (stat64 (fullname, &st) == -1)
/* We cannot stat the file, ignore it. */
break;
d_type = IFTODT (st.st_mode);
}
if (d_type == DT_DIR)
{
/* We have to do more tests. The file is a
directory and it therefore must contain a
regular file with the same name except a
"SYS_" prefix. */
char *t = stpcpy (stpcpy (fullname, fname), "/");
strcpy (stpcpy (stpcpy (t, d->d_name), "/SYS_"),
d->d_name);
if (stat64 (fullname, &st) == -1)
/* There is no SYS_* file or we cannot
access it. */
break;
d_type = IFTODT (st.st_mode);
}
}
/* If we found a regular file (eventually after
following a symlink) we are successful. */
if (d_type == DT_REG)
++seen;
break;
}
}
closedir (dirp);
if (seen != __LC_LAST - 1)
{
/* We don't have all locale category files. Ignore the name. */
error (0, 0, "incomplete set of locale files in \"%s\"",
fname);
continue;
}
/* Add the files to the archive. To do this we first compute
sizes and the MD5 sums of all the files. */
for (cnt = 0; cnt < __LC_LAST; ++cnt)
if (cnt != LC_ALL)
{
char fullname[fnamelen + 2 * strlen (locnames[cnt]) + 7];
int fd;
strcpy (stpcpy (stpcpy (fullname, fname), "/"), locnames[cnt]);
fd = open64 (fullname, O_RDONLY);
if (fd == -1 || fstat64 (fd, &st) == -1)
{
/* Cannot read the file. */
if (fd != -1)
close (fd);
break;
}
if (S_ISDIR (st.st_mode))
{
char *t;
close (fd);
t = stpcpy (stpcpy (fullname, fname), "/");
strcpy (stpcpy (stpcpy (t, locnames[cnt]), "/SYS_"),
locnames[cnt]);
fd = open64 (fullname, O_RDONLY);
if (fd == -1 || fstat64 (fd, &st) == -1
|| !S_ISREG (st.st_mode))
{
if (fd != -1)
close (fd);
break;
}
}
/* Map the file. */
data[cnt].addr = mmap64 (NULL, st.st_size, PROT_READ, MAP_SHARED,
fd, 0);
if (data[cnt].addr == MAP_FAILED)
{
/* Cannot map it. */
close (fd);
break;
}
data[cnt].size = st.st_size;
__md5_buffer (data[cnt].addr, st.st_size, data[cnt].sum);
/* We don't need the file descriptor anymore. */
close (fd);
}
if (cnt != __LC_LAST)
{
while (cnt-- > 0)
if (cnt != LC_ALL)
munmap (data[cnt].addr, data[cnt].size);
error (0, 0, "cannot read all files in \"%s\": ignored", fname);
continue;
}
result |= add_locale_to_archive (&ah, basename (fname), data, 0);
for (cnt = 0; cnt < __LC_LAST; ++cnt)
if (cnt != LC_ALL)
munmap (data[cnt].addr, data[cnt].size);
}
/* We are done. */
close_archive (&ah);
return result;
}
void usage()
{
printf ("\
Usage: build-locale-archive [OPTION]... [TEMPLATE-FILE] [ARCHIVE-FILE]\n\
Builds a locale archive from a template file.\n\
Options:\n\
-h, --help Print this usage message.\n\
-v, --verbose Verbose execution.\n\
-l, --install-langs=LIST Only include locales given in LIST into the \n\
locale archive. LIST is a colon separated list\n\
of locale prefixes, for example \"de:en:ja\".\n\
The special argument \"all\" means to install\n\
all languages and it must be present by itself.\n\
If \"all\" is present with any other language it\n\
will be treated as the name of a locale.\n\
If the --install-langs option is missing, all\n\
locales are installed. The colon separated list\n\
can contain any strings matching the beginning of\n\
locale names.\n\
If a string does not contain a \"_\", it is added.\n\
Examples:\n\
--install-langs=\"en\"\n\
installs en_US, en_US.iso88591,\n\
en_US.iso885915, en_US.utf8,\n\
en_GB ...\n\
--install-langs=\"en_US.utf8\"\n\
installs only en_US.utf8.\n\
--install-langs=\"ko\"\n\
installs ko_KR, ko_KR.euckr,\n\
ko_KR.utf8 but *not* kok_IN\n\
because \"ko\" does not contain\n\
\"_\" and it is silently added\n\
--install-langs\"ko:kok\"\n\
installs ko_KR, ko_KR.euckr,\n\
ko_KR.utf8, kok_IN, and\n\
kok_IN.utf8.\n\
--install-langs=\"POSIX\" will\n\
installs *no* locales at all\n\
because POSIX matches none of\n\
the locales. Actually, any string\n\
matching nothing will do that.\n\
POSIX and C will always be\n\
available because they are\n\
builtin.\n\
Aliases are installed as well,\n\
i.e. --install-langs=\"de\"\n\
will install not only every locale starting with\n\
\"de\" but also the aliases \"deutsch\"\n\
and and \"german\" although the latter does not\n\
start with \"de\".\n\
\n\
If the arguments TEMPLATE-FILE and ARCHIVE-FILE are not given the locations\n\
where the glibc used expects these files are used by default.\n\
");
}
int main (int argc, char *argv[])
{
char path[4096];
DIR *dirp;
struct dirent64 *d;
struct stat64 st;
char *list[16384], *primary;
char *lang;
int install_langs_count = 0;
int i;
char *install_langs_arg, *ila_start;
char **install_langs_list = NULL;
unsigned int cnt = 0;
struct locarhandle tmpl_ah;
char *new_locar_fname = NULL;
size_t loc_path_len = strlen (loc_path);
while (1)
{
int c;
static struct option long_options[] =
{
{"help", no_argument, 0, 'h'},
{"verbose", no_argument, 0, 'v'},
{"install-langs", required_argument, 0, 'l'},
{0, 0, 0, 0}
};
/* getopt_long stores the option index here. */
int option_index = 0;
c = getopt_long (argc, argv, "vhl:",
long_options, &option_index);
/* Detect the end of the options. */
if (c == -1)
break;
switch (c)
{
case 0:
printf ("unknown option %s", long_options[option_index].name);
if (optarg)
printf (" with arg %s", optarg);
printf ("\n");
usage ();
exit (1);
case 'v':
verbose = 1;
be_quiet = 0;
break;
case 'h':
usage ();
exit (0);
case 'l':
install_langs_arg = ila_start = strdup (optarg);
/* If the argument to --install-lang is "all", do
not limit the list of languages to install and install
them all. We do not support installing a single locale
called "all". */
#define MAGIC_INSTALL_ALL "all"
if (install_langs_arg != NULL
&& install_langs_arg[0] != '\0'
&& !(strncmp(install_langs_arg, MAGIC_INSTALL_ALL,
strlen(MAGIC_INSTALL_ALL)) == 0
&& strlen (install_langs_arg) == 3))
{
/* Count the number of languages we will install. */
while (true)
{
lang = strtok(install_langs_arg, ":;,");
if (lang == NULL)
break;
install_langs_count++;
install_langs_arg = NULL;
}
free (ila_start);
/* Reject an entire string made up of delimiters. */
if (install_langs_count == 0)
break;
/* Copy the list. */
install_langs_list = (char **)xmalloc (sizeof(char *) * install_langs_count);
install_langs_arg = ila_start = strdup (optarg);
install_langs_count = 0;
while (true)
{
lang = strtok(install_langs_arg, ":;,");
if (lang == NULL)
break;
install_langs_list[install_langs_count] = lang;
install_langs_count++;
install_langs_arg = NULL;
}
}
break;
case '?':
/* getopt_long already printed an error message. */
usage ();
exit (0);
default:
abort ();
}
}
tmpl_ah.fname = NULL;
if (optind < argc)
tmpl_ah.fname = argv[optind];
if (optind + 1 < argc)
new_locar_fname = argv[optind + 1];
if (verbose)
{
if (tmpl_ah.fname)
printf("input archive file specified on command line: %s\n",
tmpl_ah.fname);
else
printf("using default input archive file.\n");
if (new_locar_fname)
printf("output archive file specified on command line: %s\n",
new_locar_fname);
else
printf("using default output archive file.\n");
}
dirp = opendir (loc_path);
if (dirp == NULL)
error (EXIT_FAILURE, errno, "cannot open directory \"%s\"", loc_path);
open_tmpl_archive (&tmpl_ah);
if (new_locar_fname)
unlink (new_locar_fname);
else
unlink (locar_file);
primary = getenv ("LC_ALL");
if (primary == NULL)
primary = getenv ("LANG");
if (primary != NULL)
{
if (strncmp (primary, "ja", 2) != 0
&& strncmp (primary, "ko", 2) != 0
&& strncmp (primary, "zh", 2) != 0)
{
char *ptr = malloc (strlen (primary) + strlen (".utf8") + 1), *p, *q;
/* This leads to invalid locales sometimes:
de_DE.iso885915@euro -> de_DE.utf8@euro */
if (ptr != NULL)
{
p = ptr;
q = primary;
while (*q && *q != '.' && *q != '@')
*p++ = *q++;
if (*q == '.')
while (*q && *q != '@')
q++;
p = stpcpy (p, ".utf8");
strcpy (p, q);
primary = ptr;
}
else
primary = NULL;
}
}
memcpy (path, loc_path, loc_path_len);
while ((d = readdir64 (dirp)) != NULL)
{
if (strcmp (d->d_name, ".") == 0 || strcmp (d->d_name, "..") == 0)
continue;
if (strchr (d->d_name, '_') == NULL)
continue;
size_t d_name_len = strlen (d->d_name);
if (loc_path_len + d_name_len + 1 > sizeof (path))
{
error (0, 0, "too long filename \"%s\"", d->d_name);
continue;
}
memcpy (path + loc_path_len, d->d_name, d_name_len + 1);
if (stat64 (path, &st) < 0)
{
error (0, errno, "cannot stat \"%s\"", path);
continue;
}
if (! S_ISDIR (st.st_mode))
continue;
if (cnt == 16384)
{
error (0, 0, "too many directories in \"%s\"", loc_path);
break;
}
list[cnt] = strdup (path);
if (list[cnt] == NULL)
{
error (0, errno, "cannot add file to list \"%s\"", path);
continue;
}
if (primary != NULL && cnt > 0 && strcmp (primary, d->d_name) == 0)
{
char *p = list[0];
list[0] = list[cnt];
list[cnt] = p;
}
cnt++;
}
closedir (dirp);
/* Store the archive to the file specified as the second argument on the
command line or the default locale archive. */
fill_archive (&tmpl_ah, new_locar_fname,
install_langs_count, install_langs_list,
cnt, list, primary);
close_archive (&tmpl_ah);
truncate (tmpl_file, 0);
if (install_langs_count > 0)
{
free (ila_start);
free (install_langs_list);
}
char *tz_argv[] = { "/usr/sbin/tzdata-update", NULL };
execve (tz_argv[0], (char *const *)tz_argv, (char *const *)&tz_argv[1]);
exit (0);
}

View File

@ -1,25 +0,0 @@
Author: Florian Weimer <fweimer@redhat.com>
Date: Wed Jul 4 16:16:57 2018 +0200
Makeconfig (ASFLAGS): Always append required assembler flags.
Submitted upstream here:
https://sourceware.org/ml/libc-alpha/2018-07/msg00077.html
Otherwise, we lose essential flags such as -Wa,--noexecstack due to
the way += works in make due to the ASFLAGS command line override.
diff --git a/Makeconfig b/Makeconfig
index b0b27f0113ac18b8..92e76d6200bbcd5b 100644
--- a/Makeconfig
+++ b/Makeconfig
@@ -1047,7 +1047,7 @@ endif
ifndef ASFLAGS
ASFLAGS := $(filter -g% -fdebug-prefix-map=%,$(CFLAGS))
endif
-ASFLAGS += -Werror=undef $(ASFLAGS-config) $(asflags-cpu)
+override ASFLAGS += -Werror=undef $(ASFLAGS-config) $(asflags-cpu)
ifndef BUILD_CC
BUILD_CC = $(CC)

View File

@ -88,21 +88,21 @@ index 0000000..fdf460e
+<U0000>
+..
+<UFFFF>
+<U10000>
+<U00010000>
+..
+<U1FFFF>
+<U20000>
+<U0001FFFF>
+<U00020000>
+..
+<U2FFFF>
+<UE0000>
+<U0002FFFF>
+<U000E0000>
+..
+<UEFFFF>
+<UF0000>
+<U000EFFFF>
+<U000F0000>
+..
+<UFFFFF>
+<U100000>
+<U000FFFFF>
+<U00100000>
+..
+<U10FFFF>
+<U0010FFFF>
+UNDEFINED
+order_end
+END LC_COLLATE

View File

@ -8,14 +8,14 @@ behaviour which updates the locale archive. The Fedora install phase
in the spec file of the rpm will handle this manually.
diff --git a/localedata/Makefile b/localedata/Makefile
index a5f3c92d58954dfc..56719c7c714aa0f1 100644
index 0eea396ad86da956..54caabda33728207 100644
--- a/localedata/Makefile
+++ b/localedata/Makefile
@@ -218,6 +218,7 @@ $(INSTALL-SUPPORTED-LOCALES): install-locales-dir
@@ -413,6 +413,7 @@ define build-one-locale
echo -n '...'; \
input=`echo $$locale | sed 's/\([^.]*\)[^@]*\(.*\)/\1\2/'`; \
$(LOCALEDEF) $$flags --alias-file=../intl/locale.alias \
+ --no-archive \
-i locales/$$input -f charmaps/$$charset \
$(addprefix --prefix=,$(install_root)) $$locale \
&& echo ' done'; \
&& echo ' done';

View File

@ -1,46 +0,0 @@
Short description: Allow access to internal locale archive functions.
Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
Origin: PATCH
Upstream status: not-needed
This is a part of commit glibc-2.3.3-1492-ga891c7b,
needed for fedora/build-locale-archive.c only.
2007-04-16 Jakub Jelinek <jakub@redhat.com>
* locale/programs/locarchive.c (add_alias, insert_name): Remove static.
diff -Nrup a/locale/programs/locarchive.c b/locale/programs/locarchive.c
--- a/locale/programs/locarchive.c 2012-06-05 07:42:49.000000000 -0600
+++ b/locale/programs/locarchive.c 2012-06-07 12:15:21.585319540 -0600
@@ -252,9 +252,9 @@ oldlocrecentcmp (const void *a, const vo
/* forward decls for below */
static uint32_t add_locale (struct locarhandle *ah, const char *name,
locale_data_t data, bool replace);
-static void add_alias (struct locarhandle *ah, const char *alias,
- bool replace, const char *oldname,
- uint32_t *locrec_offset_p);
+void add_alias (struct locarhandle *ah, const char *alias,
+ bool replace, const char *oldname,
+ uint32_t *locrec_offset_p);
static bool
@@ -635,7 +635,7 @@ close_archive (struct locarhandle *ah)
#include "../../intl/explodename.c"
#include "../../intl/l10nflist.c"
-static struct namehashent *
+struct namehashent *
insert_name (struct locarhandle *ah,
const char *name, size_t name_len, bool replace)
{
@@ -693,7 +693,7 @@ insert_name (struct locarhandle *ah,
return &namehashtab[idx];
}
-static void
+void
add_alias (struct locarhandle *ah, const char *alias, bool replace,
const char *oldname, uint32_t *locrec_offset_p)
{

View File

@ -0,0 +1,45 @@
The Fedora /etc/nsswitch.conf is based largely on the upstream
version with minor downstream distribution modifications for
use with SSSD and systemd.
diff --git a/nss/nsswitch.conf b/nss/nsswitch.conf
index f55358811495c9f1..14c3cde8080a848c 100644
--- a/nss/nsswitch.conf
+++ b/nss/nsswitch.conf
@@ -1,7 +1,7 @@
#
# /etc/nsswitch.conf
#
-# An example Name Service Switch config file. This file should be
+# Name Service Switch config file. This file should be
# sorted with the most-used services at the beginning.
#
# Valid databases are: aliases, ethers, group, gshadow, hosts,
@@ -52,18 +52,20 @@
# shadow: db files
# group: db files
-# In alphabetical order. Re-order as required to optimize peformance.
+# In order of likelihood of use to accelerate lookup.
+passwd: sss files
+shadow: files sss
+group: sss files
+hosts: files dns myhostname
+services: files sss
+netgroup: sss
+automount: files sss
+
aliases: files
ethers: files
-group: files
gshadow: files
-hosts: files dns
initgroups: files
-netgroup: files
networks: files dns
-passwd: files
protocols: files
publickey: files
rpc: files
-shadow: files
-services: files

View File

@ -1,38 +0,0 @@
Short description: Do not define _XOPEN_STREAMS.
Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
Origin: PATCH
Bug-Fedora: #436349
Upstream status: not-submitted
This patch should go upstream. Not defining _XOPEN_STREAMS is the
same as setting it to -1 for POSIX conformance. The headers setting
needs to be reviewed indepedently.
This is part of commit glibc-2.3.3-1564-gd0b6ac6
* Fri Mar 14 2008 Jakub Jelinek <jakub@redhat.com> 2.7.90-11
- remove <stropts.h>, define _XOPEN_STREAMS -1 (#436349)
diff -Nrup a/nptl/sysdeps/unix/sysv/linux/bits/posix_opt.h b/nptl/sysdeps/unix/sysv/linux/bits/posix_opt.h
--- a/sysdeps/unix/sysv/linux/bits/posix_opt.h 2012-06-05 07:42:49.000000000 -0600
+++ b/sysdeps/unix/sysv/linux/bits/posix_opt.h 2012-06-07 12:15:21.817318674 -0600
@@ -188,4 +188,7 @@
/* Typed memory objects are not available. */
#define _POSIX_TYPED_MEMORY_OBJECTS -1
+/* Streams are not available. */
+#define _XOPEN_STREAMS -1
+
#endif /* bits/posix_opt.h */
diff -Nrup a/streams/Makefile b/streams/Makefile
--- a/streams/Makefile 2012-06-05 07:42:49.000000000 -0600
+++ b/streams/Makefile 2012-06-07 12:15:21.824318649 -0600
@@ -20,7 +20,7 @@
include ../Makeconfig
-headers = stropts.h sys/stropts.h bits/stropts.h bits/xtitypes.h
+#headers = stropts.h sys/stropts.h bits/stropts.h bits/xtitypes.h
routines = isastream getmsg getpmsg putmsg putpmsg fattach fdetach
include ../Rules

View File

@ -1,32 +0,0 @@
This patch is similar to glibc-asflags.patch and is needed to change
the ld.so linker flags. It is needed to work around this valgrind
bug: https://bugzilla.redhat.com/show_bug.cgi?id=1600034
diff --git a/Makeconfig b/Makeconfig
index 92e76d6200bbcd5b..376181c8ff06dea7 100644
--- a/Makeconfig
+++ b/Makeconfig
@@ -363,12 +363,12 @@ endif
ifeq (yesyes,$(build-shared)$(have-z-combreloc))
combreloc-LDFLAGS = -Wl,-z,combreloc
LDFLAGS.so += $(combreloc-LDFLAGS)
-LDFLAGS-rtld += $(combreloc-LDFLAGS)
+override LDFLAGS-rtld += $(combreloc-LDFLAGS)
endif
relro-LDFLAGS = -Wl,-z,relro
LDFLAGS.so += $(relro-LDFLAGS)
-LDFLAGS-rtld += $(relro-LDFLAGS)
+override LDFLAGS-rtld += $(relro-LDFLAGS)
ifeq (yes,$(have-hash-style))
# For the time being we unconditionally use 'both'. At some time we
@@ -376,7 +376,7 @@ ifeq (yes,$(have-hash-style))
# with --hash-style=gnu only.
hashstyle-LDFLAGS = -Wl,--hash-style=both
LDFLAGS.so += $(hashstyle-LDFLAGS)
-LDFLAGS-rtld += $(hashstyle-LDFLAGS)
+override LDFLAGS-rtld += $(hashstyle-LDFLAGS)
endif
ifeq (yes,$(enable-static-pie))

View File

@ -1,272 +0,0 @@
Short description: RPM Post-upgrade cleanup program.
Author(s): Fedora glibc team <glibc@lists.fedoraproject.org>
Origin: PATCH
Upstream status: not-needed
A helper program is needed to clean up the system configuration
early during RPM package installation, so that other scriptlets
can run successfully.
diff --git a/elf/Makefile b/elf/Makefile
index 2a432d8beebcd207..368dcae477fff2ae 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -117,6 +117,14 @@ others-extras = $(ldconfig-modules)
endif
endif
+# This needs to be statically linked because it is executed at a time
+# when there might be incompatible shared objects on disk, and the
+# purpose of this program is to remove them (among other things).
+others-static += glibc_post_upgrade
+others += glibc_post_upgrade
+glibc_post_upgrade-modules := static-stubs
+CFLAGS-glibc_post_upgrade.c += -DGCONV_MODULES_DIR='"$(gconvdir)"'
+
# To find xmalloc.c and xstrdup.c
vpath %.c ../locale/programs
@@ -559,6 +567,8 @@ $(objpfx)sln: $(sln-modules:%=$(objpfx)%.o)
$(objpfx)ldconfig: $(ldconfig-modules:%=$(objpfx)%.o)
+$(objpfx)glibc_post_upgrade: $(glibc_post_upgrade-modules:%=$(objpfx)%.o)
+
SYSCONF-FLAGS := -D'SYSCONFDIR="$(sysconfdir)"'
CFLAGS-ldconfig.c += $(SYSCONF-FLAGS) -D'LIBDIR="$(libdir)"' \
-D'SLIBDIR="$(slibdir)"'
diff --git a/elf/glibc_post_upgrade.c b/elf/glibc_post_upgrade.c
new file mode 100644
index 0000000000000000..19b59f70e2308032
--- /dev/null
+++ b/elf/glibc_post_upgrade.c
@@ -0,0 +1,229 @@
+#include <sys/types.h>
+#include <sys/wait.h>
+#include <stdio.h>
+#include <errno.h>
+#include <unistd.h>
+#include <sys/time.h>
+#include <dirent.h>
+#include <stddef.h>
+#include <fcntl.h>
+#include <string.h>
+
+#define LD_SO_CONF "/etc/ld.so.conf"
+#define ICONVCONFIG "/usr/sbin/iconvconfig"
+
+#define verbose_exec(failcode, path...) \
+ do \
+ { \
+ char *const arr[] = { path, NULL }; \
+ vexec (failcode, arr); \
+ } while (0)
+
+__attribute__((noinline)) static void vexec (int failcode, char *const path[]);
+__attribute__((noinline)) static void says (const char *str);
+__attribute__((noinline)) static void sayn (long num);
+__attribute__((noinline)) static void message (char *const path[]);
+
+int
+main (void)
+{
+ char initpath[256];
+
+ char buffer[4096];
+ struct pref {
+ const char *p;
+ int len;
+ } prefix[] = { { "libc-", 5 }, { "libm-", 5 },
+ { "librt-", 6 }, { "libpthread-", 11 },
+ { "librtkaio-", 10 }, { "libthread_db-", 13 } };
+ int i, j, fd;
+ off_t base;
+ ssize_t ret;
+
+ /* In order to support in-place upgrades, we must immediately remove
+ obsolete platform directories after installing a new glibc
+ version. RPM only deletes files removed by updates near the end
+ of the transaction. If we did not remove the obsolete platform
+ directories here, they would be preferred by the dynamic linker
+ during the execution of subsequent RPM scriptlets, likely
+ resulting in process startup failures. */
+ const char *remove_dirs[] =
+ {
+#if defined (__i386__)
+ "/lib/i686",
+ "/lib/i686/nosegneg",
+#elif defined (__powerpc64__) && _CALL_ELF != 2
+ "/lib64/power6",
+#endif
+ };
+ for (j = 0; j < sizeof (remove_dirs) / sizeof (remove_dirs[0]); ++j)
+ {
+ size_t rmlen = strlen (remove_dirs[j]);
+ fd = open (remove_dirs[j], O_RDONLY);
+ if (fd >= 0
+ && (ret = getdirentries (fd, buffer, sizeof (buffer), &base))
+ >= (ssize_t) offsetof (struct dirent, d_name))
+ {
+ for (base = 0; base + offsetof (struct dirent, d_name) < ret; )
+ {
+ struct dirent *d = (struct dirent *) (buffer + base);
+
+ for (i = 0; i < sizeof (prefix) / sizeof (prefix[0]); i++)
+ if (! strncmp (d->d_name, prefix[i].p, prefix[i].len))
+ {
+ char *p = d->d_name + prefix[i].len;
+
+ while (*p == '.' || (*p >= '0' && *p <= '9')) p++;
+ if (p[0] == 's' && p[1] == 'o' && p[2] == '\0'
+ && p + 3 - d->d_name
+ < sizeof (initpath) - rmlen - 1)
+ {
+ memcpy (initpath, remove_dirs[j], rmlen);
+ initpath[rmlen] = '/';
+ strcpy (initpath + rmlen + 1, d->d_name);
+ unlink (initpath);
+ break;
+ }
+ }
+ base += d->d_reclen;
+ }
+ close (fd);
+ }
+ }
+
+ int ldsocfd = open (LD_SO_CONF, O_RDONLY);
+ struct stat ldsocst;
+ if (ldsocfd >= 0 && fstat (ldsocfd, &ldsocst) >= 0)
+ {
+ char p[ldsocst.st_size + 1];
+ if (read (ldsocfd, p, ldsocst.st_size) == ldsocst.st_size)
+ {
+ p[ldsocst.st_size] = '\0';
+ if (strstr (p, "include ld.so.conf.d/*.conf") == NULL)
+ {
+ close (ldsocfd);
+ ldsocfd = open (LD_SO_CONF, O_WRONLY | O_TRUNC);
+ if (ldsocfd >= 0)
+ {
+ size_t slen = strlen ("include ld.so.conf.d/*.conf\n");
+ if (write (ldsocfd, "include ld.so.conf.d/*.conf\n", slen)
+ != slen
+ || write (ldsocfd, p, ldsocst.st_size) != ldsocst.st_size)
+ _exit (109);
+ }
+ }
+ }
+ if (ldsocfd >= 0)
+ close (ldsocfd);
+ }
+
+ /* If installing bi-arch glibc, rpm sometimes doesn't unpack all files
+ before running one of the lib's %post scriptlet. /sbin/ldconfig will
+ then be run by the other arch's %post. */
+ if (! access ("/sbin/ldconfig", X_OK))
+ verbose_exec (110,
+ (char *) "/sbin/ldconfig",
+ (char *) "/sbin/ldconfig");
+
+ if (! utimes (GCONV_MODULES_DIR "/gconv-modules.cache", NULL))
+ {
+ const char *iconv_cache = GCONV_MODULES_DIR "/gconv-modules.cache";
+ const char *iconv_dir = GCONV_MODULES_DIR;
+ verbose_exec (113,
+ (char *) ICONVCONFIG,
+ (char *) "/usr/sbin/iconvconfig",
+ (char *) "-o",
+ (char *) iconv_cache,
+ (char *) "--nostdlib",
+ (char *) iconv_dir);
+ }
+
+ _exit(0);
+}
+
+void
+vexec (int failcode, char *const path[])
+{
+ pid_t pid;
+ int status, save_errno;
+ int devnull = 0;
+
+ if (failcode < 0)
+ {
+ devnull = 1;
+ failcode = -failcode;
+ }
+ pid = vfork ();
+ if (pid == 0)
+ {
+ int fd;
+ if (devnull && (fd = open ("/dev/null", O_WRONLY)) >= 0)
+ {
+ dup2 (fd, 1);
+ dup2 (fd, 2);
+ close (fd);
+ }
+ execv (path[0], path + 1);
+ save_errno = errno;
+ message (path);
+ says (" exec failed with errno ");
+ sayn (save_errno);
+ says ("\n");
+ _exit (failcode);
+ }
+ else if (pid < 0)
+ {
+ save_errno = errno;
+ message (path);
+ says (" fork failed with errno ");
+ sayn (save_errno);
+ says ("\n");
+ _exit (failcode + 1);
+ }
+ if (waitpid (0, &status, 0) != pid || !WIFEXITED (status))
+ {
+ message (path);
+ says (" child terminated abnormally\n");
+ _exit (failcode + 2);
+ }
+ if (WEXITSTATUS (status))
+ {
+ message (path);
+ says (" child exited with exit code ");
+ sayn (WEXITSTATUS (status));
+ says ("\n");
+ _exit (WEXITSTATUS (status));
+ }
+}
+
+static void
+says (const char *str)
+{
+ write (1, str, strlen (str));
+}
+
+static void
+sayn (long num)
+{
+ char string[sizeof (long) * 3 + 1];
+ char *p = string + sizeof (string) - 1;
+
+ *p = '\0';
+ if (num == 0)
+ *--p = '0';
+ else
+ while (num)
+ {
+ *--p = '0' + num % 10;
+ num = num / 10;
+ }
+
+ says (p);
+}
+
+static void
+message (char *const path[])
+{
+ says ("/usr/sbin/glibc_post_upgrade: While trying to execute ");
+ says (path[0]);
+}

View File

@ -9,32 +9,32 @@ python3 during a transitional phase.
Author: Carlos O'Donell <carlos@redhat.com>
diff --git a/benchtests/scripts/compare_bench.py b/benchtests/scripts/compare_bench.py
index ea25f778c09bba9d..b53beb3c6e32c3cf 100755
index c1c438a1c9f0eae6..b7d3d7bcee87969d 100755
--- a/benchtests/scripts/compare_bench.py
+++ b/benchtests/scripts/compare_bench.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
# Copyright (C) 2015-2018 Free Software Foundation, Inc.
# Copyright (C) 2015-2019 Free Software Foundation, Inc.
# This file is part of the GNU C Library.
#
diff --git a/benchtests/scripts/import_bench.py b/benchtests/scripts/import_bench.py
index 602b3f954d4801a6..76bf1528a5418748 100644
index 7a55d19f038e64d4..72e6034243a8c9b6 100644
--- a/benchtests/scripts/import_bench.py
+++ b/benchtests/scripts/import_bench.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
# Copyright (C) 2015-2018 Free Software Foundation, Inc.
# Copyright (C) 2015-2019 Free Software Foundation, Inc.
# This file is part of the GNU C Library.
#
diff --git a/benchtests/scripts/validate_benchout.py b/benchtests/scripts/validate_benchout.py
index 6147f05bec3a4844..9a5c7947ee4ed7e9 100755
index 55d07c6bce5b5184..04129f9c26c2874c 100755
--- a/benchtests/scripts/validate_benchout.py
+++ b/benchtests/scripts/validate_benchout.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
# Copyright (C) 2014-2018 Free Software Foundation, Inc.
# Copyright (C) 2014-2019 Free Software Foundation, Inc.
# This file is part of the GNU C Library.
#

View File

@ -1,254 +0,0 @@
commit 4b25485f03158959cff45379eecc1d73c7dcdd11
Author: Florian Weimer <fweimer@redhat.com>
Date: Fri Aug 10 11:19:26 2018 +0200
Linux: Rewrite __old_getdents64 [BZ #23497]
Commit 298d0e3129c0b5137f4989275b13fe30d0733c4d ("Consolidate Linux
getdents{64} implementation") broke the implementation because it does
not take into account struct offset differences.
The new implementation is close to the old one, before the
consolidation, but has been cleaned up slightly.
(cherry picked from commit 690652882b499defb3d950dfeff8fe421d13cab5)
diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
index f71cc39c7e257a0a..773aaea0e980bdd6 100644
--- a/sysdeps/unix/sysv/linux/Makefile
+++ b/sysdeps/unix/sysv/linux/Makefile
@@ -161,6 +161,7 @@ inhibit-glue = yes
ifeq ($(subdir),dirent)
sysdep_routines += getdirentries getdirentries64
+tests-internal += tst-readdir64-compat
endif
ifeq ($(subdir),nis)
diff --git a/sysdeps/unix/sysv/linux/getdents64.c b/sysdeps/unix/sysv/linux/getdents64.c
index 3bde0cf4f0226f95..bc140b5a7fac3040 100644
--- a/sysdeps/unix/sysv/linux/getdents64.c
+++ b/sysdeps/unix/sysv/linux/getdents64.c
@@ -33,41 +33,80 @@ strong_alias (__getdents64, __getdents)
# include <shlib-compat.h>
# if SHLIB_COMPAT(libc, GLIBC_2_1, GLIBC_2_2)
-# include <olddirent.h>
+# include <olddirent.h>
+# include <unistd.h>
-/* kernel definition of as of 3.2. */
-struct compat_linux_dirent
+static ssize_t
+handle_overflow (int fd, __off64_t offset, ssize_t count)
{
- /* Both d_ino and d_off are compat_ulong_t which are defined in all
- architectures as 'u32'. */
- uint32_t d_ino;
- uint32_t d_off;
- unsigned short d_reclen;
- char d_name[1];
-};
+ /* If this is the first entry in the buffer, we can report the
+ error. */
+ if (count == 0)
+ {
+ __set_errno (EOVERFLOW);
+ return -1;
+ }
+
+ /* Otherwise, seek to the overflowing entry, so that the next call
+ will report the error, and return the data read so far.. */
+ if (__lseek64 (fd, offset, SEEK_SET) != 0)
+ return -1;
+ return count;
+}
ssize_t
__old_getdents64 (int fd, char *buf, size_t nbytes)
{
- ssize_t retval = INLINE_SYSCALL_CALL (getdents, fd, buf, nbytes);
+ /* We do not move the individual directory entries. This is only
+ possible if the target type (struct __old_dirent64) is smaller
+ than the source type. */
+ _Static_assert (offsetof (struct __old_dirent64, d_name)
+ <= offsetof (struct dirent64, d_name),
+ "__old_dirent64 is larger than dirent64");
+ _Static_assert (__alignof__ (struct __old_dirent64)
+ <= __alignof__ (struct dirent64),
+ "alignment of __old_dirent64 is larger than dirent64");
- /* The kernel added the d_type value after the name. Change this now. */
- if (retval != -1)
+ ssize_t retval = INLINE_SYSCALL_CALL (getdents64, fd, buf, nbytes);
+ if (retval > 0)
{
- union
- {
- struct compat_linux_dirent k;
- struct dirent u;
- } *kbuf = (void *) buf;
-
- while ((char *) kbuf < buf + retval)
+ char *p = buf;
+ char *end = buf + retval;
+ while (p < end)
{
- char d_type = *((char *) kbuf + kbuf->k.d_reclen - 1);
- memmove (kbuf->u.d_name, kbuf->k.d_name,
- strlen (kbuf->k.d_name) + 1);
- kbuf->u.d_type = d_type;
+ struct dirent64 *source = (struct dirent64 *) p;
+
+ /* Copy out the fixed-size data. */
+ __ino_t ino = source->d_ino;
+ __off64_t offset = source->d_off;
+ unsigned int reclen = source->d_reclen;
+ unsigned char type = source->d_type;
+
+ /* Check for ino_t overflow. */
+ if (__glibc_unlikely (ino != source->d_ino))
+ return handle_overflow (fd, offset, p - buf);
+
+ /* Convert to the target layout. Use a separate struct and
+ memcpy to side-step aliasing issues. */
+ struct __old_dirent64 result;
+ result.d_ino = ino;
+ result.d_off = offset;
+ result.d_reclen = reclen;
+ result.d_type = type;
+
+ /* Write the fixed-sized part of the result to the
+ buffer. */
+ size_t result_name_offset = offsetof (struct __old_dirent64, d_name);
+ memcpy (p, &result, result_name_offset);
+
+ /* Adjust the position of the name if necessary. Copy
+ everything until the end of the record, including the
+ terminating NUL byte. */
+ if (result_name_offset != offsetof (struct dirent64, d_name))
+ memmove (p + result_name_offset, source->d_name,
+ reclen - offsetof (struct dirent64, d_name));
- kbuf = (void *) ((char *) kbuf + kbuf->k.d_reclen);
+ p += reclen;
}
}
return retval;
diff --git a/sysdeps/unix/sysv/linux/tst-readdir64-compat.c b/sysdeps/unix/sysv/linux/tst-readdir64-compat.c
new file mode 100644
index 0000000000000000..43c4a8477c7403c5
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/tst-readdir64-compat.c
@@ -0,0 +1,111 @@
+/* Test readdir64 compatibility symbol.
+ Copyright (C) 2018 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <dirent.h>
+#include <dlfcn.h>
+#include <errno.h>
+#include <shlib-compat.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <string.h>
+#include <support/check.h>
+
+/* Copied from <olddirent.h>. */
+struct __old_dirent64
+ {
+ __ino_t d_ino;
+ __off64_t d_off;
+ unsigned short int d_reclen;
+ unsigned char d_type;
+ char d_name[256];
+ };
+
+typedef struct __old_dirent64 *(*compat_readdir64_type) (DIR *);
+
+#if TEST_COMPAT (libc, GLIBC_2_1, GLIBC_2_2)
+struct __old_dirent64 *compat_readdir64 (DIR *);
+compat_symbol_reference (libc, compat_readdir64, readdir64, GLIBC_2_1);
+#endif
+
+static int
+do_test (void)
+{
+#if TEST_COMPAT (libc, GLIBC_2_1, GLIBC_2_2)
+
+ /* Directory stream using the non-compat readdir64 symbol. The test
+ checks against this. */
+ DIR *dir_reference = opendir (".");
+ TEST_VERIFY_EXIT (dir_reference != NULL);
+ DIR *dir_test = opendir (".");
+ TEST_VERIFY_EXIT (dir_test != NULL);
+
+ /* This loop assumes that the enumeration order is consistent for
+ two different handles. Nothing should write to the current
+ directory (in the source tree) while this test runs, so there
+ should not be any difference due to races. */
+ size_t count = 0;
+ while (true)
+ {
+ errno = 0;
+ struct dirent64 *entry_reference = readdir64 (dir_reference);
+ if (entry_reference == NULL && errno != 0)
+ FAIL_EXIT1 ("readdir64 entry %zu: %m\n", count);
+ struct __old_dirent64 *entry_test = compat_readdir64 (dir_test);
+ if (entry_reference == NULL)
+ {
+ if (errno == EOVERFLOW)
+ {
+ TEST_VERIFY (entry_reference->d_ino
+ != (__ino_t) entry_reference->d_ino);
+ printf ("info: inode number overflow at entry %zu\n", count);
+ break;
+ }
+ if (errno != 0)
+ FAIL_EXIT1 ("compat readdir64 entry %zu: %m\n", count);
+ }
+
+ /* Check that both streams end at the same time. */
+ if (entry_reference == NULL)
+ {
+ TEST_VERIFY (entry_test == NULL);
+ break;
+ }
+ else
+ TEST_VERIFY_EXIT (entry_test != NULL);
+
+ /* Check that the entries are the same. */
+ TEST_COMPARE_BLOB (entry_reference->d_name,
+ strlen (entry_reference->d_name),
+ entry_test->d_name, strlen (entry_test->d_name));
+ TEST_COMPARE (entry_reference->d_ino, entry_test->d_ino);
+ TEST_COMPARE (entry_reference->d_off, entry_test->d_off);
+ TEST_COMPARE (entry_reference->d_type, entry_test->d_type);
+ TEST_COMPARE (entry_reference->d_reclen, entry_test->d_reclen);
+
+ ++count;
+ }
+ printf ("info: %zu directory entries found\n", count);
+ TEST_VERIFY (count >= 3); /* ".", "..", and some source files. */
+
+ TEST_COMPARE (closedir (dir_test), 0);
+ TEST_COMPARE (closedir (dir_reference), 0);
+#endif
+ return 0;
+}
+
+#include <support/test-driver.c>

View File

@ -1,139 +0,0 @@
Author: Florian Weimer <fweimer@redhat.com>
Date: Wed Jul 4 11:34:36 2018 +0200
Add --with-nonshared-cflags option to configure
Submitted upstream:
https://sourceware.org/ml/libc-alpha/2018-07/msg00071.html
diff --git a/INSTALL b/INSTALL
index 0a22aa7d01e6e87b..0f80d9d615db6d42 100644
--- a/INSTALL
+++ b/INSTALL
@@ -90,6 +90,15 @@ if 'CFLAGS' is specified it must enable optimization. For example:
library will still be usable, but functionality may be lost--for
example, you can't build a shared libc with old binutils.
+'--with-nonshared-cflags=CFLAGS'
+ Use additional compiler flags CFLAGS to build the parts of the
+ library which are always statically linked into applications and
+ libraries even with shared linking (that is, the object files
+ contained in 'lib*_nonshared.a' libraries). The build process will
+ automatically use the appropriate flags, but this option can be
+ used to set additional flags required for building applications and
+ libraries, to match local policy.
+
'--disable-shared'
Don't build shared libraries even if it is possible. Not all
systems support shared libraries; you need ELF support and
diff --git a/Makeconfig b/Makeconfig
index 608ffe648c80c724..b0b27f0113ac18b8 100644
--- a/Makeconfig
+++ b/Makeconfig
@@ -1038,7 +1038,7 @@ object-suffixes-for-libc += .oS
# Must build the routines as PIC, though, because they can end up in (users')
# shared objects. We don't want to use CFLAGS-os because users may, for
# example, make that processor-specific.
-CFLAGS-.oS = $(CFLAGS-.o) $(PIC-ccflag)
+CFLAGS-.oS = $(CFLAGS-.o) $(PIC-ccflag) $(extra-nonshared-cflags)
CPPFLAGS-.oS = $(CPPFLAGS-.o) -DPIC -DLIBC_NONSHARED=1
libtype.oS = lib%_nonshared.a
endif
diff --git a/config.make.in b/config.make.in
index d9891b2cd8ec3fbf..a6fe48d31f4d2725 100644
--- a/config.make.in
+++ b/config.make.in
@@ -110,6 +110,7 @@ BUILD_CC = @BUILD_CC@
CFLAGS = @CFLAGS@
CPPFLAGS-config = @CPPFLAGS@
CPPUNDEFS = @CPPUNDEFS@
+extra-nonshared-cflags = @extra_nonshared_cflags@
ASFLAGS-config = @ASFLAGS_config@
AR = @AR@
NM = @NM@
diff --git a/configure b/configure
index ef1830221522b7a5..fec0efff8216addd 100755
--- a/configure
+++ b/configure
@@ -684,6 +684,7 @@ force_install
bindnow
hardcoded_path_in_tests
enable_timezone_tools
+extra_nonshared_cflags
use_default_link
sysheaders
ac_ct_CXX
@@ -762,6 +763,7 @@ with_binutils
with_selinux
with_headers
with_default_link
+with_nonshared_cflags
enable_sanity_checks
enable_shared
enable_profile
@@ -1479,6 +1481,8 @@ Optional Packages:
--with-headers=PATH location of system headers to use (for example
/usr/src/linux/include) [default=compiler default]
--with-default-link do not use explicit linker scripts
+ --with-nonshared-cflags=FLAGS
+ build nonshared libraries with additional FLAGS
--with-cpu=CPU select code for CPU variant
Some influential environment variables:
@@ -3336,6 +3340,16 @@ else
fi
+
+# Check whether --with-nonshared-cflags was given.
+if test "${with_nonshared_cflags+set}" = set; then :
+ withval=$with_nonshared_cflags; extra_nonshared_cflags=$withval
+else
+ extra_nonshared_cflags=
+fi
+
+
+
# Check whether --enable-sanity-checks was given.
if test "${enable_sanity_checks+set}" = set; then :
enableval=$enable_sanity_checks; enable_sanity=$enableval
diff --git a/configure.ac b/configure.ac
index dc517017f588626a..154185d70de38928 100644
--- a/configure.ac
+++ b/configure.ac
@@ -154,6 +154,14 @@ AC_ARG_WITH([default-link],
[use_default_link=$withval],
[use_default_link=default])
+dnl Additional build flags injection.
+AC_ARG_WITH([nonshared-cflags],
+ AC_HELP_STRING([--with-nonshared-cflags=FLAGS],
+ [build nonshared libraries with additional FLAGS]),
+ [extra_nonshared_cflags=$withval],
+ [extra_nonshared_cflags=])
+AC_SUBST(extra_nonshared_cflags)
+
AC_ARG_ENABLE([sanity-checks],
AC_HELP_STRING([--disable-sanity-checks],
[really do not use threads (should not be used except in special situations) @<:@default=yes@:>@]),
diff --git a/manual/install.texi b/manual/install.texi
index 422da1447eb4dc68..eaf0cd09e7501b96 100644
--- a/manual/install.texi
+++ b/manual/install.texi
@@ -117,6 +117,15 @@ problem and suppress these constructs, so that the library will still be
usable, but functionality may be lost---for example, you can't build a
shared libc with old binutils.
+@item --with-nonshared-cflags=@var{cflags}
+Use additional compiler flags @var{cflags} to build the parts of the
+library which are always statically linked into applications and
+libraries even with shared linking (that is, the object files contained
+in @file{lib*_nonshared.a} libraries). The build process will
+automatically use the appropriate flags, but this option can be used to
+set additional flags required for building applications and libraries,
+to match local policy.
+
@c disable static doesn't work currently
@c @item --disable-static
@c Don't build static libraries. Static libraries aren't that useful these

1162
glibc.spec

File diff suppressed because it is too large Load Diff

View File

@ -1,274 +0,0 @@
#include <sys/types.h>
#include <sys/wait.h>
#include <stdio.h>
#include <errno.h>
#include <unistd.h>
#include <sys/time.h>
#include <dirent.h>
#include <stddef.h>
#include <fcntl.h>
#include <string.h>
#include <sys/stat.h>
#include <elf.h>
#define LD_SO_CONF "/etc/ld.so.conf"
#define ICONVCONFIG "/usr/sbin/iconvconfig"
#define verbose_exec(failcode, path...) \
do \
{ \
char *const arr[] = { path, NULL }; \
vexec (failcode, arr); \
} while (0)
__attribute__((noinline)) void vexec (int failcode, char *const path[]);
__attribute__((noinline)) void says (const char *str);
__attribute__((noinline)) void sayn (long num);
__attribute__((noinline)) void message (char *const path[]);
__attribute__((noinline)) int check_elf (const char *name);
int
main (void)
{
struct stat statbuf;
char initpath[256];
char buffer[4096];
struct pref {
char *p;
int len;
} prefix[] = { { "libc-", 5 }, { "libm-", 5 },
{ "librt-", 6 }, { "libpthread-", 11 },
{ "librtkaio-", 10 }, { "libthread_db-", 13 } };
int i, j, fd;
off_t base;
ssize_t ret;
/* In order to support in-place upgrades, we must immediately remove
obsolete platform directories after installing a new glibc
version. RPM only deletes files removed by updates near the end
of the transaction. If we did not remove the obsolete platform
directories here, they would be preferred by the dynamic linker
during the execution of subsequent RPM scriptlets, likely
resulting in process startup failures. */
const char *remove_dirs[] =
{
#if defined (__i386__)
"/lib/i686",
"/lib/i686/nosegneg",
#elif defined (__powerpc64__) && _CALL_ELF != 2
"/lib64/power6",
"/lib64/power7",
"/lib64/power8",
#endif
};
for (j = 0; j < sizeof (remove_dirs) / sizeof (remove_dirs[0]); ++j)
{
size_t rmlen = strlen (remove_dirs[j]);
fd = open (remove_dirs[j], O_RDONLY);
if (fd >= 0
&& (ret = getdirentries (fd, buffer, sizeof (buffer), &base))
>= (ssize_t) offsetof (struct dirent, d_name))
{
for (base = 0; base + offsetof (struct dirent, d_name) < ret; )
{
struct dirent *d = (struct dirent *) (buffer + base);
for (i = 0; i < sizeof (prefix) / sizeof (prefix[0]); i++)
if (! strncmp (d->d_name, prefix[i].p, prefix[i].len))
{
char *p = d->d_name + prefix[i].len;
while (*p == '.' || (*p >= '0' && *p <= '9')) p++;
if (p[0] == 's' && p[1] == 'o' && p[2] == '\0'
&& p + 3 - d->d_name
< sizeof (initpath) - rmlen - 1)
{
memcpy (initpath, remove_dirs[j], rmlen);
initpath[rmlen] = '/';
strcpy (initpath + rmlen + 1, d->d_name);
unlink (initpath);
break;
}
}
base += d->d_reclen;
}
close (fd);
}
}
int ldsocfd = open (LD_SO_CONF, O_RDONLY);
struct stat ldsocst;
if (ldsocfd >= 0 && fstat (ldsocfd, &ldsocst) >= 0)
{
char p[ldsocst.st_size + 1];
if (read (ldsocfd, p, ldsocst.st_size) == ldsocst.st_size)
{
p[ldsocst.st_size] = '\0';
if (strstr (p, "include ld.so.conf.d/*.conf") == NULL)
{
close (ldsocfd);
ldsocfd = open (LD_SO_CONF, O_WRONLY | O_TRUNC);
if (ldsocfd >= 0)
{
size_t slen = strlen ("include ld.so.conf.d/*.conf\n");
if (write (ldsocfd, "include ld.so.conf.d/*.conf\n", slen)
!= slen
|| write (ldsocfd, p, ldsocst.st_size) != ldsocst.st_size)
_exit (109);
}
}
}
if (ldsocfd >= 0)
close (ldsocfd);
}
/* If installing bi-arch glibc, rpm sometimes doesn't unpack all files
before running one of the lib's %post scriptlet. /sbin/ldconfig will
then be run by the other arch's %post. */
if (! access ("/sbin/ldconfig", X_OK))
verbose_exec (110, "/sbin/ldconfig", "/sbin/ldconfig");
if (! utimes (GCONV_MODULES_DIR "/gconv-modules.cache", NULL))
{
char *iconv_cache = GCONV_MODULES_DIR"/gconv-modules.cache";
char *iconv_dir = GCONV_MODULES_DIR;
verbose_exec (113, ICONVCONFIG, "/usr/sbin/iconvconfig",
"-o", iconv_cache,
"--nostdlib", iconv_dir);
}
_exit(0);
}
void
vexec (int failcode, char *const path[])
{
pid_t pid;
int status, save_errno;
int devnull = 0;
if (failcode < 0)
{
devnull = 1;
failcode = -failcode;
}
pid = vfork ();
if (pid == 0)
{
int fd;
if (devnull && (fd = open ("/dev/null", O_WRONLY)) >= 0)
{
dup2 (fd, 1);
dup2 (fd, 2);
close (fd);
}
execv (path[0], path + 1);
save_errno = errno;
message (path);
says (" exec failed with errno ");
sayn (save_errno);
says ("\n");
_exit (failcode);
}
else if (pid < 0)
{
save_errno = errno;
message (path);
says (" fork failed with errno ");
sayn (save_errno);
says ("\n");
_exit (failcode + 1);
}
if (waitpid (0, &status, 0) != pid || !WIFEXITED (status))
{
message (path);
says (" child terminated abnormally\n");
_exit (failcode + 2);
}
if (WEXITSTATUS (status))
{
message (path);
says (" child exited with exit code ");
sayn (WEXITSTATUS (status));
says ("\n");
_exit (WEXITSTATUS (status));
}
}
void
says (const char *str)
{
write (1, str, strlen (str));
}
void
sayn (long num)
{
char string[sizeof (long) * 3 + 1];
char *p = string + sizeof (string) - 1;
*p = '\0';
if (num == 0)
*--p = '0';
else
while (num)
{
*--p = '0' + num % 10;
num = num / 10;
}
says (p);
}
void
message (char *const path[])
{
says ("/usr/sbin/glibc_post_upgrade: While trying to execute ");
says (path[0]);
}
int
check_elf (const char *name)
{
/* Play safe, if we can't open or read, assume it might be
ELF for the current arch. */
int ret = 1;
int fd = open (name, O_RDONLY);
if (fd >= 0)
{
Elf32_Ehdr ehdr;
if (read (fd, &ehdr, offsetof (Elf32_Ehdr, e_version))
== offsetof (Elf32_Ehdr, e_version))
{
ret = 0;
if (ehdr.e_ident[EI_CLASS]
== (sizeof (long) == 8 ? ELFCLASS64 : ELFCLASS32))
{
#if defined __i386__
ret = ehdr.e_machine == EM_386;
#elif defined __x86_64__
ret = ehdr.e_machine == EM_X86_64;
#elif defined __powerpc64__
ret = ehdr.e_machine == EM_PPC64;
#elif defined __powerpc__
ret = ehdr.e_machine == EM_PPC;
#elif defined __s390__ || defined __s390x__
ret = ehdr.e_machine == EM_S390;
#elif defined __x86_64__
ret = ehdr.e_machine == EM_X86_64;
#elif defined __sparc__
if (sizeof (long) == 8)
ret = ehdr.e_machine == EM_SPARCV9;
else
ret = (ehdr.e_machine == EM_SPARC
|| ehdr.e_machine == EM_SPARC32PLUS);
#else
ret = 1;
#endif
}
}
close (fd);
}
return ret;
}

View File

@ -1,56 +0,0 @@
#
# /etc/nsswitch.conf
#
# An example Name Service Switch config file. This file should be
# sorted with the most-used services at the beginning.
#
# The entry '[NOTFOUND=return]' means that the search for an
# entry should stop if the search in the previous entry turned
# up nothing. Note that if the search failed due to some other reason
# (like no NIS server responding) then the search continues with the
# next entry.
#
# Valid entries include:
#
# nisplus Use NIS+ (NIS version 3)
# nis Use NIS (NIS version 2), also called YP
# dns Use DNS (Domain Name Service)
# files Use the local files in /etc
# db Use the pre-processed /var/db files
# compat Use /etc files plus *_compat pseudo-databases
# hesiod Use Hesiod (DNS) for user lookups
# sss Use sssd (System Security Services Daemon)
# [NOTFOUND=return] Stop searching if not found so far
#
# 'sssd' performs its own 'files'-based caching, so it should
# generally come before 'files'.
# To use 'db', install the nss_db package, and put the 'db' in front
# of 'files' for entries you want to be looked up first in the
# databases, like this:
#
# passwd: db files
# shadow: db files
# group: db files
passwd: sss files
shadow: files sss
group: sss files
hosts: files dns myhostname
bootparams: files
ethers: files
netmasks: files
networks: files
protocols: files
rpc: files
services: files sss
netgroup: sss
publickey: files
automount: files sss
aliases: files

View File

@ -1 +1 @@
SHA512 (glibc-2.28.tar.xz) = 521f820953ff07c69ece4c2186f59fc061a7f9747932cd70ef2995c2b2deee76eeb6de700d85071cdca5949179aa8ccee75eda7feca1394121ec7b821ad0a3f3
SHA512 (glibc-2.30.9000-100-g1a6566094d.tar.xz) = e6054a8f1367fde262f023c76f7eaf5ce588613c4894b8d577c7e1c3159a2dfcefb7c60e301340b823cd8e6d2f8d264d7da83e61034b9180836d392d5db4c5ba