diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 219dcebfd..ea4d964aa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,9 +7,11 @@ jobs: steps: - uses: actions/checkout@v1 - name: Download LLVM - run: sudo apt-get install llvm + run: sudo apt-get install llvm-11 clang-11 llvm - name: build odin run: make release + - name: Odin run -llvm-api + run: ./odin run examples/demo/demo.odin -llvm-api - name: Odin run run: ./odin run examples/demo/demo.odin - name: Odin check @@ -20,14 +22,16 @@ jobs: - uses: actions/checkout@v1 - name: Download LLVM and setup PATH run: | - brew install llvm + brew install llvm@11 echo "/usr/local/opt/llvm/bin" >> $GITHUB_PATH TMP_PATH=$(xcrun --show-sdk-path)/user/include echo "CPATH=$TMP_PATH" >> $GITHUB_ENV - name: build odin run: make release - name: Odin run - run: ./odin run examples/demo/demo.odin + run: | + ./odin run examples/demo/demo.odin + ./odin run examples/demo/demo.odin -llvm-api - name: Odin check run: ./odin check examples/demo/demo.odin -vet build_windows: diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 1b6d82eaf..18141b736 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -49,9 +49,11 @@ jobs: steps: - uses: actions/checkout@v1 - name: (Linux) Download LLVM - run: sudo apt-get install llvm + run: sudo apt-get install llvm-11 clang-11 llvm - name: build odin run: make nightly + - name: Odin run -llvm-api + run: ./odin run examples/demo/demo.odin -llvm-api - name: Odin run run: ./odin run examples/demo/demo.odin - name: Copy artifacts @@ -78,6 +80,8 @@ jobs: echo "CPATH=$TMP_PATH" >> $GITHUB_ENV - name: build odin run: make nightly + - name: Odin run -llvm-api + run: ./odin run examples/demo/demo.odin -llvm-api - name: Odin run run: ./odin run examples/demo/demo.odin - name: Copy artifacts @@ -100,26 +104,26 @@ jobs: - uses: actions/setup-python@v2 with: python-version: '3.x' - + - name: Install B2 CLI shell: bash run: | python -m pip install --upgrade pip pip install --upgrade b2 - + - name: Display Python version run: python -c "import sys; print(sys.version)" - + - name: Download Windows artifacts uses: actions/download-artifact@v1 with: name: windows_artifacts - + - name: Download Ubuntu artifacts uses: actions/download-artifact@v1 with: name: ubuntu_artifacts - + - name: Download macOS artifacts uses: actions/download-artifact@v1 with: diff --git a/Makefile b/Makefile index 0be242aeb..e07e4c4ec 100644 --- a/Makefile +++ b/Makefile @@ -1,13 +1,19 @@ GIT_SHA=$(shell git rev-parse --short HEAD) DISABLED_WARNINGS=-Wno-switch -Wno-pointer-sign -Wno-tautological-constant-out-of-range-compare -Wno-tautological-compare -Wno-macro-redefined LDFLAGS=-pthread -ldl -lm -lstdc++ -CFLAGS=-std=c++11 -DGIT_SHA=\"$(GIT_SHA)\" +CFLAGS=-std=c++14 -DGIT_SHA=\"$(GIT_SHA)\" CC=clang OS=$(shell uname) ifeq ($(OS), Darwin) LDFLAGS:=$(LDFLAGS) -liconv + CFLAGS:=$(CFLAGS) $(shell llvm-config --cxxflags --ldflags) -DLLVM_BACKEND_SUPPORT -DUSE_NEW_LLVM_ABI_SYSTEM + LDFLAGS:=$(LDFLAGS) -lLLVM-C +endif +ifeq ($(OS), Linux) + CFLAGS:=$(CFLAGS) $(shell llvm-config-11 --cxxflags --ldflags) -DLLVM_BACKEND_SUPPORT -DUSE_NEW_LLVM_ABI_SYSTEM + LDFLAGS:=$(LDFLAGS) $(shell llvm-config-11 --libs core native --system-libs) endif all: debug demo diff --git a/core/os/stat_unix.odin b/core/os/stat_unix.odin index 76cab69da..a3f25b5aa 100644 --- a/core/os/stat_unix.odin +++ b/core/os/stat_unix.odin @@ -61,7 +61,7 @@ _make_time_from_unix_file_time :: proc(uft: Unix_File_Time) -> time.Time { _fill_file_info_from_stat :: proc(fi: ^File_Info, s: OS_Stat) { fi.size = s.size; fi.mode = cast(File_Mode)s.mode; - fi.is_dir = S_ISDIR(s.mode); + fi.is_dir = S_ISDIR(u32(s.mode)); // NOTE(laleksic, 2021-01-21): Not really creation time, but closest we can get (maybe better to leave it 0?) fi.creation_time = _make_time_from_unix_file_time(s.status_change); diff --git a/examples/demo/demo.odin b/examples/demo/demo.odin index 7119dc432..6817b15a4 100644 --- a/examples/demo/demo.odin +++ b/examples/demo/demo.odin @@ -1109,6 +1109,11 @@ prefix_table := [?]string{ }; threading_example :: proc() { + if ODIN_OS == "darwin" { + // TODO: Fix threads on darwin/macOS + return; + } + fmt.println("\n# threading_example"); { // Basic Threads diff --git a/src/llvm_backend.cpp b/src/llvm_backend.cpp index 6ed94661e..7a21ad885 100644 --- a/src/llvm_backend.cpp +++ b/src/llvm_backend.cpp @@ -2323,7 +2323,7 @@ void lb_debug_complete_types(lbModule *m) { for (unsigned i = 0; i < element_count; i++) { u64 offset_in_bits = i; i64 val = bt->BitSet.lower + cast(i64)i; - gb_snprintf(name, gb_count_of(name), "%lld", val); + gb_snprintf(name, gb_count_of(name), "%lld", cast(long long)val); elements[i] = LLVMDIBuilderCreateBitFieldMemberType( m->debug_builder, scope,