diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d2f32e7a1..0cbe8ad23 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,7 +8,11 @@ jobs: steps: - uses: actions/checkout@v1 - name: Download LLVM - run: sudo apt-get install llvm-11 clang-11 + run: | + wget https://apt.llvm.org/llvm.sh + chmod +x llvm.sh + sudo ./llvm.sh 17 + echo "/usr/lib/llvm-17/bin" >> $GITHUB_PATH - name: build odin run: ./build_odin.sh release - name: Odin version @@ -63,10 +67,8 @@ jobs: - uses: actions/checkout@v1 - name: Download LLVM, and setup PATH run: | - brew install llvm@13 - echo "/usr/local/opt/llvm@13/bin" >> $GITHUB_PATH - TMP_PATH=$(xcrun --show-sdk-path)/user/include - echo "CPATH=$TMP_PATH" >> $GITHUB_ENV + brew install llvm@17 + echo "/usr/local/opt/llvm@17/bin" >> $GITHUB_PATH - name: build odin run: ./build_odin.sh release - name: Odin version @@ -104,10 +106,8 @@ jobs: - uses: actions/checkout@v1 - name: Download LLVM and setup PATH run: | - brew install llvm@13 - echo "/opt/homebrew/opt/llvm@13/bin" >> $GITHUB_PATH - TMP_PATH=$(xcrun --show-sdk-path)/user/include - echo "CPATH=$TMP_PATH" >> $GITHUB_ENV + brew install llvm@17 + echo "/opt/homebrew/opt/llvm@17/bin" >> $GITHUB_PATH - name: build odin run: ./build_odin.sh release - name: Odin version @@ -128,11 +128,11 @@ jobs: - name: Odin check examples/all run: ./odin check examples/all -strict-style timeout-minutes: 10 - # - name: Core library tests - # run: | - # cd tests/core - # make - # timeout-minutes: 10 + - name: Core library tests + run: | + cd tests/core + make + timeout-minutes: 10 - name: Odin internals tests run: | cd tests/internal diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 709f968a7..ff90ab57e 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -47,7 +47,11 @@ jobs: steps: - uses: actions/checkout@v1 - name: (Linux) Download LLVM - run: sudo apt-get install llvm-11 clang-11 + run: | + wget https://apt.llvm.org/llvm.sh + chmod +x llvm.sh + sudo ./llvm.sh 17 + echo "/usr/lib/llvm-17/bin" >> $GITHUB_PATH - name: build odin run: make nightly - name: Odin run @@ -78,10 +82,8 @@ jobs: - uses: actions/checkout@v1 - name: Download LLVM and setup PATH run: | - brew install llvm@13 dylibbundler - echo "/usr/local/opt/llvm@13/bin" >> $GITHUB_PATH - TMP_PATH=$(xcrun --show-sdk-path)/user/include - echo "CPATH=$TMP_PATH" >> $GITHUB_ENV + brew install llvm@17 dylibbundler + echo "/usr/local/opt/llvm@17/bin" >> $GITHUB_PATH - name: build odin # These -L makes the linker prioritize system libraries over LLVM libraries, this is mainly to # not link with libunwind bundled with LLVM but link with libunwind on the system. @@ -114,10 +116,8 @@ jobs: - uses: actions/checkout@v1 - name: Download LLVM and setup PATH run: | - brew install llvm@13 dylibbundler - echo "/opt/homebrew/opt/llvm@13/bin" >> $GITHUB_PATH - TMP_PATH=$(xcrun --show-sdk-path)/user/include - echo "CPATH=$TMP_PATH" >> $GITHUB_ENV + brew install llvm@17 dylibbundler + echo "/opt/homebrew/opt/llvm@17/bin" >> $GITHUB_PATH - name: build odin # These -L makes the linker prioritize system libraries over LLVM libraries, this is mainly to # not link with libunwind bundled with LLVM but link with libunwind on the system. diff --git a/core/time/time.odin b/core/time/time.odin index 10b71ee0d..4807af840 100644 --- a/core/time/time.odin +++ b/core/time/time.odin @@ -238,8 +238,9 @@ time_add :: proc "contextless" (t: Time, d: Duration) -> Time { // // Accuracy seems to be pretty good out of the box on Linux, to within around 4µs worst case. // On Windows it depends but is comparable with regular sleep in the worst case. -// To get the same kind of accuracy as on Linux, have your program call `win32.time_begin_period(1)` to +// To get the same kind of accuracy as on Linux, have your program call `windows.timeBeginPeriod(1)` to // tell Windows to use a more accurate timer for your process. +// Additionally your program should call `windows.timeEndPeriod(1)` once you're done with `accurate_sleep`. accurate_sleep :: proc "contextless" (d: Duration) { to_sleep, estimate, mean, m2, count: Duration diff --git a/glfw3.dll b/glfw3.dll deleted file mode 100644 index 0511a9a8c..000000000 Binary files a/glfw3.dll and /dev/null differ diff --git a/src/build_settings.cpp b/src/build_settings.cpp index 19006ab2c..3a9951cb2 100644 --- a/src/build_settings.cpp +++ b/src/build_settings.cpp @@ -436,7 +436,9 @@ struct BuildContext { BlockingMutex target_features_mutex; StringSet target_features_set; String target_features_string; + String minimum_os_version_string; + bool minimum_os_version_string_given; }; gb_global BuildContext build_context = {0}; @@ -1419,7 +1421,7 @@ gb_internal void init_build_context(TargetMetrics *cross_target, Subtarget subta bc->metrics = *metrics; if (metrics->os == TargetOs_darwin) { - if (bc->minimum_os_version_string.len == 0) { + if (!bc->minimum_os_version_string_given) { bc->minimum_os_version_string = str_lit("11.0.0"); } diff --git a/src/checker.cpp b/src/checker.cpp index c6f44fcd8..e7d0ad9cb 100644 --- a/src/checker.cpp +++ b/src/checker.cpp @@ -1115,7 +1115,16 @@ gb_internal void init_universal(void) { add_global_constant("ODIN_COMPILE_TIMESTAMP", t_untyped_integer, exact_value_i64(odin_compile_timestamp())); - add_global_bool_constant("__ODIN_LLVM_F16_SUPPORTED", lb_use_new_pass_system() && !is_arch_wasm()); + { + bool f16_supported = lb_use_new_pass_system(); + if (is_arch_wasm()) { + f16_supported = false; + } else if (build_context.metrics.os == TargetOs_darwin && build_context.metrics.arch == TargetArch_amd64) { + // NOTE(laytan): See #3222 for my ramblings on this. + f16_supported = false; + } + add_global_bool_constant("__ODIN_LLVM_F16_SUPPORTED", f16_supported); + } { GlobalEnumValue values[3] = { diff --git a/src/linker.cpp b/src/linker.cpp index 6699c9cb8..63987f9e8 100644 --- a/src/linker.cpp +++ b/src/linker.cpp @@ -502,9 +502,12 @@ gb_internal i32 linker_stage(LinkerData *gen) { platform_lib_str = gb_string_appendc(platform_lib_str, "-L/opt/local/lib "); } - if (build_context.minimum_os_version_string.len) { + // Only specify this flag if the user has given a minimum version to target. + // This will cause warnings to show up for mismatched libraries. + if (build_context.minimum_os_version_string_given) { link_settings = gb_string_append_fmt(link_settings, "-mmacosx-version-min=%.*s ", LIT(build_context.minimum_os_version_string)); } + // This points the linker to where the entry point is link_settings = gb_string_appendc(link_settings, "-e _main "); } diff --git a/src/main.cpp b/src/main.cpp index 9c353653f..79c3a1670 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1066,6 +1066,7 @@ gb_internal bool parse_build_flags(Array args) { case BuildFlag_MinimumOSVersion: { GB_ASSERT(value.kind == ExactValue_String); build_context.minimum_os_version_string = value.value_string; + build_context.minimum_os_version_string_given = true; break; } case BuildFlag_RelocMode: { @@ -1926,7 +1927,7 @@ gb_internal void print_show_help(String const arg0, String const &command) { print_usage_line(1, "-minimum-os-version:"); print_usage_line(2, "Sets the minimum OS version targeted by the application."); print_usage_line(2, "Default: -minimum-os-version:11.0.0"); - print_usage_line(2, "(Only used when target is Darwin.)"); + print_usage_line(2, "Only used when target is Darwin, if given, linking mismatched versions will emit a warning."); print_usage_line(0, ""); print_usage_line(1, "-extra-linker-flags:");