Using asm labels in function declaration produces unexpected bindings
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
- 52/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Ambito
- backend-api-design, tooling
Direzione di ricerca
Start by reading bindgen's handling of C function declarations and asm labels, then reproduce the provided syslog example with the stated bindgen version and compare the generated declarations. The issue does not name a source file or test; trace the parsing and code generation paths involved and add a regression test for the example. Done means the renamed function produces one binding instead of two.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
gcc (and clang which I guess inherited the extension) allows a function to be declared with one name, but redirect calls to a function of a different name [1]. glibc makes heavy use of the feature to support multiple versions of long double on multiple targets. Some powerpc64le distros have switched the long double format, which turns on these awkward redirections.
A simplified and preprocessed example of syslog from syslog.h on powerpc64le on fedora 44 looks like:
extern void syslog (int __pri, const char *__fmt, ...);
extern __typeof (syslog) syslog __asm ("__syslogieee128");
Which produces the following from bindgen:
/* automatically generated by rust-bindgen 0.72.1 */
unsafe extern "C" {
pub fn syslog(__pri: ::std::os::raw::c_int, __fmt: *const ::std::os::raw::c_char, ...);
}
unsafe extern "C" {
#[link_name = "\u{1}__syslogieee128"]
pub fn syslog1(arg1: ::std::os::raw::c_int, arg2: *const ::std::os::raw::c_char, ...);
}
Ideally, there should be one binding to the renamed function. In this case, it's harmless as long as Rust does not support long double.
- Lingua principale
- Rust
- Stelle
- 5.3k
- Fork
- 846
- Merge medio
- 2g 6h
- 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 rust-lang/rust-bindgen
-
--enable-cxx-namespaces panics on namespace [[deprecated]] { ("[" is not a valid Ident)Forse già presa @lwz23 l’ha presa 48 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
rust-lang/rust-bindgen#3485 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
rust-lang/rust-bindgen#3483 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
rust-lang/rust-bindgen#3370 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
rust-lang/rust-bindgen#3363 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
rust-lang/rust-bindgen#3540 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di rust-lang/rust-bindgen
Issue simili
-
area: cli kind:docs priority: P3
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
swc-project/swc-ai-issues#164 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
pop-os/cosmic-player#367 ·
-
good first issue help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
servo/rust-smallvec#873 ·