Commit Graph

454 Commits

Author SHA1 Message Date
gingerBill
513e6daace Merge pull request #5081 from Lperlind/vet-explicit-allocators
Add -vet-explicit-allocators
2025-07-22 11:06:12 +01:00
Harold Brenes
7c917d56e9 Check for invalid subtargets.
- Add 'ios' pseudo-subtarget which triggets with either iPhone or iPhoneSimulator subtargets.

- Treat an explicit 'default' subtarget as exclusive only to the default subtarget, not an other platform-compatible subtargets.

- 'generic' continues to resolve to true for any platform-compatible subtarget as it names appears to imply such behavior.
2025-07-20 14:35:06 -04:00
Harold Brenes
63b9cb18ef Missing rename in panic string 2025-07-14 22:32:06 -04: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
0e245fb40f Updated iOS/iPhoneSimulator build support 2025-07-13 20:17:30 -04:00
Hayden Gray
f72b2b1530 [source-code-locations] - added options to show, obfuscate, and hide source code locations (#5412) 2025-06-26 22:43:44 +02:00
Jeroen van Rijn
805f7ce973 Typo fix 2025-06-01 19:22:51 +02:00
Jeroen van Rijn
405bf7cd55 Also clean up .dSym on Darwin 2025-06-01 15:59:38 +02:00
Feoramund
598c1a1f19 Allow overriding object extension in -build-mode:obj 2025-05-30 08:01:23 -04:00
Feoramund
73866b6b3d Remove trailing whitespace 2025-05-30 07:31:03 -04: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
Jeroen van Rijn
84b140f963 Rename -keep-test-executable to -keep-executable 2025-05-23 08:47:48 +02:00
Jeroen van Rijn
12167bace0 Tweak #5202
Back out the new `-build-only` for tests in favor of the more established `-build-mode:test`, but retain the new `-keep-test-executable` option and default cleanup of test executables.
2025-05-23 08:28:27 +02:00
Feoramund
6c5b96948e Enable all sanitizers on FreeBSD 2025-05-22 21:39:35 -04:00
Feoramund
5b5822effc Delete test executable after running, add -keep-test-executable 2025-05-22 17:58:51 -04:00
Feoramund
0536f86268 Add -build-only for odin test command
This allows test executables to be only built, not run too.
2025-05-22 17:33:24 -04:00
Feoramund
e35e1dcc7b Only trim .odin from build filenames 2025-05-22 08:23:06 -04:00
Jeroen van Rijn
ab95932502 -dynamic-literals 2025-05-19 20:44:27 +02:00
Feoramund
eb051a2d7c Re-enable static map calls on AMD64 SysV 2025-05-18 17:13:39 -04:00
Lucas Perlind
65b4c793f0 Add -vet-explicit-allocators
This vet flag will make it so that allocators must be explicitly used
in places where context.allocator and context.temp_allocator are a
procedure parameter.

The goal of this flag is to prevent using the context.allocator in
cases where a different allocator was meant to be used.
Some code bases default context.allocator to nil/panic allocator
to catch this at runtime. This effectively makes it a compile
time error instead.
2025-04-27 22:47:03 +10:00
gingerBill
1f814c33dc Support subtargets in build tags: #build darwin:generic and #build linux:android, darwin:ios 2025-04-10 11:36:03 +01:00
gingerBill
5e63388de2 Fix init_android_values SDK check for odin check 2025-04-10 11:07:44 +01:00
IllusionMan1212
da885fb807 android bundling improvements
replace `jarsigner` with build tools' `apksigner` which is capable of using newer signature schemes

remove the `android-manifest` flag and assume the file exists in the directory we're bundling

make `android-keystore-alias` and `android-keystore-password` optional.
The former is not needed if there's only one key in the keystore, and the latter will be prompted by `apksigner` if missing

don't change the working directory to the bundled directory to prevent confusion when passing a relative path to
`android-keystore`

add the `res`, `assets`, and `lib` directories to the bundle if they exist in the bundled directory
2025-04-05 02:38:04 +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
IllusionMan1212
4495f0f0f2 feat: added a -android-keystore-password option to pass a password for the keystore instead of hardcoding it as android 2025-04-04 05:23:12 +02:00
IllusionMan1212
7c26024920 fix: strip trailing slashes for android keystore and jarsigner paths
The `system()` call on linux was failing to execute the `jarsigner` command because its path had a trailing slash
2025-04-04 05:22:04 +02:00
gingerBill
e7ae7b8fd4 Command package -> bundle 2025-03-28 09:27:04 +00:00
gingerBill
0e6cc6ec4b Use working directory for aapt commands 2025-03-27 10:31:59 +00:00
gingerBill
e29b5ae8ed Use u64 for the command kind just in case 2025-03-27 09:27:54 +00:00
gingerBill
6689c722ad odin package android 2025-03-27 09:26:33 +00:00
gingerBill
f13a075cd1 Begin work on odin package-android command 2025-03-26 18:03:36 +00:00
gingerBill
346836a098 Disable -build-mode:exe for -subtarget:android 2025-03-26 17:45:35 +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
db82a49576 Fix typos 2025-03-26 13:30:18 +00:00
gingerBill
dfd0f18f47 Allow check for -subtarget:android 2025-03-26 13:19:40 +00:00
gingerBill
e6718fcfcc Very very rudimentary support for -target:linux_arm64 -subtarget:android 2025-03-26 13:09:39 +00:00
Laytan Laats
f80e73e036 few llvm 20 changes 2025-03-19 21:22:55 +01:00
gingerBill
867af80bff Add -use-single-module 2025-01-22 13:26:35 +00:00
gingerBill
d4e15074ea Enable -use-separate-modules as default for all platforms 2025-01-22 13:13:00 +00:00
flysand7
3f20b63243 Error if -no-thread-local is used in presence of -no-crt on Unix 2025-01-17 02:51:22 +03:00
flysand7
4f0206ce08 Added compile-time checks for thread locals with -no-crt
Now using any thread-local variables with -no-crt enabled
will cause a compiler error, unless -no-thread-local is
given.

Also fixed a minor typo in a comment.
2025-01-17 01:12:23 +03:00
gingerBill
bca08d3b85 Make -no-dynamic-literals the default now 2025-01-05 13:33:06 +00:00
gingerBill
2efe4c2d68 Add #+feature dynamic-literals 2025-01-05 13:19:10 +00:00
Laytan Laats
676fe34863 fix #4547 - wasm -out without file extension 2024-12-06 19:38:53 +01:00
gingerBill
b36a81ef53 ABI change: for indirect parameters size_of <= 16, do callee stack copy 2024-12-05 10:49:39 +00:00