Commit Graph

5406 Commits

Author SHA1 Message Date
Feoramund
e13b05168c Fix syscall_bsd on NetBSD ARM64 2025-04-06 19:58:23 -04:00
gingerBill
eecc6c1f18 Merge pull request #5003 from IllusionMan1212/more-android-fixes
Android bundling improvements
2025-04-06 09:28:13 +01: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
Hisham Aburaqibah
ef49d2f0b8 print android-specific flags for the bundle command 2025-04-05 15:18:27 +02:00
IllusionMan1212
2328e84077 fix cross compilation for linux_riscv 2025-04-05 15:18:21 +02:00
Jeroen van Rijn
843467bb8f Fix #5004
Fixes constant NaN to constant NaN comparisons.
2025-04-05 14:47:30 +02: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
Romāns Potašovs
9557d6a644 fix compiler issue 2025-04-04 19:35:59 +03:00
gingerBill
19e056a806 Merge pull request #4997 from IllusionMan1212/android-fixes
A few fixes for android
2025-04-04 12:05:21 +01: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
IllusionMan1212
7d041cb2b8 fix: prevent segfault by initializing cwd to nullptr 2025-04-04 05:14:52 +02:00
gingerBill
d9f990d42e Fix #4975 2025-04-03 10:55:35 +01:00
gingerBill
ce5b7cccab Fix lb_add_debug_local_variable to use the correct procedure in LLVM 20 2025-04-03 10:04:14 +01:00
gingerBill
4ebaed1fdd Remove refactor 2025-04-03 09:54:44 +01:00
gingerBill
e412d3b4c1 Minor clean up to lb_handle_objc_find_or_register_internal 2025-04-03 09:48:30 +01:00
gingerBill
cd5bef4f61 Rewrite objc SEL/Class register handling code 2025-04-03 09:37:38 +01:00
gingerBill
5eaff20f4a Add mutex for lb_handle_objc_find_or_register_class 2025-04-02 18:26:40 +01:00
gingerBill
b615e77264 Merge branch 'master' of https://github.com/odin-lang/Odin 2025-04-02 18:23:15 +01:00
gingerBill
d0dd1b2d80 Add mutex for lb_handle_objc_find_or_register_selector 2025-04-02 18:23:08 +01:00
Jeroen van Rijn
10bde20850 Fix #4980
Add nullptr check.
2025-04-02 14:21:52 +02:00
gingerBill
e7ae7b8fd4 Command package -> bundle 2025-03-28 09:27:04 +00: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
gingerBill
d3f0b31fcc Improve or_else type inference logic 2025-03-27 15:08:53 +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
9b3d381af0 Fix another typo 2025-03-27 12:55:41 +00:00
gingerBill
1fc1a7fd51 Fix typos 2025-03-27 11:12:44 +00:00
gingerBill
0e6cc6ec4b Use working directory for aapt commands 2025-03-27 10:31:59 +00:00
gingerBill
caac504b88 Handle android flags to be more "optional" 2025-03-27 09:53:44 +00:00
gingerBill
e9fd565cfd Fix flags for odin package <platform> 2025-03-27 09:32:52 +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
729b6a4337 Merge pull request #4974 from harold-b/hb.fix-syscall-memory-dep
Add `~{memory}` clobber to syscall intrinsics for platforms where it was missing
2025-03-27 09:09:18 +00:00
Harold Brenes
6fda041e17 Add ~{memory} clobber to syscall intrinsics for platforms where it was not yet added.
This fixes #4972 and #4588.

As laytan asserts, there is no guarantee that a syscall will not modify memory that it just obtained from the user, or held onto via a previous syscall. Therefore this constraint should be required for all syscalls.
2025-03-26 19:25:06 -04: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
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
db82a49576 Fix typos 2025-03-26 13:30:18 +00:00
gingerBill
518634405c Add -show-more-timings for Android stuff 2025-03-26 13:28:57 +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
gingerBill
4b64317296 Make things rely less on #if guards 2025-03-26 09:41:23 +00:00
gingerBill
5e89e5ad8b Use store 2025-03-24 13:40:24 +00:00
gingerBill
fe6117fc63 Use store over memcpy 2025-03-24 13:14:54 +00:00
gingerBill
ce026ff2c4 Fix #4949 2025-03-24 13:13:25 +00:00
gingerBill
56e0ab7655 Fix #4952 2025-03-24 13:11:41 +00:00