Commit Graph

21 Commits

Author SHA1 Message Date
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
Laytan Laats
5032839abc darwin: add library paths for default Homebrew and MacPorts locations 2024-01-13 21:38:30 +01:00
Patrick Cleavelin
59aa05170d respect -lld CLI arg 2024-01-04 13:55:36 -06:00
Laytan Laats
8a7c2ea9d0 darwin: actually honor no-crt by not linking with -lSystem -lm 2024-01-02 21:44:51 +01:00
Platin21
37c2e9bec3 Fixed Typo / Added check for 1 2024-01-02 21:14:17 +01:00
Platin21
4626cd03da Adds missing space 2024-01-02 21:04:44 +01:00
Platin21
3850be2e11 Fixed git issue.. 2024-01-02 21:04:03 +01:00
Platin21
da977cf1e6 Adds new flag for linker to know if it should link the system library or not 2024-01-02 20:55:15 +01:00
Platin21
778bbee17c Removes macOS min version and supports default latest 2024-01-02 19:49:44 +01:00
Thomas Louis
4701b31b55 Fixing a pdb linker error when the path contains spaces 2023-12-27 11:36:38 +01:00
Laytan Laats
6b9202dfbf -no-crt and assembly compilation on darwin 2023-11-15 18:06:27 +01:00
flysand7
a2a05e40e6 implemented foreign asm imports on linux/osx 2023-10-15 21:25:55 +11:00
gingerBill
b09cdc0f25 Hook up Tilde to the linker code 2023-07-24 12:01:23 +01:00
gingerBill
bd81c6f5b4 Move linker code into separate file 2023-07-24 11:53:18 +01:00