# Question about make std\_spec

**URL:** <https://forum.crystal-lang.org/t/question-about-make-std-spec/6288>\
**Category:** Crystal Contrib\
**Created:** [January 10, 2024, 6:01am UTC](https://forum.crystal-lang.org/t/question-about-make-std-spec/6288 "2024-01-10T06:01:32Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![femto](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/femto/32/2246_2.png) [@femto](https://forum.crystal-lang.org/u/femto)\
**Post date:** [January 10, 2024, 6:01am UTC](https://forum.crystal-lang.org/t/question-about-make-std-spec/6288/1 "2024-01-10T06:01:32Z")

</div>

tried lastest commit on master

```auto
make && make std_spec          
Using /usr/local/opt/llvm/bin/llvm-config [version= 17.0.6]
c++ -c -o src/llvm/ext/llvm_ext.o src/llvm/ext/llvm_ext.cc -I/usr/local/Cellar/llvm/17.0.6/include -std=c++17 -stdlib=libc++ -D __STDC_CONSTANT_MACROS -D__ STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
CRYSTAL_CONFIG_BUILD_COMMIT="0b57b6cc8" CRYSTAL_CONFIG_PATH='$ORIGIN/../share/crystal/src' SOURCE_DATE_EPOCH="1704818267" CRYSTAL_CONFIG_LIBRARY_PATH='$ORIGIN/../lib/crystal' ./bin/crystal build -D strict_multi_assign -D preview_overload_order -Dwithout_interpreter -o .build/crystal src/compiler/crystal.cr -D without_openssl -D without_zlib -D use_pcre2
ld: warning: dylib (/usr/local/Cellar/llvm/17.0.6/lib/libunwind.dylib) was built for newer macOS version (12.6) than being linked (12.0)
ld: warning: dylib (/usr/local/Cellar/llvm/17.0.6/lib/libunwind.dylib) was built for newer macOS version (12.6) than being linked (12.0)
ld: warning: dylib (/usr/local/Cellar/llvm/17.0.6/lib/libunwind.dylib) was built for newer macOS version (12.6) than being linked (12.0)
ld: warning: dylib (/usr/local/Cellar/llvm/17.0.6/lib/libunwind.dylib) was built for newer macOS version (12.6) than being linked (12.0)
Using /usr/local/opt/llvm/bin/llvm-config [version= 17.0.6]
./bin/crystal build -D strict_multi_assign -D preview_overload_order -Dwithout_interpreter --exclude-warnings spec/std --exclude-warnings spec/compiler --exclude-warnings spec/primitives -o .build/std_spec spec/std_spec.cr
Using compiled compiler at .build/crystal
ld: warning: dylib (/usr/local/Cellar/llvm/17.0.6/lib/libunwind.dylib) was built for newer macOS version (12.6) than being linked (12.0)
ld: warning: dylib (/usr/local/Cellar/llvm/17.0.6/lib/libunwind.dylib) was built for newer macOS version (12.6) than being linked (12.0)
ld: warning: dylib (/usr/local/Cellar/llvm/17.0.6/lib/libunwind.dylib) was built for newer macOS version (12.6) than being linked (12.0)
ld: warning: dylib (/usr/local/Cellar/llvm/17.0.6/lib/libunwind.dylib) was built for newer macOS version (12.6) than being linked (12.0)
.build/std_spec --order=random   
0.2.5
Randomized with seed: 24319

```

what’s the ld warning and why is that?

---

<div class="post-metadata">

**Author:** ![michaels](https://avatars.discourse-cdn.com/v4/letter/m/94ad74/32.png) [@michaels](https://forum.crystal-lang.org/u/michaels)\
**Post date:** [August 6, 2025, 7:34am UTC](https://forum.crystal-lang.org/t/question-about-make-std-spec/6288/3 "2025-08-06T07:34:46Z")

</div>

I’m a relatively new crystal user and found a similar thing just running a simple test Kemal app. I’m on Mac OS 15.5 and upon compiling (for a run) I get loads of ld: warnings like “was built for newer macOS version (15.0) than being linked (13.3)”, e.g. below.. is there a way to suppress these?

ld: warning: object file (H-T-T-P-5858F-ormD-ata.o0.o) was built for newer macOS version (15.0) than being linked (13.3)  
ld: warning: object file (P-ointer40H-ash58-ae15d8163d21c417f1fc491f0bbc15a1.o0.o) was built for newer macOS version (15.0) than being linked (13.3)  
ld: warning: object file (H-T-T-P-5858F-ormD-ata5858P-arser.o0.o) was built for newer macOS version (15.0) than being linked (13.3)  
ld: warning: ld: warning: object file (M-I-M-E-5858M-ultipart5858P-arser.o0.o) was built for newer macOS version (15.0) than being linked (13.3)  
ld: warning: object file (M-I-M-E-5858M-ultipart.o0.o) was built for newer macOS version (15.0) than being linked (13.3)  
ld: warning: object file (M-I-M-E-5858M-ultipart5858S-tate.o0.o) was built for newer macOS version (15.0) than being linked (13.3)  
ld: warning: object file (H-T-T-P-5858F-ormD-ata5858P-art.o0.o) was built for newer macOS version (15.0) than being linked (13.3)

Thanks.

---

<div class="post-metadata">

**Author:** ![HertzDevil](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/hertzdevil/32/1023_2.png) [@HertzDevil](https://forum.crystal-lang.org/u/HertzDevil)\
**Post date:** [August 6, 2025, 8:49am UTC](https://forum.crystal-lang.org/t/question-about-make-std-spec/6288/4 "2025-08-06T08:49:32Z")

</div>

This should have been fixed in the latest version of Crystal

---

<div class="post-metadata">

**Author:** ![michaels](https://avatars.discourse-cdn.com/v4/letter/m/94ad74/32.png) [@michaels](https://forum.crystal-lang.org/u/michaels)\
**Post date:** [August 6, 2025, 11:10am UTC](https://forum.crystal-lang.org/t/question-about-make-std-spec/6288/5 "2025-08-06T11:10:51Z")

</div>

Thanks for the quick reply. I checked the version I used, and it was 1.17.1.

---

<div class="post-metadata">

**Author:** ![ysbaddaden](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/ysbaddaden/32/2252_2.png) [@ysbaddaden](https://forum.crystal-lang.org/u/ysbaddaden)\
**Post date:** [August 6, 2025, 1:59pm UTC](https://forum.crystal-lang.org/t/question-about-make-std-spec/6288/6 "2025-08-06T13:59:34Z")

</div>

Apparently the `MACOS_DEPLOYMENT_TARGET` environment variable isn’t enough 😞

> <https://github.com/crystal-lang/crystal/pull/15603>
>
> Fixes #15130.
> 
> On a macOS host, if the \`MACOSX\_DEPLOYMENT\_TARGET\` environment …variable is set, that value now overrides the host triple's environment component:
> 
> \`\`\`sh
> $ bin/crystal eval 'p Crystal::HOST\_TRIPLE'
> "aarch64-apple-darwin24.3.0"
> $ MACOSX\_DEPLOYMENT\_TARGET=10.11 bin/crystal eval 'p Crystal::HOST\_TRIPLE'
> "aarch64-apple-macosx10.11"
> $ MACOSX\_DEPLOYMENT\_TARGET=13.0 bin/crystal eval 'p Crystal::HOST\_TRIPLE'
> "aarch64-apple-macosx13.0"
> \`\`\`
> 
> (\`darwin24.3.0\` corresponds to \`macosx15.0\`; \[this is how LLVM converts the former into the latter\](https://github.com/llvm/llvm-project/blob/6ddc07163d6c781622384eb83c7220d3051243a6/llvm/lib/TargetParser/Triple.cpp#L1427-L1470).)

---

<div class="post-metadata">

**Author:** ![michaels](https://avatars.discourse-cdn.com/v4/letter/m/94ad74/32.png) [@michaels](https://forum.crystal-lang.org/u/michaels)\
**Post date:** [August 7, 2025, 8:39am UTC](https://forum.crystal-lang.org/t/question-about-make-std-spec/6288/7 "2025-08-07T08:39:46Z")

</div>

should I raise a separate github issue about this, or is the above one which has a bot message referring to this message enough?

I also wonder when compiling on the mac, would it be necessary to set an env variable to suppress these (amongst other things)?

---

<div class="post-metadata">

**Author:** ![ysbaddaden](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/ysbaddaden/32/2252_2.png) [@ysbaddaden](https://forum.crystal-lang.org/u/ysbaddaden)\
**Post date:** [August 7, 2025, 10:06am UTC](https://forum.crystal-lang.org/t/question-about-make-std-spec/6288/8 "2025-08-07T10:06:39Z")

</div>

Let’s try to figure out what’s happening here. Is `$MACOSX_DEPLOYMENT_TARGET` defined on your system? Or maybe they renamed it as `$MACOS_DEPLOYMENT_TARGET` (no `X`)?

Or maybe the linker defaults to macOS 13.3 but the environment variable isn’t set, so we build the objects for the current host triple, which then leads to the mismatch warnings?

poke @HertzDevil

---

<div class="post-metadata">

**Author:** ![michaels](https://avatars.discourse-cdn.com/v4/letter/m/94ad74/32.png) [@michaels](https://forum.crystal-lang.org/u/michaels)\
**Post date:** [August 7, 2025, 10:27pm UTC](https://forum.crystal-lang.org/t/question-about-make-std-spec/6288/9 "2025-08-07T22:27:56Z")

</div>

Sorry, I wanted to reply to the other [post](https://forum.crystal-lang.org/t/question-about-make-std-spec/6288/3), but being a new user I was limited to 3 replies on that topic, so I’ve raised a new one to reply.

In that other post I was reporting why when doing ‘crystal run ..’ I would see so many of the following warnings:

ld: warning: object file (…o0.o) was built for newer macOS version (15.0) than being linked (11.0)

it was suggested by @ysbaddaden that I might need to set the env var $MACOSX\_DEPLOYMENT\_TARGET and I did set it to “15.5”, and reran, and found that the warnings were suppressed, which is great. However as a new crystal user, I think this is not very intuitive and wonder about the need to see those messages. Why would it be necessary to set this var? Is it possible to invert the situation so those are suppressed by default and enable a var or flag to show those? Thanks.

---

<div class="post-metadata">

**Author:** ![ysbaddaden](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/ysbaddaden/32/2252_2.png) [@ysbaddaden](https://forum.crystal-lang.org/u/ysbaddaden)\
**Post date:** [August 8, 2025, 8:49am UTC](https://forum.crystal-lang.org/t/question-about-make-std-spec/6288/11 "2025-08-08T08:49:47Z")

</div>

I wasn’t asking to export the variable. I’m trying to understand why the linker is complaining on your mac, and figure out what _we_ should do to determine the linker’s default deployment target… or maybe we should tell the linker to target the current target, for example by setting `$MACOSX_DEPLOYMENT_TARGET` or through an argument?

I assume `echo $MACOSX_DEPLOYMENT_TARGET` doesn’t print anything by default?

---

<div class="post-metadata">

**Author:** ![michaels](https://avatars.discourse-cdn.com/v4/letter/m/94ad74/32.png) [@michaels](https://forum.crystal-lang.org/u/michaels)\
**Post date:** [August 9, 2025, 12:02am UTC](https://forum.crystal-lang.org/t/question-about-make-std-spec/6288/12 "2025-08-09T00:02:29Z")

</div>

Apologies. Yes, `echo $MACOSX_DEPLOYMENT_TARGET` prints nothing by default. I’ve just tested it again on a brand new MacBook (MacOS 15.3.1) and after installing Crystal 1.17.1 via homebrew, and there is no `$MACOSX_DEPLOYMENT_TARGET` or `$MACOS_DEPLOYMENT_TARGET` variables.

---

<div class="post-metadata">

**Author:** ![Sija](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/sija/32/737_2.png) [@Sija](https://forum.crystal-lang.org/u/Sija)\
**Post date:** [August 9, 2025, 1:03am UTC](https://forum.crystal-lang.org/t/question-about-make-std-spec/6288/13 "2025-08-09T01:03:26Z")

</div>

`$MACOSX_DEPLOYMENT_TARGET` variable needs to be set manually.

See [Always set `MACOSX_DEPLOYMENT_TARGET` in build scripts · Issue #13115 · rust-lang/cargo · GitHub](https://github.com/rust-lang/cargo/issues/13115)

---

<div class="post-metadata">

**Author:** ![michaels](https://avatars.discourse-cdn.com/v4/letter/m/94ad74/32.png) [@michaels](https://forum.crystal-lang.org/u/michaels)\
**Post date:** [August 10, 2025, 1:51am UTC](https://forum.crystal-lang.org/t/question-about-make-std-spec/6288/14 "2025-08-10T01:51:10Z")

</div>

I realise this is pretty minor, so feel free to ignore - but as someone coming into Crystal from scratch (and coming from Windows also), perhaps this should be documented. There’s no mention of the env variable on the Mac install page, nor this doc [page](https://crystal-lang.org/reference/1.17/man/crystal/index.html#environment-variables) about env vars, though it seems from the above reply having this env var available may be an assumed thing for general development, so apologies if I’m just ignorant to that 😊

---

<div class="post-metadata">

**Author:** ![ysbaddaden](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/ysbaddaden/32/2252_2.png) [@ysbaddaden](https://forum.crystal-lang.org/u/ysbaddaden)\
**Post date:** [August 15, 2025, 2:08pm UTC](https://forum.crystal-lang.org/t/question-about-make-std-spec/6288/15 "2025-08-15T14:08:04Z")

</div>

Do not apologize, we just thought the warnings got finally fixed, but they were not 😭

Maybe we should do the opposite, like define the env variable from the target triplet given by, and maybe have some safe fallback? The [Rust cc crate does that](https://github.com/rust-lang/cc-rs/blob/bfd68f2d0b19b0872d8bc085290d94d40ca85d60/src/lib.rs#L3498-L3520) for example… and [Rust itself does it](https://github.com/rust-lang/rust/blob/ba412a6e70ac84641be7764d088acabd0eb3fa39/compiler/rustc_session/src/session.rs#L912) too; it falls back to these defaults:

> <https://github.com/rust-lang/rust/blob/ba412a6e70ac84641be7764d088acabd0eb3fa39/compiler/rustc_target/src/spec/base/apple/mod.rs#L272-L289>

And this is where we should make the change: [crystal/src/compiler/crystal/config.cr at aa89b919d7d4310af9e61fb2f44c65a4cb0f9645 · crystal-lang/crystal · GitHub](https://github.com/crystal-lang/crystal/blob/aa89b919d7d4310af9e61fb2f44c65a4cb0f9645/src/compiler/crystal/config.cr#L89-L93).

---

<div class="post-metadata">

**Author:** ![ysbaddaden](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/ysbaddaden/32/2252_2.png) [@ysbaddaden](https://forum.crystal-lang.org/u/ysbaddaden)\
**Post date:** [August 15, 2025, 2:10pm UTC](https://forum.crystal-lang.org/t/question-about-make-std-spec/6288/16 "2025-08-15T14:10:22Z")

</div>

Do you get issues if you set `MACOSX_DEPLOYMENT_TARGET=10.12` for example?

---

<div class="post-metadata">

**Author:** ![michaels](https://avatars.discourse-cdn.com/v4/letter/m/94ad74/32.png) [@michaels](https://forum.crystal-lang.org/u/michaels)\
**Post date:** [August 15, 2025, 9:14pm UTC](https://forum.crystal-lang.org/t/question-about-make-std-spec/6288/17 "2025-08-15T21:14:02Z")

</div>

Thanks. I tried setting to 10.12, and still see warnings, e.g. the following for a simple ‘hello world’ kemal app.

`ld: warning: dylib (/opt/homebrew/lib/libgc.dylib) was built for newer macOS version (15.0) than being linked (11.0)`  
`ld: warning: dylib (/opt/homebrew/lib/libpcre2-8.dylib) was built for newer macOS version (13.0) than being linked (11.0)`  
`ld: warning: dylib (/opt/homebrew/lib/libssl.dylib) was built for newer macOS version (15.0) than being linked (11.0)`  
`ld: warning: dylib (/opt/homebrew/lib/libcrypto.dylib) was built for newer macOS version (15.0) than being linked (11.0)`

I also tried 11.0 and 13.0 with same result, but setting to 15.0 was good (no warnings). Thanks again.

---

<div class="post-metadata">

**Author:** ![ysbaddaden](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.crystal-lang.org/ysbaddaden/32/2252_2.png) [@ysbaddaden](https://forum.crystal-lang.org/u/ysbaddaden)\
**Post date:** [August 16, 2025, 5:31pm UTC](https://forum.crystal-lang.org/t/question-about-make-std-spec/6288/18 "2025-08-16T17:31:40Z")

</div>

Oh, Homebrew compiled the libraries for `15.0` so Crystal’s objects must also be compiled for `15.0` or later —except for PCRE2 which targets `13.0` but 🤷

I was thinking that maybe the [crystal formula](https://github.com/Homebrew/homebrew-core/blob/9aa361abfb967a29b22a8528884ebd813334aba4/Formula/c/crystal.rb) for Homebrew should set the `MACOSX_DEPLOYMENT_TARGET` and… that’s exactly what the [rust formula](https://github.com/Homebrew/homebrew-core/blob/9aa361abfb967a29b22a8528884ebd813334aba4/Formula/r/rust.rb#L137-L143) does.

I guess we should do both:

1. fallback to a default version when `MACOS_DEPLOYMENT_TARGET` is unset (or blank);
2. fix the homebrew formula to set `MACOS_DEPLOYMENT_TARGET` to the current macOS version.
