diff --git a/Configure.pl b/Configure.pl index 124715cf27..602bf8ce75 100755 --- a/Configure.pl +++ b/Configure.pl @@ -223,6 +223,11 @@ sub uniq { $config{ccmiscflags} =~ s/^ +$//; } +# Disable ROP vulnerability protection on OpenBSD, since it breaks the legojit. +if ($^O eq 'openbsd' && $config{cc} eq 'clang') { + $config{ccmiscflags} .= ' -fno-ret-protector'; +} + # Set the remaining ldmiscflags. Do this after probing for gcc -Werror probe to not miss that change for the linker. $config{ldmiscflags} = $config{ccmiscflags} unless defined $config{ldmiscflags}; diff --git a/build/setup.pm b/build/setup.pm index 2306649b36..d972f56e93 100644 --- a/build/setup.pm +++ b/build/setup.pm @@ -506,10 +506,6 @@ our %OS_OPENBSD = ( %OS_POSIX, syslibs => [ @{$OS_POSIX{syslibs}}, qw( kvm ) ], - # XXX: this is required at the moment because of the legojit. If possible, - # the legojit should be protected against ROP vulnerabilities and this line - # should be removed. - ccmiscflags => '-fno-ret-protector', -thirdparty => { uv => { %TP_UVDUMMY, objects => '$(UV_OPENBSD)' },