diff --git a/ext/dl/extconf.rb b/ext/dl/extconf.rb index 8317ac35ad..6d4d6c5d51 100644 --- a/ext/dl/extconf.rb +++ b/ext/dl/extconf.rb @@ -1,7 +1,8 @@ require 'mkmf' if RbConfig::CONFIG['GCC'] == 'yes' - $CFLAGS << " -fno-defer-pop -fno-omit-frame-pointer" + (have_macro("__clang__") ? $LDFLAGS : $CFLAGS) << " -fno-defer-pop" + $CFLAGS << " -fno-omit-frame-pointer" end $INSTALLFILES = [