Commit Graph

16569 Commits

Author SHA1 Message Date
gingerBill
b942f72cb0 Add docs for -lto:<string>; remove -lld and -radlink flags docs; with -lto default to -use-separate-modules and -linker:lld dev-2026-02 2026-02-04 12:45:26 +00:00
gingerBill
5cf0ba47ab Merge pull request #6226 from Nahuel2998/fix/x11-xlib-procs-returntype
vendor/x11/xlib: Fix returntype of some procs
2026-02-04 10:28:29 +00:00
gingerBill
61f3d45fa7 Merge pull request #6227 from JesseRMeyer/lto-support
Fix LTO on Windows
2026-02-04 08:59:23 +00:00
Jesse Meyer
b8276065f9 Merge branch 'master' into lto-support 2026-02-03 20:52:52 -05:00
Jesse Meyer
bd6148dd6b Fix Windows LTO: preserve required procedures with llvm.used
On Windows with LTO, required procedures with external linkage need to
be added to @llvm.used to survive linker-level dead code elimination.

LLVM may generate implicit calls to runtime builtins (e.g., __extendhfsf2
for f16 conversions) during instruction lowering, after the IR is
finalized. Without @llvm.used, the linker discards these procedures
before the implicit calls are generated.

This adds required procedures to @llvm.used at creation time. The fix
is Windows-specific; other platforms handle this correctly.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 20:16:44 -05:00
Jesse Meyer
a0562dfd6e Fix lld-link LTO jobs flag syntax on Windows
lld-link doesn't recognize /lldltojobs:N as a standalone flag and
treats it as a file path. Use /opt:lldltojobs=N instead.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 20:16:20 -05:00
Jesse Meyer
9eba12948a Skip sanitizer IR passes when LTO is enabled
With ThinLTO, the linker runs sanitizer passes at link time via
-fsanitize= flags, where it has whole-program visibility. Running
them at bitcode emission too double-instruments every module,
producing hundreds of "Redundant instrumentation detected" warnings.
Per-function sanitize/no_sanitize attributes are preserved in the
bitcode and respected by the linker's pass.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 20:16:20 -05:00
Jesse Meyer
43ad4a1d9f Add ThinLTO support via -lto:thin and -lto:thin-files flags
- Add -lto:thin and -lto:thin-files CLI flags with validation
- Emit LLVM bitcode (.bc) instead of object files when LTO is enabled
- Pass -flto=thin and -flto-jobs to clang/lld linkers
- Guard linkage corrections to skip declarations without definitions
  (required for LTO where declarations appear across modules)
- Allow module-per-file with LTO even at higher optimization levels

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 20:16:20 -05:00
Nahuel2998
37e82c9387 vendor/x11/xlib: Fix returntype of some procs
Returntype of a few procs was incorrectly set to i32 rather than a proc
that returns i32.
2026-02-03 17:17:33 -03:00
Jeroen van Rijn
270df36468 Merge pull request #6213 from Yawning/feature/more-secec
crypto: More core:crypto
2026-02-03 15:45:57 +01:00
gingerBill
e6a62c4bb0 Minor optimization to map_probe_distance 2026-02-03 12:19:20 +00:00
Yawning Angel
eadd5f789c core/crypto/ecdh: Add secp384r1 2026-02-03 18:48:07 +09:00
Yawning Angel
64ce2bdf0e core/crypto/_weierstrass: Add secp384r1 2026-02-03 18:48:07 +09:00
Yawning Angel
bd0cfe4a81 core/crypto/_fiat: Minor p256 cleanups 2026-02-03 16:15:16 +09:00
Jeroen van Rijn
de086c316f Merge pull request #6223 from FabzAn/pass-on-permanent_allocator
text/regex: Pass given allocator on in create_iterator
2026-02-02 20:25:27 +01:00
gingerBill
f3daaa62fe Merge pull request #6220 from laytan/fix-lto-macos
fix LTO on MacOS
2026-02-02 18:46:18 +00:00
Fabian Erdmann
55ab089ffc text/regex: Pass given allocator on in create_iterator 2026-02-02 19:41:37 +01:00
Laytan Laats
afbbb829ea fix LTO on MacOS
If no `-minimum-os-version` is given, ignore the `override-module`
warnings. The user not using, `-minimum-os-version` opts you into linker
warnings about target versions.

If a `-minimum-os-version` is provided, normalize it to a full version
`11` to `11.0.0` for example. The linker seems to want that when doing
LTO.
2026-02-02 18:13:48 +01:00
Jeroen van Rijn
6a07f70c1c support -> supported 2026-02-02 17:57:50 +01:00
gingerBill
3666c1d3aa Merge branch 'master' of https://github.com/odin-lang/Odin 2026-02-02 14:28:23 +00:00
gingerBill
bb7496a2fc Add intrinsics.count_trailing_ones and intrinsics.count_leading_ones 2026-02-02 14:28:16 +00:00
Jeroen van Rijn
13f26f4645 Merge pull request #6218 from Kelimion/fix-6204
Fix #6204
2026-02-02 13:22:38 +01:00
Jeroen van Rijn
98413ad154 Remove duplicate buffer 2026-02-02 13:16:13 +01:00
Jeroen van Rijn
3a7c4994ac Fix #6204
Use temporary stack buffers and some global scratch space to remove the need for any allocator.
2026-02-02 13:11:23 +01:00
gingerBill
80c9482774 Merge pull request #6217 from odin-lang/bill/threading-fixes-2026-02
Fix to frontend threading bugs
2026-02-02 12:04:21 +00:00
gingerBill
a936f3fb7d Comment out t->Struct.are_offsets_being_processed.load() 2026-02-02 11:41:33 +00:00
gingerBill
8594deb4e1 Move return true; to after the if check 2026-02-02 11:40:30 +00:00
gingerBill
2bbedda61c Remove unneeded mutex in hash_exact_value 2026-02-02 11:39:57 +00:00
gingerBill
041ebdd8f6 Add parent mutex lock for scope_insert_with_name 2026-02-02 11:39:17 +00:00
gingerBill
813b622dcc Merge pull request #6214 from Josh8011/master
user32.odin add UnhookWinEvent
2026-02-02 11:37:43 +00:00
gingerBill
adf56ced22 Merge pull request #6215 from odin-lang/bill/fix-data-races-2026-02
Fix numerous data races
2026-02-02 11:37:19 +00:00
gingerBill
b9e4007cb1 Merge pull request #6216 from odin-lang/bill/debug-info-fixes
Debug Info Fixes
2026-02-02 11:33:21 +00:00
gingerBill
c85af4a454 Fix #6202 2026-02-02 11:27:41 +00:00
gingerBill
b183b1219c Revert mutex_lock logic 2026-02-02 11:25:49 +00:00
gingerBill
63c4faca75 Fix positions for debug locations in defer, loops, and switch clauses 2026-02-02 11:19:00 +00:00
gingerBill
fde90931de Add case for completeness 2026-02-02 11:16:05 +00:00
gingerBill
3dccd4e3ad Fix debug info 2026-02-02 11:15:34 +00:00
gingerBill
e014181abf Move values construction to after padding has been set 2026-02-02 11:12:42 +00:00
gingerBill
af86c5963d Merge pull request #6208 from JesseRMeyer/lto-support
Add ThinLTO support via -lto:thin and -lto:thin-files flags
2026-02-02 11:10:43 +00:00
gingerBill
21509ae3f4 Fix mutex_lock 2026-02-02 11:06:16 +00:00
gingerBill
ad2122a7fc Move alignas to before name 2026-02-02 11:05:30 +00:00
gingerBill
c7f40b8b8f Use mutex striping for add_type_and_value 2026-02-02 11:03:50 +00:00
gingerBill
acabae8644 Make Entity.parent_proc_decl atomic 2026-02-02 10:58:25 +00:00
gingerBill
8a92ba74fc Make defer_use_checked and where_clauses_evaluated atomic 2026-02-02 10:56:30 +00:00
gingerBill
74347f3069 Make Entity.code_gen_* atomic 2026-02-02 10:53:18 +00:00
gingerBill
d086a16f64 Make atomic variant_block_size and tag_size in TypeUnion 2026-02-02 10:52:14 +00:00
gingerBill
cb50725b86 Use compare_exchange_strong mutex_lock on non-windows sytems 2026-02-02 10:50:30 +00:00
gingerBill
20a7a645c2 Mock out TSAN_* usage in thread_pool.cpp 2026-02-02 10:48:55 +00:00
gingerBill
2608f92fee Use std::atomic for Ast.viral_state_flags and Ast_Ident.entity 2026-02-02 10:48:30 +00:00
gingerBill
f45ca2d03e Use contextless 2026-02-02 10:06:44 +00:00