Commit Graph

33 Commits

Author SHA1 Message Date
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
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