Message ID | 20200704032741.835663-1-dxu@dxuuu.xyz |
---|---|
State | New |
Headers | show |
Series |
|
Related | show |
On 7/4/20 5:27 AM, Daniel Xu wrote: > I noticed that the modules test was failing. Some choice use of `nm` > revealed `TWENTY_THREE` was not in the final binary. Rather than trying > to trick the compiler/linker by using magic flags, simply `println!()` > the global. > > gdb/testsuite/ I cannot judge about the patch itself, but the FAIL was filed as PR26121, so please add here: "PR rust/26121". Thanks, - Tom > * gdb.rust/modules.rs: Prevent linker from discarding test > symbol > > Signed-off-by: Daniel Xu <dxu@dxuuu.xyz> > --- > gdb/testsuite/gdb.rust/modules.rs | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/gdb/testsuite/gdb.rust/modules.rs b/gdb/testsuite/gdb.rust/modules.rs > index 6db082817b..dc2a469b2f 100644 > --- a/gdb/testsuite/gdb.rust/modules.rs > +++ b/gdb/testsuite/gdb.rust/modules.rs > @@ -93,4 +93,7 @@ pub mod mod1 { > > fn main () { > mod1::inner::innest::f1(); > + > + // Prevent linker from discarding `TWENTY_THREE` > + println!("{}", TWENTY_THREE); > } >
Hi Tom, On Mon Jul 6, 2020 at 2:32 AM PDT, Tom de Vries wrote: > On 7/4/20 5:27 AM, Daniel Xu wrote: > > I noticed that the modules test was failing. Some choice use of `nm` > > revealed `TWENTY_THREE` was not in the final binary. Rather than trying > > to trick the compiler/linker by using magic flags, simply `println!()` > > the global. > > > > gdb/testsuite/ > > I cannot judge about the patch itself, but the FAIL was filed as > PR26121, so please add here: "PR rust/26121". Sorry about that, didn't know there was an open issue. Will send a V2. Daniel
diff --git a/gdb/testsuite/gdb.rust/modules.rs b/gdb/testsuite/gdb.rust/modules.rs index 6db082817b..dc2a469b2f 100644 --- a/gdb/testsuite/gdb.rust/modules.rs +++ b/gdb/testsuite/gdb.rust/modules.rs @@ -93,4 +93,7 @@ pub mod mod1 { fn main () { mod1::inner::innest::f1(); + + // Prevent linker from discarding `TWENTY_THREE` + println!("{}", TWENTY_THREE); }
I noticed that the modules test was failing. Some choice use of `nm` revealed `TWENTY_THREE` was not in the final binary. Rather than trying to trick the compiler/linker by using magic flags, simply `println!()` the global. gdb/testsuite/ * gdb.rust/modules.rs: Prevent linker from discarding test symbol Signed-off-by: Daniel Xu <dxu@dxuuu.xyz> --- gdb/testsuite/gdb.rust/modules.rs | 3 +++ 1 file changed, 3 insertions(+) -- 2.27.0