Commit 623fe37
authored
Fix architecture checks (#1969)
* Use standard modules to test endianness
CMake prior to v3.20 provides a module TestBigEndian which we can use to
set the WABT_BIG_ENDIAN define. As of 3.20, the CMAKE_<LANG>_BYTE_ORDER
variable should be preferred. Leaving this as a note for the future.
* Fix x87 math detection
TARGET_ARCH was only used to determine whether to add gcc-specific SSE
math flags (-msse2 -mfpmath=sse). The new approach simply assumes gcc
compatibility with its __i386__ and __SSE2_MATH__ symbols, which are
defined precisely when we are targeting x86-32 with SSE2 math enabled.
If those macros are defined, then we conclude all is well. Otherwise, we
add the flags if we know the compiler is gcc or clang (and will thus
accept them) and issue a warning if the compiler is unknown.
Fixes #1709
Fixes #16881 parent eb2a07e commit 623fe37
3 files changed
+24
-41
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
111 | 114 | | |
112 | 115 | | |
113 | 116 | | |
| |||
167 | 170 | | |
168 | 171 | | |
169 | 172 | | |
| 173 | + | |
170 | 174 | | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
200 | 181 | | |
201 | | - | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
202 | 189 | | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | 190 | | |
214 | 191 | | |
215 | 192 | | |
| |||
384 | 361 | | |
385 | 362 | | |
386 | 363 | | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
387 | 367 | | |
388 | 368 | | |
389 | 369 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
45 | 48 | | |
46 | 49 | | |
47 | 50 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| |||
0 commit comments