|
34 | 34 | # Check that a cdylib exports the public #[no_mangle] functions of dependencies
|
35 | 35 | [ "$$($(NM) $(TMPDIR)/$(CDYLIB_NAME) | grep -c public_c_function_from_rlib)" -eq "1" ]
|
36 | 36 | # Check that a cdylib DOES NOT export any public Rust functions
|
37 |
| - [ "$$($(NM) $(TMPDIR)/$(CDYLIB_NAME) | grep -c _ZN.*h.*E)" -eq "0" ] |
| 37 | + [ "$$($(NM) $(TMPDIR)/$(CDYLIB_NAME) | grep -c _R[a-zA-Z0-9_]+)" -eq "0" ] |
38 | 38 |
|
39 | 39 | # Check that a Rust dylib exports its monomorphic functions
|
40 | 40 | [ "$$($(NM) $(TMPDIR)/$(RDYLIB_NAME) | grep -c public_c_function_from_rust_dylib)" -eq "1" ]
|
41 |
| - [ "$$($(NM) $(TMPDIR)/$(RDYLIB_NAME) | grep -c _ZN.*public_rust_function_from_rust_dylib.*E)" -eq "1" ] |
| 41 | + [ "$$($(NM) $(TMPDIR)/$(RDYLIB_NAME) | grep -c _R.*public_rust_function_from_rust_dylib.*)" -eq "1" ] |
42 | 42 | # Check that a Rust dylib does not export generics if -Zshare-generics=no
|
43 |
| - [ "$$($(NM) $(TMPDIR)/$(RDYLIB_NAME) | grep -c _ZN.*public_generic_function_from_rust_dylib.*E)" -eq "0" ] |
| 43 | + [ "$$($(NM) $(TMPDIR)/$(RDYLIB_NAME) | grep -c _R.*public_generic_function_from_rust_dylib.*)" -eq "0" ] |
44 | 44 |
|
45 | 45 |
|
46 | 46 | # Check that a Rust dylib exports the monomorphic functions from its dependencies
|
47 | 47 | [ "$$($(NM) $(TMPDIR)/$(RDYLIB_NAME) | grep -c public_c_function_from_rlib)" -eq "1" ]
|
48 | 48 | [ "$$($(NM) $(TMPDIR)/$(RDYLIB_NAME) | grep -c public_rust_function_from_rlib)" -eq "1" ]
|
49 | 49 | # Check that a Rust dylib does not export generics if -Zshare-generics=no
|
50 |
| - [ "$$($(NM) $(TMPDIR)/$(RDYLIB_NAME) | grep -c _ZN.*public_generic_function_from_rlib.*E)" -eq "0" ] |
| 50 | + [ "$$($(NM) $(TMPDIR)/$(RDYLIB_NAME) | grep -c _R.*public_generic_function_from_rlib.*)" -eq "0" ] |
51 | 51 |
|
52 | 52 | # Check that an executable does not export any dynamic symbols
|
53 | 53 | [ "$$($(NM) $(TMPDIR)/$(EXE_NAME) | grep -c public_c_function_from_rlib)" -eq "0" ]
|
|
61 | 61 | # Check that a cdylib exports the public #[no_mangle] functions of dependencies
|
62 | 62 | [ "$$($(NM) $(TMPDIR)/$(COMBINED_CDYLIB_NAME) | grep -c public_c_function_from_rlib)" -eq "1" ]
|
63 | 63 | # Check that a cdylib DOES NOT export any public Rust functions
|
64 |
| - [ "$$($(NM) $(TMPDIR)/$(COMBINED_CDYLIB_NAME) | grep -c _ZN.*h.*E)" -eq "0" ] |
| 64 | + [ "$$($(NM) $(TMPDIR)/$(COMBINED_CDYLIB_NAME) | grep -c _R[a-zA-Z0-9_]+)" -eq "0" ] |
65 | 65 |
|
66 | 66 |
|
67 | 67 | $(RUSTC) -Zshare-generics=yes an_rlib.rs
|
|
74 | 74 | # Check that a cdylib exports the public #[no_mangle] functions of dependencies
|
75 | 75 | [ "$$($(NM) $(TMPDIR)/$(CDYLIB_NAME) | grep -c public_c_function_from_rlib)" -eq "1" ]
|
76 | 76 | # Check that a cdylib DOES NOT export any public Rust functions
|
77 |
| - [ "$$($(NM) $(TMPDIR)/$(CDYLIB_NAME) | grep -c _ZN.*h.*E)" -eq "0" ] |
| 77 | + [ "$$($(NM) $(TMPDIR)/$(CDYLIB_NAME) | grep -c _R[a-zA-Z0-9_]+)" -eq "0" ] |
78 | 78 |
|
79 | 79 | # Check that a Rust dylib exports its monomorphic functions, including generics this time
|
80 | 80 | [ "$$($(NM) $(TMPDIR)/$(RDYLIB_NAME) | grep -c public_c_function_from_rust_dylib)" -eq "1" ]
|
81 |
| - [ "$$($(NM) $(TMPDIR)/$(RDYLIB_NAME) | grep -c _ZN.*public_rust_function_from_rust_dylib.*E)" -eq "1" ] |
82 |
| - [ "$$($(NM) $(TMPDIR)/$(RDYLIB_NAME) | grep -c _ZN.*public_generic_function_from_rust_dylib.*E)" -eq "1" ] |
| 81 | + [ "$$($(NM) $(TMPDIR)/$(RDYLIB_NAME) | grep -c _R.*public_rust_function_from_rust_dylib.*)" -eq "1" ] |
| 82 | + [ "$$($(NM) $(TMPDIR)/$(RDYLIB_NAME) | grep -c _R.*public_generic_function_from_rust_dylib.*)" -eq "1" ] |
83 | 83 |
|
84 | 84 | # Check that a Rust dylib exports the monomorphic functions from its dependencies
|
85 | 85 | [ "$$($(NM) $(TMPDIR)/$(RDYLIB_NAME) | grep -c public_c_function_from_rlib)" -eq "1" ]
|
86 | 86 | [ "$$($(NM) $(TMPDIR)/$(RDYLIB_NAME) | grep -c public_rust_function_from_rlib)" -eq "1" ]
|
87 |
| - [ "$$($(NM) $(TMPDIR)/$(RDYLIB_NAME) | grep -c _ZN.*public_generic_function_from_rlib.*E)" -eq "1" ] |
| 87 | + [ "$$($(NM) $(TMPDIR)/$(RDYLIB_NAME) | grep -c _R.*public_generic_function_from_rlib.*)" -eq "1" ] |
88 | 88 |
|
89 | 89 | # Check that an executable does not export any dynamic symbols
|
90 | 90 | [ "$$($(NM) $(TMPDIR)/$(EXE_NAME) | grep -c public_c_function_from_rlib)" -eq "0" ]
|
|
0 commit comments