Commit Graph

227 Commits

Author SHA1 Message Date
Jeroen van Rijn
9eec9f5788 Add -minimum-os-version flag
Allow for Darwin targets to specify the minimum OS version:
e.g. -minimum-os-version:12.0.0
2022-11-01 15:04:44 +01:00
Jeroen van Rijn
159c5311c3 Revert "Fix #2112" 2022-10-08 23:01:06 +02:00
Jeroen van Rijn
ab7367ae47 Fix #2112 2022-10-08 19:00:05 +02:00
Colin Davidson
2ff61bdfc7 fix target features to make wasm intrinsics happy 2022-09-21 18:35:56 -07:00
gingerBill
3ff56e4405 Correct get_fullpath_relative to remove all trailing path separators (/ and \) 2022-09-21 11:31:52 +01:00
gingerBill
663b62e45f Fix ODIN_BUILD_PROJECT_NAME 2022-09-12 14:43:50 +01:00
gingerBill
81e3b64ecd Add ODIN_BUILD_PROJECT_NAME and //+build-project-name
This allows for condition inclusion of files, similar to `+build` or `ODIN_BUILD`, but relies on the directory name of the project to be the same as specified

Example:

    odin build foo/bar/baz

    ODIN_BUILD_PROJECT_NAME == "baz"

    //+build_project_name baz
2022-09-08 16:35:25 +01:00
Jeroen van Rijn
cac72a9423 Allow Odin to find itself if it's in PATH on OpenBSD, because reasons. 2022-09-04 19:01:32 +02:00
gingerBill
aeacf3a9d8 Correct max alignment handling throughout the llvm backend 2022-08-24 13:07:41 +01:00
gingerBill
4ba486baa2 Add extra max alignment parameter for metrics (specifically for SIMD) 2022-08-24 12:58:16 +01:00
gingerBill
82e840a0ca EXPERIMENTAL intrinsics.valgrind_client_request 2022-08-17 13:52:13 +01:00
Ian Lilley
c1c8ceafc2 find windows sdk bin path for rc.exe 2022-08-07 17:52:29 -04:00
gingerBill
e8148055ad Fix compilation on non-windows platforms 2022-07-09 23:55:02 +01:00
gingerBill
babbc304b8 Fix wasm compilation in windows 2022-07-09 23:53:18 +01:00
gingerBill
a1f15c2c69 Merge pull request #1807 from odin-lang/simd-dev
Generic #simd type and intrinsics
2022-05-31 11:52:24 +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
d7eaf0f87b Add intrinsics.x86_cpuid and intrinsics.x86_xgetbv 2022-05-28 15:41:11 +01:00
Jeroen van Rijn
2f7bd154a2 Additional cleanup of microsoft_craziness.h. 2022-05-27 20:59:46 +02:00
Jeroen van Rijn
f137b927b6 Refactor ms_craziness.h 2022-05-27 15:47:29 +02:00
Jeroen van Rijn
3c5124ce68 Fix odin build examples\demo\ trailing slash handling. 2022-05-24 13:55:39 +02:00
gingerBill
dfbe68bcfe Begin to add support for experimental wasm64 2022-05-21 13:30:43 +01:00
gingerBill
da54d0ec8c Fix typo 2022-05-21 13:18:11 +01:00
gingerBill
0e27b27b81 Fix building issues with arm32 2022-05-01 23:28:32 +01:00
gingerBill
10a311092b Add basic arm32 ABI support (linux_arm32) 2022-05-01 23:15:06 +01:00
Jeroen van Rijn
a5342a0126 Address edge cases. 2022-04-26 13:14:09 +02:00
Jeroen van Rijn
f4723aea4c Remove redundant bit for non-Windows. 2022-04-24 13:37:26 +02:00
Jeroen van Rijn
76d48b38d3 Compiler: Allow -out: to not have an extension on *nix for executables (only). 2022-04-24 13:37:26 +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
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
gingerBill
a7adb2fb6e Merge branch 'master' into freestanding_amd64 2022-03-14 11:02:59 +00:00
Sébastien Marie
499c657ffa rename architecture from 386 to i386 2022-03-03 15:28:18 +00:00
gingerBill
15d783e920 Enforce -no-entry-point on freestanding targets 2022-02-28 15:13:41 +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
882116e358 Only allow -disallow-rtti on freestanding targets 2022-02-28 14:00:44 +00:00
gingerBill
278e239973 Commit rest of code for -disallow-rtti 2022-02-28 13:40:01 +00:00
Sébastien Marie
8e270d3a99 openbsd: poor man implementation for getting executable path
it tries to get executable path from argv[0]. it is unreliable and unsecure, but should be fine enough for the considered use-case. it still doesn't address all possible cases.
2022-02-26 08:19:41 +00:00
Sébastien Marie
ae5cb09041 internal_odin_root_dir: readlink could fail 2022-02-25 17:59:57 +00:00
Sébastien Marie
5676c9e7eb initial OpenBSD support 2022-02-25 08:49:25 +00:00
gingerBill
4a04a32e0a Change target name to freestanding_amd64_sysv 2022-02-23 11:33:28 +00: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
1bec9e5331 Add freestanding_amd64_gnu 2022-02-20 14:19:52 +00:00
gingerBill
070b450768 Add ODIN_ERROR_POS_STYLE constant and change runtime.print_caller_location based on that constant 2022-01-26 17:34:39 +00:00
gingerBill
74174eb4ae Remove spurious ) 2022-01-26 16:38:12 +00:00
gingerBill
081a5a52a6 Add ODIN_ERROR_POS_STYLE environment variable
Allowing for two different error message styles:
default or odin
    path(line:column) message
unix
    path:line:column: message
2022-01-26 16:09:22 +00:00
gingerBill
f0529535e0 ODIN_ENDIAN changed to an enum constant; ODIN_ENUM_STRING is the new string version of the old constant 2022-01-15 17:53:18 +00:00
gingerBill
29ebe0c3c9 Rename architecture 386 to i386 2022-01-15 17:40:00 +00:00
gingerBill
6c48670819 Make ODIN_BUILD_MODE a enum type 2022-01-15 17:34:35 +00:00