File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -500,12 +500,14 @@ def init_env(
500500 env_cflags = shlex .split (os .environ .get ('CFLAGS' , '' ))
501501 env_cppflags = shlex .split (os .environ .get ('CPPFLAGS' , '' ))
502502 env_ldflags = shlex .split (os .environ .get ('LDFLAGS' , '' ))
503+ # Newer clang does not use -fno-plt leading to an error
504+ no_plt = '-fno-plt' if test_compile (cc , '-fno-plt' , '-Werror' ) else ''
503505
504506 cflags_ = os .environ .get (
505507 'OVERRIDE_CFLAGS' , (
506508 f'-Wextra { float_conversion } -Wno-missing-field-initializers -Wall -Wstrict-prototypes { std } '
507509 f' { werror } { optimize } { sanitize_flag } -fwrapv { stack_protector } { missing_braces } '
508- f' -pipe -fvisibility=hidden -fno-plt '
510+ f' -pipe -fvisibility=hidden { no_plt } '
509511 )
510512 )
511513 cflags = shlex .split (cflags_ ) + shlex .split (
You can’t perform that action at this time.
0 commit comments