Odin icon indicating copy to clipboard operation
Odin copied to clipboard

Build error when using `-no-crt` and `-o:speed` flags with `core:fmt` package

Open englerj opened this issue 3 years ago • 1 comments

Context

  • Operating System & Odin Version: Odin: dev-2022-10-nightly:775c9648 OS: Windows 11 Professional (version: 21H2), build 22000.978 CPU: Intel(R) Core(TM) i5-8600K CPU @ 3.60GHz RAM: 32702 MiB

Expected Behavior

Build succeeds.

Current Behavior

Build fails.

Failure Information (for bugs)

When using the core:fmt package, and building with both the -no-crt and -o:speed flags, the build fails due to an unresolved external symbol. When building with either the -no-crt or -o:speed flags (but not both), the build succeeds. When building with both flags and, additionally, the -use-separate-modules flag, the build will succeed.

Steps to Reproduce

package exe

import "core:fmt"

main :: proc()
{
    fmt.printf("{:v}, {:v}", "it's working", "it's working")
}

odin build -no-crt -o:speed

Failure Logs

... : error LNK2019: unresolved external symbol __gnu_h2f_ieee referenced in function fmt.fmt_quaternion ... : fatal error LNK1120: 1 unresolved externals

englerj avatar Oct 06 '22 12:10 englerj

For what it's worth, I'm unable to replicate this on Linux (with the additional required -no-thread-local and -default-to-panic-allocator) as of the latest commit.

Odin:    dev-2025-05:dd31075c3
OS:      Arch Linux, Linux 6.14.6-arch1-1
CPU:     12th Gen Intel(R) Core(TM) i7-12700K
RAM:     31906 MiB
Backend: LLVM 19.1.7

Feoramund avatar May 18 '25 21:05 Feoramund