Commit 04163ac
committed
compiler: add 'b_time64' base option
Introduce a new base option called `b_time64`. This is a boolean option,
which defaults to `false` (in which case it has no effect). If set to
true, this will set `_TIME_BITS=64` (or equivalent) for all
compilations.
This enables a workaround for the Y2038 problem. With `_TIME_BITS=64`,
libc will switch `time_t` and other relevant time types to 64-bits, if
not already 64-bit (i.e., this usually only affects 32-bit platforms).
libc will also transparently switch to 64-bit syscalls.
For more background information, there is an LWN article about it (from
10 years ago):
https://lwn.net/Articles/664800/
Handling of this option is similar to _FILE_OFFSET_BITS=64, which meson
sets by default. Unfortunately, `time_t` is much more often used in
public APIs, and thus more likely to lead to ABI mismatches when mixing
code compiled with and without the option.1 parent 6174a49 commit 04163ac
File tree
5 files changed
+20
-1
lines changed- docs/markdown
- mesonbuild
- compilers
- mixins
- modules
5 files changed
+20
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
232 | 232 | | |
233 | 233 | | |
234 | 234 | | |
| 235 | + | |
235 | 236 | | |
236 | 237 | | |
237 | 238 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
330 | 330 | | |
331 | 331 | | |
332 | 332 | | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
333 | 338 | | |
334 | 339 | | |
335 | 340 | | |
| |||
1095 | 1100 | | |
1096 | 1101 | | |
1097 | 1102 | | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
1098 | 1110 | | |
1099 | 1111 | | |
1100 | 1112 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1344 | 1344 | | |
1345 | 1345 | | |
1346 | 1346 | | |
| 1347 | + | |
| 1348 | + | |
| 1349 | + | |
1347 | 1350 | | |
1348 | 1351 | | |
1349 | 1352 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
343 | 343 | | |
344 | 344 | | |
345 | 345 | | |
| 346 | + | |
| 347 | + | |
346 | 348 | | |
347 | 349 | | |
348 | 350 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
789 | 789 | | |
790 | 790 | | |
791 | 791 | | |
| 792 | + | |
792 | 793 | | |
793 | 794 | | |
794 | 795 | | |
| |||
0 commit comments