mirror of
https://github.com/nginx/nginx.git
synced 2024-12-19 05:33:52 -06:00
Perl: pass additional linker options to perl module.
Previously flags passed by --with-ld-opt were not used when building perl module, which meant hardening flags provided by package build systems were not applied.
This commit is contained in:
parent
89f82c1155
commit
c8526aca25
@ -28,8 +28,10 @@ if test -n "$NGX_PERL_VER"; then
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
NGX_PERL_CFLAGS="$CFLAGS `$NGX_PERL -MExtUtils::Embed -e ccopts`"
|
||||
NGX_PM_CFLAGS=`$NGX_PERL -MExtUtils::Embed -e ccopts`
|
||||
NGX_PM_LDFLAGS=`$NGX_PERL -MConfig -e 'print $Config{lddlflags}'`
|
||||
|
||||
NGX_PERL_CFLAGS="$CFLAGS `$NGX_PERL -MExtUtils::Embed -e ccopts`"
|
||||
|
||||
# gcc 4.1/4.2 warn about unused values in pTHX_
|
||||
NGX_PERL_CFLAGS=`echo $NGX_PERL_CFLAGS \
|
||||
|
@ -35,6 +35,7 @@ $NGX_OBJS/src/http/modules/perl/Makefile: \\
|
||||
|
||||
cd $NGX_OBJS/src/http/modules/perl \\
|
||||
&& NGX_PM_CFLAGS="\$(NGX_PM_CFLAGS) -g $NGX_CC_OPT" \\
|
||||
NGX_PM_LDFLAGS="$NGX_LD_OPT \$(NGX_PM_LDFLAGS)" \\
|
||||
NGX_INCS="$CORE_INCS $NGX_OBJS $HTTP_INCS" \\
|
||||
NGX_DEPS="\$(CORE_DEPS) \$(HTTP_DEPS)" \\
|
||||
$NGX_PERL Makefile.PL \\
|
||||
|
@ -31,6 +31,7 @@ END
|
||||
if test -n "$NGX_PERL_CFLAGS"; then
|
||||
echo NGX_PERL_CFLAGS = $NGX_PERL_CFLAGS >> $NGX_MAKEFILE
|
||||
echo NGX_PM_CFLAGS = $NGX_PM_CFLAGS >> $NGX_MAKEFILE
|
||||
echo NGX_PM_LDFLAGS = $NGX_PM_LDFLAGS >> $NGX_MAKEFILE
|
||||
fi
|
||||
|
||||
|
||||
|
@ -16,6 +16,8 @@ WriteMakefile(
|
||||
CCFLAGS => "$ENV{NGX_PM_CFLAGS}",
|
||||
OPTIMIZE => '-O',
|
||||
|
||||
LDDLFLAGS => "$ENV{NGX_PM_LDFLAGS}",
|
||||
|
||||
INC => join(" ", map {
|
||||
m#^/# ? "-I $_" : "-I ../../../../../$_"
|
||||
} (split /\s+/, $ENV{NGX_INCS})),
|
||||
|
Loading…
Reference in New Issue
Block a user