UPDATE: sysutils/monit 5.27.0

2020-07-26 Thread Caspar Schutijser
Hi ports@,

Below is a diff that updates sysutils/monit to 5.27.0. Tested on amd64.

Some notes:

1) I added a patch to make sure the -fcf-protection=full compiler option
is not used. If this option is used, the compiler emits
.note.gnu.property ELF section headers and as a result, the produced
binary does not run: some garbage is printed to the screen and the
output ends as follows if I try to run it:
/usr/local/bin/monit[2]:: not found
/usr/local/bin/monit[2]: L: not found
/usr/local/bin/monit[20]: syntax error: `(' unexpected
I don't know if just patching away the use of this compiler option is
the way to go or that something else would be better. Feedback on that
is appreciated.

jasper@ helped me figure out that the presence of the
.note.gnu.property section header was to blame, thanks for that.

2) I made the use of C99 explicit by appending -std=c99 to CFLAGS since
at least C99 is required now. Borrowed from some commits I've seen
from kmos@.

3) The tarball does not contain a README anymore so don't install it
in the post-install target.

Thanks,
Caspar Schutijser


Index: Makefile
===
RCS file: /cvs/ports/sysutils/monit/Makefile,v
retrieving revision 1.64
diff -u -p -r1.64 Makefile
--- Makefile14 Sep 2019 21:18:18 -  1.64
+++ Makefile26 Jul 2020 11:05:17 -
@@ -2,7 +2,7 @@
 
 COMMENT=   monitoring and managing daemons utility
 
-DISTNAME=  monit-5.26.0
+DISTNAME=  monit-5.27.0
 
 CATEGORIES=sysutils
 
@@ -19,6 +19,9 @@ MASTER_SITES= ${HOMEPAGE}/dist/
 
 CONFIGURE_STYLE=gnu
 
+# Must specify C99 for base-gcc
+CFLAGS+=   -std=c99
+
 SUBST_VARS=LOCALSTATEDIR
 
 pre-configure:
@@ -26,7 +29,6 @@ pre-configure:
 
 post-install:
${INSTALL_DATA_DIR} ${PREFIX}/share/{doc,examples}/monit
-   ${INSTALL_DATA} ${WRKSRC}/README ${PREFIX}/share/doc/monit
${INSTALL_DATA} ${WRKSRC}/monitrc ${PREFIX}/share/examples/monit
 
 .include 
Index: distinfo
===
RCS file: /cvs/ports/sysutils/monit/distinfo,v
retrieving revision 1.42
diff -u -p -r1.42 distinfo
--- distinfo14 Sep 2019 21:18:18 -  1.42
+++ distinfo26 Jul 2020 11:05:17 -
@@ -1,2 +1,2 @@
-SHA256 (monit-5.26.0.tar.gz) = h/xFaKOvmivokEDvsWnjouR7Ji+Z541d3emd2J8C88I=
-SIZE (monit-5.26.0.tar.gz) = 1371327
+SHA256 (monit-5.27.0.tar.gz) = 2MDe72JPGTqVJQL+m6q/pm49jQV99XONpD+aN3kq/KQ=
+SIZE (monit-5.27.0.tar.gz) = 1455341
Index: patches/patch-Makefile_in
===
RCS file: /cvs/ports/sysutils/monit/patches/patch-Makefile_in,v
retrieving revision 1.4
diff -u -p -r1.4 patch-Makefile_in
--- patches/patch-Makefile_in   14 Sep 2019 21:18:18 -  1.4
+++ patches/patch-Makefile_in   26 Jul 2020 11:05:17 -
@@ -1,12 +1,12 @@
 $OpenBSD: patch-Makefile_in,v 1.4 2019/09/14 21:18:18 sthen Exp $
 
-Using $< in a non-suffix rule context is a GNUmake idiom (Makefile:1279)
+Using $< in a non-suffix rule context is a GNUmake idiom.
 
 Index: Makefile.in
 --- Makefile.in.orig
 +++ Makefile.in
-@@ -1297,7 +1297,7 @@ cleanall: clean distclean
-   -rm -rf m4 config
+@@ -1326,7 +1326,7 @@ cleanall: clean distclean
+   -git clean -fxd
  
  monit.1: doc/monit.pod
 -  $(POD2MAN) $(POD2MANFLAGS) $< > $@
@@ -14,3 +14,16 @@ Index: Makefile.in
-rm -f pod2*
  
  # -
+@@ -1337,10 +1337,10 @@ src/y.tab.c src/y.tab.h: run-yacc
+ 
+ .INTERMEDIATE: run-yacc
+ run-yacc: src/p.y
+-  $(YACC) $(YACCFLAGS) -o src/y.tab.c $<
++  $(YACC) $(YACCFLAGS) -o src/y.tab.c src/p.y
+ 
+ src/lex.yy.c: src/l.l
+-  $(FLEX) $(FLEXFLAGS) -o$@ $<
++  $(FLEX) $(FLEXFLAGS) -o$@ src/l.l
+ @WITH_CODESIGN_TRUE@all-local: $(bin_PROGRAMS)
+ @WITH_CODESIGN_TRUE@  $(foreach file, $(bin_PROGRAMS), codesign -s 
$(CODESIGN_IDENTITY) -v --deep --timestamp --options runtime $(file))
+ 
Index: patches/patch-configure
===
RCS file: patches/patch-configure
diff -N patches/patch-configure
--- /dev/null   1 Jan 1970 00:00:00 -
+++ patches/patch-configure 26 Jul 2020 11:05:17 -
@@ -0,0 +1,51 @@
+$OpenBSD$
+
+Patch away the detection/use of -fcf-protection=full. This compiler option
+results in .note.gnu.property ELF section headers being emitted and (at least)
+ld.lld(1) does not like this section header.
+
+Index: configure
+--- configure.orig
 configure
+@@ -4473,41 +4473,6 @@ else
+   :
+ fi
+ 
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler 
accepts -fcf-protection=full" >&5
+-$as_echo_n "checking whether C compiler accepts -fcf-protection=full... " 
>&6; }
+-if ${ax_cv_check_cflags___fcf_protection_full+:} false; then :
+-  $as_echo_n "(cached) " >&6
+-else
+-
+-  ax_check_save_flags=$CFLAGS
+-  CFLAGS="$CFLAGS  -fcf-protection=full"
+-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+-/* end confdefs.h.  */
+-
+-i

Re: UPDATE: sysutils/monit 5.27.0

2020-09-13 Thread Caspar Schutijser
Hi,

On Sun, Jul 26, 2020 at 01:12:49PM +0200, Caspar Schutijser wrote:
> Below is a diff that updates sysutils/monit to 5.27.0. Tested on amd64.
> 
> Some notes:
> 
> 1) I added a patch to make sure the -fcf-protection=full compiler option
> is not used. If this option is used, the compiler emits
> .note.gnu.property ELF section headers and as a result, the produced
> binary does not run: some garbage is printed to the screen and the
> output ends as follows if I try to run it:
> /usr/local/bin/monit[2]:: not found
> /usr/local/bin/monit[2]: L: not found
> /usr/local/bin/monit[20]: syntax error: `(' unexpected
> I don't know if just patching away the use of this compiler option is
> the way to go or that something else would be better. Feedback on that
> is appreciated.
> 
> jasper@ helped me figure out that the presence of the
> .note.gnu.property section header was to blame, thanks for that.
> 
> 2) I made the use of C99 explicit by appending -std=c99 to CFLAGS since
> at least C99 is required now. Borrowed from some commits I've seen
> from kmos@.
> 
> 3) The tarball does not contain a README anymore so don't install it
> in the post-install target.

Apparently the .note.gnu.property stuff (bullet point #1) is not
necessary anymore. I don't know for a fact why that is but
my first guess would be the recent upgrade to LLVM 10. Below is
an updated diff.

Thanks,
Caspar Schutijser


Index: Makefile
===
RCS file: /cvs/ports/sysutils/monit/Makefile,v
retrieving revision 1.64
diff -u -p -r1.64 Makefile
--- Makefile14 Sep 2019 21:18:18 -  1.64
+++ Makefile13 Sep 2020 13:58:36 -
@@ -2,7 +2,7 @@
 
 COMMENT=   monitoring and managing daemons utility
 
-DISTNAME=  monit-5.26.0
+DISTNAME=  monit-5.27.0
 
 CATEGORIES=sysutils
 
@@ -19,6 +19,9 @@ MASTER_SITES= ${HOMEPAGE}/dist/
 
 CONFIGURE_STYLE=gnu
 
+# Must specify C99 for base-gcc
+CFLAGS+=   -std=c99
+
 SUBST_VARS=LOCALSTATEDIR
 
 pre-configure:
@@ -26,7 +29,6 @@ pre-configure:
 
 post-install:
${INSTALL_DATA_DIR} ${PREFIX}/share/{doc,examples}/monit
-   ${INSTALL_DATA} ${WRKSRC}/README ${PREFIX}/share/doc/monit
${INSTALL_DATA} ${WRKSRC}/monitrc ${PREFIX}/share/examples/monit
 
 .include 
Index: distinfo
===
RCS file: /cvs/ports/sysutils/monit/distinfo,v
retrieving revision 1.42
diff -u -p -r1.42 distinfo
--- distinfo14 Sep 2019 21:18:18 -  1.42
+++ distinfo13 Sep 2020 13:58:36 -
@@ -1,2 +1,2 @@
-SHA256 (monit-5.26.0.tar.gz) = h/xFaKOvmivokEDvsWnjouR7Ji+Z541d3emd2J8C88I=
-SIZE (monit-5.26.0.tar.gz) = 1371327
+SHA256 (monit-5.27.0.tar.gz) = 2MDe72JPGTqVJQL+m6q/pm49jQV99XONpD+aN3kq/KQ=
+SIZE (monit-5.27.0.tar.gz) = 1455341
Index: patches/patch-Makefile_in
===
RCS file: /cvs/ports/sysutils/monit/patches/patch-Makefile_in,v
retrieving revision 1.4
diff -u -p -r1.4 patch-Makefile_in
--- patches/patch-Makefile_in   14 Sep 2019 21:18:18 -  1.4
+++ patches/patch-Makefile_in   13 Sep 2020 13:58:36 -
@@ -1,12 +1,12 @@
 $OpenBSD: patch-Makefile_in,v 1.4 2019/09/14 21:18:18 sthen Exp $
 
-Using $< in a non-suffix rule context is a GNUmake idiom (Makefile:1279)
+Using $< in a non-suffix rule context is a GNUmake idiom.
 
 Index: Makefile.in
 --- Makefile.in.orig
 +++ Makefile.in
-@@ -1297,7 +1297,7 @@ cleanall: clean distclean
-   -rm -rf m4 config
+@@ -1326,7 +1326,7 @@ cleanall: clean distclean
+   -git clean -fxd
  
  monit.1: doc/monit.pod
 -  $(POD2MAN) $(POD2MANFLAGS) $< > $@
@@ -14,3 +14,16 @@ Index: Makefile.in
-rm -f pod2*
  
  # -
+@@ -1337,10 +1337,10 @@ src/y.tab.c src/y.tab.h: run-yacc
+ 
+ .INTERMEDIATE: run-yacc
+ run-yacc: src/p.y
+-  $(YACC) $(YACCFLAGS) -o src/y.tab.c $<
++  $(YACC) $(YACCFLAGS) -o src/y.tab.c src/p.y
+ 
+ src/lex.yy.c: src/l.l
+-  $(FLEX) $(FLEXFLAGS) -o$@ $<
++  $(FLEX) $(FLEXFLAGS) -o$@ src/l.l
+ @WITH_CODESIGN_TRUE@all-local: $(bin_PROGRAMS)
+ @WITH_CODESIGN_TRUE@  $(foreach file, $(bin_PROGRAMS), codesign -s 
$(CODESIGN_IDENTITY) -v --deep --timestamp --options runtime $(file))
+ 
Index: pkg/PLIST
===
RCS file: /cvs/ports/sysutils/monit/pkg/PLIST,v
retrieving revision 1.11
diff -u -p -r1.11 PLIST
--- pkg/PLIST   1 May 2019 19:21:57 -   1.11
+++ pkg/PLIST   13 Sep 2020 13:58:36 -
@@ -3,7 +3,6 @@
 @bin bin/monit
 @man man/man1/monit.1
 share/doc/monit/
-share/doc/monit/README
 share/examples/monit/
 share/examples/monit/monitrc
 @mode 0600



Re: UPDATE: sysutils/monit 5.27.0

2020-09-13 Thread Caspar Schutijser
On Sun, Sep 13, 2020 at 04:06:20PM +0200, Caspar Schutijser wrote:
> Hi,
> 
> On Sun, Jul 26, 2020 at 01:12:49PM +0200, Caspar Schutijser wrote:
> > Below is a diff that updates sysutils/monit to 5.27.0. Tested on amd64.
> > 
> > Some notes:
> > 
> > 1) I added a patch to make sure the -fcf-protection=full compiler option
> > is not used. If this option is used, the compiler emits
> > .note.gnu.property ELF section headers and as a result, the produced
> > binary does not run: some garbage is printed to the screen and the
> > output ends as follows if I try to run it:
> > /usr/local/bin/monit[2]:: not found
> > /usr/local/bin/monit[2]: L: not found
> > /usr/local/bin/monit[20]: syntax error: `(' unexpected
> > I don't know if just patching away the use of this compiler option is
> > the way to go or that something else would be better. Feedback on that
> > is appreciated.
> > 
> > jasper@ helped me figure out that the presence of the
> > .note.gnu.property section header was to blame, thanks for that.
> > 
> > 2) I made the use of C99 explicit by appending -std=c99 to CFLAGS since
> > at least C99 is required now. Borrowed from some commits I've seen
> > from kmos@.
> > 
> > 3) The tarball does not contain a README anymore so don't install it
> > in the post-install target.
> 
> Apparently the .note.gnu.property stuff (bullet point #1) is not
> necessary anymore. I don't know for a fact why that is but
> my first guess would be the recent upgrade to LLVM 10.

(Should've added this bit in my previous email, sorry)

In my previous email I only talk about LLVM (and as such, the
architectures where LLVM is used). As for other architectures that use
GCC: GCC 4.2.1 does not accept the -fcf-protection=full compiler option
so on those architectures, this problem did not exist in the first
place.

Thanks,
Caspar