net-snmp/net-snmp-5.7.3-cflags.patch
Jan Safranek b1bfd06991 Trim net-snmp-config --cflags output
Resolves: #1309080

As result, Makefile.PL must not remove -Wall from CFLAGS, otherwise it gets -Werror=format-security without -Wformat and gcc fails.
2016-02-24 12:26:08 +01:00

135 lines
7.8 KiB
Diff

1309080 - net-snmp-config specifies redhat-hardened-cc1 in cflags and causes gcc failure without redhat-rpm-config
Don't remove -Wall in perl Makefiles - it would remove -Wformat and gcc would fail with
error: -Wformat-security ignored without -Wformat
+ there is one upstream patch below (to be removed on rebase)
diff -up net-snmp-5.7.3/perl/agent/default_store/Makefile.PL.cflags net-snmp-5.7.3/perl/agent/default_store/Makefile.PL
--- net-snmp-5.7.3/perl/agent/default_store/Makefile.PL.cflags 2014-12-08 21:23:22.000000000 +0100
+++ net-snmp-5.7.3/perl/agent/default_store/Makefile.PL 2016-02-24 12:17:05.154209526 +0100
@@ -79,7 +79,7 @@ sub InitMakeParams {
$Params{'LIBS'} = "-L../../../snmplib/.libs -L../../../snmplib/ " . $Params{'LIBS'};
$Params{'CCFLAGS'} = "-I../../../include " . $Params{'CCFLAGS'};
}
- $Params{'CCFLAGS'} =~ s/ -W(all|inline|strict-prototypes|write-strings|cast-qual|no-char-subscripts)//g; # ignore developer warnings
+ $Params{'CCFLAGS'} =~ s/ -W(inline|strict-prototypes|write-strings|cast-qual|no-char-subscripts)//g; # ignore developer warnings
if ($Params{'LIBS'} eq "" || $Params{'CCFLAGS'} eq "") {
die "You need to install net-snmp first (I can't find net-snmp-config)";
}
diff -up net-snmp-5.7.3/perl/agent/Makefile.PL.cflags net-snmp-5.7.3/perl/agent/Makefile.PL
--- net-snmp-5.7.3/perl/agent/Makefile.PL.cflags 2014-12-08 21:23:22.000000000 +0100
+++ net-snmp-5.7.3/perl/agent/Makefile.PL 2016-02-24 12:17:05.154209526 +0100
@@ -92,7 +92,7 @@ sub InitMakeParams {
$Params{'LIBS'} = `$opts->{'nsconfig'} --libdir` . $Params{'LIBS'};
# $Params{'PREREQ_PM'} = {'NetSNMP::OID' => '0.1'};
}
- $Params{'CCFLAGS'} =~ s/ -W(all|inline|strict-prototypes|write-strings|cast-qual|no-char-subscripts)//g; # ignore developer warnings
+ $Params{'CCFLAGS'} =~ s/ -W(inline|strict-prototypes|write-strings|cast-qual|no-char-subscripts)//g; # ignore developer warnings
if ($Params{'LIBS'} eq "" || $Params{'CCFLAGS'} eq "") {
die "You need to install net-snmp first (I can't find net-snmp-config)";
}
diff -up net-snmp-5.7.3/perl/agent/Support/Makefile.PL.cflags net-snmp-5.7.3/perl/agent/Support/Makefile.PL
--- net-snmp-5.7.3/perl/agent/Support/Makefile.PL.cflags 2016-02-24 12:17:16.291271579 +0100
+++ net-snmp-5.7.3/perl/agent/Support/Makefile.PL 2016-02-24 12:17:22.413305687 +0100
@@ -86,7 +86,7 @@ sub InitMakeParams {
$Params{'LIBS'} = "-L../../snmplib/.libs -L../../snmplib/ " . $Params{'LIBS'};
$Params{'CCFLAGS'} = "-I../../include " . $Params{'CCFLAGS'};
}
- $Params{'CCFLAGS'} =~ s/ -W(all|inline|strict-prototypes|write-strings|cast-qual|no-char-subscripts)//g; # ignore developer warnings
+ $Params{'CCFLAGS'} =~ s/ -W(inline|strict-prototypes|write-strings|cast-qual|no-char-subscripts)//g; # ignore developer warnings
if ($Params{'LIBS'} eq "" || $Params{'CCFLAGS'} eq "") {
die "You need to install net-snmp first (I can't find net-snmp-config)";
}
diff -up net-snmp-5.7.3/perl/ASN/Makefile.PL.cflags net-snmp-5.7.3/perl/ASN/Makefile.PL
--- net-snmp-5.7.3/perl/ASN/Makefile.PL.cflags 2014-12-08 21:23:22.000000000 +0100
+++ net-snmp-5.7.3/perl/ASN/Makefile.PL 2016-02-24 12:17:05.155209532 +0100
@@ -86,7 +86,7 @@ sub InitMakeParams {
$Params{'LIBS'} = "-L../../snmplib/.libs -L../../snmplib/ " . $Params{'LIBS'};
$Params{'CCFLAGS'} = "-I../../include " . $Params{'CCFLAGS'};
}
- $Params{'CCFLAGS'} =~ s/ -W(all|inline|strict-prototypes|write-strings|cast-qual|no-char-subscripts)//g; # ignore developer warnings
+ $Params{'CCFLAGS'} =~ s/ -W(inline|strict-prototypes|write-strings|cast-qual|no-char-subscripts)//g; # ignore developer warnings
if ($Params{'LIBS'} eq "" || $Params{'CCFLAGS'} eq "") {
die "You need to install net-snmp first (I can't find net-snmp-config)";
}
diff -up net-snmp-5.7.3/perl/default_store/Makefile.PL.cflags net-snmp-5.7.3/perl/default_store/Makefile.PL
--- net-snmp-5.7.3/perl/default_store/Makefile.PL.cflags 2014-12-08 21:23:22.000000000 +0100
+++ net-snmp-5.7.3/perl/default_store/Makefile.PL 2016-02-24 12:17:05.155209532 +0100
@@ -79,7 +79,7 @@ sub InitMakeParams {
$Params{'LIBS'} = "-L../../snmplib/.libs -L../../snmplib/ " . $Params{'LIBS'};
$Params{'CCFLAGS'} = "-I../../include " . $Params{'CCFLAGS'};
}
- $Params{'CCFLAGS'} =~ s/ -W(all|inline|strict-prototypes|write-strings|cast-qual|no-char-subscripts)//g; # ignore developer warnings
+ $Params{'CCFLAGS'} =~ s/ -W(inline|strict-prototypes|write-strings|cast-qual|no-char-subscripts)//g; # ignore developer warnings
if ($Params{'LIBS'} eq "" || $Params{'CCFLAGS'} eq "") {
die "You need to install net-snmp first (I can't find net-snmp-config)";
}
diff -up net-snmp-5.7.3/perl/OID/Makefile.PL.cflags net-snmp-5.7.3/perl/OID/Makefile.PL
--- net-snmp-5.7.3/perl/OID/Makefile.PL.cflags 2014-12-08 21:23:22.000000000 +0100
+++ net-snmp-5.7.3/perl/OID/Makefile.PL 2016-02-24 12:17:05.155209532 +0100
@@ -86,7 +86,7 @@ sub InitMakeParams {
# } else {
# $Params{'PREREQ_PM'} = {'SNMP' => '5.0'};
}
- $Params{'CCFLAGS'} =~ s/ -W(all|inline|strict-prototypes|write-strings|cast-qual|no-char-subscripts)//g; # ignore developer warnings
+ $Params{'CCFLAGS'} =~ s/ -W(inline|strict-prototypes|write-strings|cast-qual|no-char-subscripts)//g; # ignore developer warnings
if ($Params{'LIBS'} eq "" || $Params{'CCFLAGS'} eq "") {
die "You need to install net-snmp first (I can't find net-snmp-config)";
}
diff -up net-snmp-5.7.3/perl/SNMP/Makefile.PL.cflags net-snmp-5.7.3/perl/SNMP/Makefile.PL
--- net-snmp-5.7.3/perl/SNMP/Makefile.PL.cflags 2014-12-08 21:23:22.000000000 +0100
+++ net-snmp-5.7.3/perl/SNMP/Makefile.PL 2016-02-24 12:17:05.155209532 +0100
@@ -98,7 +98,7 @@ sub InitMakeParams {
# } else {
# $Params{'PREREQ_PM'} = { 'NetSNMP::default_store' => 0.01 };
}
- $Params{'CCFLAGS'} =~ s/ -W(all|inline|strict-prototypes|write-strings|cast-qual|no-char-subscripts)//g; # ignore developer warnings
+ $Params{'CCFLAGS'} =~ s/ -W(inline|strict-prototypes|write-strings|cast-qual|no-char-subscripts)//g; # ignore developer warnings
if (!$ENV{'NETSNMP_PREFIX'}) {
$prefix = `$opts->{'nsconfig'} --prefix`;
chomp($prefix);
diff -up net-snmp-5.7.3/perl/TrapReceiver/Makefile.PL.cflags net-snmp-5.7.3/perl/TrapReceiver/Makefile.PL
--- net-snmp-5.7.3/perl/TrapReceiver/Makefile.PL.cflags 2014-12-08 21:23:22.000000000 +0100
+++ net-snmp-5.7.3/perl/TrapReceiver/Makefile.PL 2016-02-24 12:17:05.155209532 +0100
@@ -124,7 +124,7 @@ sub InitMakeParams {
$Params{'LIBS'} = `$opts->{'nsconfig'} --libdir` . " $Params{'LIBS'}";
}
- $Params{'CCFLAGS'} =~ s/ -W(all|inline|strict-prototypes|write-strings|cast-qual|no-char-subscripts)//g; # ignore developer warnings
+ $Params{'CCFLAGS'} =~ s/ -W(inline|strict-prototypes|write-strings|cast-qual|no-char-subscripts)//g; # ignore developer warnings
if ($Params{'CCFLAGS'} eq "") {
die "You need to install net-snmp first (I can't find net-snmp-config)";
}
commit 127274f8f27fba264a4c0f91190fd6f8037cdf21
Author: Jan Safranek <jsafranek@users.sourceforge.net>
Date: Wed Feb 24 10:14:21 2016 +0100
Trim output of net-snmp-config --cflags.
We should report CFLAGS needed to import and use Net-SNMP headers, not
CFLAGS used to compile actual Net-SNMP.
E.g. we should not report various distro fortify-source options.
diff --git a/net-snmp-config.in b/net-snmp-config.in
index 7e34944..f3bffe9 100644
--- a/net-snmp-config.in
+++ b/net-snmp-config.in
@@ -138,10 +138,10 @@ else
;;
#################################################### compile
--base-cflags)
- echo @CFLAGS@ @CPPFLAGS@ -I${NSC_INCLUDEDIR}
+ echo -I${NSC_INCLUDEDIR}
;;
--cflags|--cf*)
- echo @CFLAGS@ @DEVFLAGS@ @CPPFLAGS@ -I. -I${NSC_INCLUDEDIR}
+ echo @DEVFLAGS@ -I. -I${NSC_INCLUDEDIR}
;;
--srcdir)
echo $NSC_SRCDIR