From 7012051144074f7a16168297f5b9c2ff06b2e95d Mon Sep 17 00:00:00 2001 From: Quinton Miller Date: Sat, 26 Oct 2024 00:03:42 +0800 Subject: [PATCH] allow options starting with `-Wl,` --- src/compiler/crystal/loader/unix.cr | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/compiler/crystal/loader/unix.cr b/src/compiler/crystal/loader/unix.cr index 5b00cde8a588..962a3a47f22a 100644 --- a/src/compiler/crystal/loader/unix.cr +++ b/src/compiler/crystal/loader/unix.cr @@ -76,6 +76,15 @@ class Crystal::Loader parser.unknown_args do |args, after_dash| file_paths.concat args end + + # although flags starting with `-Wl,` appear in `args` above, this is + # still called by `OptionParser`, so we assume it is fine to ignore these + # flags + parser.invalid_option do |arg| + unless arg.starts_with?("-Wl,") + raise LoadError.new "Not a recognized linker flag: #{arg}" + end + end end search_paths = extra_search_paths + search_paths