Commit Graph

84 Commits

Author SHA1 Message Date
gingerBill 5f76d6ce15 Support -linker:mold 2025-09-19 10:25:11 +01:00
Jon Lipstate 231ce2da59 windows i386 support 2025-08-29 12:41:38 -07:00
Harold Brenes bab4ce11fc Rename iOS subtarget to iPhone for consistency.
Add `ODIN_PLATFORM_SUBTARGET_IOS` builtin constant which evaluated to
`true` when the platform is `Darwin` and the subtarget it either `iPhone` or `iPhoneSimulator`
2025-07-14 21:55:28 -04:00
Harold Brenes 77e5c71414 Fix correct versioned target triplet for iphonesimulator subtarget
- Always set the `-m*-version-min` linker flag for non-macOS Darwin subtargets
2025-07-14 14:28:07 -04:00
Harold Brenes 070943aa98 Provide default minimum version for iOS and apply its target triplet.
- Fix incorrect clang_path override for iOS during link stage.
2025-07-14 12:59:25 -04:00
Harold Brenes 4d2d890b4c Fix accidental incorrect assignment 2025-07-13 20:29:54 -04:00
Harold Brenes 0e245fb40f Updated iOS/iPhoneSimulator build support 2025-07-13 20:17:30 -04:00
xenobas 0ed54d3557 fix: escape object files with single quotes during linking 2025-06-20 19:40:24 +01:00
Feoramund 1fc390146f Let -no-entry-point work for Windows DLLs
Fixes #4660
2025-06-10 08:54:28 -04:00
Jeroen van Rijn 405bf7cd55 Also clean up .dSym on Darwin 2025-06-01 15:59:38 +02:00
Jeroen van Rijn 0d0f311df1 Always provide /PDB option to linker if generating debug info.
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.
2025-05-29 19:02:46 +02:00
Jeroen van Rijn 229c734820 Add comments to builtin.odin, documenting ODIN_* constants. (#5218)
And document constants not previously listed.
2025-05-26 18:58:59 +02:00
Feoramund 6c5b96948e Enable all sanitizers on FreeBSD 2025-05-22 21:39:35 -04:00
Feoramund c090a28b9d Add /usr/local/lib to FreeBSD linker path 2025-05-20 18:56:18 -04:00
Feoramund 591118c688 Use --sysroot instead of -Wl,-syslibroot on Darwin
This keeps the linker from using the wrong SDK and mirrors how we build
the Odin compiler itself in `build_odin.sh`.
2025-05-18 11:11:02 -04:00
Romāns Potašovs dc75ee72ae add quotes for absolute path 2025-04-09 15:31:34 +03:00
IllusionMan1212 af91dd7c7a android: always link liblog 2025-04-08 01:30:55 +02:00
IllusionMan1212 7d2a8dc8ee fix: use the clang binary that's provided by the android NDK
always link against libandroid because it's needed by the glue code.
2025-04-07 13:02:14 +02:00
Hisham Aburaqibah 106427b127 fix(android): pass --sysroot when compiling the android glue code
This prevents a `function-like macro '__GLIBC_USE' is not defined`
compilation error from happening with newer NDK versions (I tried r28)
2025-04-05 15:18:27 +02:00
IllusionMan1212 2328e84077 fix cross compilation for linux_riscv 2025-04-05 15:18:21 +02:00
IllusionMan1212 44950d5f37 fix: cross-compilation for android on linux
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
2025-04-05 02:20:06 +02:00
gingerBill edf97bdb03 Merge pull request #4970 from odin-lang/bill/android-subtarget
Very Very Rudimentary Support for Android
2025-03-28 09:02:26 +00:00
Dave Voutila 5274aa53b3 Fix linker invocation on OpenBSD.
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.
2025-03-27 10:37:36 -04:00
gingerBill f13a075cd1 Begin work on odin package-android command 2025-03-26 18:03:36 +00:00
gingerBill eee450516e Improve bodge for android execute build 2025-03-26 17:45:04 +00:00
gingerBill 45ecafd7b1 Really bodgy android packing system for odin build 2025-03-26 17:33:10 +00:00
gingerBill 8e884c6292 Remove _PATH on android environment variables 2025-03-26 16:50:35 +00:00
gingerBill d48e7bb0b8 Migrate ODIN_ANDROID_* constants to build_settings.cpp; -minimum-os-version:<int> for -subtarget:android 2025-03-26 16:05:21 +00:00
gingerBill 518634405c Add -show-more-timings for Android stuff 2025-03-26 13:28:57 +00:00
gingerBill e6718fcfcc Very very rudimentary support for -target:linux_arm64 -subtarget:android 2025-03-26 13:09:39 +00:00
gingerBill 4b64317296 Make things rely less on #if guards 2025-03-26 09:41:23 +00:00
gingerBill 15ece42e74 Print frameworks first on Darwin targets 2025-01-28 10:34:41 +00:00
gingerBill d6633639dc Remove duplicates of .framework/.dynlib/.so in linker 2025-01-22 13:01:06 +00:00
gingerBill b9886dfcc7 Add -linker:<string> to replace -lld and -radlink 2024-11-14 17:04:45 +00:00
gingerBill 21a25bddde Add -radlink 2024-11-14 16:32:26 +00:00
0dminnimda 5e308cef5e Revert further simplifiction 2024-11-04 15:50:43 +03:00
0dminnimda 8ad5e46ff8 Simplify further 2024-11-04 15:44:07 +03:00
0dminnimda c26e7e17a1 Simplify use of pie 2024-11-04 15:39:51 +03:00
0dminnimda 35f1b0f11e Add support for linking as pie 2024-11-04 02:35:49 +03:00
Laytan Laats bcf2b93c6e quote the dsymutil argument
Fixes #4417
2024-10-25 15:34:59 +02:00
Laytan Laats 6778598bc6 support the rpath changes on macos 2024-09-05 00:12:16 +02:00
Laytan 0aa971207b add -no-rpath 2024-09-04 22:38:19 +02:00
Laytan 1a7c1d107a set -rpath to \$ORIGIN and expect libraries next to executable just like Windows 2024-09-04 22:19:46 +02:00
Laytan ca6ef95b03 add support for linux_riscv64 and freestanding_riscv64 2024-08-20 14:06:40 +02:00
Jeroen van Rijn cc73e06a46 Allow precompiled resources with -resource:foo.res
And add them to the magic new feature.
2024-07-10 15:09:13 +02:00
Jeroen van Rijn 8dc4eca4d2 Allow using precompiled .res file. 2024-07-10 14:25:18 +02:00
gingerBill b83822fd35 #3892 - Use temporary directory for asm file generation 2024-07-09 15:41:05 +01:00
Laytan Laats 6f1cc8071c wasm: add foreign import and linking of wasm object files 2024-07-02 15:28:08 +02:00
gingerBill 0c8a81d298 Fix #3819 2024-06-28 08:57:31 +01:00
Jeroen van Rijn 58cd75350b Allow ODIN_CLANG_PATH=clang-path overrides
Link using `clang`, unless overridden by `ODIN_CLANG_PATH` environment variable.

Fixes #3783
2024-06-27 23:21:58 +02:00