cb424d7448
verify-patch-sanity.py validates every active recipe .patch has internally- consistent hunk line counts — catching the 'malformed patch at line N' failure at commit/CI/preflight time instead of hours into a cook. This cycle hit that class three times (qtwaylandscanner, sddm, xwayland), each only discovered when cookbook tried to apply the patch. Running it across the repo found 29 latent malformed patches (validated against GNU patch: e.g. relibc/P3-sysv-ipc reproduces 'malformed patch at line 22'). They were harmless only because they sit in vendored recipes (baked, not re- applied) — but would fail on any version-bump re-derivation. --fix recounts the hunk headers (body untouched) and repaired all 29. Wired into build-preflight.sh (Phase 1.0D) and redbear-ci.yml, with a unit test (test-patch-sanity.sh). Skips archived/legacy trees and unvalidatable formats (empty placeholders, bare-@@ git hunks).
42 lines
1.3 KiB
ArmAsm
42 lines
1.3 KiB
ArmAsm
# REQUIRES: x86
|
|
|
|
# RUN: rm -rf %t; split-file %s %t
|
|
# RUN: mkdir %t/subdir
|
|
|
|
# RUN: llvm-mc -filetype obj -triple x86_64-apple-darwin %t/foo.s -o %t/foo.o
|
|
# RUN: llvm-mc -filetype obj -triple x86_64-apple-darwin %t/bar.s -o %t/bar.o
|
|
# RUN: llvm-mc -filetype obj -triple x86_64-apple-darwin %t/main.s -o %t/main.o
|
|
|
|
# RUN: %lld -dylib -install_name @executable_path/libfoo.dylib %t/foo.o -o %t/subdir/libfoo.dylib
|
|
|
|
# RUN: %lld -dylib -reexport_library %t/subdir/libfoo.dylib %t/bar.o -o %t/libbar.dylib
|
|
|
|
## When linking executables, @executable_path/ in install_name should be replaced
|
|
## by the path of the executable.
|
|
# RUN: %lld -lSystem %t/main.o %t/libbar.dylib -o %t/subdir/test
|
|
|
|
## This doesn't work for non-executables.
|
|
# RUN: not %lld -dylib -lSystem %t/main.o %t/libbar.dylib -o %t/subdir/libtest.dylib 2>&1 | FileCheck --check-prefix=ERR %s
|
|
|
|
## It also doesn't help if the needed reexport isn't next to the library.
|
|
# RUN: not %lld -lSystem %t/main.o %t/libbar.dylib -o %t/test 2>&1 | FileCheck --check-prefix=ERR %s
|
|
# ERR: error: {{.*}}libbar.dylib: unable to locate re-export with install name @executable_path/libfoo.dylib
|
|
|
|
#--- foo.s
|
|
.globl _foo
|
|
_foo:
|
|
retq
|
|
|
|
#--- bar.s
|
|
.globl _bar
|
|
_bar:
|
|
retq
|
|
|
|
#--- main.s
|
|
.section __TEXT,__text
|
|
.global _main
|
|
_main:
|
|
callq _foo
|
|
callq _bar
|
|
ret
|