aboutsummaryrefslogtreecommitdiff
path: root/src/linker.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'master' into lto-supportJesse Meyer11 days1-1/+5
|\
| * Merge pull request #6220 from laytan/fix-lto-macosgingerBill13 days1-0/+4
| |\ | | | | | | fix LTO on MacOS
| | * fix LTO on MacOSLaytan Laats13 days1-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | support -> supportedJeroen van Rijn13 days1-1/+1
| |/
| * Add ThinLTO support via -lto:thin and -lto:thin-files flagsJesse Meyer14 days1-1/+15
| | | | | | | | | | | | | | | | | | | | | | - 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>
* | Fix lld-link LTO jobs flag syntax on WindowsJesse Meyer11 days1-1/+1
| | | | | | | | | | | | | | 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>
* | Add ThinLTO support via -lto:thin and -lto:thin-files flagsJesse Meyer11 days1-1/+15
|/ | | | | | | | | | | - 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>
* Support `-linker:mold` on FreeBSD and NetBSD; Remove `-use-lld` and ↵gingerBill2026-01-301-1/+1
| | | | `-use-radlink`
* Adds static linking to non-windows platforms (#6057)Fabrice2026-01-131-1/+15
|
* Fix orca linking pathWrath2025-10-151-1/+1
|
* Support `-linker:mold`gingerBill2025-09-191-7/+22
|
* windows i386 supportJon Lipstate2025-08-291-1/+5
|
* Rename `iOS` subtarget to `iPhone` for consistency.Harold Brenes2025-07-141-1/+1
| | | | | Add `ODIN_PLATFORM_SUBTARGET_IOS` builtin constant which evaluated to `true` when the platform is `Darwin` and the subtarget it either `iPhone` or `iPhoneSimulator`
* Fix correct versioned target triplet for iphonesimulator subtargetHarold Brenes2025-07-141-1/+3
| | | | - Always set the `-m*-version-min` linker flag for non-macOS Darwin subtargets
* Provide default minimum version for iOS and apply its target triplet.Harold Brenes2025-07-141-4/+10
| | | | - Fix incorrect clang_path override for iOS during link stage.
* Fix accidental incorrect assignmentHarold Brenes2025-07-131-1/+1
|
* Updated iOS/iPhoneSimulator build supportHarold Brenes2025-07-131-5/+49
|
* fix: escape object files with single quotes during linkingxenobas2025-06-201-2/+2
|
* Let `-no-entry-point` work for Windows DLLsFeoramund2025-06-101-0/+3
| | | | Fixes #4660
* Also clean up .dSym on DarwinJeroen van Rijn2025-06-011-3/+3
|
* Always provide /PDB option to linker if generating debug info.Jeroen van Rijn2025-05-291-1/+1
| | | | | | | radlink by default places the .PDB file in the working directory, even if /OUT says to place it elsewhere, unlike link.exe, which places it next to the executable by default. So, if compiling using -debug, we generate a PDB path even if -pdb-name wasn't used to override it.
* Add comments to `builtin.odin`, documenting ODIN_* constants. (#5218)Jeroen van Rijn2025-05-261-3/+3
| | | And document constants not previously listed.
* Enable all sanitizers on FreeBSDFeoramund2025-05-221-0/+12
|
* Add `/usr/local/lib` to FreeBSD linker pathFeoramund2025-05-201-0/+3
|
* Use `--sysroot` instead of `-Wl,-syslibroot` on DarwinFeoramund2025-05-181-1/+11
| | | | | This keeps the linker from using the wrong SDK and mirrors how we build the Odin compiler itself in `build_odin.sh`.
* add quotes for absolute pathRomāns Potašovs2025-04-091-1/+1
|
* android: always link liblogIllusionMan12122025-04-081-0/+1
|
* fix: use the clang binary that's provided by the android NDKIllusionMan12122025-04-071-3/+10
| | | | always link against libandroid because it's needed by the glue code.
* fix(android): pass `--sysroot` when compiling the android glue codeHisham Aburaqibah2025-04-051-0/+5
| | | | | This prevents a `function-like macro '__GLIBC_USE' is not defined` compilation error from happening with newer NDK versions (I tried r28)
* fix cross compilation for linux_riscvIllusionMan12122025-04-051-1/+1
|
* fix: cross-compilation for android on linuxIllusionMan12122025-04-051-1/+2
| | | | | | | add `-nodefaultlibs` when cross-linking for android to prevent clang from linking with libgcc check build mode first before calling `init_android_values` to prevent printing a message that tells the user to set `-android-keystore` if its not set and build mode is exe
* Merge pull request #4970 from odin-lang/bill/android-subtargetgingerBill2025-03-281-44/+156
|\ | | | | Very Very Rudimentary Support for Android
| * Begin work on `odin package-android` commandgingerBill2025-03-261-146/+0
| |
| * Improve bodge for android execute buildgingerBill2025-03-261-3/+5
| |
| * Really bodgy android packing system for `odin build`gingerBill2025-03-261-1/+147
| |
| * Remove `_PATH` on android environment variablesgingerBill2025-03-261-14/+14
| |
| * Migrate `ODIN_ANDROID_*` constants to `build_settings.cpp`; ↵gingerBill2025-03-261-36/+6
| | | | | | | | `-minimum-os-version:<int>` for `-subtarget:android`
| * Add `-show-more-timings` for Android stuffgingerBill2025-03-261-0/+9
| |
| * Very very rudimentary support for `-target:linux_arm64 -subtarget:android`gingerBill2025-03-261-10/+157
| |
| * Make things rely less on `#if` guardsgingerBill2025-03-261-33/+17
| |
* | Fix linker invocation on OpenBSD.Dave Voutila2025-03-271-0/+7
|/ | | | | | | | | | | Firstly, we need to explicitly request pthreads and also need to mind the fact ports (like SDL2) install in /usr/local/lib. Secondly, since OpenBSD 7.4 the system enforces indirect branch targets on hardware platforms that support it. Until the LLVM integration in Odin can be changed to emit proper branch targets (e.g. endbr64 on amd64), we need to request the linker make the resulting program opt-out of enforcement.
* Print frameworks first on Darwin targetsgingerBill2025-01-281-1/+23
|
* Remove duplicates of .framework/.dynlib/.so in linkergingerBill2025-01-221-1/+10
|
* Add `-linker:<string>` to replace `-lld` and `-radlink`gingerBill2024-11-141-8/+13
|
* Add `-radlink`gingerBill2024-11-141-20/+41
|
* Revert further simplifiction0dminnimda2024-11-041-1/+1
|
* Simplify further0dminnimda2024-11-041-1/+1
|
* Simplify use of pie0dminnimda2024-11-041-20/+9
|
* Add support for linking as pie0dminnimda2024-11-041-2/+22
|
* quote the dsymutil argumentLaytan Laats2024-10-251-1/+1
| | | | Fixes #4417