Commit Graph

63 Commits

Author SHA1 Message Date
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
Jeroen van Rijn
eebc0dd026 Fix rc.exe bug with double-quoted .res path. 2024-06-16 19:11:54 +02:00
laytan
08382cb05d orca windows 2024-06-05 19:28:40 +02:00
Laytan Laats
8455e159f5 improve orca target 2024-06-05 20:57:39 +02:00
gingerBill
e737122ce8 Add experimental target orca_wasm32 2024-05-30 21:58:27 +01:00
gingerBill
e71cd871c4 Reimplement -build-mode:static/-build-mode:lib 2024-05-16 14:27:05 +01:00
gingerBill
595726e6c5 Merge pull request #3369 from joakin/fix-dynamic-library-from-vendor-on-linux
Fix vendor dynamic libraries not working on Linux
2024-05-03 17:14:32 +01:00
gingerBill
94e0707456 Fix minor bug 2024-04-26 13:12:15 +01:00
joakin
60ef4fda4d Recognize dynamic library names like libraylib.so.5.0.0 2024-04-19 13:35:53 +02:00
Laytan Laats
9c958ee66d fix nasm check 2024-04-08 20:43:52 +02:00
gingerBill
b979fd4c43 Remove consecutive linking libraries 2024-04-04 16:14:05 +01:00
gingerBill
0e5a482c42 Default to "smart" linker behaviour; Add -min-link-libs to use minimize link libs if wanted 2024-04-04 16:11:26 +01:00
Laytan Laats
19d566ebc5 darwin: fix linker warning when building dynamic library
Trying to fix all linker warnings that macOS comes up with, when
building a dynamic library it currently emits `ld: warning: ignoring -e, not used for output type`
2024-03-26 21:00:14 +01:00
Laytan Laats
b26a685b76 darwin: be less annoying about "incompatible" library versions
After #3316 we set a default minimum version, now this will warn if you
link with a library that is targeting later versions.

This might be a bit annoying, especially when the user hasn't actually
given Odin a minimum target.

So this PR makes these warnings only show when you explicitly give a
target version (afaik that is the only thing that -mmacosx-min-version
actually does for us because we don't use it to compile anything, just
to link).
2024-03-25 22:11:20 +01:00
Laytan Laats
15c1e8274d darwin: fix ld warnings and set minimum os version 2024-03-23 22:12:05 +01:00
Laytan Laats
a555862522 linker improvements
`path_to_fullpath` did different things on Windows&Unix, an attempt to
bring them closer together was made here.
This was prompted by the compiler completely ignoring
`foreign import "foo.dylib"` when `foo.dylib` does not exist (because
`path_to_fullpath` returns an empty string).
Causing just unresolved symbol errors, when on Windows it would pass
along the path to the linker and actually say it doesn't exist, which
is now also the case for Unix.
This also fixes some checker errors that relied on the Windows
behaviour, for example: `Error: File name, , cannot be as a library name
as it is not a valid identifier`.

Made `-no-crt` require either `-default-to-nil-allocator` or
`-default-to-panic-allocator` on Unix, the current default allocators
rely on libc and this was not obvious and would immediately bring up
unresolved symbol errors for the linked memory management functions, or
just link with libc anyways because it was foreign imported.

Added a suggestion to install `nasm` with the user's package manager
when assembling using `nasm` fails on Unix, I saw some confusion about
it in the Discord.

Ignore explicit foreign imports of libc. It is already linked in later
on in the linking process and would otherwise (at least on macOS) cause
linker warnings for duplicate libraries. This also makes it so when
using `-no-crt` and importing something that requires libc, linker
errors are given (like I would expect), instead of silently still
linking with libc because it was foreign imported.
2024-03-19 19:57:35 +01:00
gingerBill
53ce945034 Merge pull request #3230 from avanspector/haiku
Add Haiku OS support
2024-03-08 11:15:13 +00:00
gingerBill
14f7619cdc Merge pull request #3069 from pcleavelin/master
Respect `-lld` CLI arg on non-windows machines
2024-03-06 15:25:16 +00:00
avanspector
88add0b6b1 Improve Haiku support 2024-02-25 02:24:52 +01:00
Laytan
eab0e730a0 fix -no-crt on Linux 2024-02-08 19:48:37 +01:00
Patrick Cleavelin
7b9ea9eca0 Merge branch 'odin-lang:master' into master 2024-01-27 14:12:19 -06:00
Jeroen van Rijn
fc047a8043 Expand -subsystem option on Windows
W:\Odin>odin run sketch.odin -file -subsystem:foo
Invalid -subsystem string, got oo. Expected one of:
        BOOT_APPLICATION, CONSOLE (default), EFI_APPLICATION, EFI_BOOT_SERVICE_DRIVER, EFI_ROM, EFI_RUNTIME_DRIVER, NATIVE, POSIX, WINDOWS (or WINDOW), WINDOWSCE

We now also set the constant ODIN_WINDOWS_SUBSYSTEM, which is "" for non-Windows targets.
2024-01-18 19:12:39 +01:00