forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitaac831c
committed
Use auxv to check for CRC32 instructions on ARM.
Previously we probed for CRC32 instructions by testing if they causedSIGILL. Some have expressed doubts about that technique, the Linuxdocumentation advises not to use it, and it's not exactly beautiful.Now that more operating systems expose CPU features to userspace via theELF loader in approximately the same way, let's use that instead.This is expected to work on Linux, FreeBSD and recent OpenBSD.OpenBSD/ARM has not been tested and is not present in our build farm,but the API matches FreeBSD.On macOS, compilers use a more recent baseline ISA so the runtime testmechanism isn't reached. (A similar situation is expected forWindows/ARM when that port lands.)On NetBSD, runtime feature probing is lost for armv8-a builds. It lookspotentially doable with sysctl following the example of the cpuctlprogram; patches are welcome.No back-patch for now, since we don't have any evidence of actualbreakage from the previous technique.Suggested-by: Bastien Roucariès <rouca@debian.org>Discussion:https://postgr.es/m/4496616.iHFcN1HehY%40portable-bastien1 parentea15816 commitaac831c
File tree
5 files changed
+34
-44
lines changed- src
- include
- port
5 files changed
+34
-44
lines changedLines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
15144 | 15144 |
| |
15145 | 15145 |
| |
15146 | 15146 |
| |
15147 |
| - | |
| 15147 | + | |
15148 | 15148 |
| |
15149 | 15149 |
| |
15150 | 15150 |
| |
|
Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1723 | 1723 |
| |
1724 | 1724 |
| |
1725 | 1725 |
| |
| 1726 | + | |
| 1727 | + | |
1726 | 1728 |
| |
1727 | 1729 |
| |
1728 | 1730 |
| |
|
Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2623 | 2623 |
| |
2624 | 2624 |
| |
2625 | 2625 |
| |
| 2626 | + | |
2626 | 2627 |
| |
| 2628 | + | |
2627 | 2629 |
| |
2628 | 2630 |
| |
2629 | 2631 |
| |
|
Lines changed: 6 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
125 | 125 |
| |
126 | 126 |
| |
127 | 127 |
| |
| 128 | + | |
| 129 | + | |
| 130 | + | |
128 | 131 |
| |
129 | 132 |
| |
130 | 133 |
| |
| |||
154 | 157 |
| |
155 | 158 |
| |
156 | 159 |
| |
| 160 | + | |
| 161 | + | |
| 162 | + | |
157 | 163 |
| |
158 | 164 |
| |
159 | 165 |
| |
|
Lines changed: 23 additions & 43 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
24 | 24 |
| |
25 | 25 |
| |
26 | 26 |
| |
27 |
| - | |
28 |
| - | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
29 | 33 |
| |
30 | 34 |
| |
31 | 35 |
| |
32 |
| - | |
33 |
| - | |
34 |
| - | |
35 |
| - | |
36 |
| - | |
37 |
| - | |
38 |
| - | |
39 |
| - | |
40 |
| - | |
41 |
| - | |
42 |
| - | |
43 |
| - | |
44 |
| - | |
45 | 36 |
| |
46 | 37 |
| |
47 | 38 |
| |
48 |
| - | |
49 |
| - | |
| 39 | + | |
| 40 | + | |
50 | 41 |
| |
51 |
| - | |
52 |
| - | |
53 |
| - | |
54 |
| - | |
55 |
| - | |
56 |
| - | |
57 |
| - | |
58 |
| - | |
59 |
| - | |
60 |
| - | |
61 |
| - | |
62 |
| - | |
63 |
| - | |
64 |
| - | |
65 |
| - | |
66 |
| - | |
67 |
| - | |
68 |
| - | |
69 |
| - | |
70 |
| - | |
71 |
| - | |
72 |
| - | |
73 |
| - | |
74 |
| - | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
75 | 57 |
| |
76 |
| - | |
77 |
| - | |
78 | 58 |
| |
79 | 59 |
| |
80 | 60 |
| |
|
0 commit comments
Comments
(0)