Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to 0.55: r_debug__bindgen_ty_1 not found in this scope. #1880

Closed
vext01 opened this issue Aug 24, 2020 · 4 comments · Fixed by #1882
Closed

Upgrade to 0.55: r_debug__bindgen_ty_1 not found in this scope. #1880

vext01 opened this issue Aug 24, 2020 · 4 comments · Fixed by #1882

Comments

@vext01
Copy link

vext01 commented Aug 24, 2020

Input C/C++ Header

It's just an include of <link.h> on a Debian 10 system. Expanded file here

Bindgen Invocation

let bindings = bindgen::Builder::default()                                                     
    .header(WRAPPER_HEADER)                                                                                                              
    .generate()                                                                                
    .expect("bindgen failed");

Actual Results

Compilation fails:

error[E0412]: cannot find type `r_debug__bindgen_ty_1` in this scope
    --> /home/vext01/research/yorick/bindgen-bug/target/debug/build/phdrs-8186bba3cfb0801b/out/bindings.rs:7710:18
     |
7710 |     pub r_state: r_debug__bindgen_ty_1,
     |                  ^^^^^^^^^^^^^^^^^^^^^ not found in this scope

Any ideas?

@emilio
Copy link
Contributor

emilio commented Aug 24, 2020

Hmm, probably a regression from #1850. Thanks for filing!

Reduced test-case:

typedef unsigned long long Elf64_Addr;

struct r_debug
  {
    int r_version; /* Version number for this protocol.  */

    struct link_map *r_map; /* Head of the chain of loaded objects.  */

    /* This is the address of a function internal to the run-time linker,
       that will always be called when the linker begins to map in a
       library or unmap it, and again when the mapping change is complete.
       The debugger can set a breakpoint at this address if it wants to
       notice shared object mapping changes.  */
    Elf64_Addr r_brk;
    enum
      {
 /* This state value describes the mapping change taking place when
	   the `r_brk' address is called.  */
 RT_CONSISTENT, /* Mapping change is complete.  */
 RT_ADD, /* Beginning to add a new object.  */
 RT_DELETE /* Beginning to remove an object mapping.  */
      } r_state;

    Elf64_Addr r_ldbase; /* Base address the linker is loaded at.  */
  };

@emilio
Copy link
Contributor

emilio commented Aug 24, 2020

#1882 has a fix.

@vext01
Copy link
Author

vext01 commented Aug 24, 2020

Thanks!

@emilio
Copy link
Contributor

emilio commented Aug 25, 2020

0.55.1 has this fix, thank you again for reporting it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants