]> git.ipfire.org Git - thirdparty/glibc.git/log
thirdparty/glibc.git
6 years agopowerpc: Replace lxvd2x/stxvd2x with lvx/stvx in P7's memcpy/memmove
Rajalakshmi Srinivasaraghavan [Wed, 25 Oct 2017 15:13:53 +0000 (13:13 -0200)] 
powerpc: Replace lxvd2x/stxvd2x with lvx/stvx in P7's memcpy/memmove

POWER9 DD2.1 and earlier has an issue where some cache inhibited
vector load traps to the kernel, causing a performance degradation.  To
handle this in memcpy and memmove, lvx/stvx is used for aligned
addresses instead of lxvd2x/stxvd2x.

Reference: https://patchwork.ozlabs.org/patch/814059/

* sysdeps/powerpc/powerpc64/power7/memcpy.S: Replace
lxvd2x/stxvd2x with lvx/stvx.
* sysdeps/powerpc/powerpc64/power7/memmove.S: Likewise.

Reviewed-by: Tulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
6 years agoReplace "if if " with "if " in comments
H.J. Lu [Wed, 25 Oct 2017 15:05:51 +0000 (08:05 -0700)] 
Replace "if if " with "if " in comments

* include/alloc_buffer.h: Replace "if if " with "if " in
comments.
* sysdeps/mips/memcpy.S: Likkewise.
* sysdeps/mips/memset.S: Likewise.
* sysdeps/x86_64/fpu/multiarch/svml_s_sincosf16_core_avx512.S:
Likewise.
* sysdeps/x86_64/fpu/multiarch/svml_s_sincosf4_core_sse4.S:
Likewise.
* sysdeps/x86_64/fpu/multiarch/svml_s_sincosf8_core_avx2.S:
Likewise.

6 years agoCJK locales: Add fullwidth yYnN to yesexpr and noexpr [BZ #15261]
Mike FABIAN [Wed, 25 Oct 2017 11:47:59 +0000 (13:47 +0200)] 
CJK locales: Add fullwidth yYnN to yesexpr and noexpr [BZ #15261]

[BZ #15261]
* localedata/locales/cmn_TW (LC_MESSAGES): Add fullwidth yYnN to
yesexpr and noexpr.
* localedata/locales/hak_TW (LC_MESSAGES): Likewise.
* localedata/locales/ko_KR (LC_MESSAGES): Likewise.
* localedata/locales/lzh_TW (LC_MESSAGES): Likewise.
* localedata/locales/nan_TW (LC_MESSAGES): Likewise.
* localedata/locales/zh_CN (LC_MESSAGES): Likewise.
* localedata/locales/zh_HK (LC_MESSAGES): Likewise.
* localedata/locales/zh_TW (LC_MESSAGES): Likewise.

6 years agoSync LC_MESSAGES of several locales with CLDR
Mike FABIAN [Wed, 25 Oct 2017 11:28:31 +0000 (13:28 +0200)] 
Sync LC_MESSAGES of several locales with CLDR

* localedata/locales/am_ET (LC_MESSAGES): Sync with CLDR.
* localedata/locales/az_AZ (LC_MESSAGES): Likewise.
* localedata/locales/el_GR (LC_MESSAGES): Likewise.
* localedata/locales/ha_NG (LC_MESSAGES): Likewise.
* localedata/locales/ln_CD (LC_MESSAGES): Likewise.
* localedata/locales/mfe_MU (LC_MESSAGES): Likewise.
* localedata/locales/ml_IN (LC_MESSAGES): Likewise.
* localedata/locales/mt_MT (LC_MESSAGES): Likewise.
* localedata/locales/os_RU (LC_MESSAGES): Likewise.
* localedata/locales/tg_TJ (LC_MESSAGES): Likewise.
* localedata/locales/tt_RU (LC_MESSAGES): Likewise.
* localedata/locales/wo_SN (LC_MESSAGES): Likewise.

6 years agoUse ASCII as much as possible in LC_MESSAGES of all locales to improve readability...
Mike FABIAN [Wed, 25 Oct 2017 08:47:23 +0000 (10:47 +0200)] 
Use ASCII as much as possible in LC_MESSAGES of all locales to improve readability of the source

* localedata/locales/aa_ET (LC_MESSAGES): Use ASCII as much
as possible for better readability of the source.
* localedata/locales/af_ZA (LC_MESSAGES): Likewise.
* localedata/locales/ak_GH (LC_MESSAGES): Likewise.
* localedata/locales/am_ET (LC_MESSAGES): Likewise.
* localedata/locales/anp_IN (LC_MESSAGES): Likewise.
* localedata/locales/ar_EG (LC_MESSAGES): Likewise.
* localedata/locales/as_IN (LC_MESSAGES): Likewise.
* localedata/locales/ast_ES (LC_MESSAGES): Likewise.
* localedata/locales/ayc_PE (LC_MESSAGES): Likewise.
* localedata/locales/az_AZ (LC_MESSAGES): Likewise.
* localedata/locales/az_IR (LC_MESSAGES): Likewise.
* localedata/locales/be_BY (LC_MESSAGES): Likewise.
* localedata/locales/be_BY@latin (LC_MESSAGES): Likewise.
* localedata/locales/bem_ZM (LC_MESSAGES): Likewise.
* localedata/locales/ber_MA (LC_MESSAGES): Likewise.
* localedata/locales/bg_BG (LC_MESSAGES): Likewise.
* localedata/locales/bhb_IN (LC_MESSAGES): Likewise.
* localedata/locales/bi_VU (LC_MESSAGES): Likewise.
* localedata/locales/bo_CN (LC_MESSAGES): Likewise.
* localedata/locales/br_FR (LC_MESSAGES): Likewise.
* localedata/locales/bs_BA (LC_MESSAGES): Likewise.
* localedata/locales/ca_ES (LC_MESSAGES): Likewise.
* localedata/locales/ce_RU (LC_MESSAGES): Likewise.
* localedata/locales/crh_UA (LC_MESSAGES): Likewise.
* localedata/locales/cs_CZ (LC_MESSAGES): Likewise.
* localedata/locales/csb_PL (LC_MESSAGES): Likewise.
* localedata/locales/cv_RU (LC_MESSAGES): Likewise.
* localedata/locales/cy_GB (LC_MESSAGES): Likewise.
* localedata/locales/da_DK (LC_MESSAGES): Likewise.
* localedata/locales/de_DE (LC_MESSAGES): Likewise.
* localedata/locales/dv_MV (LC_MESSAGES): Likewise.
* localedata/locales/dz_BT (LC_MESSAGES): Likewise.
* localedata/locales/el_GR (LC_MESSAGES): Likewise.
* localedata/locales/en_CA (LC_MESSAGES): Likewise.
* localedata/locales/en_US (LC_MESSAGES): Likewise.
* localedata/locales/es_ES (LC_MESSAGES): Likewise.
* localedata/locales/et_EE (LC_MESSAGES): Likewise.
* localedata/locales/eu_ES (LC_MESSAGES): Likewise.
* localedata/locales/fa_IR (LC_MESSAGES): Likewise.
* localedata/locales/ff_SN (LC_MESSAGES): Likewise.
* localedata/locales/fi_FI (LC_MESSAGES): Likewise.
* localedata/locales/fil_PH (LC_MESSAGES): Likewise.
* localedata/locales/fo_FO (LC_MESSAGES): Likewise.
* localedata/locales/fr_BE (LC_MESSAGES): Likewise.
* localedata/locales/fr_CH (LC_MESSAGES): Likewise.
* localedata/locales/fr_FR (LC_MESSAGES): Likewise.
* localedata/locales/fr_LU (LC_MESSAGES): Likewise.
* localedata/locales/fur_IT (LC_MESSAGES): Likewise.
* localedata/locales/fy_DE (LC_MESSAGES): Likewise.
* localedata/locales/ga_IE (LC_MESSAGES): Likewise.
* localedata/locales/gd_GB (LC_MESSAGES): Likewise.
* localedata/locales/gl_ES (LC_MESSAGES): Likewise.
* localedata/locales/gu_IN (LC_MESSAGES): Likewise.
* localedata/locales/gv_GB (LC_MESSAGES): Likewise.
* localedata/locales/ha_NG (LC_MESSAGES): Likewise.
* localedata/locales/hak_TW (LC_MESSAGES): Likewise.
* localedata/locales/he_IL (LC_MESSAGES): Likewise.
* localedata/locales/hif_FJ (LC_MESSAGES): Likewise.
* localedata/locales/hne_IN (LC_MESSAGES): Likewise.
* localedata/locales/hr_HR (LC_MESSAGES): Likewise.
* localedata/locales/hsb_DE (LC_MESSAGES): Likewise.
* localedata/locales/ht_HT (LC_MESSAGES): Likewise.
* localedata/locales/hu_HU (LC_MESSAGES): Likewise.
* localedata/locales/hy_AM (LC_MESSAGES): Likewise.
* localedata/locales/ia_FR (LC_MESSAGES): Likewise.
* localedata/locales/id_ID (LC_MESSAGES): Likewise.
* localedata/locales/ig_NG (LC_MESSAGES): Likewise.
* localedata/locales/ik_CA (LC_MESSAGES): Likewise.
* localedata/locales/is_IS (LC_MESSAGES): Likewise.
* localedata/locales/it_CH (LC_MESSAGES): Likewise.
* localedata/locales/it_IT (LC_MESSAGES): Likewise.
* localedata/locales/iu_CA (LC_MESSAGES): Likewise.
* localedata/locales/ja_JP (LC_MESSAGES): Likewise.
* localedata/locales/kk_KZ (LC_MESSAGES): Likewise.
* localedata/locales/kl_GL (LC_MESSAGES): Likewise.
* localedata/locales/ko_KR (LC_MESSAGES): Likewise.
* localedata/locales/ks_IN (LC_MESSAGES): Likewise.
* localedata/locales/ku_TR (LC_MESSAGES): Likewise.
* localedata/locales/kw_GB (LC_MESSAGES): Likewise.
* localedata/locales/ky_KG (LC_MESSAGES): Likewise.
* localedata/locales/lb_LU (LC_MESSAGES): Likewise.
* localedata/locales/lg_UG (LC_MESSAGES): Likewise.
* localedata/locales/li_NL (LC_MESSAGES): Likewise.
* localedata/locales/lij_IT (LC_MESSAGES): Likewise.
* localedata/locales/ln_CD (LC_MESSAGES): Likewise.
* localedata/locales/lo_LA (LC_MESSAGES): Likewise.
* localedata/locales/lt_LT (LC_MESSAGES): Likewise.
* localedata/locales/lv_LV (LC_MESSAGES): Likewise.
* localedata/locales/lzh_TW (LC_MESSAGES): Likewise.
* localedata/locales/mg_MG (LC_MESSAGES): Likewise.
* localedata/locales/mhr_RU (LC_MESSAGES): Likewise.
* localedata/locales/mi_NZ (LC_MESSAGES): Likewise.
* localedata/locales/mk_MK (LC_MESSAGES): Likewise.
* localedata/locales/ml_IN (LC_MESSAGES): Likewise.
* localedata/locales/mn_MN (LC_MESSAGES): Likewise.
* localedata/locales/ms_MY (LC_MESSAGES): Likewise.
* localedata/locales/mt_MT (LC_MESSAGES): Likewise.
* localedata/locales/my_MM (LC_MESSAGES): Likewise.
* localedata/locales/nan_TW (LC_MESSAGES): Likewise.
* localedata/locales/nan_TW@latin (LC_MESSAGES): Likewise.
* localedata/locales/nb_NO (LC_MESSAGES): Likewise.
* localedata/locales/nds_DE (LC_MESSAGES): Likewise.
* localedata/locales/nds_NL (LC_MESSAGES): Likewise.
* localedata/locales/ne_NP (LC_MESSAGES): Likewise.
* localedata/locales/nhn_MX (LC_MESSAGES): Likewise.
* localedata/locales/niu_NU (LC_MESSAGES): Likewise.
* localedata/locales/nl_NL (LC_MESSAGES): Likewise.
* localedata/locales/nn_NO (LC_MESSAGES): Likewise.
* localedata/locales/nr_ZA (LC_MESSAGES): Likewise.
* localedata/locales/nso_ZA (LC_MESSAGES): Likewise.
* localedata/locales/oc_FR (LC_MESSAGES): Likewise.
* localedata/locales/om_ET (LC_MESSAGES): Likewise.
* localedata/locales/or_IN (LC_MESSAGES): Likewise.
* localedata/locales/os_RU (LC_MESSAGES): Likewise.
* localedata/locales/pa_IN (LC_MESSAGES): Likewise.
* localedata/locales/pa_PK (LC_MESSAGES): Likewise.
* localedata/locales/pap_AW (LC_MESSAGES): Likewise.
* localedata/locales/pap_CW (LC_MESSAGES): Likewise.
* localedata/locales/pl_PL (LC_MESSAGES): Likewise.
* localedata/locales/ps_AF (LC_MESSAGES): Likewise.
* localedata/locales/pt_BR (LC_MESSAGES): Likewise.
* localedata/locales/quz_PE (LC_MESSAGES): Likewise.
* localedata/locales/raj_IN (LC_MESSAGES): Likewise.
* localedata/locales/ro_RO (LC_MESSAGES): Likewise.
* localedata/locales/ru_RU (LC_MESSAGES): Likewise.
* localedata/locales/ru_UA (LC_MESSAGES): Likewise.
* localedata/locales/rw_RW (LC_MESSAGES): Likewise.
* localedata/locales/sa_IN (LC_MESSAGES): Likewise.
* localedata/locales/sc_IT (LC_MESSAGES): Likewise.
* localedata/locales/sd_IN@devanagari (LC_MESSAGES): Likewise.
* localedata/locales/se_NO (LC_MESSAGES): Likewise.
* localedata/locales/sgs_LT (LC_MESSAGES): Likewise.
* localedata/locales/si_LK (LC_MESSAGES): Likewise.
* localedata/locales/sk_SK (LC_MESSAGES): Likewise.
* localedata/locales/sl_SI (LC_MESSAGES): Likewise.
* localedata/locales/sm_WS (LC_MESSAGES): Likewise.
* localedata/locales/so_DJ (LC_MESSAGES): Likewise.
* localedata/locales/sq_AL (LC_MESSAGES): Likewise.
* localedata/locales/sr_RS (LC_MESSAGES): Likewise.
* localedata/locales/sr_RS@latin (LC_MESSAGES): Likewise.
* localedata/locales/ss_ZA (LC_MESSAGES): Likewise.
* localedata/locales/st_ZA (LC_MESSAGES): Likewise.
* localedata/locales/sv_SE (LC_MESSAGES): Likewise.
* localedata/locales/sw_KE (LC_MESSAGES): Likewise.
* localedata/locales/szl_PL (LC_MESSAGES): Likewise.
* localedata/locales/tcy_IN (LC_MESSAGES): Likewise.
* localedata/locales/tg_TJ (LC_MESSAGES): Likewise.
* localedata/locales/th_TH (LC_MESSAGES): Likewise.
* localedata/locales/the_NP (LC_MESSAGES): Likewise.
* localedata/locales/ti_ER (LC_MESSAGES): Likewise.
* localedata/locales/tk_TM (LC_MESSAGES): Likewise.
* localedata/locales/tn_ZA (LC_MESSAGES): Likewise.
* localedata/locales/to_TO (LC_MESSAGES): Likewise.
* localedata/locales/tr_TR (LC_MESSAGES): Likewise.
* localedata/locales/ts_ZA (LC_MESSAGES): Likewise.
* localedata/locales/tt_RU (LC_MESSAGES): Likewise.
* localedata/locales/tt_RU@iqtelif (LC_MESSAGES): Likewise.
* localedata/locales/uk_UA (LC_MESSAGES): Likewise.
* localedata/locales/unm_US (LC_MESSAGES): Likewise.
* localedata/locales/ur_IN (LC_MESSAGES): Likewise.
* localedata/locales/ur_PK (LC_MESSAGES): Likewise.
* localedata/locales/uz_UZ (LC_MESSAGES): Likewise.
* localedata/locales/uz_UZ@cyrillic (LC_MESSAGES): Likewise.
* localedata/locales/ve_ZA (LC_MESSAGES): Likewise.
* localedata/locales/vi_VN (LC_MESSAGES): Likewise.
* localedata/locales/wa_BE (LC_MESSAGES): Likewise.
* localedata/locales/wo_SN (LC_MESSAGES): Likewise.
* localedata/locales/xh_ZA (LC_MESSAGES): Likewise.
* localedata/locales/yi_US (LC_MESSAGES): Likewise.
* localedata/locales/yo_NG (LC_MESSAGES): Likewise.
* localedata/locales/yue_HK (LC_MESSAGES): Likewise.
* localedata/locales/zh_CN (LC_MESSAGES): Likewise.
* localedata/locales/zh_HK (LC_MESSAGES): Likewise.
* localedata/locales/zh_TW (LC_MESSAGES): Likewise.
* localedata/locales/zu_ZA (LC_MESSAGES): Likewise.

6 years agobrx_IN locale: Fix yesexpr and noexpr
Mike FABIAN [Wed, 25 Oct 2017 08:40:20 +0000 (10:40 +0200)] 
brx_IN locale: Fix yesexpr and noexpr

* localedata/locales/brx_IN (LC_MESSAGES): Fix yesexpr and noexpr
(Use first letters of yesstr and nostr correctly instead of using
full words).

6 years agota_IN locale: Fix yesexpr and noexpr
Mike FABIAN [Wed, 25 Oct 2017 08:35:19 +0000 (10:35 +0200)] 
ta_IN locale: Fix yesexpr and noexpr

* localedata/locales/ta_IN (LC_MESSAGES): Fix yesexpr and noexpr
(Use first letters of yesstr and nostr correctly).

6 years agohi_IN, kn_IN, ks_IN@devanagari locales: In yesexpr and noexpr, also check for the...
Mike FABIAN [Wed, 25 Oct 2017 08:06:31 +0000 (10:06 +0200)] 
hi_IN, kn_IN, ks_IN@devanagari locales:  In yesexpr and noexpr, also check for the first characters of yesstr and nostr

* localedata/locales/hi_IN (LC_MESSAGES): In yesexpr and noexpr,
also check for the first characters of yesstr and nostr.
* localedata/locales/kn_IN (LC_MESSAGES): Likewise.
* localedata/locales/ks_IN@devanagari (LC_MESSAGES): Likewise.

6 years agocmn_TW locale: Improve yesexpr and noexpr
Mike FABIAN [Wed, 25 Oct 2017 07:58:59 +0000 (09:58 +0200)] 
cmn_TW locale: Improve yesexpr and noexpr

* localedata/locales/cmn_TW (LC_MESSAGES): In yesexpr and noexpr,
also check for Chinese characters.

6 years agochr_US locale: Fix yesexpr and noexpr
Mike FABIAN [Wed, 25 Oct 2017 07:56:21 +0000 (09:56 +0200)] 
chr_US locale: Fix yesexpr and noexpr

* localedata/locales/chr_US (LC_MESSAGES): In yesexpr and noexpr,
match also for the contents of yesstr and nostr. As the first letter
of yesstr and nostr is equal, checking only for the first letter
is not enough.

6 years agober_DZ locale: Use copy “"kab_DZ"” in LC_MESSAGES.
Mike FABIAN [Wed, 25 Oct 2017 07:31:26 +0000 (09:31 +0200)] 
ber_DZ locale: Use copy “"kab_DZ"” in LC_MESSAGES.

* localedata/locales/ber_DZ (LC_MESSAGES): Use copy "kab_DZ",
it is the same according to  Belkacem Mohammed <belkacem77@gmail.com>.

6 years agokab_DZ locale: Add e-mail of main contributor
Mike FABIAN [Wed, 25 Oct 2017 07:25:11 +0000 (09:25 +0200)] 
kab_DZ locale: Add e-mail of main contributor

* localedata/locales/kab_DZ (LC_IDENTIFICATION): Add e-mail
of main contributor.

6 years agozh_SG locale: Use copy "zh_CN" in LC_MESSAGES instead of English
Mike FABIAN [Wed, 25 Oct 2017 07:15:33 +0000 (09:15 +0200)] 
zh_SG locale: Use copy "zh_CN" in LC_MESSAGES instead of English

* localedata/locales/zh_SG (LC_MESSAGES): Use copy "zh_CN"
instead of using English.

6 years agoug_CN locale: Fix noexpr and yesexpr
Mike FABIAN [Wed, 25 Oct 2017 06:34:21 +0000 (08:34 +0200)] 
ug_CN locale: Fix noexpr and yesexpr

* localedata/locales/ug_CN (LC_MESSAGES): Fix noexpr and yesexpr
by including the first letters of nostr and yesexpr in the regexp.
Also make it more readable by using ASCII where possible.

6 years agoti_IN locale: Fix noexpr
Mike FABIAN [Wed, 25 Oct 2017 06:17:24 +0000 (08:17 +0200)] 
ti_IN locale: Fix noexpr

* localedata/locales/te_IN (LC_MESSAGES): Fix noexpr by including
the first letter of nostr in the regexp. It agrees with CLDR now.
Also make it more readable by using ASCII where possible.

6 years agokm_KH locale: Fix yesstr and nostr.
Mike FABIAN [Tue, 24 Oct 2017 14:37:36 +0000 (16:37 +0200)] 
km_KH locale: Fix yesstr and nostr.

* localedata/locales/km_KH (LC_MESSAGES): Fix yestr and nostr.
The yesstr and nostr apparently came from CLDR. And CLDR has a bug there:
these strings contain a U+17D6 (which somewhat looks like a colon)
instead of a real colon to separate the full words for “yes”
and “no” from the single letter responses.

6 years agoka_GE locale: Fix yesexp to make it agree with CLDR.
Mike FABIAN [Tue, 24 Oct 2017 14:20:55 +0000 (16:20 +0200)] 
ka_GE locale: Fix yesexp to make it agree with CLDR.

* localedata/locales/ka_GE (LC_MESSAGES): Fix yesexp to make
it agree with CLDR (include the first letter of yesstr).
Also make it more readable by using ASCII where possible.

6 years agomr_IN locale: Fix yesstr and nostr and improve yesexpr and noexpr.
Mike FABIAN [Tue, 24 Oct 2017 12:06:05 +0000 (14:06 +0200)] 
mr_IN locale: Fix yesstr and nostr and improve yesexpr and noexpr.

* localedata/locales/mr_IN (LC_MESSAGES): Fix yesstr and nostr
and improve yesexpr and noexpr. The yesstr and nostr apparently
came from CLDR. And CLDR has a bug there: these strings contain
a U+0903 (which looks like a colon) instead of a real colon
to separate the full words for “yes” and “no” from the single
letter responses.

6 years agobn_BD locale: Use only the first letters of the full yesstr and nostr in yesexpr...
Mike FABIAN [Tue, 24 Oct 2017 09:56:18 +0000 (11:56 +0200)] 
bn_BD locale: Use only the first letters of the full yesstr and nostr in yesexpr and noexpr

Using all characters of the full words for yes and no in yesexpr and noexpr
makes no sense here, especially not because the words for yes and no
share one character.

* localedata/locales/bn_BD (LC_MESSAGES): Use only the first
letters of the full yesstr and nostr in yesexpr and noexpr.

6 years agoAdd yesstr, nostr, lang_term, lang_lib to an_ES locale
Mike FABIAN [Tue, 24 Oct 2017 07:07:18 +0000 (09:07 +0200)] 
Add yesstr, nostr, lang_term, lang_lib to an_ES locale

* localedata/locales/an_ES (LC_MESSAGES): Add yesstr and nostr.
* localedata/locales/an_ES (LC_ADDRESS): Add lang_term and lang_lib.
* localedata/locales/an_ES: Make source more readable by using ASCII
where possible.

6 years agoAdd new locale yuw_PG [BZ #20952]
Mike FABIAN [Mon, 23 Oct 2017 17:03:23 +0000 (19:03 +0200)] 
Add new locale yuw_PG [BZ #20952]

[BZ #20952]
* localedata/locales/yuw_PG: New file.
* localedata/SUPPORTED: Add yuw_PG/UTF-8.
* locale/iso-639.def: Add Yau (Uruwa).

6 years agoAdd single-threaded path to _int_malloc
Wilco Dijkstra [Tue, 24 Oct 2017 11:43:05 +0000 (12:43 +0100)] 
Add single-threaded path to _int_malloc

This patch adds single-threaded fast paths to _int_malloc.

* malloc/malloc.c (_int_malloc): Add SINGLE_THREAD_P path.

6 years agoAdd single-threaded path to malloc/realloc/calloc/memalloc
Wilco Dijkstra [Tue, 24 Oct 2017 11:39:24 +0000 (12:39 +0100)] 
Add single-threaded path to malloc/realloc/calloc/memalloc

This patch adds a single-threaded fast path to malloc, realloc,
calloc and memalloc.  When we're single-threaded, we can bypass
arena_get (which always locks the arena it returns) and just use
the main arena.  Also avoid retrying a different arena since
there is just the main arena.

* malloc/malloc.c (__libc_malloc): Add SINGLE_THREAD_P path.
(__libc_realloc): Likewise.
(_mid_memalign): Likewise.
(__libc_calloc): Likewise.

6 years agoFixes for tpi_PG locale
Mike FABIAN [Mon, 23 Oct 2017 17:19:21 +0000 (19:19 +0200)] 
Fixes for tpi_PG locale

* localedata/locales/tpi_PG (LC_MESSAGES): Fix yesexpr and noexpr
by adding the generic +1 and -0 as in all other locales.
* localedata/locales/tpi_PG (LC_TIME): Fix some typos in the month and
day names and make it more readable by using ASCII where possible.

6 years agoUpdate x86 fix-fp-int-compare-invalid.h for GCC 8.
Joseph Myers [Tue, 24 Oct 2017 00:33:08 +0000 (00:33 +0000)] 
Update x86 fix-fp-int-compare-invalid.h for GCC 8.

The glibc implementation of iseqsig relies on ordered comparison
operators raising the "invalid" exception for quiet NaN operands, with
a workaround on platforms where a GCC bug means that exception is not
raised.  For x86, that bug has now been fixed for GCC 8, so this patch
disables the workaround in that case.  If and when the corresponding
bugs for powerpc and s390 are fixed, the headers for those platforms
should of course be updated similarly.

Tested for x86_64 and x86, including with GCC mainline.  Note that
other failures appear with GCC mainline because of spurious use of
ordered comparison instructions for unordered operations
<https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82692>.

* sysdeps/x86/fpu/fix-fp-int-compare-invalid.h
(FIX_COMPARE_INVALID): Define to 0 if [__GNUC_PREREQ (8, 0)].

6 years agoposix: Do not use WNOHANG in waitpid call for Linux posix_spawn
Adhemerval Zanella [Sat, 21 Oct 2017 13:33:27 +0000 (11:33 -0200)] 
posix: Do not use WNOHANG in waitpid call for Linux posix_spawn

As shown in some buildbot issues on aarch64 and powerpc, calling
clone (VFORK) and waitpid (WNOHANG) does not guarantee the child
is ready to be collected.  This patch changes the call back to 0
as before fe05e1cb6d64 fix.

This change can lead to the scenario 4.3 described in the commit,
where the waitpid call can hang undefinitely on the call.  However
this is also a very unlikely and also undefinied situation where
both the caller is trying to terminate a pid before posix_spawn
returns and the race pid reuse is triggered.  I don't see how to
correct handle this specific situation within posix_spawn.

Checked on x86_64-linux-gnu, aarch64-linux-gnu and
powerpc64-linux-gnu.

* sysdeps/unix/sysv/linux/spawni.c (__spawnix): Use 0 instead of
WNOHANG in waitpid call.

6 years agoaarch64: Document _SC_LEVEL1_DCACHE_LINESIZE caveat
Siddhesh Poyarekar [Mon, 23 Oct 2017 14:52:42 +0000 (20:22 +0530)] 
aarch64: Document _SC_LEVEL1_DCACHE_LINESIZE caveat

The _SC_LEVEL1_DCACHE_LINESIZE is reported using the contents of the
ctr_el0 register, which tells us the minimum observable cache line
size by userspace.  This typically is the same as the L1 cache line
size, but that may not always be true.  It could be a higher level
cache line size as long as cache cleaning and invalidation work
correctly with that line size in userspace.  The falkor core for
example reports the L2 line size as the dcache line size in CTR_EL0
while also reporting the correct L1 dcache line size via CCSIDR_EL1.

* manual/conf.texi (_SC_LEVEL1_DCACHE_LINESIZE,
_SC_LEVEL1_ICACHE_LINESIZE): Document aarch64 caveat.

Reviewed-by: Rical Jasan <ricaljasan@pacific.net>
Reviewed-by: Szabolcs Nagy <szabolcs.nagy@arm.com>
6 years agoDocument cache information sysconf variables
Siddhesh Poyarekar [Mon, 23 Oct 2017 14:49:34 +0000 (20:19 +0530)] 
Document cache information sysconf variables

Write short descriptions for each of the cache information sysconf
variables.

* manual/conf.texi (_SC_LEVEL1_ICACHE_SIZE,
_SC_LEVEL1_ICACHE_ASSOC, _SC_LEVEL1_ICACHE_LINESIZE,
_SC_LEVEL1_DCACHE_SIZE, _SC_LEVEL1_DCACHE_ASSOC,
_SC_LEVEL1_DCACHE_LINESIZE, _SC_LEVEL2_CACHE_SIZE,
_SC_LEVEL2_CACHE_ASSOC, _SC_LEVEL2_CACHE_LINESIZE,
_SC_LEVEL3_CACHE_SIZE, _SC_LEVEL3_CACHE_ASSOC,
_SC_LEVEL3_CACHE_LINESIZE, _SC_LEVEL4_CACHE_SIZE,
_SC_LEVEL4_CACHE_ASSOC, _SC_LEVEL4_CACHE_LINESIZE): New
variables.

Reviewed-by: Rical Jasan <ricaljasan@pacific.net>
6 years agoaarch64: Add missing math Makefile for recent commit
Szabolcs Nagy [Mon, 23 Oct 2017 14:31:37 +0000 (15:31 +0100)] 
aarch64: Add missing math Makefile for recent commit

Without -fno-math-errno, the builtins just do a call instead of
inlining a single instruction.

6 years agoaarch64: Implement math acceleration via builtins
Michael Collison [Mon, 23 Oct 2017 09:28:01 +0000 (10:28 +0100)] 
aarch64: Implement math acceleration via builtins

This patch converts asm statements into builtins for AArch64.  As an
example for the file sysdeps/aarch64/fpu/s_ceil.c, we convert the
function from

double
__ceil (double x)
{
  double result;
  asm ("frintp\t%d0, %d1" :
       "=w" (result) : "w" (x) );
  return result;
}

into

double
__ceil (double x)
{
  return __builtin_ceil (x);
}

Tested on aarch64-linux-gnu with gcc-4.9.4 and gcc-6.

* sysdeps/aarch64/fpu/e_sqrt.c (ieee754_sqrt): Replace asm statements
with __builtin_sqrt.
* sysdeps/aarch64/fpu/e_sqrtf.c (ieee754_sqrtf): Replace asm statements
with __builtin_sqrtf.
* sysdeps/aarch64/fpu/s_ceil.c (__ceil): Replace asm statements
with __builtin_ceil.
* sysdeps/aarch64/fpu/s_ceilf.c (__ceilf): Replace asm statements
with __builtin_ceilf.
* sysdeps/aarch64/fpu/s_floor.c (__floor): Replace asm statements
with __builtin_floor.
* sysdeps/aarch64/fpu/s_floorf.c (__floorf): Replace asm statements
with __builtin_floorf.
* sysdeps/aarch64/fpu/s_fma.c (__fma): Replace asm statements
with __builtin_fma.
* sysdeps/aarch64/fpu/s_fmaf.c (__fmaf): Replace asm statements
with __builtin_fmaf.
* sysdeps/aarch64/fpu/s_fmax.c (__fmax): Replace asm statements
with __builtin_fmax.
* sysdeps/aarch64/fpu/s_fmaxf.c (__fmaxf): Replace asm statements
with __builtin_fmaxf.
* sysdeps/aarch64/fpu/s_fmin.c (__fmin): Replace asm statements
with __builtin_fmin.
* sysdeps/aarch64/fpu/s_fminf.c (__fminf): Replace asm statements
with __builtin_fminf.
* sysdeps/aarch64/fpu/s_frint.c: Delete file.
* sysdeps/aarch64/fpu/s_frintf.c: Delete file.
* sysdeps/aarch64/fpu/s_llrint.c (__llrint): Replace asm statements
with builtin_rint and conversion to int.
* sysdeps/aarch64/fpu/s_llrintf.c (__llrintf): Likewise.
* sysdeps/aarch64/fpu/s_llround.c (__llround): Replace asm statements
with builtin_llround.
* sysdeps/aarch64/fpu/s_llroundf.c (__llroundf): Likewise.
* sysdeps/aarch64/fpu/s_lrint.c (__lrint): Replace asm statements
with builtin_rint and conversion to long int.
* sysdeps/aarch64/fpu/s_lrintf.c (__lrintf): Likewise.
* sysdeps/aarch64/fpu/s_lround.c (__lround): Replace asm statements
with builtin_lround.
* sysdeps/aarch64/fpu/s_lroundf.c (__lroundf): Replace asm statements
with builtin_lroundf.
* sysdeps/aarch64/fpu/s_nearbyint.c (__nearbyint): Replace asm
statements with __builtin_nearbyint.
* sysdeps/aarch64/fpu/s_nearbyintf.c (__nearbyintf): Replace asm
statements with __builtin_nearbyintf.
* sysdeps/aarch64/fpu/s_rint.c (__rint): Replace asm statements
with __builtin_rint.
* sysdeps/aarch64/fpu/s_rintf.c (__rintf): Replace asm statements
with __builtin_rintf.
* sysdeps/aarch64/fpu/s_round.c (__round): Replace asm statements
with __builtin_round.
* sysdeps/aarch64/fpu/s_roundf.c (__roundf): Replace asm statements
with __builtin_roundf.
* sysdeps/aarch64/fpu/s_trunc.c (__trunc): Replace asm statements
with __builtin_trunc.
* sysdeps/aarch64/fpu/s_truncf.c (__truncf): Replace asm statements
with __builtin_truncf.
* sysdeps/aarch64/fpu/Makefile: Build e_sqrt[f].c with -fno-math-errno.

6 years agoPowerPC64 power8 strncpy cfi fixes
Alan Modra [Sun, 22 Oct 2017 21:14:50 +0000 (07:44 +1030)] 
PowerPC64 power8 strncpy cfi fixes

cfi info for stack adjust needs to be on the insn doing the adjust.
cfi describing register saves can be anywhere after the save insn but
before the reg is altered.  Fewer locations with cfi result in smaller
cfi programs and possibly slightly faster exception handling.  Thus
the LR cfi_offset move.

The idea behind ajusting sp after restoring regs is to break a
register dependency chain, in this case not be using r1 immediately
after it is modified.

The missing LR cfi_restore meant that code after the blr,
unaligned_lt_16 and other labels, would have cfi that said LR was at
cfa+16, but that code is reached without LR being saved.

* sysdeps/powerpc/powerpc64/power8/strncpy.S: Move LR cfi.
Adjust stack after restoring regs.  Add missing LR cfi_restore.

Reviewed-by: Tulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com>
6 years agoPowerPC64 power7 strncpy stack handling and cfi
Alan Modra [Sun, 22 Oct 2017 21:13:32 +0000 (07:43 +1030)] 
PowerPC64 power7 strncpy stack handling and cfi

This patch moves the frame setup and teardown to immediately around
the single memset call, as has been done for power8.  I've also
decreased FRAMESIZE to that needed to save the two callee-saved
registers used.  Plus added cfi.

* sysdeps/powerpc/powerpc64/power7/strncpy.S: Decrease FRAMESIZE.
Move LR save and frame setup/teardown and LR restore to
immediately around memset call.  Provide cfi.

Reviewed-by: Tulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com>
6 years agoi386: Replace assembly versions of e_powf with generic e_powf.c
H.J. Lu [Sun, 22 Oct 2017 15:11:15 +0000 (08:11 -0700)] 
i386: Replace assembly versions of e_powf with generic e_powf.c

This patch replaces i386 assembly versions of e_powf with generic
e_powf.c.  For workload-spec2017.wrf, on Nehalem, it improves
performance by:

                           Before            After     Improvement
reciprocal-throughput      230.855          78.3358       194%
latency                    231.685          94.1259       146%

On Skylake, it improves performance by:

                           Before            After     Improvement
reciprocal-throughput      239.858          47.4713       405%
latency                    247.57           93.8798       163%

On IvyBridge with --disable-multi-arch, it improves performance by:

                           Before            After     Improvement
reciprocal-throughput      269.078          63.3758       324%
latency                    271.473          102.091       165%

* sysdeps/i386/fpu/e_powf.S: Removed.
* sysdeps/i386/fpu/e_powf_log2_data.c: Likewise.
* sysdeps/i386/fpu/w_powf.c: Likewise.
* sysdeps/i386/fpu/libm-test-ulps: Updated for generic e_powf.c.
* sysdeps/i386/i686/fpu/multiarch/libm-test-ulps: Likewise.
* sysdeps/i386/i686/fpu/multiarch/Makefile (libm-sysdep_routines):
Add e_powf-sse2.
(CFLAGS-e_powf-sse2.c): New.
* sysdeps/i386/i686/fpu/multiarch/e_powf-sse2.c: New file.
* sysdeps/i386/i686/fpu/multiarch/e_powf.c: Likewise.

6 years agoi386: Replace assembly versions of e_log2f with generic e_log2f.c
H.J. Lu [Sun, 22 Oct 2017 15:09:08 +0000 (08:09 -0700)] 
i386: Replace assembly versions of e_log2f with generic e_log2f.c

This patch replaces i386 assembly versions of e_log2f with generic
e_log2f.c.  For workload-spec2017.wrf, on Nehalem, it improves
performance by:

                           Before            After     Improvement
reciprocal-throughput      92.3845          30.8752       199%
latency                    112.855          54.8645       105%

On Skylake, it improves performance by:

                           Before            After     Improvement
reciprocal-throughput      98.7488          22.7507       334%
latency                    118.01           51.6083       128%

On IvyBridge with --disable-multi-arch, it improves performance by:

                           Before            After     Improvement
reciprocal-throughput      106.635          28.8596       269%
latency                    129.888          56.9187       128%

* sysdeps/i386/fpu/e_log2f.S: Removed.
* sysdeps/i386/fpu/e_log2f_data.c: Likewise.
* sysdeps/i386/fpu/w_log2f.c: Likewise.
* sysdeps/i386/fpu/libm-test-ulps: Updated for generic e_log2f.c.
* sysdeps/i386/i686/fpu/multiarch/libm-test-ulps: Likewise.
* sysdeps/i386/i686/fpu/multiarch/Makefile (libm-sysdep_routines):
Add e_log2f-sse2.
(CFLAGS-e_log2f-sse2.c): New.
* sysdeps/i386/i686/fpu/multiarch/e_log2f-sse2.c: New file.
* sysdeps/i386/i686/fpu/multiarch/e_log2f.c: Likewise.

6 years agox86-64: Add powf with FMA
H.J. Lu [Sun, 22 Oct 2017 15:07:48 +0000 (08:07 -0700)] 
x86-64: Add powf with FMA

For workload-spec2017.wrf, on Skylake, it improves performance by:

                           Before            After     Improvement
reciprocal-throughput      35.4713          27.3842       29%
latency                    82.4537          66.3175       24%

* sysdeps/x86_64/fpu/multiarch/Makefile (libm-sysdep_routines):
Add e_powf-fma.
(CFLAGS-e_powf-fma.c): New.
* sysdeps/x86_64/fpu/multiarch/e_powf-fma.c: New file.
* sysdeps/x86_64/fpu/multiarch/e_powf.c: Likewise.

6 years agox86-64: Add log2f with FMA
H.J. Lu [Sun, 22 Oct 2017 15:06:46 +0000 (08:06 -0700)] 
x86-64: Add log2f with FMA

For workload-spec2017.wrf, on Skylake, it improves performance by:

                           Before            After     Improvement
reciprocal-throughput      16.5937          14.0789       17%
latency                    41.7755          35.3586       18%

* sysdeps/x86_64/fpu/multiarch/Makefile (libm-sysdep_routines):
Add e_log2f-fma.
(CFLAGS-e_log2f-fma.c): New.
* sysdeps/x86_64/fpu/multiarch/e_log2f-fma.c: New file.
* sysdeps/x86_64/fpu/multiarch/e_log2f.c: Likewise.

6 years agox86-64: Add logf with FMA
H.J. Lu [Sun, 22 Oct 2017 15:03:46 +0000 (08:03 -0700)] 
x86-64: Add logf with FMA

For workload-spec2017.wrf, on Skylake, it improves performance by:

                           Before            After     Improvement
reciprocal-throughput      16.1534          13.8874       16%
latency                    41.9642          34.3072       22%

* sysdeps/x86_64/fpu/multiarch/Makefile (libm-sysdep_routines):
Add e_logf-fma.
(CFLAGS-e_logf-fma.c): New.
* sysdeps/x86_64/fpu/multiarch/e_logf-fma.c: New file.
* sysdeps/x86_64/fpu/multiarch/e_logf.c: Likewise.

6 years agoi386: Replace assembly versions of e_logf with generic e_logf.c
H.J. Lu [Sun, 22 Oct 2017 15:01:38 +0000 (08:01 -0700)] 
i386: Replace assembly versions of e_logf with generic e_logf.c

This patch replaces i386 assembly versions of e_logf with generic
e_logf.c.  For workload-spec2017.wrf, on Nehalem, it improves
performance by:

                           Before            After     Improvement
reciprocal-throughput      73.3865          40.0454       83%
latency                    90.0985          54.4479       65%

On Skylake, it improves performance by:

                           Before            After     Improvement
reciprocal-throughput      75.1384          22.1452       239%
latency                    91.9441          50.7925       81%

On IvyBridge with --disable-multi-arch, it improves performance by:

                           Before            After     Improvement
reciprocal-throughput      84.5575          28.7879       193%
latency                    103.971          57.5231       80%

* sysdeps/i386/fpu/e_logf.S: Removed.
* sysdeps/i386/fpu/e_logf_data.c: Likewise.
* sysdeps/i386/fpu/w_logf.c: Likewise.
* sysdeps/i386/i686/fpu/e_logf.S: Likewise.
* sysdeps/i386/fpu/libm-test-ulps: Updated for generic e_logf.c.
* sysdeps/i386/i686/fpu/multiarch/libm-test-ulps: Likewise.
* sysdeps/i386/i686/fpu/multiarch/Makefile (libm-sysdep_routines):
Add e_logf-sse2.
(CFLAGS-e_logf-sse2.c): New.
* sysdeps/i386/i686/fpu/multiarch/e_logf-sse2.c: New file.
* sysdeps/i386/i686/fpu/multiarch/e_logf.c: Likewise.

6 years agoi386: Replace assembly versions of e_exp2f with generic e_exp2f.c
H.J. Lu [Sun, 22 Oct 2017 14:58:54 +0000 (07:58 -0700)] 
i386: Replace assembly versions of e_exp2f with generic e_exp2f.c

This patch replaces i386 assembly versions of e_exp2f with generic
e_exp2f.c.  For workload-spec2017.wrf, on Nehalem, it improves
performance by:

                           Before            After     Improvement
reciprocal-throughput      112.996          40.0454       182%
latency                    126.581          54.4479       132%

On Skylake, it improves performance by:

                           Before            After     Improvement
reciprocal-throughput      113.14           39.447        186%
latency                    136.068          55.684        144%

On IvyBridge with --disable-multi-arch, it improves performance by:

                           Before            After     Improvement
reciprocal-throughput      132.521          40.3759       228%
latency                    145.791          58.4587       149%

* sysdeps/i386/fpu/e_exp2f.S: Removed.
* sysdeps/i386/fpu/w_exp2f.c: Likewise.
* sysdeps/i386/fpu/libm-test-ulps: Updated for generic e_exp2f.c.
* sysdeps/i386/i686/fpu/multiarch/libm-test-ulps: Likewise.
* sysdeps/i386/i686/fpu/multiarch/Makefile (libm-sysdep_routines):
Add e_exp2f-sse2.
(CFLAGS-e_exp2f-sse2.c): New.
* sysdeps/i386/i686/fpu/multiarch/e_exp2f-sse2.c: New file.
* sysdeps/i386/i686/fpu/multiarch/e_exp2f.c: Likewise.

6 years agox86-64: Add exp2f with FMA
H.J. Lu [Sun, 22 Oct 2017 14:55:49 +0000 (07:55 -0700)] 
x86-64: Add exp2f with FMA

For workload-spec2017.wrf, on Skylake, it improves performance by:

                           Before            After     Improvement
reciprocal-throughput      13.0291          11.2225       16%
latency                    44.5154          37.5766       18%

* sysdeps/x86_64/fpu/multiarch/Makefile (libm-sysdep_routines):
Add e_exp2f-fma.
(CFLAGS-e_exp2f-fma.c): New.
* sysdeps/x86_64/fpu/multiarch/e_exp2f-fma.c: New file.
* sysdeps/x86_64/fpu/multiarch/e_exp2f.c: Likewise.

6 years agoi386: Replace assembly versions of e_expf with generic e_expf.c
H.J. Lu [Sun, 22 Oct 2017 14:54:38 +0000 (07:54 -0700)] 
i386: Replace assembly versions of e_expf with generic e_expf.c

This patch replaces i386 assembly versions of e_expf with generic
e_expf.c.  For workload-spec2017.wrf, on Nehalem, it improves
performance by:

                           Before            After     Improvement
reciprocal-throughput      55.5724          40.2664       38%
latency                    80.0687          60.8517       31%

On Skylake, it improves performance by:

                           Before            After     Improvement
reciprocal-throughput      62.4056          39.4188       58%
latency                    85.5496          59.6377       43%

On IvyBridge with --disable-multi-arch, it improves performance by:

                           Before            After     Improvement
reciprocal-throughput      133.707          40.3778       231%
latency                    149.191          63.2515       135%

* sysdeps/i386/fpu/e_exp2f_data.c: Removed.
* sysdeps/i386/fpu/e_expf.S: Likewise.
* sysdeps/i386/fpu/math_errf.c: Likewise.
* sysdeps/i386/fpu/w_expf.c: Likewise.
* sysdeps/i386/i686/fpu/multiarch/e_expf-ia32.S: Likewise.
* sysdeps/i386/i686/fpu/multiarch/e_expf-sse2.S: Likewise.
* sysdeps/i386/i686/fpu/multiarch/w_expf.c: Likewise.
* sysdeps/i386/fpu/libm-test-ulps: Updated for generic e_expf.c.
* sysdeps/i386/i686/fpu/multiarch/libm-test-ulps: Likewise.
* sysdeps/i386/i686/fpu/multiarch/Makefile (libm-sysdep_routines):
Remove e_expf-ia32.
(CFLAGS-e_expf-sse2.c): New.
* sysdeps/i386/i686/fpu/multiarch/e_expf-sse2.c: New file.
* sysdeps/i386/i686/fpu/multiarch/e_expf.c: Rewritten.

6 years agox86-64: Replace assembly versions of e_expf with generic e_expf.c
H.J. Lu [Sun, 22 Oct 2017 14:49:36 +0000 (07:49 -0700)] 
x86-64: Replace assembly versions of e_expf with generic e_expf.c

This patch replaces x86-64 assembly versions of e_expf with generic
e_expf.c.  For workload-spec2017.wrf, on Nehalem, it improves
performance by:

                           Before            After     Improvement
reciprocal-throughput      36.039           20.7749       73%
latency                    58.8096          40.8715       43%

On Skylake, it improves

                           Before            After     Improvement
reciprocal-throughput      18.4436          11.1693       65%
latency                    47.5162          37.5411       26%

* sysdeps/x86_64/fpu/e_expf.S: Removed.
* sysdeps/x86_64/fpu/multiarch/e_expf-fma.S: Likewise.
* sysdeps/x86_64/fpu/w_expf.c: Likewise.
* sysdeps/x86_64/fpu/libm-test-ulps: Updated for generic
e_expf.c.
* sysdeps/x86_64/fpu/multiarch/Makefile (CFLAGS-e_expf-fma.c):
New.
* sysdeps/x86_64/fpu/multiarch/e_expf-fma.c: New file.
* sysdeps/x86_64/fpu/multiarch/e_expf.c (__redirect_ieee754_expf):
Renamed to ...
(__redirect_expf): This.
(SYMBOL_NAME): Changed to expf.
(__ieee754_expf): Renamed to ...
(__expf): This.
(__GI___expf): This.
(__ieee754_expf): Add strong_alias.
(__expf_finite): Likewise.
(__expf): New.
Include <sysdeps/ieee754/flt-32/e_expf.c>.

6 years agoglob: Fix buffer overflow during GLOB_TILDE unescaping [BZ #22332]
Paul Eggert [Sun, 22 Oct 2017 08:00:57 +0000 (10:00 +0200)] 
glob: Fix buffer overflow during GLOB_TILDE unescaping [BZ #22332]

6 years agoUpdate NEWS and ChangeLog for CVE-2017-15671
Florian Weimer [Sun, 22 Oct 2017 07:29:52 +0000 (09:29 +0200)] 
Update NEWS and ChangeLog for CVE-2017-15671

6 years agoglob: Add new test tst-glob-tilde
Florian Weimer [Sat, 21 Oct 2017 16:03:30 +0000 (18:03 +0200)] 
glob: Add new test tst-glob-tilde

The new test checks for memory leaks (see bug 22325) and attempts
to trigger the buffer overflow in bug 22320.

6 years agoAdd bits/floatn.h defines for more _FloatN / _FloatNx types.
Joseph Myers [Fri, 20 Oct 2017 21:42:51 +0000 (21:42 +0000)] 
Add bits/floatn.h defines for more _FloatN / _FloatNx types.

The bits/floatn.h header currently only has defines relating to
_Float128.  This patch adds defines relating to other _FloatN /
_FloatNx types.

The approach taken is to add defines for all _FloatN / _FloatNx types
known to GCC, and to put them in a common bits/floatn-common.h header
included at the end of all the individual bits/floatn.h headers.  If
in future some defines become different for different glibc
configurations, they will move out into the separate bits/floatn.h
headers.

Some defines are expected always to be the same across glibc ports.
Corresponding defines are nevertheless put in this header.  The intent
is that where there are conditionals (in headers or in non-installed
files) that can just repeat the same or nearly the same logic for each
floating-point type, they should do so, even if in fact the cases for
some types could be unconditionally present or absent because the same
conditionals are true or false for all glibc configurations.  This
should make the glibc code with such conditionals easier to read,
because the reader can just see that the same conditionals are
repeated for each type, rather than seeing different conditionals for
different types and needing to reason, at each location with such
differences, why those differences are indeed correct there.  (Cases
involving per-format rather than per-type logic are more likely still
to need differences in how they handle different types.)

Having such defines and conditionals also helps in incremental
preparation for adding _Float32 / _Float64 / _Float32x / _Float64x
function aliases.  I intend subsequent patches to add such
conditionals corresponding to those already present for _Float128, as
well as making more architecture-specific function implementations use
common macros to define aliases in preparation for adding such _FloatN
/ _FloatNx aliases.

Tested for x86_64.

* bits/floatn-common.h: New file.
* math/Makefile (headers): Add bits/floatn-common.h.
* bits/floatn.h: Include <bits/floatn-common.h>.
* sysdeps/ia64/bits/floatn.h: Likewise.
* sysdeps/ieee754/ldbl-128/bits/floatn.h: Likewise.
* sysdeps/mips/ieee754/bits/floatn.h: Likewise.
* sysdeps/powerpc/bits/floatn.h: Likewise.
* sysdeps/x86/bits/floatn.h: Likewise.

6 years agoAvoid build multiarch if compiler warns about mismatched alias
Adhemerval Zanella [Tue, 10 Oct 2017 14:12:50 +0000 (11:12 -0300)] 
Avoid build multiarch if compiler warns about mismatched alias

GCC 8 emits an warning for alias for functions with incompatible types
and it is used extensivelly for ifunc resolvers implementations in C
(for instance on weak_alias with the internal symbol name to the
external one or with the libc_hidden_def to set ifunc for internal
usage).

This breaks the build when the ifunc resolver is not defined using
gcc attribute extensions (HAVE_GCC_IFUNC being 0).  Although for
all currently architectures that have multiarch support this compiler
options is enabled for default, there is still the option where the
user might try build glibc with a compiler without support for such
extension.  In this case this patch just disable the multiarch folder
in sysdeps selections.

GCC 7 and before still builds IFUNCs regardless of compiler support
(although for the lack of attribute support debug information would
be optimal).

Checked with a build on multiarch support architectures (aarch64,
arm, sparc, s390, powerpc, x86_64, i386) with multiarch enable
and disable and with GCC 7 and GCC 8.

* configure.ac (libc_cv_gcc_incompatbile_alias): New define:
indicates whether compiler emits an warning for alias for
functions with incompatible types.

6 years agoposix: Fix improper assert in Linux posix_spawn (BZ#22273)
Adhemerval Zanella [Thu, 12 Oct 2017 18:20:57 +0000 (15:20 -0300)] 
posix: Fix improper assert in Linux posix_spawn (BZ#22273)

As noted by Florian Weimer, current Linux posix_spawn implementation
can trigger an assert if the auxiliary process is terminated before
actually setting the err member:

    340   /* Child must set args.err to something non-negative - we rely on
    341      the parent and child sharing VM.  */
    342   args.err = -1;
    [...]
    362   new_pid = CLONE (__spawni_child, STACK (stack, stack_size), stack_size,
    363                    CLONE_VM | CLONE_VFORK | SIGCHLD, &args);
    364
    365   if (new_pid > 0)
    366     {
    367       ec = args.err;
    368       assert (ec >= 0);

Another possible issue is killing the child between setting the err and
actually calling execve.  In this case the process will not ran, but
posix_spawn also will not report any error:

    269
    270   args->err = 0;
    271   args->exec (args->file, args->argv, args->envp);

As suggested by Andreas Schwab, this patch removes the faulty assert
and also handles any signal that happens before fork and execve as the
spawn was successful (and thus relaying the handling to the caller to
figure this out).  Different than Florian, I can not see why using
atomics to set err would help here, essentially the code runs
sequentially (due CLONE_VFORK) and I think it would not be legal the
compiler evaluate ec without checking for new_pid result (thus there
is no need to compiler barrier).

Summarizing the possible scenarios on posix_spawn execution, we
have:

  1. For default case with a success execution, args.err will be 0, pid
     will not be collected and it will be reported to caller.

  2. For default failure case, args.err will be positive and the it will
     be collected by the waitpid.  An error will be reported to the
     caller.

  3. For the unlikely case where the process was terminated and not
     collected by a caller signal handler, it will be reported as succeful
     execution and not be collected by posix_spawn (since args.err will
     be 0). The caller will need to actually handle this case.

  4. For the unlikely case where the process was terminated and collected
     by caller we have 3 other possible scenarios:

     4.1. The auxiliary process was terminated with args.err equal to 0:
  it will handled as 1. (so it does not matter if we hit the pid
          reuse race since we won't possible collect an unexpected
          process).

     4.2. The auxiliary process was terminated after execve (due a failure
          in calling it) and before setting args.err to -1: it will also
          be handle as 1. but with the issue of not be able to report the
          caller a possible execve failures.

     4.3. The auxiliary process was terminated after args.err is set to -1:
          this is the case where it will be possible to hit the pid reuse
          case where we will need to collected the auxiliary pid but we
          can not be sure if it will be expected one.  I think for this
          case we need to actually change waitpid to use WNOHANG to avoid
          hanging indefinitely on the call and report an error to caller
          since we can't differentiate between a default failure as 2.
          and a possible pid reuse race issue.

Checked on x86_64-linux-gnu.

* sysdeps/unix/sysv/linux/spawni.c (__spawnix): Handle the case where
the auxiliary process is terminated by a signal before calling _exit
or execve.

6 years agox86-64: Use fxsave/xsave/xsavec in _dl_runtime_resolve [BZ #21265]
H.J. Lu [Fri, 20 Oct 2017 18:00:08 +0000 (11:00 -0700)] 
x86-64: Use fxsave/xsave/xsavec in _dl_runtime_resolve [BZ #21265]

In _dl_runtime_resolve, use fxsave/xsave/xsavec to preserve all vector,
mask and bound registers.  It simplifies _dl_runtime_resolve and supports
different calling conventions.  ld.so code size is reduced by more than
1 KB.  However, use fxsave/xsave/xsavec takes a little bit more cycles
than saving and restoring vector and bound registers individually.

Latency for _dl_runtime_resolve to lookup the function, foo, from one
shared library plus libc.so:

                             Before    After     Change

Westmere (SSE)/fxsave         345      866       151%
IvyBridge (AVX)/xsave         420      643       53%
Haswell (AVX)/xsave           713      1252      75%
Skylake (AVX+MPX)/xsavec      559      719       28%
Skylake (AVX512+MPX)/xsavec   145      272       87%
Ryzen (AVX)/xsavec            280      553       97%

This is the worst case where portion of time spent for saving and
restoring registers is bigger than majority of cases.  With smaller
_dl_runtime_resolve code size, overall performance impact is negligible.

On IvyBridge, differences in build and test time of binutils with lazy
binding GCC and binutils are noises.  On Westmere, differences in
bootstrap and "makc check" time of GCC 7 with lazy binding GCC and
binutils are also noises.

[BZ #21265]
* sysdeps/x86/cpu-features-offsets.sym (XSAVE_STATE_SIZE_OFFSET):
New.
* sysdeps/x86/cpu-features.c: Include <libc-pointer-arith.h>.
(get_common_indeces): Set xsave_state_size, xsave_state_full_size
and bit_arch_XSAVEC_Usable if needed.
(init_cpu_features): Remove bit_arch_Use_dl_runtime_resolve_slow
and bit_arch_Use_dl_runtime_resolve_opt.
* sysdeps/x86/cpu-features.h (bit_arch_Use_dl_runtime_resolve_opt):
Removed.
(bit_arch_Use_dl_runtime_resolve_slow): Likewise.
(bit_arch_Prefer_No_AVX512): Updated.
(bit_arch_MathVec_Prefer_No_AVX512): Likewise.
(bit_arch_XSAVEC_Usable): New.
(STATE_SAVE_OFFSET): Likewise.
(STATE_SAVE_MASK): Likewise.
[__ASSEMBLER__]: Include <cpu-features-offsets.h>.
(cpu_features): Add xsave_state_size and xsave_state_full_size.
(index_arch_Use_dl_runtime_resolve_opt): Removed.
(index_arch_Use_dl_runtime_resolve_slow): Likewise.
(index_arch_XSAVEC_Usable): New.
* sysdeps/x86/cpu-tunables.c (TUNABLE_CALLBACK (set_hwcaps)):
Support XSAVEC_Usable.  Remove Use_dl_runtime_resolve_slow.
* sysdeps/x86_64/Makefile (tst-x86_64-1-ENV): New if tunables
is enabled.
* sysdeps/x86_64/dl-machine.h (elf_machine_runtime_setup):
Replace _dl_runtime_resolve_sse, _dl_runtime_resolve_avx,
_dl_runtime_resolve_avx_slow, _dl_runtime_resolve_avx_opt,
_dl_runtime_resolve_avx512 and _dl_runtime_resolve_avx512_opt
with _dl_runtime_resolve_fxsave, _dl_runtime_resolve_xsave and
_dl_runtime_resolve_xsavec.
* sysdeps/x86_64/dl-trampoline.S (DL_RUNTIME_UNALIGNED_VEC_SIZE):
Removed.
(DL_RUNTIME_RESOLVE_REALIGN_STACK): Check STATE_SAVE_ALIGNMENT
instead of VEC_SIZE.
(REGISTER_SAVE_BND0): Removed.
(REGISTER_SAVE_BND1): Likewise.
(REGISTER_SAVE_BND3): Likewise.
(REGISTER_SAVE_RAX): Always defined to 0.
(VMOV): Removed.
(_dl_runtime_resolve_avx): Likewise.
(_dl_runtime_resolve_avx_slow): Likewise.
(_dl_runtime_resolve_avx_opt): Likewise.
(_dl_runtime_resolve_avx512): Likewise.
(_dl_runtime_resolve_avx512_opt): Likewise.
(_dl_runtime_resolve_sse): Likewise.
(_dl_runtime_resolve_sse_vex): Likewise.
(USE_FXSAVE): New.
(_dl_runtime_resolve_fxsave): Likewise.
(USE_XSAVE): Likewise.
(_dl_runtime_resolve_xsave): Likewise.
(USE_XSAVEC): Likewise.
(_dl_runtime_resolve_xsavec): Likewise.
* sysdeps/x86_64/dl-trampoline.h (_dl_runtime_resolve_avx512):
Removed.
(_dl_runtime_resolve_avx512_opt): Likewise.
(_dl_runtime_resolve_avx): Likewise.
(_dl_runtime_resolve_avx_opt): Likewise.
(_dl_runtime_resolve_sse): Likewise.
(_dl_runtime_resolve_sse_vex): Likewise.
(_dl_runtime_resolve_fxsave): New.
(_dl_runtime_resolve_xsave): Likewise.
(_dl_runtime_resolve_xsavec): Likewise.

6 years agoMention Tim Rühsen as the reporter for CVE-2017-15670
Florian Weimer [Fri, 20 Oct 2017 17:28:44 +0000 (19:28 +0200)] 
Mention Tim Rühsen as the reporter for CVE-2017-15670

6 years agoCVE-2017-15670: glob: Fix one-byte overflow [BZ #22320]
Paul Eggert [Fri, 20 Oct 2017 16:41:14 +0000 (18:41 +0200)] 
CVE-2017-15670: glob: Fix one-byte overflow [BZ #22320]

6 years agoFix build issue with SINGLE_THREAD_P
Wilco Dijkstra [Fri, 20 Oct 2017 16:39:47 +0000 (17:39 +0100)] 
Fix build issue with SINGLE_THREAD_P

Add sysdep-cancel.h include.

* malloc/malloc.c (sysdep-cancel.h): Add include.

6 years agoAdd single-threaded path to _int_free
Wilco Dijkstra [Fri, 20 Oct 2017 16:27:53 +0000 (17:27 +0100)] 
Add single-threaded path to _int_free

This patch adds single-threaded fast paths to _int_free.
Bypass the explicit locking for larger allocations.

* malloc/malloc.c (_int_free): Add SINGLE_THREAD_P fast paths.

6 years agoresolv: Remove bogus targets that build ga_test
Will Hawkins [Fri, 20 Oct 2017 05:25:26 +0000 (22:25 -0700)] 
resolv: Remove bogus targets that build ga_test

Remove the bogus targets (and source) that supposedly build ga_test.
This code was added to resolv very early in the development process
but does not appear to be an actual test program. The target for
building this file is tests but because the glibc Make system is
built the way it is, the target is overriden by higher-level tests
targets and, therefore, the ga_test program is never built. Removing
the target and the source code makes the resolv/Makefile less confusing.

Tested by building and running 'make check' on 64 bit host running
Kernel 4.10.0-19 configured with
 --prefix=/home/hawkinsw/code/glibc-build/install
 --enable-hardcoded-path-in-tests
 --disable-mathvec

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
6 years agoAdd new locale kab_DZ [BZ #18812]
Mike FABIAN [Fri, 20 Oct 2017 15:50:40 +0000 (17:50 +0200)] 
Add new locale kab_DZ  [BZ #18812]

[BZ #18812]
* localedata/SUPPORTED: Add kab_DZ/UTF-8.
* localedata/locales/kab_DZ: New file.

6 years agom68k: Update elf_machine_load_address for static PIE
H.J. Lu [Fri, 20 Oct 2017 10:36:34 +0000 (03:36 -0700)] 
m68k: Update elf_machine_load_address for static PIE

When --enable-static-pie is used to configure glibc, we need to use
_dl_relocate_static_pie to compute load address in static PIE.

* sysdeps/m68k/dl-machine.h (elf_machine_load_address): Use
_dl_relocate_static_pie instead of _dl_start to compute load
address in static PIE.

6 years agom68k: Check PIC instead of SHARED in start.S
H.J. Lu [Fri, 20 Oct 2017 10:34:38 +0000 (03:34 -0700)] 
m68k: Check PIC instead of SHARED in start.S

Since start.o may be compiled as PIC, we should check PIC instead of
SHARED.

* sysdeps/m68k/start.S (_start): Check PIC instead of SHARED.

6 years agoAdd new locale shn_MM [BZ #13605]
Mike FABIAN [Fri, 20 Oct 2017 06:50:32 +0000 (08:50 +0200)] 
Add new locale shn_MM [BZ #13605]

[BZ #13605]
* localedata/SUPPORTED: Add shn_MM/UTF-8.
* localedata/locales/shn_MM: New file.

6 years agosysconf: Fix missing definition of UIO_MAXIOV on Linux [BZ #22321]
Florian Weimer [Fri, 20 Oct 2017 02:10:15 +0000 (04:10 +0200)] 
sysconf: Fix missing definition of UIO_MAXIOV on Linux [BZ #22321]

After commit 37f802f86400684c8d13403958b2c598721d6360 (Remove
__need_IOV_MAX and __need_FOPEN_MAX), UIO_MAXIOV is no longer supplied
(indirectly) through <bits/stdio_lim.h>, so sysdeps/posix/sysconf.c no
longer sees the definition.

6 years agoi386: Regenerate libm-test-ulps
H.J. Lu [Thu, 19 Oct 2017 18:51:57 +0000 (11:51 -0700)] 
i386: Regenerate libm-test-ulps

Regenerate libm-test-ulps for --disable-multi-arch.

* sysdeps/i386/fpu/libm-test-ulps: Regenerated.

6 years agoAdd MIPS bits/floatn.h.
Joseph Myers [Thu, 19 Oct 2017 17:59:41 +0000 (17:59 +0000)] 
Add MIPS bits/floatn.h.

This patch adds a MIPS-specific bits/floatn.h header.  This header is
identical to the ldbl-128 version except for the comment at the top;
the purpose is to ensure that a 32-bit MIPS build installs a header
that is the same as in a 64-bit MIPS build and so properly shows
_Float128 support to be available for 64-bit compilations, on the
general principle of an installation for one multilib providing
headers also suitable for other multilibs.

Tested with build-many-glibcs.py.

* sysdeps/mips/ieee754/bits/floatn.h: New file.

6 years agoInstall correct bits/long-double.h for MIPS64 (bug 22322).
Joseph Myers [Thu, 19 Oct 2017 17:32:20 +0000 (17:32 +0000)] 
Install correct bits/long-double.h for MIPS64 (bug 22322).

Similar to bug 21987 for SPARC, MIPS64 wrongly installs the ldbl-128
version of bits/long-double.h, meaning incorrect results when using
headers installed from a 64-bit installation for a 32-bit build.  (I
haven't actually seen this cause build failures before its interaction
with bits/floatn.h did so - installed headers wrongly expecting
_Float128 to be available in a 32-bit configuration.)

This patch fixes the bug by moving the MIPS header to
sysdeps/mips/ieee754, which comes before sysdeps/ieee754/ldbl-128 in
the sysdeps directory ordering.  (bits/floatn.h will need a similar
fix - duplicating the ldbl-128 version for MIPS will suffice - for
headers from a 32-bit installation to be correct for 64-bit builds.)

Tested with build-many-glibcs.py (compilers build for
mips64-linux-gnu, where there was previously a libstdc++ build failure
as at
<https://sourceware.org/ml/libc-testresults/2017-q4/msg00130.html>).

[BZ #22322]
* sysdeps/mips/bits/long-double.h: Move to ....
* sysdeps/mips/ieee754/bits/long-double.h: ... here.

6 years agoFix deadlock in _int_free consistency check
Wilco Dijkstra [Thu, 19 Oct 2017 17:19:55 +0000 (18:19 +0100)] 
Fix deadlock in _int_free consistency check

This patch fixes a deadlock in the fastbin consistency check.
If we fail the fast check due to concurrent modifications to
the next chunk or system_mem, we should not lock if we already
have the arena lock.  Simplify the check to make it obviously
correct.

* malloc/malloc.c (_int_free): Fix deadlock bug in consistency check.

6 years agox86-64: Don't set GLRO(dl_platform) to NULL [BZ #22299]
H.J. Lu [Thu, 19 Oct 2017 15:28:09 +0000 (08:28 -0700)] 
x86-64: Don't set GLRO(dl_platform) to NULL [BZ #22299]

Since ld.so expands $PLATFORM with GLRO(dl_platform), don't set
GLRO(dl_platform) to NULL.

[BZ #22299]
* sysdeps/x86/cpu-features.c (init_cpu_features): Don't set
GLRO(dl_platform) to NULL.
* sysdeps/x86_64/Makefile (tests): Add tst-platform-1.
(modules-names): Add tst-platformmod-1 and
x86_64/tst-platformmod-2.
(CFLAGS-tst-platform-1.c): New.
(CFLAGS-tst-platformmod-1.c): Likewise.
(CFLAGS-tst-platformmod-2.c): Likewise.
(LDFLAGS-tst-platformmod-2.so): Likewise.
($(objpfx)tst-platform-1): Likewise.
($(objpfx)tst-platform-1.out): Likewise.
(tst-platform-1-ENV): Likewise.
($(objpfx)x86_64/tst-platformmod-2.os): Likewise.
* sysdeps/x86_64/tst-platform-1.c: New file.
* sysdeps/x86_64/tst-platformmod-1.c: Likewise.
* sysdeps/x86_64/tst-platformmod-2.c: Likewise.

6 years agoAdd new locale mjw_IN [BZ #13994]
Mike FABIAN [Thu, 19 Oct 2017 13:15:01 +0000 (15:15 +0200)] 
Add new locale mjw_IN [BZ #13994]

[BZ #13994]
* locale/iso-639.def: Add Karbi.
* localedata/SUPPORTED: Add mjw_IN/UTF-8.
* localedata/locales/mjw_IN: New file.

6 years agoAdd _Float128 function aliases.
Joseph Myers [Wed, 18 Oct 2017 17:37:18 +0000 (17:37 +0000)] 
Add _Float128 function aliases.

This patch adds support for *f128 function aliases on platforms where
long double has the binary128 format (and thus GCC 7 provides the
_Float128 type with the same ABI as long double but as a distinct type
in terms of C type compatibility).  This is the same API as provided
in glibc 2.26 for powerpc64le / x86_64 / x86 / ia64 where _Float128
has a different format from long double, with the bulk of the API
coming from TS 18661-3.  All the functions alias the corresponding
long double functions, and __* function names are not provided since
those are only needed once for each floating-point format, not more
than once for different types with the same format (so for example,
-ffinite-math-only maps foof128 to __fool_finite, while type-generic
macros end up calling e.g. __issignalingl for _Float128 arguments on
such platforms).

The preparation for this feature was done in previous patches, so this
one just needs to add the relevant makefile and header definitions,
and update macro definitions of libm_alias_ldouble_other_r, to turn on
the feature, and update documentation and ABI baselines.

Tested (a) for x86_64, (b) for aarch64, (c) with build-many-glibcs.py
with both GCC 6 and GCC 7.

* sysdeps/ieee754/ldbl-128/Makeconfig: New file.
* sysdeps/ieee754/ldbl-128/bits/floatn.h: Likewise.
* sysdeps/ieee754/ldbl-128/float128-abi.h: Likewise.
* sysdeps/generic/libm-alias-ldouble.h: Include <bits/floatn.h>.
[__HAVE_FLOAT128 && !__HAVE_DISTINCT_FLOAT128]
(libm_alias_ldouble_other_r): Also create _Float128 alias.
* sysdeps/ieee754/ldbl-opt/libm-alias-ldouble.h: Include
<bits/floatn.h>.
[__HAVE_FLOAT128 && !__HAVE_DISTINCT_FLOAT128]
(libm_alias_ldouble_other_r): Also create _Float128 alias.
* manual/math.texi (Mathematics): Document additional architecture
support for _Float128.
* sysdeps/unix/sysv/linux/aarch64/libc.abilist: Update.
* sysdeps/unix/sysv/linux/aarch64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/alpha/libc.abilist: Likewise.
* sysdeps/unix/sysv/linux/alpha/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/mips/mips64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist: Likewise.
* sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist: Likewise.
* sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist: Likewise.
* sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist: Likewise.
* sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist: Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist: Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist: Likewise.

6 years ago[AARCH64] Rewrite elf_machine_load_address using _DYNAMIC symbol
Szabolcs Nagy [Wed, 18 Oct 2017 16:26:23 +0000 (17:26 +0100)] 
[AARCH64] Rewrite elf_machine_load_address using _DYNAMIC symbol

This patch rewrites aarch64 elf_machine_load_address to use special _DYNAMIC
symbol instead of _dl_start.

The static address of _DYNAMIC symbol is stored in the first GOT entry.
Here is the change which makes this solution work (part of binutils 2.24):
https://sourceware.org/ml/binutils/2013-06/msg00248.html

i386, x86_64 targets use the same method to do this as well.

The original implementation relies on a trick that R_AARCH64_ABS32 relocation
being resolved at link time and the static address fits in the 32bits.
However, in LP64, normally, the address is defined to be 64 bit.

Here is the C version one which should be portable in all cases.

* sysdeps/aarch64/dl-machine.h (elf_machine_load_address): Use
_DYNAMIC symbol to calculate load address.

6 years agopowerpc: fix check-before-set in SET_RESTORE_ROUND
Paul Clarke [Wed, 18 Oct 2017 14:02:02 +0000 (12:02 -0200)] 
powerpc: fix check-before-set in SET_RESTORE_ROUND

A performance regression was introduced by commit
84d74e427a771906830800e574a72f8d25a954b8 "powerpc: Cleanup fenv_private.h".

In the powerpc implementation of SET_RESTORE_ROUND, there is the
following code in the "SET" function (slightly simplified):
--
  old.fenv = fegetenv_register ();

  new.l = (old.l & _FPU_MASK_TRAPS_RN) | r; (1)

  if (new.l != old.l)                       (2)
    {
      if ((old.l & _FPU_ALL_TRAPS) != 0)
        (void) __fe_mask_env ();
      fesetenv_register (new.fenv);         (3)
--

Line (1) sets the value of "new" to the current value of FPSCR,
but masks off summary bits, exceptions, non-IEEE mode, and
rounding mode, then ORs in the new rounding mode.

Line (2) compares this new value to the current value in order to
avoid setting a new value in the FPSCR (line (3)) unless something
significant has changed (exception enables or rounding mode).

The summary bits are not germane to the comparison, but are cleared
in "new" and preserved in "old", resulting in false negative
comparisons, and unnecessarily setting the FPSCR in those cases
with associated negative performance impacts.

The solution is to treat the summaries identically for "new" and "old":
- save them in SET
- leave them alone otherwise
- restore the saved values in RESTORE

Also minor changes:
- expand _FPU_MASK_RN to 64bit hex, to match other MASKs
- treat bit 52 (left-to-right) as reserved (since it is)

* sysdeps/powerpc/fpu/fenv_private.h (_FPU_MASK_TRAPS_RN):
(_FPU_MASK_FRAC_INEX_RET_CC): Fix masks to more properly handle
summary bits.
(_FPU_MASK_RN): Expand _FPU_MASK_RN to 64bit hex.
(_FPU_MASK_NOT_RN_NI): Treat bit 52 (left-to-right) as reserved.

Reviewed-by: Tulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com>
6 years agoUse U+202F NARROW NO-BREAK SPACE as thousands separators in pl_PL locale [BZ #16777]
Mike FABIAN [Wed, 18 Oct 2017 12:27:44 +0000 (14:27 +0200)] 
Use U+202F NARROW NO-BREAK SPACE as thousands separators in pl_PL locale [BZ #16777]

[BZ #16777]
* localedata/locales/pl_PL (LC_MONETARY): Use U+202F as mon_thousands_sep
and improve readability by using more ASCII.
* localedata/locales/pl_PL (LC_NUMERIC): Use U+202F as thousands_sep
and improve readability by using more ASCII.

6 years agoFix build failure on tilepro due to unsupported atomics
Wilco Dijkstra [Wed, 18 Oct 2017 11:20:55 +0000 (12:20 +0100)] 
Fix build failure on tilepro due to unsupported atomics

        * malloc/malloc.c (malloc_state): Use int for have_fastchunks since
        not all targets support atomics on bool.

6 years agoUse __f128 to define FLT128_* constants in include/float.h for old GCC.
Joseph Myers [Tue, 17 Oct 2017 20:16:01 +0000 (20:16 +0000)] 
Use __f128 to define FLT128_* constants in include/float.h for old GCC.

When using compilers before GCC 7, include/float.h provides fallback
definitions of FLT128_* constants.  These definitions use 'Q' constant
suffixes, which works for configurations with _Float128 ABI-distinct
from long double, but not where it has the same ABI as long double.
This patch changes the definitions to use the __f128 macro from
<bits/floatn.h>, so allowing them to work in the non-distinct
_Float128 case (where they are used in building glibc tests, not for
building glibc itself) as well.

Tested (a) with build-many-glibcs.py with GCC 6 (installed stripped
shared libraries unchanged by the patch); (b) with
build-many-glibcs.py with GCC 6 together with the main patch to enable
float128 aliases; (c) for x86_64 with both GCC 6 and GCC 7.

* include/float.h [!__GNUC_PREREQ (7, 0) && __HAVE_FLOAT128 &&
__GLIBC_USE (IEC_60559_TYPES_EXT)] (FLT128_MAX): Define using
__f128.
[!__GNUC_PREREQ (7, 0) && __HAVE_FLOAT128 && __GLIBC_USE
(IEC_60559_TYPES_EXT)] (FLT128_EPSILON): Likewise.
[!__GNUC_PREREQ (7, 0) && __HAVE_FLOAT128 && __GLIBC_USE
(IEC_60559_TYPES_EXT)] (FLT128_MIN): Likewise.
[!__GNUC_PREREQ (7, 0) && __HAVE_FLOAT128 && __GLIBC_USE
(IEC_60559_TYPES_EXT)] (FLT128_TRUE_MIN): Likewise.

6 years agoposix: Add p{readv,writev}2 flags to generic uio-ext.h
Adhemerval Zanella [Thu, 28 Sep 2017 15:41:27 +0000 (08:41 -0700)] 
posix: Add p{readv,writev}2 flags to generic uio-ext.h

* bits/uio-ext.h (RWF_HIPRI, RWF_DSYNC, RWF_SYNC, RWF_NOWAIT): New
defines.

6 years agoImprove malloc initialization sequence
Wilco Dijkstra [Tue, 17 Oct 2017 17:55:16 +0000 (18:55 +0100)] 
Improve malloc initialization sequence

The current malloc initialization is quite convoluted. Instead of
sometimes calling malloc_consolidate from ptmalloc_init, call
malloc_init_state early so that the main_arena is always initialized.
The special initialization can now be removed from malloc_consolidate.
This also fixes BZ #22159.

Check all calls to malloc_consolidate and remove calls that are
redundant initialization after ptmalloc_init, like in int_mallinfo
and __libc_mallopt (but keep the latter as consolidation is required for
set_max_fast).  Update comments to improve clarity.

Remove impossible initialization check from _int_malloc, fix assert
in do_check_malloc_state to ensure arena->top != 0.  Fix the obvious bugs
in do_check_free_chunk and do_check_remalloced_chunk to enable single
threaded malloc debugging (do_check_malloc_state is not thread safe!).

[BZ #22159]
* malloc/arena.c (ptmalloc_init): Call malloc_init_state.
* malloc/malloc.c (do_check_free_chunk): Fix build bug.
(do_check_remalloced_chunk): Fix build bug.
(do_check_malloc_state): Add assert that checks arena->top.
(malloc_consolidate): Remove initialization.
(int_mallinfo): Remove call to malloc_consolidate.
(__libc_mallopt): Clarify why malloc_consolidate is needed.

6 years agoUse relaxed atomics for malloc have_fastchunks
Wilco Dijkstra [Tue, 17 Oct 2017 17:43:31 +0000 (18:43 +0100)] 
Use relaxed atomics for malloc have_fastchunks

Currently free typically uses 2 atomic operations per call.  The have_fastchunks
flag indicates whether there are recently freed blocks in the fastbins.  This
is purely an optimization to avoid calling malloc_consolidate too often and
avoiding the overhead of walking all fast bins even if all are empty during a
sequence of allocations.  However using catomic_or to update the flag is
completely unnecessary since it can be changed into a simple boolean and
accessed using relaxed atomics.  There is no change in multi-threaded behaviour
given the flag is already approximate (it may be set when there are no blocks in
any fast bins, or it may be clear when there are free blocks that could be
consolidated).

Performance of malloc/free improves by 27% on a simple benchmark on AArch64
(both single and multithreaded). The number of load/store exclusive instructions
is reduced by 33%. Bench-malloc-thread speeds up by ~3% in all cases.

* malloc/malloc.c (FASTCHUNKS_BIT): Remove.
(have_fastchunks): Remove.
(clear_fastchunks): Remove.
(set_fastchunks): Remove.
(malloc_state): Add have_fastchunks.
(malloc_init_state): Use have_fastchunks.
(do_check_malloc_state): Remove incorrect invariant checks.
(_int_malloc): Use have_fastchunks.
(_int_free): Likewise.
(malloc_consolidate): Likewise.

6 years agoInline tcache functions
Wilco Dijkstra [Tue, 17 Oct 2017 17:25:43 +0000 (18:25 +0100)] 
Inline tcache functions

The functions tcache_get and tcache_put show up in profiles as they
are a critical part of the tcache code.  Inline them to give tcache
a 16% performance gain.  Since this improves multi-threaded cases
as well, it helps offset any potential performance loss due to adding
single-threaded fast paths.

* malloc/malloc.c (tcache_put): Inline.
(tcache_get): Inline.

6 years agoFix armv7-a compiler option name
Adhemerval Zanella [Tue, 17 Oct 2017 15:32:03 +0000 (13:32 -0200)] 
Fix armv7-a compiler option name

This patch fixes the wrong -march name option used to define
the ARMv7-A glibc variant pushed on commit 3d26560.

6 years agoNew locale ca_ES@valencia [BZ #2522]
Aurelien Jarno [Thu, 30 Jun 2016 10:57:32 +0000 (12:57 +0200)] 
New locale ca_ES@valencia [BZ #2522]

The Valencian (meridional Catalan) locale is basically a copy of the
Catalan locale. The point of having a separate locale is only for PO
translations. This locale is already provided by several distributions
and is already supported by various projects like LibreOffice, Mozilla,
Gnome, KDE.

Aurelien Jarno  <aurelien@aurel32.net>
[BZ #2522]
* localedata/locales/ca_ES@valencia: New file.
* localedata/SUPPORTED: Add ca_ES@valencia/UTF-8.

6 years agoLet signbit use the builtin in C++ mode with gcc < 6.x (bug 22296)
Romain Naour [Mon, 16 Oct 2017 21:21:56 +0000 (23:21 +0200)] 
Let signbit use the builtin in C++ mode with gcc < 6.x (bug 22296)

When using gcc < 6.x, signbit does not use the type-generic
__builtin_signbit builtin, instead it uses __MATH_TG.
However, when library support for float128 is available, __MATH_TG uses
__builtin_types_compatible_p, which is not available in C++ mode.

On the other hand, libstdc++ undefines (in cmath) many macros from
math.h, including signbit, so that it can provide its own functions.
However, during its configure tests, libstdc++ just tests for the
availability of the macros (it does not undefine them, nor does it
provide its own functions).

Finally, libstdc++ configure tests include math.h and get the definition
of signbit that uses __MATH_TG (and __builtin_types_compatible_p).
Since libstdc++ does not undefine the macros during its configure
tests, they fail.

This patch lets signbit use the builtin in C++ mode when gcc < 6.x is
used. This allows the configure test in libstdc++ to work.

Tested for x86_64.

[BZ #22296]
* math/math.h: Let signbit use the builtin in C++ mode with gcc
< 6.x

Cc: Gabriel F. T. Gomes <gftg@linux.vnet.ibm.com>
Cc: Joseph Myers <joseph@codesourcery.com>
6 years agoAdd build-many-glibcs.py arm-linux-gnueabihf-v7{-disable-multiarch}
Adhemerval Zanella [Mon, 9 Oct 2017 18:53:33 +0000 (15:53 -0300)] 
Add build-many-glibcs.py arm-linux-gnueabihf-v7{-disable-multiarch}

This patch adds two extra configuration for arm-linux-gnueabihf to
cover for multiarch support:

  1. arm-linux-gnueabihf-v7a: enables multiarch support by using
     -march=armv7a.

  2. Same as 1. but with --disable-multiarch.

Check with build-many-glibcs.py for both options.

* scripts/build-many-glibcs.py (Context.add_all_configs):
Add arm-linux-gnueabihf multiarch extra_glibcs.

6 years agoAdd common ifunc-init.h header
Adhemerval Zanella [Thu, 12 Oct 2017 19:24:44 +0000 (16:24 -0300)] 
Add common ifunc-init.h header

This patch moves the generic definition from x86_64 init-arch
to a common header ifunc-init.h.  No functional changes is expected.

Checked on a x86_64-linux-gnu build.

* sysdeps/generic/ifunc-init.h: New file.
* sysdeps/x86/init-arch.h: Use generic ifunc-init.h.

6 years agoPlace monetary symbol in el_GR and el_CY after the amount
Mike FABIAN [Tue, 17 Oct 2017 12:54:53 +0000 (14:54 +0200)] 
Place monetary symbol in el_GR and el_CY after the amount

CLDR uses this pattern as well.

[BZ #22019]
* localedata/locales/el_GR: Set n_cs_precedes to 0.
* localedata/locales/el_CY: copy "el_GR" because it is identical.
* stdlib/tst-strfmon_l.c: adapt test case.

6 years agoMove some float128 symbol version definitions.
Joseph Myers [Mon, 16 Oct 2017 22:04:42 +0000 (22:04 +0000)] 
Move some float128 symbol version definitions.

With support for _Float128 functions on platforms where that type has
the same ABI as long double, as well as on platforms where it is
ABI-distinct, those functions will need to be exported from glibc's
shared libraries at appropriate symbol versions in each case.

This patch avoids duplication of lists of symbols to export by moving
the symbols other than __* to math/Versions and stdlib/Versions.
There, they are conditional on <float128-abi.h> defining
FLOAT128_VERSION and a default version of that header is added that
does not define that macro.  Enabling the float128 function aliases
will then include adding a sysdeps/ieee754/ldbl-128/float128-abi.h
that defines FLOAT128_VERSION to GLIBC_2.27.  Symbols __* remain in
sysdeps/ieee754/float128/Versions; those symbols should be present
only once per floating-point format, not once per type.

Note that if any platforms currently lacking support for a type with
binary128 format get glibc support for such a type in future (whether
only as _Float128, or also as a new long double format), and new libm
functions (present for all types) have been added by then, additional
macros will be needed to allow such functions to get a version of the
form "GLIBC_2.28 if the platform had _Float128 support by then, or the
later version at which that platform had _Float128 support added".
This is not however a preexisting condition, but would have applied
equally to the existing support for _Float128 as an ABI-distinct
type.  New all-type libm functions should just be added to the
appropriate symbol version (currently GLIBC_2.27) for all types, with
such special-case handling for _Float128 versions (and _Float64x as
well in future) waiting until someone actually wants to add support
for _Float128 to an existing platform after a release in which that
platform and a post-2.26 libm function had support but that platform
lacked _Float128 support.

Tested with build-many-glibcs.py that installed stripped shared
libraries are unchanged by this patch.  Also tested in conjunction
with the remaining changes to enable float128 aliases.

* sysdeps/generic/float128-abi.h: New file.
* sysdeps/ieee754/float128/Versions (FLOAT128_VERSION): Move
non-__prefixed symbols to ....
* math/Versions: ... here.  Include <float128-abi.h>.
* stdlib/Versions ... and here.  Include <float128-abi.h>

6 years agoversion.h: Switch to ".9000" as the suffix for the development version
Florian Weimer [Mon, 16 Oct 2017 19:39:18 +0000 (21:39 +0200)] 
version.h: Switch to ".9000" as the suffix for the development version

6 years agomalloc: Use compat_symbol_reference in libmcheck [BZ #22050]
Florian Weimer [Mon, 16 Oct 2017 18:52:34 +0000 (20:52 +0200)] 
malloc: Use compat_symbol_reference in libmcheck [BZ #22050]

Since glibc 2.24, __malloc_initialize_hook is a compat symbol.  As a
result, the link editor does not export a definition of
__malloc_initialize_hook from the main program, so that it no longer
interposes the variable definition in libc.so.  Specifying the symbol
version restores the exported symbol.

6 years agomalloc: Do not compile mcheck-init.o as libc module
Florian Weimer [Mon, 16 Oct 2017 18:50:04 +0000 (20:50 +0200)] 
malloc: Do not compile mcheck-init.o as libc module

Otherwise, this will lead to a link failure because the reference
to mcheck is hidden.

6 years agoshlib-compat: Update documentation of the compat_symbol_reference macro
Carlos O'Donell [Mon, 16 Oct 2017 18:43:28 +0000 (20:43 +0200)] 
shlib-compat: Update documentation of the compat_symbol_reference macro

6 years agoSupport running libm tests for float128 as alias for long double.
Joseph Myers [Mon, 16 Oct 2017 13:28:30 +0000 (13:28 +0000)] 
Support running libm tests for float128 as alias for long double.

This patch adds support for running libm tests for float128 in the
case where the float128 functions are aliases of long double
functions.  In this case, the sysdeps Makeconfig file
(i.e. sysdeps/ieee754/ldbl-128/Makeconfig) will need to define
"float128-alias-fcts = yes" to enable the tests.

Tested for x86_64.  Also tested with build-many-glibcs.py; installed
stripped shared libraries are unchanged by the patch.  Also tested
together with changes to enable the float128 aliases.

* math/Makefile (test-types): Add
$(type-float128-$(float128-alias-fcts)).
* math/test-float128.h (TYPE_STR): Define conditional on
[FLT128_MANT_DIG == LDBL_MANT_DIG].
(ULP_IDX): Likewise.
(ULP_I_IDX): Likewise.

6 years agoSupport strtof128 etc. aliases.
Joseph Myers [Mon, 16 Oct 2017 13:22:11 +0000 (13:22 +0000)] 
Support strtof128 etc. aliases.

This patch adds support for building strtof128, wcstof128, strtof128_l
and wcstof128_l as aliases, in the case of __HAVE_FLOAT128 &&
!__HAVE_DISTINCT_FLOAT128.

Tested with build-many-glibcs.py that installed stripped shared
libraries are unchanged by this patch.  Also tested together with
changes to enable float128 aliases.

* stdlib/strtold.c: Include <bits/floatn.h>
[__HAVE_FLOAT128 && !__HAVE_DISTINCT_FLOAT128] (strtof128): Define
and later undefine as macro.  Define as weak alias if
[!USE_WIDE_CHAR].
[__HAVE_FLOAT128 && !__HAVE_DISTINCT_FLOAT128] (wcstof128): Define
and later undefine as macro.  Define as weak alias if
[USE_WIDE_CHAR].
* sysdeps/ieee754/ldbl-128/strtold_l.c [__HAVE_FLOAT128 &&
!__HAVE_DISTINCT_FLOAT128] (strtof128_l): Define and later
undefine as macro.  Define as weak alias if [!USE_WIDE_CHAR].
[__HAVE_FLOAT128 && !__HAVE_DISTINCT_FLOAT128] (wcstof128_l):
Define and later undefine as macro.  Define as weak alias if
[USE_WIDE_CHAR].
* sysdeps/ieee754/ldbl-64-128/strtold_l.c: Include
<bits/floatn.h>.
[__HAVE_FLOAT128 && !__HAVE_DISTINCT_FLOAT128] (strtof128_l):
Define and later undefine as macro.  Define as weak alias if
[!USE_WIDE_CHAR].
[__HAVE_FLOAT128 && !__HAVE_DISTINCT_FLOAT128] (wcstof128_l):
Define and later undefine as macro.  Define as weak alias if
[USE_WIDE_CHAR].

6 years agolocale: Don't use \n with record_verbose messages.
Carlos O'Donell [Sat, 14 Oct 2017 22:38:05 +0000 (15:38 -0700)] 
locale: Don't use \n with record_verbose messages.

Recorded verbose messages no longer need to pass \n in their
message string since the record_verbose function adds \n to
the messages (like error and warnings do also). The avoids
seeing a double \n for verbose messages.

Signed-off-by: Carlos O'Donell <carlos@redhat.com>
6 years agoSilence -O3 -Wall warning in malloc/hooks.c with GCC 7 [BZ #22052]
H.J. Lu [Sun, 15 Oct 2017 15:16:26 +0000 (08:16 -0700)] 
Silence -O3 -Wall warning in malloc/hooks.c with GCC 7 [BZ #22052]

realloc_check has

  unsigned char *magic_p;
...
  __libc_lock_lock (main_arena.mutex);
  const mchunkptr oldp = mem2chunk_check (oldmem, &magic_p);
  __libc_lock_unlock (main_arena.mutex);
  if (!oldp)
    malloc_printerr ("realloc(): invalid pointer");
...
  if (newmem == NULL)
    *magic_p ^= 0xFF;

with

static void malloc_printerr(const char *str) __attribute__ ((noreturn));

GCC 7 -O3 warns

hooks.c: In function ‘realloc_check’:
hooks.c:352:14: error: ‘magic_p’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
     *magic_p ^= 0xFF;

due to the GCC bug:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82090

This patch silences GCC 7 by using DIAG_IGNORE_NEEDS_COMMENT.

[BZ #22052]
* malloc/hooks.c (realloc_check): Use DIAG_IGNORE_NEEDS_COMMENT
to silence -O3 -Wall warning with GCC 7.

6 years agoAdd a test for profiling static executable
H.J. Lu [Sat, 14 Oct 2017 19:58:40 +0000 (12:58 -0700)] 
Add a test for profiling static executable

The function, main, is added to profiling output of static executable
which must link against gcrt1.o.

* Makeconfig (+link-static-before-libc): Use the first of
$(CRT-$(@F)) and $(csu-objpfx)$(static-start-installed-name).
* gmon/Makefile (tests): Add tst-gmon-static.
(tests-static): Likewise.
(CFLAGS-tst-gmon-static.c): New.
(CRT-tst-gmon-static): Likewise.
(DEFAULT-LDFLAGS-tst-gmon-static): Likewise.
(tst-gmon-static-ENV): Likewise.
(tests-special): Likewise.
($(objpfx)tst-gmon-static.out): Likewise.
(clean-tst-gmon-static-data): Likewise.
($(objpfx)tst-gmon-static-gprof.out): Likewise.
* gmon/tst-gmon-static-gprof.sh: New file.
* gmon/tst-gmon-static.c: Likewise.

6 years agolocale: No warning for non-symbolic character (bug 22295)
Carlos O'Donell [Fri, 13 Oct 2017 21:36:23 +0000 (14:36 -0700)] 
locale: No warning for non-symbolic character (bug 22295)

In "Is it OK to write ASCII strings directly into locale source files?"
https://sourceware.org/ml/libc-alpha/2017-07/msg00807.html there is
universal consensus that we do not have to keep writing <Uxxxx> symbolic
characters in locale files.

Ulrich Drepper's historical comment was that symbolic characters were
used for the eventuality of converting the source files to any encoding
system. Fast forward to today and UTF-8 is the standard. So the
requirement of <Uxxxx> is hard to justify.

Zack Weinberg's excellent scripts are coming along we can use these to
find instances of human errors in the scripts:
https://sourceware.org/ml/libc-alpha/2017-07/msg00860.html
https://sourceware.org/ml/libc-alpha/2017-08/msg00136.html

It still won't be easy to distinguish from i for í, but that's still the
case for <Uxxxx> characters which humans can't read either.

Since we all agreed that we should be able to use non-symbolic (<Uxxxx>)
characters in locale files, the following change removes the verbose
warning that is raised if you use non-symbolic characters in the locale
file.

Signed-off-by: Carlos O'Donell <carlos@redhat.com>
6 years agolocale: Allow "" int_curr_Symbol (bug 22294)
Carlos O'Donell [Fri, 13 Oct 2017 21:33:09 +0000 (14:33 -0700)] 
locale: Allow "" int_curr_Symbol (bug 22294)

The builtin POSIX locale has "" as the international currency symbol,
but a non-builtin locale may not have such a blank int_curr_symbol.

Therefore to support non-builtin locales with similar "" int_curr_symbol
we adjust the LC_MONETARY parser to allow the normal 4-character
int_curr_symbol *and* the empty "" no symbol. Anything else remains
invalid.

Tested by building all the locales.  Tested also with a custom C.UTF-8
locale with "" for int_curr_symbol.

Signed-off-by: Carlos O'Donell <carlos@redhat.com>
6 years agolocale: Fix localedef exit code (Bug 22292)
Carlos O'Donell [Fri, 13 Oct 2017 16:54:03 +0000 (09:54 -0700)] 
locale: Fix localedef exit code (Bug 22292)

The error and warning handling in localedef, locale, and iconv
is a bit of a mess.

We use ugly constructs like this:
      WITH_CUR_LOCALE (error (1, errno, gettext ("\
cannot read character map directory `%s'"), directory));

to issue errors, and read error_message_count directly from the
error API to detect errors. The problem with that is that the
code also uses error to print warnings, and informative messages.
All of this leads to problems where just having warnings will
produce an exit status as-if errors had been seen.

To fix this situation I have adopted the following high-level
changes:
* All errors are counted distinctly.
* All warnings are counted distinctly.
* All informative messages are not counted.
* Increasing verbosity cannot generate *more* errors, and
  it previously did for errors conditional on verbose,
  this is now fixed.
* Increasing verbosity *can* generate *more* warnings.
* Making the output quiet cannot generate *fewer* errors,
  and it previously did for errors conditional on be_quiet,
  this is now fixed.
* Each of error, warning, and informative message has it's
  own function to call defined in record-status.h, and they
  are: record_error, record_warning, and record_verbose.
* The record_error function always records an error, but
  conditional on be_quiet may not print it.
* The record_warning function always records a warning,
  but conditional on be_quiet may not print it.
* The record_verbose function only prints the verbose
  message if verbose is true and be_quiet is false.

This has allowed the following fix:
* Previously any warnings were being treated as errors
  because they incremented error_message_count, but now
  we properly return an exit status of 1 if there are
  warnings but output was generated.

All of this allows localedef to correctly decide if errors,
or warnings were present, and produce the correct exit code.

The locale and iconv programs now also use record-status.h
and we have removed the WITH_CUR_LOCALE hack, and instead
have internal push_locale/pop_locale functions centralized
in the record routines.

Signed-off-by: Carlos O'Donell <carlos@redhat.com>
6 years agolocaledata: Reorganize Unicode LC_CTYPE inclusion.
Carlos O'Donell [Fri, 13 Oct 2017 06:52:14 +0000 (23:52 -0700)] 
localedata: Reorganize Unicode LC_CTYPE inclusion.

The commit does the following things:

* Move non-transliteration Unicode generated data to i18n_ctype.
* Copy the i18n_ctype data into i18n and add transliteration.

In the future, any locale which needs Unicode LC_CTYPE data can
also just use `copy i18n_ctype` and get the base character classes
and maps without transliteration.

Tested by compiling all the locales and my prototype C.UTF-8 which
uses it.

Signed-off-by: Carlos O'Donell <carlos@redhat.com>
6 years agoSupport strfromf128 alias.
Joseph Myers [Fri, 13 Oct 2017 23:09:48 +0000 (23:09 +0000)] 
Support strfromf128 alias.

This patch adds support for building strfromf128 as an alias of
strfroml, in the case of __HAVE_FLOAT128 && !__HAVE_DISTINCT_FLOAT128.

Tested with build-many-glibcs.py that installed stripped shared
libraries are unchanged by this patch.  Also tested together with
changes to enable float128 aliases.

* stdlib/strfroml.c: Include <bits/floatn.h>.
[__HAVE_FLOAT128 && !__HAVE_DISTINCT_FLOAT128] (strfromf128):
Define before include of <stdlib.h> and undefine afterwards, then
define as weak alias.

6 years agoUse libm_alias_ldouble_other in ldbl-64-128/s_nextafterl.c.
Joseph Myers [Fri, 13 Oct 2017 23:05:15 +0000 (23:05 +0000)] 
Use libm_alias_ldouble_other in ldbl-64-128/s_nextafterl.c.

This patch makes ldbl-64-128/s_nextafterl.c restore the default
weak_alias definition and use libm_alias_ldouble_other (having
undefined and redefined weak_alias for the include of
ldbl-128/s_nextafterl.c, so the libm_alias_ldouble use in the latter
file is ineffective).

Tested with build-many-glibcs.py that installed stripped shared
libraries are unchanged by this patch.  Also tested together with
changes to enable float128 aliases.

* sysdeps/ieee754/ldbl-64-128/s_nextafterl.c (weak_alias):
Undefine and restore default definition.  Use
libm_alias_ldouble_other.

6 years agonptl: Preserve error in setxid thread broadcast in coredumps [BZ #22153]
Peter Zelezny [Fri, 13 Oct 2017 20:49:49 +0000 (22:49 +0200)] 
nptl: Preserve error in setxid thread broadcast in coredumps [BZ #22153]

6 years agoFix TLS relocations against local symbols on powerpc32, sparc32 and sparc64
James Clarke [Fri, 13 Oct 2017 18:44:39 +0000 (15:44 -0300)] 
Fix TLS relocations against local symbols on powerpc32, sparc32 and sparc64

Normally, TLS relocations against local symbols are optimised by the linker
to be absolute.  However, gold does not do this, and so it is possible to
end up with, for example, R_SPARC_TLS_DTPMOD64 referring to a local symbol.
Since sym_map is left as null in elf_machine_rela for the special local
symbol case, the relocation handling thinks it has nothing to do, and so
the module gets left as 0.  Havoc then ensues when the variable in question
is accessed.

Before this fix, the main_local_gold program would receive a SIGBUS on
sparc64, and SIGSEGV on powerpc32.  With this fix applied, that test now
passes like the rest of them.

* sysdeps/powerpc/powerpc32/dl-machine.h (elf_machine_rela):
Assign sym_map to be map for local symbols, as TLS relocations
use sym_map to determine whether the symbol is defined and to
extract the TLS information.
* sysdeps/sparc/sparc32/dl-machine.h (elf_machine_rela): Likewise.
* sysdeps/sparc/sparc64/dl-machine.h (elf_machine_rela): Likewise.

6 years agopowerpc: Avoid putting floating point values in memory [BZ #22189]
Tulio Magno Quites Machado Filho [Fri, 13 Oct 2017 18:44:39 +0000 (15:44 -0300)] 
powerpc: Avoid putting floating point values in memory [BZ #22189]

[BZ #22189]
* sysdeps/powerpc/fpu/math_private.h (math_opt_barrier):
(math_force_eval): Add powerpc version.