Commit Graph

453 Commits

Author SHA1 Message Date
Jeroen van Rijn
85a263130d Add LLVM > 14 check to main.cpp for Darwin. 2022-10-27 02:55:38 +02:00
gingerBill
af76d26771 Simplify win32 resource file linking 2022-09-07 11:22:43 +01:00
Jeroen van Rijn
fc2cd3e1d5 Add help verb, e.g. odin help build. 2022-09-05 22:28:16 +02:00
Jeroen van Rijn
a5a9347308 Improve error message when you use -file as the verb. 2022-09-05 21:59:56 +02:00
Joakim Hentula
28f440dd9e Do not remove .rc extension from resource path to prevent expansion to full path assuming it's a directory if a folder with the same name exists in the same folder as the resource file 2022-08-10 14:03:04 +01:00
Ian Lilley
c1c8ceafc2 find windows sdk bin path for rc.exe 2022-08-07 17:52:29 -04:00
Wes Hardee
23842a8950 fix -build-mode:shared on MacOS 2022-06-30 12:40:32 -05:00
gingerBill
8c0c327df9 Improvements to -strict-style and trailing commas 2022-06-13 11:00:13 +01:00
gingerBill
f3aefbc443 @(require_target_feature=<string>) @(enable_target_feature=<string>)
require_target_feature - required by the target micro-architecture
enable_target_feature - will be enabled for the specified procedure only
2022-05-30 14:53:12 +01:00
gingerBill
542e45de26 Increase minimum macOS version to 10.12.0 2022-05-18 12:30:26 +01:00
gingerBill
5931e2383b Remove unneeded #if defined 2022-05-04 16:58:40 +01:00
gingerBill
9f95d6fa65 Minor move around for path sets 2022-05-04 16:17:24 +01:00
gingerBill
982a1aebb3 Remove stray line 2022-05-04 16:14:42 +01:00
gingerBill
cec049b7d3 Make the link order of foreign imports deterministic 2022-05-04 16:04:26 +01:00
Jeroen van Rijn
dc323cfa1d Small fix to deprecation warning. 2022-05-04 13:29:52 +02:00
Jeroen van Rijn
47f637d23b Add deprecation warnings for -opt and flag=value insted of flag:value. 2022-05-03 13:37:07 +02:00
Jeroen van Rijn
59f55a2119 Make big_int_from_string return an error if not an integer. 2022-05-03 13:15:49 +02:00
Jeroen van Rijn
8bac82320f Fix -opt: parsing. 2022-05-03 11:44:55 +02:00
Jeroen van Rijn
e53ba3b116 Allow -error-pos-style:default as an alias for odin 2022-04-28 18:18:25 +02:00
Jeroen van Rijn
1ed84a064b Make -error-pos-style case-insensitive. 2022-04-28 18:12:55 +02:00
Jeroen van Rijn
a1002e6960 Fix -error-pos-style:unix 2022-04-28 17:46:36 +02:00
Jeroen van Rijn
3cab2592c3 Compiler: Add early error for output path being a directory.
- Introduce new `Path` type and an array of build paths on the build context.
- Resolve input and output paths/files early (before parsing).
- Error early if inputs are missing or outputs are directories.
- Plumb new file path generation into linker stage instead of its adhoc method.

TODO:
- Remove more adhoc file path generation in parser and linker stage.
- Make intermediate object file generation use new path system.
- Round out and robustify Path helper functions.
2022-04-24 13:37:26 +02:00
Jeroen van Rijn
bb9165edd2 Add -help to CI tests. 2022-04-05 20:45:00 +02:00
Jeroen van Rijn
ad0a413b40 Give build/run/check/test/doc a -file flag.
A package has canonically always been a directory, but odin allowing you to build a single-file package confused newcomers who didn't understand why they could then not access variables and procedures from another file in the same directory.

This change disallows building single-file packages by default, requiring the `-file` flag to acknowledge you understand the nuance.

`-help` for these commands also clarifies the difference.

```
W:\Odin>odin build -help
odin is a tool for managing Odin source code
Usage:
        odin build [arguments]

        build   Compile directory of .odin files as an executable.
                One must contain the program's entry point, all must be in the same package.
                Use `-file` to build a single file instead.
                Examples:
                        odin build .                    # Build package in current directory
                        odin build <dir>                # Build package in <dir>
                        odin build filename.odin -file  # Build single-file package, must contain entry point.

        Flags

        -file
                Tells `odin build` to treat the given file as a self-contained package.
                This means that `<dir>/a.odin` won't have access to `<dir>/b.odin`'s contents.
```

```
W:\Odin>odin run examples\demo\demo.odin
ERROR: `odin run` takes a package as its first argument.
Did you mean `odin run examples\demo\demo.odin -file`?
The `-file` flag tells it to treat a file as a self-contained package.
```
2022-04-05 20:26:18 +02:00
Jeroen van Rijn
2e6ad2a711 Add extra help line for define/config. 2022-04-03 21:06:06 +02:00
gingerBill
abf0fd7efc Merge pull request #1671 from colrdavidson/add_nocrt
Make no crt work on Linux
2022-03-30 12:58:12 +01:00
Colin Davidson
a632db3618 Make no crt work on Linux 2022-03-30 04:45:22 -07:00
gitlost
8661457512 Use WIFEXITED() and WEXITSTATUS() on Unix system() exit code
(ensures Odin run returns correct exit code of built executable)
Adds test "tests/core/os/test_core_os_exit.odin" (Unix only)
2022-03-24 19:31:46 +00:00
gingerBill
a7adb2fb6e Merge branch 'master' into freestanding_amd64 2022-03-14 11:02:59 +00:00
gingerBill
8e4d6b3e5d Fix typo 2022-03-09 11:24:36 +00:00
gingerBill
ba412fd87b Fix typo 2022-03-09 09:36:21 +00:00
gingerBill
ff60b752bd Replace #if with if where possible 2022-03-08 22:35:10 +00:00
gingerBill
17dab04422 Refactor link flag creation for nix systems 2022-03-08 11:13:59 +00:00
kstrb
1cd89b2da3 Linux: allow 'foreign import' of object files 2022-03-05 17:28:34 +01:00
Sébastien Marie
f76f70c7cf openbsd: defaults to PIE executable
OpenBSD uses PIE code by default to allow the system to load the binary at a random location.

don't pass -no-pie to preserve this behaviour, and build objects with -fPIC (LLVMRelocPIC).
2022-02-28 15:24:22 +00:00
gingerBill
09e4fff5b1 -target-features:<string>
This just passes a string directly to the LLVM features string
2022-02-28 15:08:50 +00:00
gingerBill
278e239973 Commit rest of code for -disallow-rtti 2022-02-28 13:40:01 +00:00
gingerBill
45124e4d5c Merge branch 'master' into freestanding_amd64 2022-02-28 12:32:51 +00:00
gingerBill
c3c88633a5 Merge pull request #1545 from AquaGeneral/master
Added options to help, and improved wording
2022-02-24 10:15:13 +00:00
Jesse Stiller
384fb76a1b Added options to help, and improved wording 2022-02-24 12:59:06 +10:00
gingerBill
196bd735d4 Replace local @(no_red_zone) with global -disable-red-zone 2022-02-23 11:29:36 +00:00
gingerBill
3d209798c9 Add help docs for -reloc-mode:<string> 2022-02-23 11:19:51 +00:00
gingerBill
3e5c60f746 Add -reloc-mode:<string> 2022-02-20 14:48:12 +00:00
gingerBill
0fa487f468 Add -foreign-error-procedures 2022-02-20 14:27:44 +00:00
gingerBill
71df46456a Minimize memory usage by having an arena per thread rather than an arena per file 2022-02-18 21:30:25 +00:00
gingerBill
9e98494fff Merge pull request #1482 from odin-lang/objc-intrinsics
Improve support Objective-C code through intrinsics and Metal API
2022-02-15 15:48:56 +00:00
Phil H
e6e04fc6c8 Add 'odin run -help' info for specifying args 2022-02-14 22:15:55 -08:00
gingerBill
fd8b2e0b88 Merge branch 'master' into objc-intrinsics 2022-02-14 11:04:36 +00:00
gingerBill
441365b388 Set the macOS minimum version to 12 for ARM CPUs 2022-02-14 10:58:01 +00:00
gingerBill
f8afda3b22 Add more objc attributes 2022-02-11 22:54:51 +00:00