Skip to content

Commit

Permalink
Merge pull request #1118 from Kaiepi/openbsd
Browse files Browse the repository at this point in the history
Fix miscellaneous compiler flag passing on OpenBSD
  • Loading branch information
jnthn committed Jun 9, 2019
2 parents c374d7f + 55b27c2 commit 3494e82
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 5 additions & 0 deletions Configure.pl
Expand Up @@ -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};

Expand Down
4 changes: 0 additions & 4 deletions build/setup.pm
Expand Up @@ -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)' },
Expand Down

0 comments on commit 3494e82

Please sign in to comment.