Commit Graph

366 Commits

Author SHA1 Message Date
gingerBill 863ee0b8d1 Merge pull request #3297 from laytan/linker-improvements
linker improvements
2024-03-20 10:09:45 +00: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 ba428fecdb Add -json-errors 2024-03-19 16:25:09 +00:00
gingerBill 9a2fc6cf4c Serialize errors to make them sortable, deterministic, and generally more control 2024-03-19 15:34:29 +00:00
avanspector fca691a066 fix core:thread and a memory leak
in the future probably native non-pthread implementation for haiku will be required
2024-02-27 02:38:06 +01:00
avanspector 0fa6ba726f add haiku build token 2024-02-25 03:03:12 +01:00
avanspector 24c8b15409 small fixes 2024-02-25 02:38:35 +01:00
avanspector 88add0b6b1 Improve Haiku support 2024-02-25 02:24:52 +01:00
Laytan Laats a8c4f46747 fix ci 2024-02-07 19:53:52 +01:00
gingerBill a08250ac5b Improve error handling for missing library collection provided by the compiler 2024-02-07 17:15:59 +00:00
gingerBill 9fb090d1b8 Merge pull request #3141 from laytan/add-all-packages-flag-for-tests
Add `odin test -all-packages` to be able to test an entire project
2024-01-31 11:59:54 +00:00
gingerBill 6a07effdd2 Freestanding - default to nil allocator; wasm - default to panic allocator 2024-01-28 22:15:28 +00:00
gingerBill 395e0fb225 -default-to-panic-allocator 2024-01-28 22:09:20 +00:00
gingerBill 09fa1c29cd Move core:runtime to base:runtime; keep alias around 2024-01-28 21:05:53 +00:00
Laytan Laats 31914e9cb9 Add odin test -all-packages to be able to test an entire project 2024-01-26 18:27:05 +01: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
Jeroen van Rijn ae52e245ea Add WINDOWS_SUBSYSTEM constant bool
true when -subsystem:windows for Windows targets, false otherwise.
2024-01-18 17:42:03 +01:00
codename-irvin 0fcd2f1d88 Use default calling convention for arm target for now - not 100% sure this is correct 2024-01-16 10:47:25 -05:00
codename-irvin 76f52dd6c9 Add freestanding aarch64 target 2024-01-15 19:49:34 -05:00
Yawning Angel cd65a15d81 src: enable_target_feature should add features, not overwrite
`llvm_features` being empty is the default state, and implies the
presence of certain features.

Previously if any target features were explicitly enabled by the
`enable_target_feature` attribute, they were added comma separated
to `llvm_features`.

For example: `lzcnt,popcnt,...,sse4.2,sse`

This was causing LLVM to try to target a CPU that *ONLY* has the
explicitly enabled features.  This now will prefix explicitly enabled
features with a `+`, and preserve the existing `llvm_features` string
by appending to it if it is set.
2024-01-07 20:04:40 +09:00
gingerBill d7d23e65ea Clean up error block usage 2024-01-05 13:47:00 +00:00
gingerBill ca2b2c498e Add -obfuscate-source-code-locations 2023-12-13 16:47:34 +00:00
Jeroen van Rijn f903951016 Facored out get_default_microarchitecture
Moved `generic` -> `x86-64-v2` selection into its own procedure so that `llvm_backend.cpp` and `main.cpp` can share the same logic.
2023-11-10 20:14:00 +01:00
Jeroen van Rijn e19460cbd7 Add -microarch:? 2023-11-10 19:37:08 +01:00
gingerBill 1d9f6346d4 Force dynamic map calls on non-windows targets 2023-10-29 17:23:24 +00:00
gingerBill c8a5bafc6b Fix static map calls and default to them! 2023-10-27 14:53:48 +01:00
gingerBill 1f643b5816 Remove -vet-extra 2023-09-30 18:29:18 +01:00
gingerBill 70aff9fbb2 Update src/build_settings.cpp
Co-authored-by: Laytan Laats <laytanlaats@hotmail.com>
2023-09-27 14:01:45 +01:00
gingerBill 4aa9d34b3d Add attributes for sanitize_memory and sanitize_thread 2023-09-21 11:20:13 +01:00
gingerBill e82b0ea4cd Add -o:aggressive for LLVM 17 2023-09-21 09:48:53 +01:00
gingerBill 2160484b62 Support -sanitize:<string> for address, memory, thread for LLVM 17 2023-09-21 09:40:33 +01:00
gingerBill 939bf4bb5d Add experimental -subtarget:ios 2023-08-08 11:35:51 +01:00
gingerBill b495a302b0 Merge branch 'master' into tilde 2023-08-03 13:14:09 +01:00
gingerBill 2f094134a3 Remove -strict-style-init-only 2023-08-01 11:14:52 +01:00
gingerBill c35c58b023 Add -vet-style and -vet-semicolon 2023-08-01 11:03:15 +01:00
gingerBill 0de7df9eab Improve //+vet; remove using in many places; add //+vet !using-stmt where necessary 2023-07-31 11:37:14 +01:00
gingerBill 60e509b1e0 Add separate -vet flags; -vet-using-* flags; //+vet file flags 2023-07-31 11:09:19 +01:00
gingerBill 7ab531bd21 Add -tilde for working on the new compiler 2023-07-08 12:07:11 +01:00
gingerBill 296674e18b Rename ODIN_DISALLOW_RTTI to ODIN_NO_RTTI; Remove dead command line flags 2023-06-12 14:53:05 +01:00
gingerBill 7a1ab62987 Fix endianness for wasm64p32 2023-06-07 01:19:40 +01:00
gingerBill 4a75a1e839 Merge branch 'master' into separate-int-word-sizes 2023-06-06 22:42:04 +01:00
Jeroen van Rijn 1f4baba06e Merge pull request #2479 from Naught00/master
Change default executable extension for non-Windows platforms
2023-05-19 20:09:39 +02:00
Mark Naughton fa1ce7d5d1 Fix accidental check in 2023-05-19 18:56:35 +01:00
Mark Naughton 018904f0ec Add write permissions check on output folder 2023-05-19 18:37:55 +01:00
Mark Naughton 413077a5d9 Fix single-file package case 2023-05-18 13:23:17 +01:00
gingerBill e82146bf17 Merge branch 'master' into separate-int-word-sizes 2023-05-03 17:06:37 +01:00
gingerBill fda1e4409c When using -debug, default to -o:none unless explicitly specified 2023-05-02 14:44:56 +01:00
Mark Naughton 4b4481ea27 Simplify extension addition logic 2023-04-26 16:39:47 +01:00
Mark Naughton e84802468b Use buildpath instead of init_filename 2023-04-26 15:48:59 +01:00
Mark Naughton 1a5ed4eb7f Fix .bin not being applied for relative directory 2023-04-26 14:10:22 +01:00