]>
Commit | Line | Data |
---|---|---|
54a0048b SL |
1 | -include ../tools.mk |
2 | ||
c30ab7b3 SL |
3 | # The following command will: |
4 | # 1. dump the symbols of a library using `nm` | |
5 | # 2. extract only those lines that we are interested in via `grep` | |
6 | # 3. from those lines, extract just the symbol name via `sed` | |
7 | # (symbol names always start with "_ZN" and end with "E") | |
8 | # 4. sort those symbol names for deterministic comparison | |
9 | # 5. write the result into a file | |
54a0048b SL |
10 | |
11 | dump-symbols = nm "$(TMPDIR)/lib$(1).rlib" \ | |
c30ab7b3 SL |
12 | | grep -E "some_test_function|Bar|bar" \ |
13 | | sed "s/.*\(_ZN.*E\).*/\1/" \ | |
54a0048b SL |
14 | | sort \ |
15 | > "$(TMPDIR)/$(1).nm" | |
16 | ||
17 | all: | |
18 | $(RUSTC) stable-symbol-names1.rs | |
19 | $(RUSTC) stable-symbol-names2.rs | |
20 | $(call dump-symbols,stable_symbol_names1) | |
21 | $(call dump-symbols,stable_symbol_names2) | |
22 | cmp "$(TMPDIR)/stable_symbol_names1.nm" "$(TMPDIR)/stable_symbol_names2.nm" |