From c130d3e420f6fae922e3f97681310ba307ab81b4 Mon Sep 17 00:00:00 2001 From: Scott Myron Date: Sun, 19 Jul 2026 21:12:05 -0500 Subject: [PATCH] Pass '-mno-outline' to the compiler (if supported) to prevent function outlining. --- ext/json/ext/parser/extconf.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ext/json/ext/parser/extconf.rb b/ext/json/ext/parser/extconf.rb index a0358ccc..18aa546a 100644 --- a/ext/json/ext/parser/extconf.rb +++ b/ext/json/ext/parser/extconf.rb @@ -30,6 +30,12 @@ append_cflags("-std=c99") +# Disable function outlining on clang to prevent some of the repeated instructions +# in json_eat_whitespace being outlined into function calls. +# Note: This verifies '-mno-outline' is accepted as a valid compiler flag +# and will not pass it if unsupported. +append_cflags("-mno-outline") + if enable_config('parser-use-simd', default=!ENV["JSON_DISABLE_SIMD"]) load __dir__ + "/../simd/conf.rb" end