@@ -129,17 +129,25 @@ fn verify_no_duplicates(path: impl AsRef<Path>) {
129129 let mut dups = Vec :: new ( ) ;
130130 let mut found_any = false ;
131131
132- for_each_symbol ( path, |sym, member| {
133- // Only check defined globals, exclude wasm file symbols
134- if !sym. is_global ( ) || sym. is_undefined ( )
135- // || sym.kind() == SymbolKind::File
136- {
132+ for_each_symbol ( & path, |sym, member| {
133+ // Only check defined globals
134+ if !sym. is_global ( ) || sym. is_undefined ( ) {
137135 return ;
138136 }
139137
140138 let info = SymInfo :: new ( & sym, member) ;
139+
140+ // x86-32 includes multiple copies of thunk symbols
141141 if info. name . starts_with ( "__x86.get_pc_thunk" ) {
142- // x86-32 includes multiple copies of thunk symbols
142+ return ;
143+ }
144+
145+ // Ignore literal constants on Windows
146+ let win_allowed_dup_pfx = [ "__real@" , "__xmm@" ] ;
147+ if win_allowed_dup_pfx
148+ . iter ( )
149+ . any ( |pfx| info. name . starts_with ( pfx) )
150+ {
143151 return ;
144152 }
145153
@@ -158,14 +166,14 @@ fn verify_no_duplicates(path: impl AsRef<Path>) {
158166
159167 assert ! ( found_any, "no symbols found" ) ;
160168
161- if cfg ! ( windows) {
162- // Ignore literal constants
163- let allowed_dup_pfx = [ "__real@" , "__xmm@" ] ;
164- dups. retain ( |sym| !allowed_dup_pfx. iter ( ) . any ( |pfx| sym. name . starts_with ( pfx) ) ) ;
165- }
166-
167169 if !dups. is_empty ( ) {
168170 dups. sort_unstable_by ( |a, b| a. name . cmp ( & b. name ) ) ;
171+
172+ Command :: new ( "run-rust-nm" )
173+ . arg ( path. as_ref ( ) )
174+ . status ( )
175+ . unwrap ( ) ;
176+
169177 panic ! ( "found duplicate symbols: {dups:#?}" ) ;
170178 }
171179
0 commit comments