apple-support-ar-wrapper: ar r drops the members already in the archive
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 42/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- cpp, macos
- Ambito
- build-system
Direzione di ricerca
Start with the ar mode handling in crosstool/libtool.cc, where the wrapper decides between a fresh libtool -static write and the q path that passes the existing archive back in. Reproduce with the two cr calls in an empty directory and check ar t lib.a; expected output is a.o b.o. Done means r, cr and crs keep earlier members with matching names, and the q behaviour from #670 still holds.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Since #601, apple-support-ar-wrapper accepts ar arguments. For r (with or without c, s, D) it runs libtool -static -D -o lib.a <new objects>, which writes a new archive. The members that an earlier call added are lost. The command exits 0, so the first sign is undefined symbols at link time.
#670 fixed the same problem for q: it passes the existing archive back to libtool as an input. That approach is not correct for r. r replaces each member that has the same name, so if the whole archive is passed back, the old member stays next to its replacement, and the linker takes the first one, which is the stale one.
Repro
Build the wrapper from the 2.11.0 tag (crosstool:exec_libtool, or xcrun clang -std=c++17 -lc++ -o apple-support-ar-wrapper crosstool/libtool.cc). Set DEVELOPER_DIR and SDKROOT (any values; the wrapper only requires them). Use any two objects a.o and b.o, and start each row of the table in an empty directory.
apple-support-ar-wrapper cr lib.a a.o
apple-support-ar-wrapper cr lib.a b.o
ar t lib.a
Expected: a.o and b.o. Actual: only b.o. (ar t also lists __.SYMDEF SORTED in both cases.)
Members after two calls (a.o, then b.o), from crosstool/libtool.cc at 2.11.0 and from /usr/bin/ar:
| Mode | wrapper | /usr/bin/ar |
|---|---|---|
r |
b.o |
a.o b.o |
cr |
b.o |
a.o b.o |
crs |
b.o |
a.o b.o |
crD |
b.o |
(D not supported) |
q |
a.o b.o |
a.o b.o |
cq |
a.o b.o |
a.o b.o |
Notes for a fix
ar rputs each new member in the place of the first old member with the same name, and appends the new members that replace nothing.- To match by name, the wrapper must name members after their files in
armode, asardoes. Today it renames duplicate basenames to<stem>_<hash>.o.
Versions: apple_support 2.11.0, macOS 26.6.2 arm64, Xcode.
- Lingua principale
- Starlark
- Stelle
- 109
- Fork
- 79
- Merge medio
- 4h 29m
- PR unite (30g)
- 11
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di bazelbuild/apple_support
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
bazelbuild/apple_support#707 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
bazelbuild/apple_support#466 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di bazelbuild/apple_support
Issue simili
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
-
blocky: new version 0.38.0Apertaout-of-date
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
CachyOS/CachyOS-PKGBUILDS#2232 ·
I maintainer di solito rispondono entro 1 giorno
-
blast/large refactor risk/low spend-dem
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
chriskelly/MusicWall#87 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
neilotoole/sq#1503 ·
I maintainer di solito rispondono entro 1 giorno
-
ci-alert
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
I maintainer di solito rispondono entro 1 giorno