upg psmisc glibc libusb

This commit is contained in:
joborun linux 2022-03-22 03:43:33 +02:00
parent d73f6728dc
commit 2f11a60174
9 changed files with 772 additions and 36 deletions

View File

@ -0,0 +1,69 @@
From 732dd3a63d39c7ca77e817b462285c14551c8b49 Mon Sep 17 00:00:00 2001
From: Carlos O'Donell <carlos@redhat.com>
Date: Thu, 3 Feb 2022 16:01:52 -0500
Subject: [PATCH] localedata: Do not generate output if warnings were present.
With LC_MONETARY parsing fixed we can now generate locales
without forcing output with '-c'.
Removing '-c' from localedef invocation is the equivalent of
using -Werror for localedef. The glibc locale sources should
always be clean and free from warnings.
We remove '-c' from both test locale generation and the targets
used for installing locales e.g. install-locale-archive, and
install-locale-files.
Tested on x86_64 and i686 without regressions.
Tested with install-locale-archive target.
Tested with install-locale-files target.
Reviewed-by: DJ Delorie <dj@redhat.com>
(cherry picked from commit 1c7a34567d21fbd3b706c77cd794956b43daefe7)
---
localedata/Makefile | 4 ++--
localedata/gen-locale.sh | 10 ++++++++--
2 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/localedata/Makefile b/localedata/Makefile
index 9ae2e5c161..7741ac3b5e 100644
--- a/localedata/Makefile
+++ b/localedata/Makefile
@@ -468,11 +468,11 @@ define build-one-locale
endef
$(INSTALL-SUPPORTED-LOCALE-ARCHIVE): install-locales-dir
- @flags="-c"; \
+ @flags=""; \
$(build-one-locale)
$(INSTALL-SUPPORTED-LOCALE-FILES): install-locales-dir
- @flags="-c --no-archive --no-hard-links"; \
+ @flags="--no-archive --no-hard-links"; \
$(build-one-locale)
tst-setlocale-ENV = LC_ALL=ja_JP.EUC-JP
diff --git a/localedata/gen-locale.sh b/localedata/gen-locale.sh
index 7fce35f212..8053c816a6 100644
--- a/localedata/gen-locale.sh
+++ b/localedata/gen-locale.sh
@@ -54,8 +54,14 @@ modifier=`echo $locfile|sed 's|[^.]*[.]\([^@ ]*\)\(@[^ ]*\)\?/LC_CTYPE|\2|'`
echo "Generating locale $locale.$charmap: this might take a while..."
-# Run quietly and force output.
-flags="--quiet -c"
+# Do not force output with '-c', all locales should compile without
+# warning or errors. There is likewise no need to run quietly with
+# '--quiet' since all locales should compile without additional
+# diagnostics. If there are messages printed then we want to see
+# them, fix them, and the associated error or warning. During
+# development it may be beneficialy to put '--quiet -c' here to allow
+# you to develop in-progress locales.
+flags=""
# For SJIS the charmap is SHIFT_JIS. We just want the locale to have
# a slightly nicer name instead of using "*.SHIFT_SJIS", but that
--
2.35.1

View File

@ -0,0 +1,302 @@
From 3feecd80013c822a12d4b01c5c25e155dfbc6e2f Mon Sep 17 00:00:00 2001
From: Carlos O'Donell <carlos@redhat.com>
Date: Thu, 3 Feb 2022 16:51:59 -0500
Subject: [PATCH] localedef: Update LC_MONETARY handling (Bug 28845)
ISO C17, POSIX Issue 7, and ISO 30112 all allow the char*
types to be empty strings i.e. "", integer or char values to
be -1 or CHAR_MAX respectively, with the exception of
decimal_point which must be non-empty in ISO C. Note that
the defaults for mon_grouping vary, but are functionaly
equivalent e.g. "\177" (no further grouping reuqired) vs.
"" (no grouping defined for all groups).
We include a broad comment talking about harmonizing ISO C,
POSIX, ISO 30112, and the default C/POSIX locale for glibc.
We reorder all setting based on locale/categories.def order.
We soften all missing definitions from errors to warnings when
defaults exist.
Given that ISO C, POSIX and ISO 30112 allow the empty string
we change LC_MONETARY handling of mon_decimal_point to allow
the empty string. If mon_decimal_point is not defined at all
then we pick the existing legacy glibc default value of
<U002E> i.e. ".".
We also set the default for mon_thousands_sep_wc at the
same time as mon_thousands_sep, but this is not a change in
behaviour, it is always either a matching value or L'\0',
but if in the future we change the default to a non-empty
string we would need to update both at the same time.
Tested on x86_64 and i686 without regressions.
Tested with install-locale-archive target.
Tested with install-locale-files target.
Reviewed-by: DJ Delorie <dj@redhat.com>
(cherry picked from commit 2ab8b74567dc0a9a3c98696e6444881997dd6c49)
---
locale/programs/ld-monetary.c | 182 +++++++++++++++++++++++++++-------
1 file changed, 146 insertions(+), 36 deletions(-)
diff --git a/locale/programs/ld-monetary.c b/locale/programs/ld-monetary.c
index 3b0412b405..18698bbe94 100644
--- a/locale/programs/ld-monetary.c
+++ b/locale/programs/ld-monetary.c
@@ -196,21 +196,105 @@ No definition for %s category found"), "LC_MONETARY");
}
}
+ /* Generally speaking there are 3 standards the define the default,
+ warning, and error behaviour of LC_MONETARY. They are ISO/IEC TR 30112,
+ ISO/IEC 9899:2018 (ISO C17), and POSIX.1-2017. Within 30112 we have the
+ definition of a standard i18n FDCC-set, which for LC_MONETARY has the
+ following default values:
+ int_curr_symbol ""
+ currency_symbol ""
+ mon_decimal_point "<U002C>" i.e. ","
+ mon_thousand_sep ""
+ mon_grouping "\177" i.e. CHAR_MAX
+ positive_sign ""
+ negative_sign "<U002E>" i.e. "."
+ int_frac_digits -1
+ frac_digits -1
+ p_cs_precedes -1
+ p_sep_by_space -1
+ n_cs_precedes -1
+ n_sep_by_space -1
+ p_sign_posn -1
+ n_sign_posn -1
+ Under 30112 a keyword that is not provided implies an empty string ""
+ for string values or a -1 for integer values, and indicates the value
+ is unspecified with no default implied. No errors are considered.
+ The exception is mon_grouping which is a string with a terminating
+ CHAR_MAX.
+ For POSIX Issue 7 we have:
+ https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap07.html
+ and again values not provided default to "" or -1, and indicate the value
+ is not available to the locale. The exception is mon_grouping which is
+ a string with a terminating CHAR_MAX. For the POSIX locale the values of
+ LC_MONETARY should be:
+ int_curr_symbol ""
+ currency_symbol ""
+ mon_decimal_point ""
+ mon_thousands_sep ""
+ mon_grouping "\177" i.e. CHAR_MAX
+ positive_sign ""
+ negative_sign ""
+ int_frac_digits -1
+ frac_digits -1
+ p_cs_precedes -1
+ p_sep_by_space -1
+ n_cs_precedes -1
+ n_sep_by_space -1
+ p_sign_posn -1
+ n_sign_posn -1
+ int_p_cs_precedes -1
+ int_p_sep_by_space -1
+ int_n_cs_precedes -1
+ int_n_sep_by_space -1
+ int_p_sign_posn -1
+ int_n_sign_posn -1
+ Like with 30112, POSIX also considers no error if the keywords are
+ missing, only that if the cateory as a whole is missing the referencing
+ of the category results in unspecified behaviour.
+ For ISO C17 there is no default value provided, but the localeconv
+ specification in 7.11.2.1 admits that members of char * type may point
+ to "" to indicate a value is not available or is of length zero.
+ The exception is decimal_point (not mon_decimal_point) which must be a
+ defined non-empty string. The values of char, which are generally
+ mapped to integer values in 30112 and POSIX, must be non-negative
+ numbers that map to CHAR_MAX when a value is not available in the
+ locale.
+ In ISO C17 for the "C" locale all values are empty strings "", or
+ CHAR_MAX, with the exception of decimal_point which is "." (defined
+ in LC_NUMERIC). ISO C17 makes no exception for mon_grouping like
+ 30112 and POSIX, but a value of "" is functionally equivalent to
+ "\177" since neither defines a grouping (though the latter terminates
+ the grouping).
+
+ Lastly, we must consider the legacy C/POSIX locale that implemented
+ as a builtin in glibc and wether a default value mapping to the
+ C/POSIX locale may benefit the user from a compatibility perspective.
+
+ Thus given 30112, POSIX, ISO C, and the builtin C/POSIX locale we
+ need to pick appropriate defaults below. */
+
+ /* The members of LC_MONETARY are handled in the order of their definition
+ in locale/categories.def. Please keep them in that order. */
+
+ /* The purpose of TEST_ELEM is to define a default value for the fields
+ in the category if the field was not defined in the cateory. If the
+ category was present but we didn't see a definition for the field then
+ we also issue a warning, otherwise the only warning you get is the one
+ earlier when a default category is created (completely missing category).
+ This missing field warning is glibc-specific since no standard requires
+ this warning, but we consider it valuable to print a warning for all
+ missing fields in the category. */
#define TEST_ELEM(cat, initval) \
if (monetary->cat == NULL) \
{ \
if (! nothing) \
- record_error (0, 0, _("%s: field `%s' not defined"), \
- "LC_MONETARY", #cat); \
+ record_warning (_("%s: field `%s' not defined"), \
+ "LC_MONETARY", #cat); \
monetary->cat = initval; \
}
+ /* Keyword: int_curr_symbol. */
TEST_ELEM (int_curr_symbol, "");
- TEST_ELEM (currency_symbol, "");
- TEST_ELEM (mon_thousands_sep, "");
- TEST_ELEM (positive_sign, "");
- TEST_ELEM (negative_sign, "");
-
/* The international currency symbol must come from ISO 4217. */
if (monetary->int_curr_symbol != NULL)
{
@@ -247,41 +331,63 @@ not correspond to a valid name in ISO 4217 [--no-warnings=intcurrsym]"),
}
}
- /* The decimal point must not be empty. This is not said explicitly
- in POSIX but ANSI C (ISO/IEC 9899) says in 4.4.2.1 it has to be
- != "". */
+ /* Keyword: currency_symbol */
+ TEST_ELEM (currency_symbol, "");
+
+ /* Keyword: mon_decimal_point */
+ /* ISO C17 7.11.2.1.3 explicitly allows mon_decimal_point to be the
+ empty string e.g. "". This indicates the value is not available in the
+ current locale or is of zero length. However, if the value was never
+ defined then we issue a warning and use a glibc-specific default. ISO
+ 30112 in the i18n FDCC-Set uses <U002C> ",", and POSIX Issue 7 in the
+ POSIX locale uses "". It is specific to glibc that the default is <U002E>
+ "."; we retain this existing behaviour for backwards compatibility. */
if (monetary->mon_decimal_point == NULL)
{
if (! nothing)
- record_error (0, 0, _("%s: field `%s' not defined"),
- "LC_MONETARY", "mon_decimal_point");
+ record_warning (_("%s: field `%s' not defined, using defaults"),
+ "LC_MONETARY", "mon_decimal_point");
monetary->mon_decimal_point = ".";
monetary->mon_decimal_point_wc = L'.';
}
- else if (monetary->mon_decimal_point[0] == '\0' && ! be_quiet && ! nothing)
+
+ /* Keyword: mon_thousands_sep */
+ if (monetary->mon_thousands_sep == NULL)
{
- record_error (0, 0, _("\
-%s: value for field `%s' must not be an empty string"),
- "LC_MONETARY", "mon_decimal_point");
+ if (! nothing)
+ record_warning (_("%s: field `%s' not defined, using defaults"),
+ "LC_MONETARY", "mon_thousands_sep");
+ monetary->mon_thousands_sep = "";
+ monetary->mon_thousands_sep_wc = L'\0';
}
+ /* Keyword: mon_grouping */
if (monetary->mon_grouping_len == 0)
{
if (! nothing)
- record_error (0, 0, _("%s: field `%s' not defined"),
- "LC_MONETARY", "mon_grouping");
-
+ record_warning (_("%s: field `%s' not defined"),
+ "LC_MONETARY", "mon_grouping");
+ /* Missing entries are given 1 element in their bytearray with
+ a value of CHAR_MAX which indicates that "No further grouping
+ is to be performed" (functionally equivalent to ISO C's "C"
+ locale default of ""). */
monetary->mon_grouping = (char *) "\177";
monetary->mon_grouping_len = 1;
}
+ /* Keyword: positive_sign */
+ TEST_ELEM (positive_sign, "");
+
+ /* Keyword: negative_sign */
+ TEST_ELEM (negative_sign, "");
+
#undef TEST_ELEM
#define TEST_ELEM(cat, min, max, initval) \
if (monetary->cat == -2) \
{ \
if (! nothing) \
- record_error (0, 0, _("%s: field `%s' not defined"), \
- "LC_MONETARY", #cat); \
+ record_warning (_("%s: field `%s' not defined"), \
+ "LC_MONETARY", #cat); \
monetary->cat = initval; \
} \
else if ((monetary->cat < min || monetary->cat > max) \
@@ -300,16 +406,11 @@ not correspond to a valid name in ISO 4217 [--no-warnings=intcurrsym]"),
TEST_ELEM (p_sign_posn, -1, 4, -1);
TEST_ELEM (n_sign_posn, -1, 4, -1);
- /* The non-POSIX.2 extensions are optional. */
- if (monetary->duo_int_curr_symbol == NULL)
- monetary->duo_int_curr_symbol = monetary->int_curr_symbol;
- if (monetary->duo_currency_symbol == NULL)
- monetary->duo_currency_symbol = monetary->currency_symbol;
-
- if (monetary->duo_int_frac_digits == -2)
- monetary->duo_int_frac_digits = monetary->int_frac_digits;
- if (monetary->duo_frac_digits == -2)
- monetary->duo_frac_digits = monetary->frac_digits;
+ /* Keyword: crncystr */
+ monetary->crncystr = (char *) xmalloc (strlen (monetary->currency_symbol)
+ + 2);
+ monetary->crncystr[0] = monetary->p_cs_precedes ? '-' : '+';
+ strcpy (&monetary->crncystr[1], monetary->currency_symbol);
#undef TEST_ELEM
#define TEST_ELEM(cat, alt, min, max) \
@@ -327,6 +428,17 @@ not correspond to a valid name in ISO 4217 [--no-warnings=intcurrsym]"),
TEST_ELEM (int_p_sign_posn, p_sign_posn, -1, 4);
TEST_ELEM (int_n_sign_posn, n_sign_posn, -1, 4);
+ /* The non-POSIX.2 extensions are optional. */
+ if (monetary->duo_int_curr_symbol == NULL)
+ monetary->duo_int_curr_symbol = monetary->int_curr_symbol;
+ if (monetary->duo_currency_symbol == NULL)
+ monetary->duo_currency_symbol = monetary->currency_symbol;
+
+ if (monetary->duo_int_frac_digits == -2)
+ monetary->duo_int_frac_digits = monetary->int_frac_digits;
+ if (monetary->duo_frac_digits == -2)
+ monetary->duo_frac_digits = monetary->frac_digits;
+
TEST_ELEM (duo_p_cs_precedes, p_cs_precedes, -1, 1);
TEST_ELEM (duo_p_sep_by_space, p_sep_by_space, -1, 2);
TEST_ELEM (duo_n_cs_precedes, n_cs_precedes, -1, 1);
@@ -349,17 +461,15 @@ not correspond to a valid name in ISO 4217 [--no-warnings=intcurrsym]"),
if (monetary->duo_valid_to == 0)
monetary->duo_valid_to = 99991231;
+ /* Keyword: conversion_rate */
if (monetary->conversion_rate[0] == 0)
{
monetary->conversion_rate[0] = 1;
monetary->conversion_rate[1] = 1;
}
- /* Create the crncystr entry. */
- monetary->crncystr = (char *) xmalloc (strlen (monetary->currency_symbol)
- + 2);
- monetary->crncystr[0] = monetary->p_cs_precedes ? '-' : '+';
- strcpy (&monetary->crncystr[1], monetary->currency_symbol);
+ /* A value for monetary-decimal-point-wc was set when
+ monetary_decimal_point was set, likewise for monetary-thousands-sep-wc. */
}
--
2.35.1

View File

@ -11,11 +11,11 @@
pkgbase=glibc
pkgname=(glibc lib32-glibc)
pkgver=2.35
pkgrel=02
pkgrel=03
arch=(x86_64)
url='https://www.gnu.org/software/libc'
makedepends=(git gd lib32-gcc-libs python)
optdepends=('perl: for mtrace')
#optdepends=('perl: for mtrace')
options=(!strip staticlibs !lto)
#_commit=3de512be7ea6053255afed6154db9ee31d4e557a
#source=(git+https://sourceware.org/git/glibc.git#commit=$_commit
@ -24,7 +24,10 @@ source=(https://ftp.gnu.org/gnu/glibc/glibc-$pkgver.tar.xz{,.sig}
locale-gen
lib32-glibc.conf
sdt.h sdt-config.h
disable-clone3.diff)
disable-clone3.diff
0001-localedef-Update-LC_MONETARY-handling-Bug-28845.patch
0001-localedata-Do-not-generate-output-if-warnings-were-p.patch
)
prepare() {
mkdir -p glibc-build lib32-glibc-build
@ -38,6 +41,11 @@ prepare() {
# Patch src: https://patchwork.ozlabs.org/project/glibc/patch/87eebkf8ph.fsf@oldenburg.str.redhat.com/
patch -Np1 -i "${srcdir}"/disable-clone3.diff
# Fix C.UTF-8 generation errors
# https://bugs.archlinux.org/task/73797
patch -Np1 -i "${srcdir}"/0001-localedef-Update-LC_MONETARY-handling-Bug-28845.patch
patch -Np1 -i "${srcdir}"/0001-localedata-Do-not-generate-output-if-warnings-were-p.patch
}
build() {
@ -45,15 +53,11 @@ build() {
--prefix=/usr
--with-headers=/usr/include
--with-bugurl=https://bugs.archlinux.org/
--enable-add-ons
--enable-bind-now
--enable-cet
--enable-kernel=4.4
--enable-lock-elision
--enable-multi-arch
--enable-stack-protector=strong
--enable-stackguard-randomization
--enable-static-pie
--enable-systemtap
--disable-profile
--disable-crypt
@ -150,17 +154,15 @@ skip_test() {
package_glibc() {
pkgdesc='GNU C Library w/o systemd'
depends=('linux-api-headers>=4.10' tzdata filesystem)
optdepends=('gd: for memusagestat')
optdepends=('gd: for memusagestat'
'perl: for mtrace')
install=glibc.install
backup=(etc/gai.conf
etc/locale.gen
etc/nscd.conf)
install -dm755 "$pkgdir/etc"
touch "$pkgdir/etc/ld.so.conf"
make -C glibc-build install_root="$pkgdir" install
rm -f "$pkgdir"/etc/ld.so.{cache,conf}
rm -f "$pkgdir"/etc/ld.so.cache
# Shipped in tzdata
rm -f "$pkgdir"/usr/bin/{tzselect,zdump,zic}
@ -169,7 +171,6 @@ package_glibc() {
install -dm755 "$pkgdir"/usr/lib/{locale,tmpfiles.d}
install -m644 nscd/nscd.conf "$pkgdir/etc/nscd.conf"
# install -m644 nscd/nscd.service "$pkgdir/usr/lib/systemd/system"
install -m644 nscd/nscd.tmpfiles "$pkgdir/usr/lib/tmpfiles.d/nscd.conf"
install -dm755 "$pkgdir/var/db/nscd"
@ -188,20 +189,17 @@ package_glibc() {
# Do not strip these for gdb and valgrind functionality, but strip the rest
find "$pkgdir"/usr/lib \
-not -name 'ld-*.so' \
-not -name 'libc-*.so' \
-not -name 'libpthread-*.so' \
-not -name 'libthread_db-*.so' \
-name '*-*.so' -type f -exec strip $STRIP_SHARED {} + 2> /dev/null || true
-not -name 'ld-*.so*' \
-not -name 'libc.so*' \
-not -name 'libpthread.so*' \
-not -name 'libthread_db.so*' \
-name '*.so*' -type f -exec strip $STRIP_SHARED {} + 2> /dev/null || true
fi
# Provide tracing probes to libstdc++ for exceptions, possibly for other
# libraries too. Useful for gdb's catch command.
install -Dm644 "$srcdir/sdt.h" "$pkgdir/usr/include/sys/sdt.h"
install -Dm644 "$srcdir/sdt-config.h" "$pkgdir/usr/include/sys/sdt-config.h"
# Provided by libxcrypt; keep the old shared library for backwards compatibility
rm -f "$pkgdir"/usr/include/crypt.h "$pkgdir"/usr/lib/libcrypt.{a,so}
}
package_lib32-glibc() {
@ -255,4 +253,6 @@ sha256sums=(5123732f6b67ccd319305efd399971d58592122bcc2a6518a1bd2510dd0cf52e # g
c27424154a6096ae32c0824b785e05de6acef33d9224fd6147d1936be9b4962b # lib32-glibc.conf
774061aff612a377714a509918a9e0e0aafce708b87d2d7e06b1bd1f6542fe70 # sdt.h
cdc234959c6fdb43f000d3bb7d1080b0103f4080f5e67bcfe8ae1aaf477812f0 # sdt-config.h
f5df8fc95592cce7825744aeb8c9699a5b4b5b7ccf7bcf554355167c3a7e375e) # disable-clone3.diff
f5df8fc95592cce7825744aeb8c9699a5b4b5b7ccf7bcf554355167c3a7e375e # disable-clone3.diff
0fbfee1dbe867c1e1d135d3bdc6fbe32d5629aa5eff555123355d21341271a82 # 0001-localedef-Update-LC_MONETARY-handling-Bug-28845.patch
2a3da2150c45d2ee811d6e837838029927eb40e50c901452e155545fa5144c54) # 0001-localedata-Do-not-generate-output-if-warnings-were-p.patch

247
glibc/PKGBUILD-arch.new Normal file
View File

@ -0,0 +1,247 @@
# Maintainer: Giancarlo Razzolini <grazzolini@archlinux.org>
# Maintainer: Frederik Schwan <freswa at archlinux dot org>
# Contributor: Bartłomiej Piotrowski <bpiotrowski@archlinux.org>
# Contributor: Allan McRae <allan@archlinux.org>
# toolchain build order: linux-api-headers->glibc->binutils->gcc->glibc->binutils->gcc
# NOTE: valgrind requires rebuilt with each major glibc version
pkgbase=glibc
pkgname=(glibc lib32-glibc)
pkgver=2.35
pkgrel=3
arch=(x86_64)
url='https://www.gnu.org/software/libc'
license=(GPL LGPL)
makedepends=(git gd lib32-gcc-libs python)
options=(!strip staticlibs !lto)
#_commit=3de512be7ea6053255afed6154db9ee31d4e557a
#source=(git+https://sourceware.org/git/glibc.git#commit=$_commit
source=(https://ftp.gnu.org/gnu/glibc/glibc-$pkgver.tar.xz{,.sig}
locale.gen.txt
locale-gen
lib32-glibc.conf
sdt.h sdt-config.h
disable-clone3.diff
0001-localedef-Update-LC_MONETARY-handling-Bug-28845.patch
0001-localedata-Do-not-generate-output-if-warnings-were-p.patch
)
validpgpkeys=(7273542B39962DF7B299931416792B4EA25340F8 # Carlos O'Donell
BC7C7372637EC10C57D7AA6579C43DFBF1CF2187) # Siddhesh Poyarekar
b2sums=('623c728884f070cd87ffeb9203f74206197c52405ac9bc44f3dd519a3468b8e8ae2536c883e5d17d94417dbd1e91775de2e674314e4ff7424f9720026d6b7063'
'SKIP'
'46d533d25c7a2ce4ae75d452eee7ebb8e3ce4d191af9be3daa43718b78cb81d33cfd8046a117a15d87de9f5e940448c66005b0490515bf731c9e4691c53908d6'
'1f6d927b4972220b1c00abee5329c5d6bc01ed5bee57b20db0c7d7433292f7d666b02baf9968267f8e378b1f3bb273e8eef0ccbf22d21400ac36949d7615a474'
'7c265e6d36a5c0dff127093580827d15519b6c7205c2e1300e82f0fb5b9dd00b6accb40c56581f18179c4fbbc95bd2bf1b900ace867a83accde0969f7b609f8a'
'a6a5e2f2a627cc0d13d11a82458cfd0aa75ec1c5a3c7647e5d5a3bb1d4c0770887a3909bfda1236803d5bc9801bfd6251e13483e9adf797e4725332cd0d91a0e'
'214e995e84b342fe7b2a7704ce011b7c7fc74c2971f98eeb3b4e677b99c860addc0a7d91b8dc0f0b8be7537782ee331999e02ba48f4ccc1c331b60f27d715678'
'edef5f724f68ea95c6b0127bd13a10245f548afc381b2d0a6d1d06ee9f87b7dd89c6becd35d5ae722bf838594eb870a747f67f07f46e7d63f8c8d1a43cce4a52'
'3c4de02d6308a4d39693e6effa08894ae096397347e439b93b0b5328aba41a373f7f2eeb88c109970f69cca65aaa74ba14e384d6d033f6a913438f4f920854a6'
'b6014af23688ea971d7af38d58829c8016a0af63770b7f5e8bc986c13ea2cafefe0935ff483b1b37c87ebe3e652b6e0c48ab43dd8ae752d0ed7fecc3751432f4')
prepare() {
mkdir -p glibc-build lib32-glibc-build
[[ -d glibc-$pkgver ]] && ln -s glibc-$pkgver glibc
cd glibc
# Disable clone3 syscall for now
# Can be removed when eletron{9,11,12} and discord are removed or patched:
# https://github.com/electron/electron/commit/993ecb5bdd5c57024c8718ca6203a8f924d6d574
# Patch src: https://patchwork.ozlabs.org/project/glibc/patch/87eebkf8ph.fsf@oldenburg.str.redhat.com/
patch -Np1 -i "${srcdir}"/disable-clone3.diff
# Fix C.UTF-8 generation errors
# https://bugs.archlinux.org/task/73797
patch -Np1 -i "${srcdir}"/0001-localedef-Update-LC_MONETARY-handling-Bug-28845.patch
patch -Np1 -i "${srcdir}"/0001-localedata-Do-not-generate-output-if-warnings-were-p.patch
}
build() {
local _configure_flags=(
--prefix=/usr
--with-headers=/usr/include
--with-bugurl=https://bugs.archlinux.org/
--enable-bind-now
--enable-cet
--enable-kernel=4.4
--enable-multi-arch
--enable-stack-protector=strong
--enable-systemtap
--disable-profile
--disable-crypt
--disable-werror
)
cd "$srcdir/glibc-build"
echo "slibdir=/usr/lib" >> configparms
echo "rtlddir=/usr/lib" >> configparms
echo "sbindir=/usr/bin" >> configparms
echo "rootsbindir=/usr/bin" >> configparms
# Credits @allanmcrae
# https://github.com/allanmcrae/toolchain/blob/f18604d70c5933c31b51a320978711e4e6791cf1/glibc/PKGBUILD
# remove fortify for building libraries
CFLAGS=${CFLAGS/-Wp,-D_FORTIFY_SOURCE=2/}
"$srcdir/glibc/configure" \
--libdir=/usr/lib \
--libexecdir=/usr/lib \
"${_configure_flags[@]}"
# build libraries with fortify disabled
echo "build-programs=no" >> configparms
make -O
# re-enable fortify for programs
sed -i "/build-programs=/s#no#yes#" configparms
echo "CFLAGS += -Wp,-D_FORTIFY_SOURCE=2" >> configparms
make -O
# build info pages manually for reproducibility
make info
cd "$srcdir/lib32-glibc-build"
export CC="gcc -m32 -mstackrealign"
export CXX="g++ -m32 -mstackrealign"
echo "slibdir=/usr/lib32" >> configparms
echo "rtlddir=/usr/lib32" >> configparms
echo "sbindir=/usr/bin" >> configparms
echo "rootsbindir=/usr/bin" >> configparms
"$srcdir/glibc/configure" \
--host=i686-pc-linux-gnu \
--libdir=/usr/lib32 \
--libexecdir=/usr/lib32 \
"${_configure_flags[@]}"
# build libraries with fortify disabled
echo "build-programs=no" >> configparms
make -O
# re-enable fortify for programs
sed -i "/build-programs=/s#no#yes#" configparms
echo "CFLAGS += -Wp,-D_FORTIFY_SOURCE=2" >> configparms
make -O
}
# Credits for skip_test() and check() @allanmcrae
# https://github.com/allanmcrae/toolchain/blob/f18604d70c5933c31b51a320978711e4e6791cf1/glibc/PKGBUILD
skip_test() {
test=$1
file=$2
sed -i "s/\b$test\b//" $srcdir/glibc/$file
}
check() {
cd glibc-build
# adjust/remove buildflags that cause false-positive testsuite failures
sed -i '/FORTIFY/d' configparms # failure to build testsuite
sed -i 's/-Werror=format-security/-Wformat-security/' config.make # failure to build testsuite
sed -i '/CFLAGS/s/-fno-plt//' config.make # 16 failures
sed -i '/CFLAGS/s/-fexceptions//' config.make # 1 failure
LDFLAGS=${LDFLAGS/,-z,now/} # 10 failures
# The following tests fail due to restrictions in the Arch build system
# The correct fix is to add the following to the systemd-nspawn call:
# --system-call-filter="@clock @memlock @pkey"
skip_test test-errno-linux sysdeps/unix/sysv/linux/Makefile
skip_test tst-ntp_gettime sysdeps/unix/sysv/linux/Makefile
skip_test tst-ntp_gettimex sysdeps/unix/sysv/linux/Makefile
skip_test tst-mlock2 sysdeps/unix/sysv/linux/Makefile
skip_test tst-pkey sysdeps/unix/sysv/linux/Makefile
skip_test tst-adjtime time/Makefile
skip_test tst-clock2 time/Makefile
make -O check
}
package_glibc() {
pkgdesc='GNU C Library'
depends=('linux-api-headers>=4.10' tzdata filesystem)
optdepends=('gd: for memusagestat'
'perl: for mtrace')
install=glibc.install
backup=(etc/gai.conf
etc/locale.gen
etc/nscd.conf)
make -C glibc-build install_root="$pkgdir" install
rm -f "$pkgdir"/etc/ld.so.cache
# Shipped in tzdata
rm -f "$pkgdir"/usr/bin/{tzselect,zdump,zic}
cd glibc
install -dm755 "$pkgdir"/usr/lib/{locale,systemd/system,tmpfiles.d}
install -m644 nscd/nscd.conf "$pkgdir/etc/nscd.conf"
install -m644 nscd/nscd.service "$pkgdir/usr/lib/systemd/system"
install -m644 nscd/nscd.tmpfiles "$pkgdir/usr/lib/tmpfiles.d/nscd.conf"
install -dm755 "$pkgdir/var/db/nscd"
install -m644 posix/gai.conf "$pkgdir"/etc/gai.conf
install -m755 "$srcdir/locale-gen" "$pkgdir/usr/bin"
# Create /etc/locale.gen
install -m644 "$srcdir/locale.gen.txt" "$pkgdir/etc/locale.gen"
sed -e '1,3d' -e 's|/| |g' -e 's|\\| |g' -e 's|^|#|g' \
"$srcdir/glibc/localedata/SUPPORTED" >> "$pkgdir/etc/locale.gen"
if check_option 'debug' n; then
find "$pkgdir"/usr/bin -type f -executable -exec strip $STRIP_BINARIES {} + 2> /dev/null || true
find "$pkgdir"/usr/lib -name '*.a' -type f -exec strip $STRIP_STATIC {} + 2> /dev/null || true
# Do not strip these for gdb and valgrind functionality, but strip the rest
find "$pkgdir"/usr/lib \
-not -name 'ld-*.so*' \
-not -name 'libc.so*' \
-not -name 'libpthread.so*' \
-not -name 'libthread_db.so*' \
-name '*.so*' -type f -exec strip $STRIP_SHARED {} + 2> /dev/null || true
fi
# Provide tracing probes to libstdc++ for exceptions, possibly for other
# libraries too. Useful for gdb's catch command.
install -Dm644 "$srcdir/sdt.h" "$pkgdir/usr/include/sys/sdt.h"
install -Dm644 "$srcdir/sdt-config.h" "$pkgdir/usr/include/sys/sdt-config.h"
}
package_lib32-glibc() {
pkgdesc='GNU C Library (32-bit)'
depends=("glibc=$pkgver")
options+=('!emptydirs')
cd lib32-glibc-build
make install_root="$pkgdir" install
rm -rf "$pkgdir"/{etc,sbin,usr/{bin,sbin,share},var}
# We need to keep 32 bit specific header files
find "$pkgdir/usr/include" -type f -not -name '*-32.h' -delete
# Dynamic linker
install -d "$pkgdir/usr/lib"
ln -s ../lib32/ld-linux.so.2 "$pkgdir/usr/lib/"
# Add lib32 paths to the default library search path
install -Dm644 "$srcdir/lib32-glibc.conf" "$pkgdir/etc/ld.so.conf.d/lib32-glibc.conf"
# Symlink /usr/lib32/locale to /usr/lib/locale
ln -s ../lib/locale "$pkgdir/usr/lib32/locale"
if check_option 'debug' n; then
find "$pkgdir"/usr/lib32 -name '*.a' -type f -exec strip $STRIP_STATIC {} + 2> /dev/null || true
find "$pkgdir"/usr/lib32 \
-not -name 'ld-*.so*' \
-not -name 'libc.so*' \
-not -name 'libpthread.so*' \
-not -name 'libthread_db.so*' \
-name '*.so*' -type f -exec strip $STRIP_SHARED {} + 2> /dev/null || true
fi
}

View File

@ -0,0 +1,109 @@
From d46cbbac4851ce6e49d8dacb0daa328453eb8a84 Mon Sep 17 00:00:00 2001
From: Benjamin Berg <bberg@redhat.com>
Date: Tue, 22 Feb 2022 11:45:38 +0100
Subject: [PATCH] core: Install first context as implicit default
There was a behaviour change in libusb, which triggers issues when the
API is misused. This caused gutenprint to crash, see
https://bugzilla.redhat.com/show_bug.cgi?id=2055504
For now, work around this by installing an implicit default. But, change
the code to log an error in case this "feature" is being used.
---
libusb/core.c | 16 +++++++++++++---
libusb/libusbi.h | 15 ++++++++++++++-
tests/umockdev.c | 31 +++++++++++++++++++++++++++++++
3 files changed, 58 insertions(+), 4 deletions(-)
diff --git a/libusb/core.c b/libusb/core.c
index 1c1ada1..c75ddae 100644
--- a/libusb/core.c
+++ b/libusb/core.c
@@ -41,6 +41,7 @@ static libusb_log_cb log_handler;
#endif
struct libusb_context *usbi_default_context;
+struct libusb_context *usbi_fallback_context;
static int default_context_refcnt;
static usbi_mutex_static_t default_context_lock = USBI_MUTEX_INITIALIZER;
static struct usbi_option default_context_options[LIBUSB_OPTION_MAX];
@@ -2284,7 +2285,7 @@ int API_EXPORTED libusb_init(libusb_context **ctx)
usbi_mutex_static_lock(&default_context_lock);
- if (!ctx && usbi_default_context) {
+ if (!ctx && default_context_refcnt > 0) {
usbi_dbg(usbi_default_context, "reusing default context");
default_context_refcnt++;
usbi_mutex_static_unlock(&default_context_lock);
@@ -2354,9 +2355,15 @@ int API_EXPORTED libusb_init(libusb_context **ctx)
goto err_io_exit;
}
- if (ctx)
+ if (ctx) {
*ctx = _ctx;
+ if (!usbi_fallback_context) {
+ usbi_fallback_context = _ctx;
+ usbi_warn(usbi_fallback_context, "installing new context as implicit default");
+ }
+ }
+
usbi_mutex_static_unlock(&default_context_lock);
return 0;
@@ -2429,6 +2436,8 @@ void API_EXPORTED libusb_exit(libusb_context *ctx)
if (!ctx)
usbi_default_context = NULL;
+ if (ctx == usbi_fallback_context)
+ usbi_fallback_context = NULL;
usbi_mutex_static_unlock(&default_context_lock);
@@ -2575,7 +2584,8 @@ static void log_v(struct libusb_context *ctx, enum libusb_log_level level,
#else
enum libusb_log_level ctx_level;
- ctx = usbi_get_context(ctx);
+ ctx = ctx ? ctx : usbi_default_context;
+ ctx = ctx ? ctx : usbi_fallback_context;
if (ctx)
ctx_level = ctx->debug;
else
diff --git a/libusb/libusbi.h b/libusb/libusbi.h
index 5f0d5c2..580add8 100644
--- a/libusb/libusbi.h
+++ b/libusb/libusbi.h
@@ -436,13 +436,26 @@ struct libusb_context {
};
extern struct libusb_context *usbi_default_context;
+extern struct libusb_context *usbi_fallback_context;
extern struct list_head active_contexts_list;
extern usbi_mutex_static_t active_contexts_lock;
static inline struct libusb_context *usbi_get_context(struct libusb_context *ctx)
{
- return ctx ? ctx : usbi_default_context;
+ static int warned = 0;
+
+ if (!ctx) {
+ ctx = usbi_default_context;
+ }
+ if (!ctx) {
+ ctx = usbi_fallback_context;
+ if (ctx && warned == 0) {
+ usbi_err(ctx, "API misuse! Using non-default context as implicit default.");
+ warned = 1;
+ }
+ }
+ return ctx;
}
enum usbi_event_flags {
--
2.35.1

View File

@ -7,7 +7,7 @@
pkgname=libusb
pkgver=1.0.25
pkgrel=02
pkgrel=03
pkgdesc="Library that provides generic access to USB devices w/o systemd"
arch=(x86_64)
url="https://libusb.info/"
@ -15,12 +15,14 @@ depends=('glibc')
makedepends=()
provides=('libusb-1.0.so')
#options=(debug)
source=("https://github.com/${pkgname}/${pkgname}/releases/download/v$pkgver/${pkgname}-$pkgver.tar.bz2")
# "${pkgname}-1.0.24-descriptor_parsing.patch"
source=("https://github.com/${pkgname}/${pkgname}/releases/download/v$pkgver/${pkgname}-$pkgver.tar.bz2"
0001-core-Install-first-context-as-implicit-default.patch)
prepare() {
cd "$pkgname-$pkgver"
# patch -Np1 -i ../"${pkgname}-1.0.24-descriptor_parsing.patch"
# FS#74110 / Work around API misuse in gutenprint - patch taken from Fedora
patch -Np1 -i "$srcdir"/0001-core-Install-first-context-as-implicit-default.patch
autoreconf -fiv
}
@ -46,4 +48,5 @@ package () {
license=('LGPL2.1')
sha256sums=(8a28ef197a797ebac2702f095e81975e2b02b2eeff2774fa909c78a74ef50849) # libusb-1.0.25.tar.bz2
sha256sums=(8a28ef197a797ebac2702f095e81975e2b02b2eeff2774fa909c78a74ef50849 # libusb-1.0.25.tar.bz2
8b4f772775767c75a4f68fb182d12064e009c1d3146599463b82ff347ec06a2f) # 0001-core-Install-first-context-as-implicit-default.patch

View File

@ -4,7 +4,7 @@
pkgname=libusb
pkgver=1.0.25
pkgrel=2
pkgrel=3
pkgdesc="Library that provides generic access to USB devices"
arch=(x86_64)
url="https://libusb.info/"
@ -13,12 +13,17 @@ depends=(glibc)
makedepends=(systemd)
provides=(libusb-1.0.so)
options=(debug)
source=("https://github.com/${pkgname}/${pkgname}/releases/download/v$pkgver/${pkgname}-$pkgver.tar.bz2")
sha512sums=('f1e6e5577d4bd1ff136927dc66c615014a06ac332ddd797b1d1ad5f7b68e2405e66068dcb210e2f0ae3e31681603ef72efbd88bf7fbe0eb41ce700fdc3f92f9d')
b2sums=('3aecfbf9fc068fdfb8e612918bb895988f8400dc2c3ffd96a81792ab844d632f0c098947200512ddc37cfa9003956f8454c1d0362973a5d646a225f81cc2923b')
source=("https://github.com/${pkgname}/${pkgname}/releases/download/v$pkgver/${pkgname}-$pkgver.tar.bz2"
0001-core-Install-first-context-as-implicit-default.patch)
sha512sums=('f1e6e5577d4bd1ff136927dc66c615014a06ac332ddd797b1d1ad5f7b68e2405e66068dcb210e2f0ae3e31681603ef72efbd88bf7fbe0eb41ce700fdc3f92f9d'
'0a8575ca6c155d2fe3c7720ca24b502a93f47ce879235cbf58120396044a7345e049032b9c66258a92b5ba4d8cc8c4afda566f4772cddd8305abdf8742d9e55b')
b2sums=('3aecfbf9fc068fdfb8e612918bb895988f8400dc2c3ffd96a81792ab844d632f0c098947200512ddc37cfa9003956f8454c1d0362973a5d646a225f81cc2923b'
'008b2629c73f7358cb13b93123f94634e410aacaf491074be67c4fac54ecb2aa5cde93d4f0c076148e7ac7cf8530250496d801506d0250dccce89fd57d3cb380')
prepare() {
cd "$pkgname-$pkgver"
# FS#74110 / Work around API misuse in gutenprint - patch taken from Fedora
patch -Np1 -i "$srcdir"/0001-core-Install-first-context-as-implicit-default.patch
autoreconf -fiv
}

View File

@ -1,11 +1,12 @@
#!/usr/bin/bash
# JOBoRun : Jwm OpenBox Obarun RUNit
# Maintainer : Joe Bo Run <joborun@disroot.org>
# Maintainer : Joe Bo Run <joborun@disroot.org>
# PkgSource : url="https://gittea.disroot.org/joborun-pkg/jobcore/$pkgname"
# Website : https://pozol.eu
#-----------------------------------------| DESCRIPTION |---------------------------------------
pkgname=psmisc
pkgver=23.4
pkgver=23.5rc1
pkgrel=01
pkgdesc='Miscellaneous procfs tools'
arch=('x86_64')
@ -31,5 +32,5 @@ package() {
license=('GPL')
sha256sums=(7f0cceeace2050c525f3ebb35f3ba01d618b8d690620580bdb8cd8269a0c1679) # psmisc-23.4.tar.xz
sha256sums=(a1213aa338ca1406715aaaa9e8a653dfe2da5acc54e291c876b42247fe1d85ff) # psmisc-23.5rc1.tar.xz
#7f0cceeace2050c525f3ebb35f3ba01d618b8d690620580bdb8cd8269a0c1679) # psmisc-23.4.tar.xz

View File

@ -1,7 +1,7 @@
# Maintainer: Eric Bélanger <eric@archlinux.org>
pkgname=psmisc
pkgver=23.4
pkgver=23.5rc1
pkgrel=1
pkgdesc='Miscellaneous procfs tools'
arch=('x86_64')
@ -9,7 +9,7 @@ url='https://gitlab.com/psmisc/psmisc'
license=('GPL')
depends=('ncurses')
source=("https://downloads.sourceforge.net/psmisc/${pkgname}-${pkgver}.tar.xz")
sha256sums=('7f0cceeace2050c525f3ebb35f3ba01d618b8d690620580bdb8cd8269a0c1679')
sha256sums=('a1213aa338ca1406715aaaa9e8a653dfe2da5acc54e291c876b42247fe1d85ff')
build() {
cd ${pkgname}-${pkgver}