summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorKonstantin Pavlov <thresh@nginx.com>2016-09-20 22:11:23 +0300
committerKonstantin Pavlov <thresh@nginx.com>2016-09-20 22:11:23 +0300
commitc8526aca2529ee0095afc3016a2f4106a9aeefdf (patch)
treef504948e7565ae4d1efb894dd61a2157cd76a07a
parent89f82c1155d0e2291f30819c38d438e112ba569a (diff)
downloadnginx-c8526aca2529ee0095afc3016a2f4106a9aeefdf.tar.gz
nginx-c8526aca2529ee0095afc3016a2f4106a9aeefdf.tar.bz2
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.
-rw-r--r--auto/lib/perl/conf4
-rw-r--r--auto/lib/perl/make1
-rw-r--r--auto/make1
-rw-r--r--src/http/modules/perl/Makefile.PL2
4 files changed, 7 insertions, 1 deletions
diff --git a/auto/lib/perl/conf b/auto/lib/perl/conf
index f5f5d3e57..d891d821a 100644
--- a/auto/lib/perl/conf
+++ b/auto/lib/perl/conf
@@ -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 \
diff --git a/auto/lib/perl/make b/auto/lib/perl/make
index 8af8902f5..350090c76 100644
--- a/auto/lib/perl/make
+++ b/auto/lib/perl/make
@@ -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 \\
diff --git a/auto/make b/auto/make
index 5589bee8b..84d266819 100644
--- a/auto/make
+++ b/auto/make
@@ -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
diff --git a/src/http/modules/perl/Makefile.PL b/src/http/modules/perl/Makefile.PL
index 03348b555..7edadcb3d 100644
--- a/src/http/modules/perl/Makefile.PL
+++ b/src/http/modules/perl/Makefile.PL
@@ -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})),