Merge ~mwhudson/ubuntu/+source/glibc:patch-review-tool into ~ubuntu-core-dev/ubuntu/+source/glibc:ubuntu/jammy

Proposed by Michael Hudson-Doyle
Status: Merged
Merged at revision: 875693633871e5ebeedeab9f6e6f234bc0357d24
Proposed branch: ~mwhudson/ubuntu/+source/glibc:patch-review-tool
Merge into: ~ubuntu-core-dev/ubuntu/+source/glibc:ubuntu/jammy
Diff against target: 1233 lines (+1193/-0)
6 files modified
debian/changelog (+10/-0)
debian/maint/review (+673/-0)
debian/maint/state.txt (+209/-0)
debian/patches/series (+3/-0)
debian/patches/upstream-updates/0001-S390-Add-new-s390-platform-z16.patch (+250/-0)
debian/patches/upstream-updates/0002-powerpc-Fix-VSX-register-number-on-__strncpy_power9-.patch (+48/-0)
Reviewer Review Type Date Requested Status
Ubuntu Core Development Team Pending
Review via email: mp+426222@code.launchpad.net

Description of the change

Add an overengineered tool to track which commits from the upstream release branch to include and use it to include just two commits for now.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index 6d571f3..3db6c2c 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,13 @@
6+glibc (2.35-0ubuntu4) UNRELEASED; urgency=medium
7+
8+ * debian/maint: add a script to manage backports of patches from upstream
9+ maintenance branch.
10+ * Cherry-pick patches from upstream maintenance branch:
11+ - 0001-S390-Add-new-s390-platform-z16.patch
12+ - 0002-powerpc-Fix-VSX-register-number-on-__strncpy_power9-.patch
13+
14+ -- Michael Hudson-Doyle <michael.hudson@ubuntu.com> Tue, 05 Jul 2022 09:54:00 +1200
15+
16 glibc (2.35-0ubuntu3) jammy; urgency=medium
17
18 * debian/rules.d/build.mk: build with --with-default-link=no.
19diff --git a/debian/maint/review b/debian/maint/review
20new file mode 100755
21index 0000000..09c0394
22--- /dev/null
23+++ b/debian/maint/review
24@@ -0,0 +1,673 @@
25+#!/usr/bin/python3
26+
27+"""
28+Stupidly overengineered script to help decide which commits to cherry-pick.
29+
30+glibc upstream maintains a release branch for each release
31+(release/$VER/master) which gets backports of selected commits from
32+the master branch. However, upstream's policy is just a little less
33+conservative than feels appropriate for an SRU so I'm not comfortable
34+just taking all updates from the branch (in particular, many of the
35+commits that are being backported have not yet been part of a glibc
36+release).
37+
38+This script is designed to help decide which patchsets to include in an
39+upload. The decisions are recorded in a hopefully mostly-readable file
40+state.txt alongside this file. Patchsets can be in four states:
41+
42+ * NEW -- no decision has been made about this yet
43+ * NO -- we have decided not to include this
44+ * YES -- this is to be included
45+ * LATER -- we will proably include this in a subsequent upload
46+
47+It has subcommands:
48+
49+ * debian/maint/review import
50+ * debian/maint/review review
51+ * debian/maint/review export
52+ * debian/maint/review dch
53+
54+## import
55+
56+This scans the upstream release branch (assumed to be the 'origin'
57+remote in the same repo) and adds any new ones to the state.txt
58+file. It applies some heuristics to group commits into patchsets
59+
60+## review
61+
62+This is an interactive command that allows review of the commits in
63+state.txt (and the most over-engineered part of all this). There are
64+keypresses to allow navigation, moving, joining, splitting and
65+reviewing patchsets (press 'h' to get started).
66+
67+## export
68+
69+This synchronizes debian/patches with state.txt.
70+
71+## dch
72+
73+This constructs a changelog entry for the newly added patches
74+(i.e. ones that are not yet mentioned in the changelog).
75+"""
76+
77+
78+import attr
79+import enum
80+import os
81+import pathlib
82+import shutil
83+import signal
84+import subprocess
85+import sys
86+import termios
87+import tempfile
88+import tty
89+import uuid
90+from typing import List
91+
92+
93+SCRIPT_DIR = pathlib.Path(__file__).resolve().parent
94+SOURCE_DIR = SCRIPT_DIR.parent.parent
95+STATE_FILE = SCRIPT_DIR.joinpath('state.txt')
96+
97+
98+class ReviewState(enum.Enum):
99+
100+ NEW = "?"
101+ NO = "N"
102+ YES = "Y"
103+ LATER = "L"
104+
105+
106+@attr.s(auto_attribs=True)
107+class PatchSet:
108+ _state: "State" = None
109+ index: int = -1
110+
111+ hashes: List[str] = attr.Factory(list)
112+ messages: List[str] = attr.Factory(list)
113+ bugs: List[str] = attr.Factory(list)
114+ review_state: ReviewState = ReviewState.NEW
115+ comment: str = ''
116+ first_patch_name: str = ''
117+
118+ def prev(self):
119+ if self.index == 0:
120+ return None
121+ return self._state[self.index - 1]
122+
123+ def next(self):
124+ if self.index >= len(self._state) - 1:
125+ return None
126+ return self._state[self.index + 1]
127+
128+
129+class State:
130+
131+ def __init__(self):
132+ self._patchsets = []
133+
134+ def __iter__(self):
135+ return iter(self._patchsets)
136+
137+ def __len__(self):
138+ return len(self._patchsets)
139+
140+ def __getitem__(self, thing):
141+ return self._patchsets[thing]
142+
143+ def add(self, patchset, index=None):
144+ patchset._state = self
145+ if index is None:
146+ patchset.index = len(self._patchsets)
147+ self._patchsets.append(patchset)
148+ else:
149+ patchset.index = index
150+ self._patchsets.insert(index, patchset)
151+ for p2 in self._patchsets[index+1:]:
152+ p2.index += 1
153+
154+ def remove(self, patchset):
155+ for p2 in self._patchsets[patchset.index+1:]:
156+ p2.index -= 1
157+ del self._patchsets[patchset.index]
158+
159+ def with_state(self, *states):
160+ return [ps for ps in self._patchsets if ps.review_state in states]
161+
162+ def load(self, path):
163+ self.load_path = path
164+ try:
165+ fp = path.open()
166+ except FileNotFoundError:
167+ return
168+
169+ blocks = []
170+ with fp:
171+ cur = []
172+ for line in fp:
173+ line = line.strip()
174+ if not line:
175+ if cur:
176+ blocks.append(cur)
177+ cur = []
178+ else:
179+ cur.append(line)
180+ if cur:
181+ blocks.append(cur)
182+
183+ for block in blocks:
184+ hashes = []
185+ messages = []
186+ bugs = []
187+ state = None
188+ comment = ''
189+ state = getattr(ReviewState, block[0])
190+ first_patch_name = ''
191+ for line in block[1:]:
192+ if line[0] in '#':
193+ comment += line[2:] + '\n'
194+ elif line.startswith("LP#"):
195+ bugs.append(line[3:])
196+ elif line.startswith("FirstPatch: "):
197+ first_patch_name = line.split(None, 1)[1]
198+ else:
199+ hash, message = line.split(None, 1)
200+ hashes.append(hash)
201+ messages.append(message)
202+ self.add(
203+ PatchSet(
204+ hashes=hashes,
205+ review_state=state,
206+ comment=comment,
207+ messages=messages,
208+ bugs=bugs,
209+ first_patch_name=first_patch_name))
210+
211+ def save(self, path=None):
212+ if path is None:
213+ path = self.load_path
214+ with path.open('w') as fp:
215+ yes_patches = []
216+ other_patches = []
217+ for patchset in self._patchsets:
218+ if patchset.review_state == ReviewState.YES:
219+ yes_patches.append(patchset)
220+ else:
221+ other_patches.append(patchset)
222+ for patchset in yes_patches + other_patches:
223+ fp.write(patchset.review_state.name + '\n')
224+ if patchset.comment:
225+ for line in patchset.comment.splitlines():
226+ fp.write('# {}\n'.format(line))
227+ for bug in patchset.bugs:
228+ fp.write("LP#{}\n".format(bug))
229+ if patchset.first_patch_name:
230+ fp.write(
231+ "FirstPatch: {}\n".format(patchset.first_patch_name))
232+ if len(patchset.hashes) != len(patchset.messages):
233+ raise Exception("erp {}".format(patchset))
234+ for hash, message in zip(patchset.hashes, patchset.messages):
235+ fp.write('{} {}\n'.format(hash, message))
236+ fp.write('\n')
237+
238+
239+V = "2.35"
240+
241+
242+def getch():
243+ fd = sys.stdin.fileno()
244+ old_settings = termios.tcgetattr(fd)
245+ try:
246+ tty.setcbreak(fd)
247+ ch = sys.stdin.read(1)
248+ finally:
249+ termios.tcsetattr(fd, termios.TCSADRAIN, old_settings)
250+ return ch
251+
252+
253+def getoption(prompt, keymap):
254+ orig = keymap
255+ sys.stdout.write(prompt)
256+ sys.stdout.flush()
257+ while True:
258+ c = getch()
259+ try:
260+ keymap = keymap[c]
261+ except KeyError:
262+ keymap = orig
263+ else:
264+ if not isinstance(keymap, dict):
265+ return keymap
266+
267+
268+def getupdown():
269+ prompt = '[(u)p (d)own (c)ancel]: '
270+ keymap = {'u': 'up', 'd': 'down', 'c': 'cancel'}
271+ return getoption(prompt, keymap)
272+
273+
274+def git(cmd):
275+ env = os.environ.copy()
276+ env['LESS'] = 'RX'
277+ try:
278+ subprocess.check_call(['git'] + cmd, cwd=SOURCE_DIR, env=env)
279+ except subprocess.CalledProcessError as e:
280+ if e.returncode == -signal.SIGPIPE:
281+ return
282+ raise
283+
284+
285+def git_output(cmd):
286+ return subprocess.check_output(
287+ ['git'] + cmd, cwd=SOURCE_DIR, encoding='utf-8')
288+
289+
290+cmds = {}
291+
292+
293+def command(name=None):
294+ def w(func):
295+ if name is None:
296+ cmds[func.__name__] = func
297+ else:
298+ cmds[name] = func
299+ return func
300+ return w
301+
302+
303+@command("import")
304+def import_(state):
305+ # Update state with new commits on release branch.
306+ seen_hashes = set()
307+ for patchset in state._patchsets:
308+ for hash in patchset.hashes:
309+ seen_hashes.add(hash)
310+
311+ output = git_output([
312+ 'log', '--reverse', '--format=%H %ct %s',
313+ # If I'd written this script before 2.35 got uploaded, this line would
314+ # be:
315+ # f'glibc-{V}..origin/release/{V}/master'
316+ # but here we hard code the last revision that became part of
317+ # debian/patches/git-updates.diff:
318+ f'e30c1c73da3f220f5bf0063a1d0344f8280311e7..origin/release/{V}/master'
319+ ])
320+ imported = 0
321+ limit = 0
322+ hashes = []
323+ messages = []
324+ for line in output.splitlines():
325+ hash, timestamp, message = line.split(None, 2)
326+ if hash in seen_hashes:
327+ continue
328+ timestamp = int(timestamp)
329+ if timestamp <= limit:
330+ hashes.append(hash)
331+ messages.append(message)
332+ else:
333+ if hashes:
334+ state.add(PatchSet(hashes=hashes, messages=messages))
335+ imported = imported + 1
336+ hashes = [hash]
337+ messages = [message]
338+ limit = timestamp + 60
339+ if hashes:
340+ state.add(PatchSet(hashes=hashes, messages=messages))
341+ imported = imported + 1
342+ print("Imported patch sets: {}".format(imported))
343+
344+
345+review_opts = {}
346+review_keymap = {}
347+keys = {
348+ 'up': '\033[A',
349+ 'down': '\033[B',
350+ }
351+
352+
353+def opt(shortcut=None):
354+ def w(func):
355+ if shortcut is not None:
356+ s = shortcut
357+ else:
358+ s = func.__name__[0]
359+ review_opts[s] = func.__name__.replace('_', ' ')
360+ review_keymap[keys.get(s, s)] = func
361+ return staticmethod(func)
362+ return w
363+
364+
365+class ReviewOpts:
366+
367+ @opt()
368+ def diff(patchset):
369+ git(['show'] + patchset.hashes)
370+
371+ @opt()
372+ def log(patchset):
373+ git(['show', '--no-patch'] + patchset.hashes)
374+
375+ @opt('up')
376+ def prev(patchset):
377+ return patchset.index - 1
378+
379+ @opt('down')
380+ def next(patchset):
381+ return patchset.index + 1
382+
383+ @opt('N')
384+ def next_unreviewed(patchset):
385+ for ps in patchset._state[patchset.index+1:]:
386+ if ps.review_state == ReviewState.NEW:
387+ return ps.index
388+ return None
389+
390+ @opt()
391+ def first(patchset):
392+ return 0
393+
394+ @opt()
395+ def end(patchset):
396+ return len(patchset._state) - 1
397+
398+ @opt('/')
399+ def find(patchset):
400+ needle = input('search for: ')
401+ if not needle:
402+ return
403+ for ps in patchset._state[patchset.index+1:]:
404+ for message in ps.messages:
405+ if needle in message:
406+ return ps.index
407+
408+ @opt()
409+ def comment(patchset):
410+ with tempfile.NamedTemporaryFile('w') as fp:
411+ fp.write(patchset.comment)
412+ fp.flush()
413+ subprocess.run(['vim', fp.name])
414+ with open(fp.name) as fp2:
415+ patchset.comment = fp2.read()
416+
417+ @opt('b')
418+ def edit_bugs(patchset):
419+ with tempfile.NamedTemporaryFile('w') as fp:
420+ for bug in patchset.bugs:
421+ fp.write(bug + "\n")
422+ fp.flush()
423+ subprocess.run(['vim', fp.name])
424+ with open(fp.name) as fp2:
425+ patchset.bugs = [line.strip() for line in fp2]
426+
427+ @opt()
428+ def no(patchset):
429+ patchset.review_state = ReviewState.NO
430+ return patchset.index + 1
431+
432+ @opt('?')
433+ def new(patchset):
434+ patchset.review_state = ReviewState.NEW
435+ return patchset.index + 1
436+
437+ @opt()
438+ def yes(patchset):
439+ patchset.review_state = ReviewState.YES
440+ return patchset.index + 1
441+
442+ @opt()
443+ def later(patchset):
444+ patchset.review_state = ReviewState.LATER
445+ return patchset.index + 1
446+
447+ @opt()
448+ def split(patchset):
449+ if len(patchset.hashes) <= 1:
450+ return
451+ if len(patchset.hashes) > 2:
452+ subprocess.run('clear')
453+ print()
454+ log(patchset, SPLIT_FORMAT)
455+ while True:
456+ at = input("Split after: ")
457+ if not at:
458+ return
459+ try:
460+ at = int(at)
461+ except ValueError:
462+ continue
463+ break
464+ else:
465+ at = 1
466+ if at <= 0 or at >= len(patchset.hashes):
467+ return
468+ new_hashes = patchset.hashes[at:]
469+ del patchset.hashes[at:]
470+ new_messages = patchset.messages[at:]
471+ del patchset.messages[at:]
472+ patchset._state.add(
473+ PatchSet(
474+ hashes=new_hashes,
475+ messages=new_messages,
476+ review_state=patchset.review_state),
477+ patchset.index+1)
478+
479+ @opt()
480+ def join(patchset):
481+ dir = getupdown()
482+ if dir == 'cancel':
483+ return
484+ elif dir == 'down':
485+ patchset = patchset.next()
486+ r = None
487+ else:
488+ r = patchset.index - 1
489+ patchset.prev().hashes += patchset.hashes
490+ patchset.prev().messages += patchset.messages
491+ patchset._state.remove(patchset)
492+ return r
493+
494+ @opt()
495+ def move(patchset):
496+ i = patchset.index
497+ ps = patchset._state._patchsets
498+ dir = getupdown()
499+ if dir == 'cancel':
500+ return
501+ elif dir == 'up':
502+ r = patchset.index - 1
503+ d = -1
504+ elif dir == 'down':
505+ r = None
506+ d = 1
507+ other = ps[i + d]
508+ other.index, patchset.index = patchset.index, other.index
509+ ps[i], ps[i + d] = ps[i + d], ps[i]
510+ return r
511+
512+ @opt()
513+ def quit(patchset):
514+ patchset._state.save()
515+ sys.exit()
516+
517+ @opt('S')
518+ def save(patchset):
519+ patchset._state.save()
520+
521+ @opt('x')
522+ def exit_no_save(patchset):
523+ sys.exit()
524+
525+ @opt()
526+ def help(patchset):
527+ for k in sorted(review_opts):
528+ print(k, '-', review_opts[k])
529+ getch()
530+
531+
532+def compile_keymap(keymap):
533+ r = {}
534+ for key, value in keymap.items():
535+ first = key[:1]
536+ r.setdefault(first, {})[key[1:]] = value
537+ for key, value in r.items():
538+ if '' in value:
539+ if len(value) != 1:
540+ raise Exception(
541+ "key definitions for %s clash" % (value.values(),))
542+ else:
543+ r[key] = value['']
544+ else:
545+ r[key] = compile_keymap(value)
546+ return r
547+
548+
549+review_prompt = '[' + ','.join(sorted(review_opts)) + ']: '
550+review_keymap = compile_keymap(review_keymap)
551+
552+
553+def _cc(r, g, b):
554+ return '8;2;{};{};{}'.format(r, g, b)
555+
556+
557+def _sgr(param):
558+ return '\x1b[0;3{}m'.format(param)
559+
560+
561+YELLOW = _sgr(_cc(255, 255, 0))
562+DIM = _sgr(_cc(128, 128, 128))
563+DEFAULT = _sgr(9)
564+
565+
566+DIM_FORMAT = '%s{status[0]} {hash} {message}%s' % (DIM, DEFAULT)
567+DEFAULT_FORMAT = '{status[0]} %s{hash}%s {message}' % (YELLOW, DEFAULT)
568+SPLIT_FORMAT = '{i} %s{hash}%s {message}' % (YELLOW, DEFAULT)
569+
570+
571+def log(patchset, format):
572+ if patchset is None:
573+ return
574+ for i, (hash, message) in enumerate(
575+ zip(patchset.hashes, patchset.messages), 1):
576+ print(format.format(
577+ i=i, status=patchset.review_state.value,
578+ hash=hash[:7], message=message))
579+
580+
581+@command()
582+def review(state):
583+ for index, patchset in enumerate(state):
584+ if patchset.review_state == ReviewState.NEW:
585+ break
586+ else:
587+ index = 0
588+ while True:
589+ patchset = state._patchsets[index]
590+ subprocess.run('clear')
591+ print()
592+ log(patchset.prev(), DIM_FORMAT)
593+ log(patchset, DEFAULT_FORMAT)
594+ log(patchset.next(), DIM_FORMAT)
595+ print()
596+ print('current state: ', patchset.review_state)
597+ if patchset.comment:
598+ print('comment:')
599+ print(patchset.comment)
600+ if patchset.bugs:
601+ print('bugs:', ','.join(patchset.bugs))
602+ print()
603+ meth = getoption(review_prompt, review_keymap)
604+ print()
605+ next = meth(patchset)
606+ if next is not None:
607+ if next < 0:
608+ next = 0
609+ if next >= len(state) - 1:
610+ next = len(state) - 1
611+ index = next
612+
613+
614+@command()
615+def export(state):
616+ # sync the state with debian/patches/upstream-updates
617+ series = SOURCE_DIR.joinpath('debian/patches/series')
618+ new_series = []
619+ with series.open() as fp:
620+ for line in fp:
621+ if not line.startswith('upstream-updates/'):
622+ new_series.append(line)
623+
624+ updates = SOURCE_DIR.joinpath('debian/patches/upstream-updates')
625+ if updates.is_dir():
626+ shutil.rmtree(updates)
627+ updates.mkdir()
628+
629+ to_export = state.with_state(ReviewState.YES)
630+
631+ new_patches = []
632+
633+ for index1, ps in enumerate(to_export, 1):
634+ for index2, hash in enumerate(ps.hashes, 1):
635+ with tempfile.TemporaryDirectory() as tdir:
636+ tdir = pathlib.Path(tdir)
637+ git(['format-patch', '--quiet', '-1', hash, '-o', tdir])
638+ patch = list(tdir.iterdir())[0]
639+ prefix = f'{index1:04}'
640+ if len(ps.hashes) > 1:
641+ prefix += f'-{index2:02}'
642+ new_name = f'{prefix}{patch.name[4:]}'
643+ patch = patch.rename(updates.joinpath(new_name))
644+ print('generated', patch.relative_to(SOURCE_DIR))
645+ new_patches.append(f'upstream-updates/{new_name}\n')
646+ if index2 == 1:
647+ ps.first_patch_name = new_name
648+
649+ with series.open('w') as fp:
650+ fp.write(''.join(new_patches))
651+ if new_series[0].strip():
652+ fp.write('\n')
653+ fp.write(''.join(new_series))
654+
655+
656+@command()
657+def dch(state):
658+ u = str(uuid.uuid4())
659+ subprocess.run(['dch', u], cwd=SOURCE_DIR)
660+ updates = SOURCE_DIR.joinpath('debian/patches/upstream-updates')
661+ patches = {patch.name for patch in updates.iterdir()}
662+ changelog_lines = []
663+ target_line = 0
664+ with SOURCE_DIR.joinpath('debian/changelog').open() as fp:
665+ for i, line in enumerate(fp):
666+ for p in patches:
667+ if p in line:
668+ patches.remove(p)
669+ break
670+ if u in line:
671+ target_line = i
672+ changelog_lines.append(line)
673+ if not patches:
674+ return
675+ content = ' * Cherry-pick patches from upstream maintenance branch:\n'
676+ by_patch_name = {
677+ ps.first_patch_name: ps for ps in state if ps.first_patch_name
678+ }
679+ for patch in sorted(patches):
680+ suffix = ''
681+ bugs = getattr(by_patch_name.get(patch), 'bugs', None)
682+ if bugs:
683+ suffix = ' (LP: {})'.format(",".join("#" + bug for bug in bugs))
684+ content += ' - ' + patch + suffix + '\n'
685+ changelog_lines[target_line] = content
686+ with SOURCE_DIR.joinpath('debian/changelog').open('w') as fp:
687+ fp.write(''.join(changelog_lines))
688+
689+
690+if len(sys.argv) != 2 or sys.argv[1] not in cmds:
691+ print("review import|review|export|dch")
692+ sys.exit(1)
693+cmd = cmds[sys.argv[1]]
694+global_state = State()
695+global_state.load(STATE_FILE)
696+cmd(global_state)
697+global_state.save()
698diff --git a/debian/maint/state.txt b/debian/maint/state.txt
699new file mode 100644
700index 0000000..2d77e9c
701--- /dev/null
702+++ b/debian/maint/state.txt
703@@ -0,0 +1,209 @@
704+YES
705+LP#1971612
706+6583d534458e7f8beec8d0766b6db0bdaae6749c S390: Add new s390 platform z16.
707+
708+YES
709+LP#1978130
710+0a1572b8bb880a63d50a63b2afe4bb67704ac23e powerpc: Fix VSX register number on __strncpy_power9 [BZ #29197]
711+
712+LATER
713+3149f47b808288ccfbf4e56234bc07bdae139708 io: Add fsync call in tst-stat
714+
715+LATER
716+c54c5cd8e30ef82041b525ca4880685c673357ee nss: Do not mention NSS test modules in <gnu/lib-names.h>
717+
718+LATER
719+123bd1ec66d2d7ea4683e9563bd94adc67f41544 nss: Protect against errno changes in function lookup (bug 28953)
720+
721+NO
722+# lol hppa
723+01d5214bb44990323fa8474b7e4119949ac9733f hppa: Implement swapcontext in assembler (bug 28960)
724+9be62976af04f4166a2c1cc5a842ef07bf223860 hppa: Use END instead of PSEUDO_END in swapcontext.S
725+
726+LATER
727+db03235895150a91fb5bd84dd3f49b4d8ec8bc72 NEWS: Move PLT tracking slowdown to glibc 2.35.
728+
729+LATER
730+cc9a4a664faac44fe62b6300b878cf5be514658b elf: Fix memory leak in _dl_find_object_update (bug 29062)
731+
732+LATER
733+ba9c42ac0e265bf1e4ec1075fa20e7166fda8bfc nptl: Handle spurious EINTR when thread cancellation is disabled (BZ#29029)
734+68d3a9a69696b46f2e552330dd0de5512c36302d nptl: Fix pthread_cancel cancelhandling atomic operations
735+
736+NO
737+bd415684df590b14d4970acc93ad28719fffe4c1 hurd: Fix arbitrary error code
738+
739+NO
740+8e8d46d59809824054dde501b0ba0e331a747078 mips: Fix mips64n32 64 bit time_t stat support (BZ#29069)
741+
742+NO
743+d3feff2232ec27f05ca619ca8b314155d9018224 m68k: Handle fewer relocations for RTLD_BOOTSTRAP (#BZ29071)
744+
745+LATER
746+70f1eecdc12dbfc742f29844be215eacf51c5014 scripts: Add glibcelf.py module
747+499a60179657d2945c6ad01bdac90e8427a6310e Default to --with-default-link=no (bug 25812)
748+e5cf8ccca655c0eb831574785a6087f3950852eb INSTALL: Rephrase -with-default-link documentation
749+cb4d670d8f0f6ef4725094ea18a62729d852ce67 scripts/glibcelf.py: Mark as UNSUPPORTED on Python 3.5 and earlier
750+
751+LATER
752+c8ee1c85c07b3c9eaef46355cb1095300855e8fa misc: Fix rare fortify crash on wchar funcs. [BZ 29030]
753+
754+LATER
755+106b7e0e45b258672a9c6f0e1de96baeb17a513f dlfcn: Do not use rtld_active () to determine ld.so state (bug 29078)
756+
757+LATER
758+10fe3cd309b32c003a6b98e08928e7d6007caecf elf: Fix DFS sorting algorithm for LD_TRACE_LOADED_OBJECTS with missing libraries (BZ #28868)
759+
760+LATER
761+ef875993483a1fa5253f98f8341f717ea5e53f53 linux: Fix missing internal 64 bit time_t stat usage
762+
763+LATER
764+14b1e32a4d366efacd6c54e7be8c2bfcc088dd6f i386: Regenerate ulps
765+
766+LATER
767+7d96aa2d7dba5a7d9c80334f1860445bd76fdc7b linux: Fix fchmodat with AT_SYMLINK_NOFOLLOW for 64 bit time_t (BZ#29097)
768+
769+LATER
770+dde291ab531010d604e8cda4483a2e94fc5d606d posix/glob.c: update from gnulib
771+
772+LATER
773+edc06fdd62331d400553675b79c30ce77bef4357 Update syscall lists for Linux 5.17
774+e72c363a15402ea2714d3519f2e126a416d1123b Update kernel version to 5.16 in tst-mman-consts.py
775+eed29011f9b29317a4025b2a6e04a531663a1023 Update kernel version to 5.17 in tst-mman-consts.py
776+95759abbf3c33e66e1e2663f80406eae3dd66587 Add SOL_MPTCP, SOL_MCTP from Linux 5.16 to bits/socket.h
777+0bcba53020b8f4363acefb1697cf6f026cbaa170 Add HWCAP2_AFP, HWCAP2_RPRES from Linux 5.17 to AArch64 bits/hwcap.h
778+
779+LATER
780+ec5b79aac7688bb1ff807376acfcc9b9afd4dcbf manual: Clarify that abbreviations of long options are allowed
781+
782+NO
783+# Maybe it's cowardly but I don't really want to backport a bunch of performance
784+# optimizations that too a few goes to get right unless someone asks for them
785+# specifically...
786+b68e782f8e16fc3f45ab967c291cfb9628e59f6e x86: Optimize strcmp-avx2.S
787+34ef8109458ff5d7263892f330cc06ad3e19d6a7 x86: Optimize strcmp-evex.S
788+250e277797b8e368ce55e0101c76864f52d2b29e x86-64: Fix strcmp-avx2.S
789+36766c02afa5255fbd8676e5d25eaa9ca07141de x86-64: Fix strcmp-evex.S
790+58596411ade4cacb76f4144117c40ab28e823b03 x86: Improve vec generation in memset-vec-unaligned-erms.S
791+0bf9c8b5feb8c73517ab4dbf47533875021e7c1c x86: Remove SSSE3 instruction for broadcast in memset.S (SSE2 Only)
792+de0cd691b2095912f9128fabfb572d835938d655 x86-64: Optimize bzero
793+c394d7e11a2cc5d99dc1ba3833727c37536d4838 x86: Set .text section in memset-vec-unaligned-erms
794+676f7bcf11ad0bdae098a45fd7d48c1040cde4e1 x86: Fix bug in strncmp-evex and strncmp-avx2 [BZ #28895]
795+059e36d9ed5f5c3c6fc1ab8e12cd0cf226dd3e0a x86: Fix fallback for wcsncmp_avx2 in strcmp-avx2.S [BZ #28896]
796+
797+LATER
798+5c0d94d780598a298c9e8685fd811fab9664c368 linux: Fix posix_spawn return code if clone fails (BZ#29109)
799+bbb017a2bb2983de297f3d443c59221fbff92e30 NEWS: Add a bug fix entry for BZ #29109
800+
801+NO
802+78f82ab4ef839b52df022234aff63e2d4d7f264f manual: Document the dlinfo function
803+28ea43f8d64f0dd1f2de75525157730e1532e600 dlfcn: Implement the RTLD_DI_PHDR request type for dlinfo
804+
805+LATER
806+58947e1fa593cff7b5513d5e8e0c81b0131984b4 fortify: Ensure that __glibc_fortify condition is a constant [BZ #29141]
807+
808+NO
809+d422197a6974390f7f46ffdd64df72e778bb4ae7 x86: Improve L to support L(XXX_SYMBOL (YYY, ZZZ))
810+
811+NO
812+18baf86f51dc34bcdd1f4b26018795908dd46477 x86_64/multiarch: Sort sysdep_routines and put one entry per line
813+
814+NO
815+a1336230489a2ff4ff3e8da9c96227de69ba19e5 x86-64: Remove bzero weak alias in SS2 memset
816+
817+NO
818+f0a53588da7d6b642eeabdbd934d799ed0df2b8f x86-64: Define __memcmpeq in ld.so
819+
820+NO
821+0a10b8b181d0ad84c5f8a7c42f4932528b2964bc x86_64: Remove bcopy optimizations
822+
823+NO
824+# more string optimizations that can wait for explicit request
825+424bbd4d2502c43cf36372d588cbca161cafea43 x86: Code cleanup in strchr-avx2 and comment justifying branch
826+ff9772ac190c101a5f6e68f4fb7ce852326ffe27 x86: Code cleanup in strchr-evex and comment justifying branch
827+3214c878f2a4546f296d9892169c06b3676c3133 x86: Optimize strcspn and strpbrk in strcspn-c.c
828+1ed2813eb14526934091ecf65184747b4b5582dc x86: Optimize strspn in strspn-c.c
829+2fef1961a7ba992c51df04dc6c5bffdfd5adb41b x86: Remove strcspn-sse2.S and use the generic implementation
830+4b61d7652164786786c4b154e2903929281fd09e x86: Remove strpbrk-sse2.S and use the generic implementation
831+420cd6f155bf3dd4ff252843991ebe896e35c7ec x86: Remove strspn-sse2.S and use the generic implementation
832+283982b36211e694755ef74592f2a1d70369aff3 x86: Optimize str{n}casecmp TOLOWER logic in strcmp.S
833+3496d64d6934ba34d636864a550dcf1828b5a987 x86: Optimize str{n}casecmp TOLOWER logic in strcmp-sse42.S
834+33fcf8344fe037dab408d2fe057a9d5f9abb05b7 x86: Add AVX2 optimized str{n}casecmp
835+fc5d42bf826b37e56b3a4f41e63e31c6d4ea5f8e x86: Add EVEX optimized str{n}casecmp
836+3b710e32d8381809c69a6d9b2a1ee9c8afb2c3c2 x86: Remove AVX str{n}casecmp
837+af0865571a973d72da8cec29001ed411e12556b0 x86: Small improvements for wcslen
838+5a8df6485c584e2b0e957ec6b9070437a724911a x86: Optimize memcmp SSE2 in memcmp.S
839+0909286ffabddd7e59cf85a539e8d43406819952 x86: Remove memcmp-sse4.S
840+cee9939f67607483110bad9db84c62ce9d71721b x86: Cleanup page cross code in memcmp-avx2-movbe.S
841+4d1841deb740f23ab063a65fd875e53934b65883 x86: Fix missing __wmemcmp def for disable-multiarch build
842+bc35e22be4ca69f3e2c2e1403ac30d028e092a38 x86-64: Fix SSE2 memcmp and SSSE3 memmove for x32
843+b05c0c8b285f3531aa48e9cef9d507804c6db77e x86: Optimize {str|wcs}rchr-sse2
844+fdbc8439acfd42149fdad411df7f74dcb1b3a168 x86: Optimize {str|wcs}rchr-avx2
845+2c4fc8e5ca742c6a3a1933799495bb0b00a807f0 x86: Optimize {str|wcs}rchr-evex
846+ac87df8d750b0734e20ffb82d1d0d0efbe4b6212 x86: Fallback {str|wcs}cmp RTM in the ncmp overflow case [BZ #29127]
847+
848+NO
849+# seems like a minor optimization
850+756d583c9eca5aa494822963a5063cfa214d1e11 elf: Merge dl-sysdep.c into the Linux version
851+1695c5e0f66d2714b1f4bf0e38b20ebebbc6d1d2 Linux: Remove HAVE_AUX_SECURE, HAVE_AUX_XID, HAVE_AUX_PAGESIZE
852+29f833f5abe03f89cc830e362474b389545aa139 Linux: Remove DL_FIND_ARG_COMPONENTS
853+3948c6ca896bdbf4d1ce08afac8a477d990c03cd Linux: Assume that NEED_DL_SYSINFO_DSO is always defined
854+150039ff07d19d2566c9d91b2a1368fb05451639 Linux: Consolidate auxiliary vector parsing
855+788eb21ff0deb0ef7cb203de5e4df7898ca1d82c Revert "Linux: Consolidate auxiliary vector parsing"
856+76304dfdaf0b979fdb2797787ec75e46aea0e8b4 Linux: Include <dl-auxv.h> in dl-sysdep.c only for SHARED
857+0a5c6c9d99073c0772a9753600f0d8885efa9163 Linux: Consolidate auxiliary vector parsing (redo)
858+
859+NO
860+58bb3aeaae711d2229bacfc784b7879af2e4f771 elf: Remove __libc_init_secure
861+
862+NO
863+d1772c937680eac35256434eca70f6d396f4b7f5 i386: Remove OPTIMIZE_FOR_GCC_5 from Linux libc-do-syscall.S
864+a7b122a7b45d0cffebbe94e7aedf8634f74d84b9 i386: Honor I386_USE_SYSENTER for 6-argument Linux system calls
865+d66cca3fbb12539aa72a4c24c2f5b2bb0197b306 Linux: Define MMAP_CALL_INTERNAL
866+55ee3afa0d1d09ea1b3eeba9b59281c7e3fc3e17 ia64: Always define IA64_USE_NEW_STUB as a flag macro
867+2d05ba7f8ef979947e910a37ae8115a816eb4d08 Linux: Implement a useful version of _startup_fatal
868+b5ddf33c6e63d89658450da4c85362349c7fe522 Linux: Introduce __brk_call for invoking the brk system call
869+72d9dcfd16468ed143a2800288476835f7a8c2a4 csu: Implement and use _dl_early_allocate during static startup
870+
871+NO
872+# doesn't really seem appropriate for a LTS update to me
873+04892c543e08a8974ffc14f53e24e2b00810978c S390: Enable static PIE
874+
875+LATER
876+f5f7144dfcbf2a11fd2c17316c213928307c1db3 rtld: Use generic argv adjustment in ld.so [BZ #23293]
877+2b128a7d30f5f808c5246034f71d249010521f1b linux: Add a getauxval test [BZ #23293]
878+
879+LATER
880+478cd506eaa5bbc81e3de6593a5064fa5f36fea9 string.h: fix __fortified_attr_access macro call [BZ #29162]
881+
882+LATER
883+6abb4002df97df668f40b0da84ab6261498a8541 Fix deadlock when pthread_atfork handler calls pthread_atfork or dlclose
884+
885+LATER
886+cb49c141838d34b653389d60c857dca91bceaf5d misc: Use 64 bit stat for daemon (BZ# 29203)
887+37c94dc999dbd624cf6ecc3fd6e823cd442858d1 misc: Use 64 bit stat for getusershell (BZ# 29204)
888+45e5d0f533c90d40914aa8d737695e5bd5ccae5e posix: Use 64 bit stat for posix_fallocate fallback (BZ# 29207)
889+9bcf5b12f8254ca118304e4e5c3fe82a42df8823 posix: Use 64 bit stat for fpathconf (_PC_ASYNC_IO) (BZ# 29208)
890+6ea3c0aba4e8b70344a134224ac29f18063a0e61 socket: Use 64 bit stat for isfdtype (BZ# 29209)
891+e4296958051874e2987719341f1a739642b9e8c7 inet: Use 64 bit stat for ruserpass (BZ# 29210)
892+c5a75ecec8d7a54da7e53c7e64ba00d8673fe619 catgets: Use 64 bit stat for __open_catalog (BZ# 29211)
893+d7d1eebd4d5806be55ffacbf18917ad68d4ae7fd iconv: Use 64 bit stat for gconv_parseconfdir (BZ# 29213)
894+fe9ca732ace94cb49e4d4846a4492db40cde34e4 socket: Fix mistyped define statement in socket/sys/socket.h (BZ #29225)
895+
896+LATER
897+97dd8b3f705b23de1f84713082b631189084a33b nptl: Fix __libc_cleanup_pop_restore asynchronous restore (BZ#29214)
898+
899+LATER
900+99978cd42c55ee427fb512de69638045f6d525c7 NEWS: Add a bug fix entry for BZ #29225
901+
902+NO
903+8468be8433c8c4cc0c17a1811a9b0f439043644a hppa: Remove _dl_skip_args usage (BZ# 29165)
904+9d8ae95604feff154a92e1963d3c08d715407e26 nios2: Remove _dl_skip_args usage (BZ# 29187)
905+
906+LATER
907+ccac2d6d95600e790e0411eab0511493ae409c1f nss: add assert to DB_LOOKUP_FCT (BZ #28752)
908+b6aade18a7e5719c942aa2da6cf3157aca993fa4 nss: handle stat failure in check_reload_and_get (BZ #28752)
909+
910+LATER
911+cd4f43be3d60384009e9a928d82db815f77ef9b7 linux: Fix mq_timereceive check for 32 bit fallback code (BZ 29304)
912+
913diff --git a/debian/patches/series b/debian/patches/series
914index ed891b5..c543961 100644
915--- a/debian/patches/series
916+++ b/debian/patches/series
917@@ -1,3 +1,6 @@
918+upstream-updates/0001-S390-Add-new-s390-platform-z16.patch
919+upstream-updates/0002-powerpc-Fix-VSX-register-number-on-__strncpy_power9-.patch
920+
921 git-updates.diff
922
923 locale/check-unknown-symbols.diff
924diff --git a/debian/patches/upstream-updates/0001-S390-Add-new-s390-platform-z16.patch b/debian/patches/upstream-updates/0001-S390-Add-new-s390-platform-z16.patch
925new file mode 100644
926index 0000000..4d224e4
927--- /dev/null
928+++ b/debian/patches/upstream-updates/0001-S390-Add-new-s390-platform-z16.patch
929@@ -0,0 +1,250 @@
930+From 6583d534458e7f8beec8d0766b6db0bdaae6749c Mon Sep 17 00:00:00 2001
931+From: Stefan Liebler <stli@linux.ibm.com>
932+Date: Wed, 13 Apr 2022 14:36:09 +0200
933+Subject: [PATCH] S390: Add new s390 platform z16.
934+
935+The new IBM z16 is added to platform string array.
936+The macro _DL_PLATFORMS_COUNT is incremented.
937+
938+_dl_hwcaps_subdir is extended by "z16" if HWCAP_S390_VXRS_PDE2
939+is set. HWCAP_S390_NNPA is not tested in _dl_hwcaps_subdirs_active
940+as those instructions may be replaced or removed in future.
941+
942+tst-glibc-hwcaps.c is extended in order to test z16 via new marker5.
943+
944+A fatal glibc error is dumped if glibc was build with architecture
945+level set for z16, but run on an older machine. (See dl-hwcap-check.h)
946+
947+(cherry picked from commit 2376944b9e5c0364b9fb473e4d8dabca31b57167)
948+---
949+ elf/Makefile | 8 ++++++++
950+ elf/tst-glibc-hwcaps-cache.script | 6 ++++++
951+ sysdeps/s390/dl-procinfo.c | 5 +++--
952+ sysdeps/s390/dl-procinfo.h | 2 +-
953+ sysdeps/s390/s390-64/Makefile | 25 ++++++++++++++++++++++--
954+ sysdeps/s390/s390-64/dl-hwcap-check.h | 6 +++++-
955+ sysdeps/s390/s390-64/dl-hwcaps-subdirs.c | 11 +++++++++--
956+ sysdeps/s390/s390-64/tst-glibc-hwcaps.c | 8 ++++++--
957+ 8 files changed, 61 insertions(+), 10 deletions(-)
958+
959+diff --git a/elf/Makefile b/elf/Makefile
960+index b2bd03a9f6..21527c67b3 100644
961+--- a/elf/Makefile
962++++ b/elf/Makefile
963+@@ -613,6 +613,11 @@ modules-names = \
964+ libmarkermod4-2 \
965+ libmarkermod4-3 \
966+ libmarkermod4-4 \
967++ libmarkermod5-1 \
968++ libmarkermod5-2 \
969++ libmarkermod5-3 \
970++ libmarkermod5-4 \
971++ libmarkermod5-5 \
972+ ltglobmod1 \
973+ ltglobmod2 \
974+ neededobj1 \
975+@@ -2509,6 +2514,7 @@ LDFLAGS-libmarkermod1-1.so += -Wl,-soname,libmarkermod1.so
976+ LDFLAGS-libmarkermod2-1.so += -Wl,-soname,libmarkermod2.so
977+ LDFLAGS-libmarkermod3-1.so += -Wl,-soname,libmarkermod3.so
978+ LDFLAGS-libmarkermod4-1.so += -Wl,-soname,libmarkermod4.so
979++LDFLAGS-libmarkermod5-1.so += -Wl,-soname,libmarkermod5.so
980+ $(objpfx)libmarkermod%.os : markermodMARKER-VALUE.c
981+ $(compile-command.c) \
982+ -DMARKER=marker$(firstword $(subst -, ,$*)) \
983+@@ -2521,6 +2527,8 @@ $(objpfx)libmarkermod3.so: $(objpfx)libmarkermod3-1.so
984+ cp $< $@
985+ $(objpfx)libmarkermod4.so: $(objpfx)libmarkermod4-1.so
986+ cp $< $@
987++$(objpfx)libmarkermod5.so: $(objpfx)libmarkermod5-1.so
988++ cp $< $@
989+
990+ # tst-glibc-hwcaps-prepend checks that --glibc-hwcaps-prepend is
991+ # preferred over auto-detected subdirectories.
992+diff --git a/elf/tst-glibc-hwcaps-cache.script b/elf/tst-glibc-hwcaps-cache.script
993+index c3271f61f9..d58fc8c5de 100644
994+--- a/elf/tst-glibc-hwcaps-cache.script
995++++ b/elf/tst-glibc-hwcaps-cache.script
996+@@ -4,6 +4,7 @@
997+ cp $B/elf/libmarkermod2-1.so $L/libmarkermod2.so
998+ cp $B/elf/libmarkermod3-1.so $L/libmarkermod3.so
999+ cp $B/elf/libmarkermod4-1.so $L/libmarkermod4.so
1000++cp $B/elf/libmarkermod5-1.so $L/libmarkermod5.so
1001+
1002+ mkdirp 0770 $L/glibc-hwcaps/power9
1003+ cp $B/elf/libmarkermod2-2.so $L/glibc-hwcaps/power9/libmarkermod2.so
1004+@@ -20,6 +21,11 @@ mkdirp 0770 $L/glibc-hwcaps/z15
1005+ cp $B/elf/libmarkermod4-2.so $L/glibc-hwcaps/z13/libmarkermod4.so
1006+ cp $B/elf/libmarkermod4-3.so $L/glibc-hwcaps/z14/libmarkermod4.so
1007+ cp $B/elf/libmarkermod4-4.so $L/glibc-hwcaps/z15/libmarkermod4.so
1008++mkdirp 0770 $L/glibc-hwcaps/z16
1009++cp $B/elf/libmarkermod5-2.so $L/glibc-hwcaps/z13/libmarkermod5.so
1010++cp $B/elf/libmarkermod5-3.so $L/glibc-hwcaps/z14/libmarkermod5.so
1011++cp $B/elf/libmarkermod5-4.so $L/glibc-hwcaps/z15/libmarkermod5.so
1012++cp $B/elf/libmarkermod5-5.so $L/glibc-hwcaps/z16/libmarkermod5.so
1013+
1014+ mkdirp 0770 $L/glibc-hwcaps/x86-64-v2
1015+ cp $B/elf/libmarkermod2-2.so $L/glibc-hwcaps/x86-64-v2/libmarkermod2.so
1016+diff --git a/sysdeps/s390/dl-procinfo.c b/sysdeps/s390/dl-procinfo.c
1017+index 2cdb3c8b5e..f142221a17 100644
1018+--- a/sysdeps/s390/dl-procinfo.c
1019++++ b/sysdeps/s390/dl-procinfo.c
1020+@@ -63,11 +63,12 @@ PROCINFO_CLASS const char _dl_s390_cap_flags[23][9]
1021+ #if !defined PROCINFO_DECL && defined SHARED
1022+ ._dl_s390_platforms
1023+ #else
1024+-PROCINFO_CLASS const char _dl_s390_platforms[10][7]
1025++PROCINFO_CLASS const char _dl_s390_platforms[11][7]
1026+ #endif
1027+ #ifndef PROCINFO_DECL
1028+ = {
1029+- "g5", "z900", "z990", "z9-109", "z10", "z196", "zEC12", "z13", "z14", "z15"
1030++ "g5", "z900", "z990", "z9-109", "z10", "z196", "zEC12", "z13", "z14", "z15",
1031++ "z16"
1032+ }
1033+ #endif
1034+ #if !defined SHARED || defined PROCINFO_DECL
1035+diff --git a/sysdeps/s390/dl-procinfo.h b/sysdeps/s390/dl-procinfo.h
1036+index 03d7e94379..1f4e3875ba 100644
1037+--- a/sysdeps/s390/dl-procinfo.h
1038++++ b/sysdeps/s390/dl-procinfo.h
1039+@@ -22,7 +22,7 @@
1040+
1041+ #define _DL_HWCAP_COUNT 23
1042+
1043+-#define _DL_PLATFORMS_COUNT 10
1044++#define _DL_PLATFORMS_COUNT 11
1045+
1046+ /* The kernel provides up to 32 capability bits with elf_hwcap. */
1047+ #define _DL_FIRST_PLATFORM 32
1048+diff --git a/sysdeps/s390/s390-64/Makefile b/sysdeps/s390/s390-64/Makefile
1049+index e5da26871c..66ed844e68 100644
1050+--- a/sysdeps/s390/s390-64/Makefile
1051++++ b/sysdeps/s390/s390-64/Makefile
1052+@@ -7,8 +7,11 @@ CFLAGS-rtld.c += -Wno-uninitialized -Wno-unused
1053+ CFLAGS-dl-load.c += -Wno-unused
1054+ CFLAGS-dl-reloc.c += -Wno-unused
1055+
1056+-$(objpfx)tst-glibc-hwcaps: $(objpfx)libmarkermod2-1.so \
1057+- $(objpfx)libmarkermod3-1.so $(objpfx)libmarkermod4-1.so
1058++$(objpfx)tst-glibc-hwcaps: \
1059++ $(objpfx)libmarkermod2-1.so \
1060++ $(objpfx)libmarkermod3-1.so \
1061++ $(objpfx)libmarkermod4-1.so \
1062++ $(objpfx)libmarkermod5-1.so
1063+ $(objpfx)tst-glibc-hwcaps.out: \
1064+ $(objpfx)libmarkermod2.so \
1065+ $(objpfx)glibc-hwcaps/z13/libmarkermod2.so \
1066+@@ -19,6 +22,11 @@ $(objpfx)tst-glibc-hwcaps.out: \
1067+ $(objpfx)glibc-hwcaps/z13/libmarkermod4.so \
1068+ $(objpfx)glibc-hwcaps/z14/libmarkermod4.so \
1069+ $(objpfx)glibc-hwcaps/z15/libmarkermod4.so \
1070++ $(objpfx)libmarkermod5.so \
1071++ $(objpfx)glibc-hwcaps/z13/libmarkermod5.so \
1072++ $(objpfx)glibc-hwcaps/z14/libmarkermod5.so \
1073++ $(objpfx)glibc-hwcaps/z15/libmarkermod5.so \
1074++ $(objpfx)glibc-hwcaps/z16/libmarkermod5.so
1075+
1076+ $(objpfx)glibc-hwcaps/z13/libmarkermod2.so: $(objpfx)libmarkermod2-2.so
1077+ $(make-target-directory)
1078+@@ -38,6 +46,19 @@ $(objpfx)glibc-hwcaps/z14/libmarkermod4.so: $(objpfx)libmarkermod4-3.so
1079+ $(objpfx)glibc-hwcaps/z15/libmarkermod4.so: $(objpfx)libmarkermod4-4.so
1080+ $(make-target-directory)
1081+ cp $< $@
1082++$(objpfx)glibc-hwcaps/z13/libmarkermod5.so: $(objpfx)libmarkermod5-2.so
1083++ $(make-target-directory)
1084++ cp $< $@
1085++$(objpfx)glibc-hwcaps/z14/libmarkermod5.so: $(objpfx)libmarkermod5-3.so
1086++ $(make-target-directory)
1087++ cp $< $@
1088++$(objpfx)glibc-hwcaps/z15/libmarkermod5.so: $(objpfx)libmarkermod5-4.so
1089++ $(make-target-directory)
1090++ cp $< $@
1091++$(objpfx)glibc-hwcaps/z16/libmarkermod5.so: $(objpfx)libmarkermod5-5.so
1092++ $(make-target-directory)
1093++ cp $< $@
1094++
1095+
1096+ ifeq (no,$(build-hardcoded-path-in-tests))
1097+ # This is an ld.so.cache test, and RPATH/RUNPATH in the executable
1098+diff --git a/sysdeps/s390/s390-64/dl-hwcap-check.h b/sysdeps/s390/s390-64/dl-hwcap-check.h
1099+index f769932325..efe204a3f3 100644
1100+--- a/sysdeps/s390/s390-64/dl-hwcap-check.h
1101++++ b/sysdeps/s390/s390-64/dl-hwcap-check.h
1102+@@ -26,7 +26,11 @@ static inline void
1103+ dl_hwcap_check (void)
1104+ {
1105+ #if defined __ARCH__
1106+-# if GCCMACRO__ARCH__ >= 13
1107++# if GCCMACRO__ARCH__ >= 14
1108++ if (!(GLRO(dl_hwcap) & HWCAP_S390_VXRS_PDE2))
1109++ _dl_fatal_printf ("\
1110++Fatal glibc error: CPU lacks VXRS_PDE2 support (z16 or later required)\n");
1111++# elif GCCMACRO__ARCH__ >= 13
1112+ if (!(GLRO(dl_hwcap) & HWCAP_S390_VXRS_EXT2))
1113+ _dl_fatal_printf ("\
1114+ Fatal glibc error: CPU lacks VXRS_EXT2 support (z15 or later required)\n");
1115+diff --git a/sysdeps/s390/s390-64/dl-hwcaps-subdirs.c b/sysdeps/s390/s390-64/dl-hwcaps-subdirs.c
1116+index 9447a6cf4e..39f4948152 100644
1117+--- a/sysdeps/s390/s390-64/dl-hwcaps-subdirs.c
1118++++ b/sysdeps/s390/s390-64/dl-hwcaps-subdirs.c
1119+@@ -19,8 +19,8 @@
1120+ #include <dl-hwcaps.h>
1121+ #include <ldsodefs.h>
1122+
1123+-const char _dl_hwcaps_subdirs[] = "z15:z14:z13";
1124+-enum { subdirs_count = 3 }; /* Number of components in _dl_hwcaps_subdirs. */
1125++const char _dl_hwcaps_subdirs[] = "z16:z15:z14:z13";
1126++enum { subdirs_count = 4 }; /* Number of components in _dl_hwcaps_subdirs. */
1127+
1128+ uint32_t
1129+ _dl_hwcaps_subdirs_active (void)
1130+@@ -50,5 +50,12 @@ _dl_hwcaps_subdirs_active (void)
1131+ return _dl_hwcaps_subdirs_build_bitmask (subdirs_count, active);
1132+ ++active;
1133+
1134++ /* z16.
1135++ Note: We do not list HWCAP_S390_NNPA here as, according to the Principles of
1136++ Operation, those instructions may be replaced or removed in future. */
1137++ if (!(GLRO (dl_hwcap) & HWCAP_S390_VXRS_PDE2))
1138++ return _dl_hwcaps_subdirs_build_bitmask (subdirs_count, active);
1139++ ++active;
1140++
1141+ return _dl_hwcaps_subdirs_build_bitmask (subdirs_count, active);
1142+ }
1143+diff --git a/sysdeps/s390/s390-64/tst-glibc-hwcaps.c b/sysdeps/s390/s390-64/tst-glibc-hwcaps.c
1144+index cf3b765b5d..a29891bdc1 100644
1145+--- a/sysdeps/s390/s390-64/tst-glibc-hwcaps.c
1146++++ b/sysdeps/s390/s390-64/tst-glibc-hwcaps.c
1147+@@ -25,6 +25,7 @@
1148+ extern int marker2 (void);
1149+ extern int marker3 (void);
1150+ extern int marker4 (void);
1151++extern int marker5 (void);
1152+
1153+ /* Return the arch level, 10 for the baseline libmarkermod*.so's. */
1154+ static int
1155+@@ -63,9 +64,11 @@ compute_level (void)
1156+ return 12;
1157+ if (strcmp (platform, "z15") == 0)
1158+ return 13;
1159++ if (strcmp (platform, "z16") == 0)
1160++ return 14;
1161+ printf ("warning: unrecognized AT_PLATFORM value: %s\n", platform);
1162+- /* Assume that the new platform supports z15. */
1163+- return 13;
1164++ /* Assume that the new platform supports z16. */
1165++ return 14;
1166+ }
1167+
1168+ static int
1169+@@ -76,6 +79,7 @@ do_test (void)
1170+ TEST_COMPARE (marker2 (), MIN (level - 9, 2));
1171+ TEST_COMPARE (marker3 (), MIN (level - 9, 3));
1172+ TEST_COMPARE (marker4 (), MIN (level - 9, 4));
1173++ TEST_COMPARE (marker5 (), MIN (level - 9, 5));
1174+ return 0;
1175+ }
1176+
1177+--
1178+2.34.1
1179+
1180diff --git a/debian/patches/upstream-updates/0002-powerpc-Fix-VSX-register-number-on-__strncpy_power9-.patch b/debian/patches/upstream-updates/0002-powerpc-Fix-VSX-register-number-on-__strncpy_power9-.patch
1181new file mode 100644
1182index 0000000..e6e57e2
1183--- /dev/null
1184+++ b/debian/patches/upstream-updates/0002-powerpc-Fix-VSX-register-number-on-__strncpy_power9-.patch
1185@@ -0,0 +1,48 @@
1186+From 0a1572b8bb880a63d50a63b2afe4bb67704ac23e Mon Sep 17 00:00:00 2001
1187+From: Matheus Castanho <msc@linux.ibm.com>
1188+Date: Tue, 7 Jun 2022 10:27:26 -0300
1189+Subject: [PATCH] powerpc: Fix VSX register number on __strncpy_power9 [BZ
1190+ #29197]
1191+
1192+__strncpy_power9 initializes VR 18 with zeroes to be used throughout the
1193+code, including when zero-padding the destination string. However, the
1194+v18 reference was mistakenly being used for stxv and stxvl, which take a
1195+VSX vector as operand. The code ended up using the uninitialized VSR 18
1196+register by mistake.
1197+
1198+Both occurrences have been changed to use the proper VSX number for VR 18
1199+(i.e. VSR 50).
1200+
1201+Tested on powerpc, powerpc64 and powerpc64le.
1202+
1203+Signed-off-by: Kewen Lin <linkw@gcc.gnu.org>
1204+(cherry picked from commit 0218463dd8265ed937622f88ac68c7d984fe0cfc)
1205+---
1206+ sysdeps/powerpc/powerpc64/le/power9/strncpy.S | 4 ++--
1207+ 1 file changed, 2 insertions(+), 2 deletions(-)
1208+
1209+diff --git a/sysdeps/powerpc/powerpc64/le/power9/strncpy.S b/sysdeps/powerpc/powerpc64/le/power9/strncpy.S
1210+index ae23161316..deb94671cc 100644
1211+--- a/sysdeps/powerpc/powerpc64/le/power9/strncpy.S
1212++++ b/sysdeps/powerpc/powerpc64/le/power9/strncpy.S
1213+@@ -352,7 +352,7 @@ L(zero_padding_loop):
1214+ cmpldi cr6,r5,16 /* Check if length was reached. */
1215+ ble cr6,L(zero_padding_end)
1216+
1217+- stxv v18,0(r11)
1218++ stxv 32+v18,0(r11)
1219+ addi r11,r11,16
1220+ addi r5,r5,-16
1221+
1222+@@ -360,7 +360,7 @@ L(zero_padding_loop):
1223+
1224+ L(zero_padding_end):
1225+ sldi r10,r5,56 /* stxvl wants size in top 8 bits */
1226+- stxvl v18,r11,r10 /* Partial store */
1227++ stxvl 32+v18,r11,r10 /* Partial store */
1228+ blr
1229+
1230+ .align 4
1231+--
1232+2.34.1
1233+

Subscribers

People subscribed via source and target branches