* [Buildroot] [PATCH v2 master 1/2] logrotate: fix up build error with gcc 6
@ 2016-08-19 17:15 Rahul Bedarkar
2016-08-19 17:15 ` [Buildroot] [PATCH v2 next 2/2] logrotate: bump version to 3.10.0 Rahul Bedarkar
2016-08-19 21:00 ` [Buildroot] [PATCH v2 master 1/2] logrotate: fix up build error with gcc 6 Thomas Petazzoni
0 siblings, 2 replies; 4+ messages in thread
From: Rahul Bedarkar @ 2016-08-19 17:15 UTC (permalink / raw)
To: buildroot
With gcc version 6, we see following warnings.
logrotate.c: In function 'postrotateSingleLog':
logrotate.c:1784:5: error: this 'if' clause does not guard... [-Werror=misleading-indentation]
if (!state->doRotate)
^~
logrotate.c:1787:2: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'if'
if (!hasErrors && log->flags & LOG_FLAG_TMPFILENAME) {
^~
Add a upstream patch to fix above warning.
config.c: In function 'strndup':
config.c:87:10: error: nonnull argument 's' compared to NULL [-Werror=nonnull-compare]
if(!s)
^
cc1: all warnings being treated as errors
make[2]: *** [config.o] Error 1
make[2]: *** Waiting for unfinished jobs....
cc1: all warnings being treated as errors
make[2]: *** [logrotate.o] Error 1
Add a patch to drop check for nonnull to fix above warning.
Fixes:
http://autobuild.buildroot.net/results/6dc/6dc2eb22104076920d77425b1e608ef9b9e01c94/
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Rahul Bedarkar <rahul.bedarkar@imgtec.com>
---
Changes v1 -> v2:
- Add upstream patch to fix second build issues instead of
version bump on master branch. (Suggested by Thomas Petazzoni)
---
.../logrotate/0002-fix-up-warning-with-gcc6.patch | 31 ++++++++++++++++++++++
package/logrotate/logrotate.hash | 1 +
package/logrotate/logrotate.mk | 1 +
3 files changed, 33 insertions(+)
create mode 100644 package/logrotate/0002-fix-up-warning-with-gcc6.patch
diff --git a/package/logrotate/0002-fix-up-warning-with-gcc6.patch b/package/logrotate/0002-fix-up-warning-with-gcc6.patch
new file mode 100644
index 0000000..49abca3
--- /dev/null
+++ b/package/logrotate/0002-fix-up-warning-with-gcc6.patch
@@ -0,0 +1,31 @@
+fix up warning with gcc6
+
+With gcc version 6, we see following warning.
+
+ config.c: In function 'strndup':
+ config.c:87:10: error: nonnull argument 's' compared to NULL [-Werror=nonnull-compare]
+ if(!s)
+ ^
+ cc1: all warnings being treated as errors
+
+strndup is declared with nonnull attribute for first parameter. In such
+cases, gcc 6 warns when we check for nonnull explicitly. So drop the
+check for nonnull.
+
+This build is found by Buildroot autobuilder.
+http://autobuild.buildroot.net/results/6dc/6dc2eb22104076920d77425b1e608ef9b9e01c94/
+
+Signed-off-by: Rahul Bedarkar <rahul.bedarkar@imgtec.com>
+
+--- logrotate-3.9.2/config.c.old 2016-08-18 22:11:53.881100685 +0530
++++ logrotate-3.9.2/config.c 2016-08-18 22:12:58.913100548 +0530
+@@ -84,9 +84,6 @@ char *strndup(const char *s, size_t n)
+ size_t nAvail;
+ char *p;
+
+- if(!s)
+- return NULL;
+-
+ /* min() */
+ nAvail = strlen(s) + 1;
+ if ( (n + 1) < nAvail)
diff --git a/package/logrotate/logrotate.hash b/package/logrotate/logrotate.hash
index 77d4dc8..8dee715 100644
--- a/package/logrotate/logrotate.hash
+++ b/package/logrotate/logrotate.hash
@@ -1,2 +1,3 @@
# Locally calculated
sha256 2de00c65e23fa9d7909cae6594e550b9abe9a7eb1553669ddeaca92d30f97009 logrotate-3.9.2.tar.gz
+sha256 e0d360908ac506e02f08fa1ad70e17d6985045d8640f383fef8f322886d6e1e1 6a36c105587b07ad14fc937f3ee6e2eb402621a2.patch
diff --git a/package/logrotate/logrotate.mk b/package/logrotate/logrotate.mk
index de4d837..38f183c 100644
--- a/package/logrotate/logrotate.mk
+++ b/package/logrotate/logrotate.mk
@@ -13,6 +13,7 @@ LOGROTATE_DEPENDENCIES = popt host-pkgconf
LOGROTATE_AUTORECONF = YES
LOGROTATE_CONF_ENV = LIBS="`$(PKG_CONFIG_HOST_BINARY) --libs popt`"
LOGROTATE_CONF_OPTS = --without-selinux
+LOGROTATE_PATCH = https://github.com/logrotate/logrotate/commit/6a36c105587b07ad14fc937f3ee6e2eb402621a2.patch
ifeq ($(BR2_PACKAGE_ACL),y)
LOGROTATE_DEPENDENCIES += acl
--
2.6.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [Buildroot] [PATCH v2 next 2/2] logrotate: bump version to 3.10.0
2016-08-19 17:15 [Buildroot] [PATCH v2 master 1/2] logrotate: fix up build error with gcc 6 Rahul Bedarkar
@ 2016-08-19 17:15 ` Rahul Bedarkar
2016-08-19 21:04 ` Thomas Petazzoni
2016-08-19 21:00 ` [Buildroot] [PATCH v2 master 1/2] logrotate: fix up build error with gcc 6 Thomas Petazzoni
1 sibling, 1 reply; 4+ messages in thread
From: Rahul Bedarkar @ 2016-08-19 17:15 UTC (permalink / raw)
To: buildroot
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Rahul Bedarkar <rahul.bedarkar@imgtec.com>
---
Changes v1 -> v2:
- Rebase on top of next branch. (Suggested by Thomas Petazzoni)
---
package/logrotate/logrotate.hash | 2 +-
package/logrotate/logrotate.mk | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/package/logrotate/logrotate.hash b/package/logrotate/logrotate.hash
index 77d4dc8..ee31f8e 100644
--- a/package/logrotate/logrotate.hash
+++ b/package/logrotate/logrotate.hash
@@ -1,2 +1,2 @@
# Locally calculated
-sha256 2de00c65e23fa9d7909cae6594e550b9abe9a7eb1553669ddeaca92d30f97009 logrotate-3.9.2.tar.gz
+sha256 db63b5932190cba941357c029b595a7fddf43539943aa1e0ca53a96136e4c5d9 logrotate-3.10.0.tar.gz
diff --git a/package/logrotate/logrotate.mk b/package/logrotate/logrotate.mk
index de4d837..96012c0 100644
--- a/package/logrotate/logrotate.mk
+++ b/package/logrotate/logrotate.mk
@@ -4,7 +4,7 @@
#
################################################################################
-LOGROTATE_VERSION = 3.9.2
+LOGROTATE_VERSION = 3.10.0
LOGROTATE_SITE = $(call github,logrotate,logrotate,$(LOGROTATE_VERSION))
LOGROTATE_LICENSE = GPLv2+
LOGROTATE_LICENSE_FILES = COPYING
--
2.6.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [Buildroot] [PATCH v2 master 1/2] logrotate: fix up build error with gcc 6
2016-08-19 17:15 [Buildroot] [PATCH v2 master 1/2] logrotate: fix up build error with gcc 6 Rahul Bedarkar
2016-08-19 17:15 ` [Buildroot] [PATCH v2 next 2/2] logrotate: bump version to 3.10.0 Rahul Bedarkar
@ 2016-08-19 21:00 ` Thomas Petazzoni
1 sibling, 0 replies; 4+ messages in thread
From: Thomas Petazzoni @ 2016-08-19 21:00 UTC (permalink / raw)
To: buildroot
Hello,
On Fri, 19 Aug 2016 22:45:03 +0530, Rahul Bedarkar wrote:
> With gcc version 6, we see following warnings.
>
> logrotate.c: In function 'postrotateSingleLog':
> logrotate.c:1784:5: error: this 'if' clause does not guard... [-Werror=misleading-indentation]
> if (!state->doRotate)
> ^~
> logrotate.c:1787:2: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'if'
> if (!hasErrors && log->flags & LOG_FLAG_TMPFILENAME) {
> ^~
> Add a upstream patch to fix above warning.
>
> config.c: In function 'strndup':
> config.c:87:10: error: nonnull argument 's' compared to NULL [-Werror=nonnull-compare]
> if(!s)
> ^
> cc1: all warnings being treated as errors
> make[2]: *** [config.o] Error 1
> make[2]: *** Waiting for unfinished jobs....
> cc1: all warnings being treated as errors
> make[2]: *** [logrotate.o] Error 1
>
> Add a patch to drop check for nonnull to fix above warning.
>
> Fixes:
>
> http://autobuild.buildroot.net/results/6dc/6dc2eb22104076920d77425b1e608ef9b9e01c94/
>
> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> Signed-off-by: Rahul Bedarkar <rahul.bedarkar@imgtec.com>
Thanks, I've applied, but I've completely changed your patch
0002-fix-up-warning-with-gcc6.patch to use a different approach.
strndup() is already in the C library, so there is no reason in our
case for logrotate to use its implementation. So I've instead fixed how
the availability of strndup() (and also asprintf) is checked, so that
the C library version is used.
I've submitted my patch upstream:
https://github.com/logrotate/logrotate/pull/55.
Thanks!
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Buildroot] [PATCH v2 next 2/2] logrotate: bump version to 3.10.0
2016-08-19 17:15 ` [Buildroot] [PATCH v2 next 2/2] logrotate: bump version to 3.10.0 Rahul Bedarkar
@ 2016-08-19 21:04 ` Thomas Petazzoni
0 siblings, 0 replies; 4+ messages in thread
From: Thomas Petazzoni @ 2016-08-19 21:04 UTC (permalink / raw)
To: buildroot
Hello,
On Fri, 19 Aug 2016 22:45:04 +0530, Rahul Bedarkar wrote:
> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> Signed-off-by: Rahul Bedarkar <rahul.bedarkar@imgtec.com>
> ---
> Changes v1 -> v2:
> - Rebase on top of next branch. (Suggested by Thomas Petazzoni)
> ---
> package/logrotate/logrotate.hash | 2 +-
> package/logrotate/logrotate.mk | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
I've applied to next, after adding the second patch needed to fix the
gcc 6.x build.
Thanks!
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-08-19 21:04 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-19 17:15 [Buildroot] [PATCH v2 master 1/2] logrotate: fix up build error with gcc 6 Rahul Bedarkar
2016-08-19 17:15 ` [Buildroot] [PATCH v2 next 2/2] logrotate: bump version to 3.10.0 Rahul Bedarkar
2016-08-19 21:04 ` Thomas Petazzoni
2016-08-19 21:00 ` [Buildroot] [PATCH v2 master 1/2] logrotate: fix up build error with gcc 6 Thomas Petazzoni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox