crystal-lang / crystal

The Crystal Programming Language
https://crystal-lang.org
Apache License 2.0
19.29k stars 1.62k forks source link

The warning when building for FreeBSD and OpenBSD #14551

Open yanecc opened 3 months ago

yanecc commented 3 months ago

Bug Report

When I built for FreeBSD with GitHub Actions, I noticed a warning from the compiler.

cc: warning: argument unused during compilation: '-rdynamic' [-Wunused-command-line-argument]

https://github.com/yanecc/MockGPT/actions/runs/8981357271/job/24666718448#step:3:1628 crystal 1.10.1

yanecc commented 3 months ago

The same warnings with OpenBSD https://github.com/yanecc/MockGPT/actions/runs/8981357271/job/24666719117#step:3:1333 crystal 1.4.1

ysbaddaden commented 3 months ago

This is clang complaining that -rdynamic is unused because of the --static compilation flag. I can't reproduce on Linux (gnu or musl) with CC=clang-17 and passing --link-flags="-Wunused-command-line-argument".

yanecc commented 3 months ago

It seems exclusive to the BSD-like os.

straight-shoota commented 3 months ago

I suppose we can skip -rdynamic on BSDs when linking statically? Would still be interesting to figure out the exact conditions for this (like why doesn't it reproduce on linux?).