From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from scc-mailout-kit-01.scc.kit.edu (scc-mailout-kit-01.scc.kit.edu [129.13.231.81]) by fantadrom.bsd.lv (OpenSMTPD) with ESMTP id 29603eef for ; Sun, 10 Jul 2016 13:34:07 -0500 (EST) Received: from asta-nat.asta.uni-karlsruhe.de ([172.22.63.82] helo=hekate.usta.de) by scc-mailout-kit-01.scc.kit.edu with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (envelope-from ) id 1bMJYK-0000db-Dv; Sun, 10 Jul 2016 20:34:06 +0200 Received: from donnerwolke.usta.de ([172.24.96.3]) by hekate.usta.de with esmtp (Exim 4.77) (envelope-from ) id 1bMJYK-0002HO-7X; Sun, 10 Jul 2016 20:34:04 +0200 Received: from athene.usta.de ([172.24.96.10]) by donnerwolke.usta.de with esmtp (Exim 4.84_2) (envelope-from ) id 1bMJYK-0003XR-15; Sun, 10 Jul 2016 20:34:04 +0200 Received: from localhost (athene.usta.de [local]) by athene.usta.de (OpenSMTPD) with ESMTPA id baca0eb2; Sun, 10 Jul 2016 20:34:04 +0200 (CEST) Date: Sun, 10 Jul 2016 20:34:03 +0200 From: Ingo Schwarze To: Christian Neukirchen Cc: tech@mdocml.bsd.lv Subject: Re: call for testing: mandoc-1.13.4 release candidate Message-ID: <20160710183403.GI14535@athene.usta.de> References: <20160709131158.GA6629@athene.usta.de> <87poqlin5p.fsf@gmail.com> <20160710163617.GG14535@athene.usta.de> <87h9bxiglz.fsf@gmail.com> X-Mailinglist: mdocml-tech Reply-To: tech@mdocml.bsd.lv MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87h9bxiglz.fsf@gmail.com> User-Agent: Mutt/1.6.2 (2016-07-01) Hi Christian, Christian Neukirchen wrote on Sun, Jul 10, 2016 at 06:48:40PM +0200: > Ingo Schwarze writes: >> Christian Neukirchen wrote on Sun, Jul 10, 2016 at 04:27:14PM +0200: >>> - It would be nice to support the LDFLAGS variable in the Makefile >> What is that needed for? I don't like adding gratuitious features >> and would prefer to understand the actual purpose in order to find >> a solution that is as simple as possible. > We build programs on Void using hardening, and need to pass special > linker flags for that (add RELRO and BIND_NOW). Actually, that seems like a useful idea to me, certainly not gratuitious. Supporting that by real LDFLAGS support in ./configure.local and in the Makefile seemed cleanest to me, so i just added it, see the commit below. >>> - It would be nice to make the default MANPAGER configurable at >>> compile time, since more(1) on non-BSD systems is an unusable >>> default (no back scrolling etc.) >> Hmm, POSIX slightly favours having more(1) as the default in man(1) >> but explicitly allows a system to use a different pager by default. >> So maybe. But implementing it is a bit of a bother because it >> requires patching the file man.1 at configuration time. I'm not >> sure yet whether i want to do that. I won't do it for the 1.13.4 >> release, it would be too intrusive at this point. > Perhaps a macro could be used to refer to the default pager, then you > just need to change one line? Macros in mdoc(7)? That's possible, but ugly. >> If you prepare a port for an operating system where the system more(1) >> is unusable, i'd recommend adding local patches to the appropriate >> places in main.c and man.1 for now. > I currently use > > sed -i 's,bin/more,bin/less,g' main.c *.1 > sed -i 's,.Xr more,.Xr less,g' *.1 > sed -i 's,"more","less",g' manpage.c Sure, it's fine if you do something like that locally for now. Yours, Ingo Log Message: ----------- support LDFLAGS; suggested by Christian Neukirchen Modified Files: -------------- mdocml: Makefile configure configure.local.example Revision Data ------------- Index: configure =================================================================== RCS file: /home/cvs/mdocml/mdocml/configure,v retrieving revision 1.38 retrieving revision 1.39 diff -Lconfigure -Lconfigure -u -p -r1.38 -r1.39 --- configure +++ configure @@ -37,6 +37,7 @@ OSNAME= CC=`printf "all:\\n\\t@echo \\\$(CC)\\n" | make -f -` CFLAGS="-g -W -Wall -Wstrict-prototypes -Wno-unused-parameter -Wwrite-strings" LDADD= +LDFLAGS= LD_OHASH= LD_SQLITE3= STATIC="-static" @@ -428,6 +429,7 @@ INSTALL_TARGETS = ${INSTALL_TARGETS} CC = ${CC} CFLAGS = ${CFLAGS} LDADD = ${LDADD} +LDFLAGS = ${LDFLAGS} STATIC = ${STATIC} PREFIX = ${PREFIX} BINDIR = ${BINDIR} Index: configure.local.example =================================================================== RCS file: /home/cvs/mdocml/mdocml/configure.local.example,v retrieving revision 1.11 retrieving revision 1.12 diff -Lconfigure.local.example -Lconfigure.local.example -u -p -r1.11 -r1.12 --- configure.local.example +++ configure.local.example @@ -131,10 +131,17 @@ BINM_SOELIM=msoelim # default is "soeli LD_OHASH="-lutil" -# Some platforms may need additional linker flags that are not autodetected. +# Some platforms may need additional linker flags to link against libmandoc +# that are not autodetected. # For example, Solaris 9 and 10 need -lrt for nanosleep(2). LDADD="-lrt" + +# Some systems may want to set additional linker flags for all the +# binaries, not only for those using libmandoc, for example for +# hardening options. + +LDFLAGS="-Wl,-z,relro" # It is possible to change the utility program used for installation # and the modes files are installed with. The defaults are: Index: Makefile =================================================================== RCS file: /home/cvs/mdocml/mdocml/Makefile,v retrieving revision 1.486 retrieving revision 1.487 diff -LMakefile -LMakefile -u -p -r1.486 -r1.487 --- Makefile +++ Makefile @@ -408,19 +408,19 @@ libmandoc.a: $(COMPAT_OBJS) $(LIBMANDOC_ ar rs $@ $(COMPAT_OBJS) $(LIBMANDOC_OBJS) mandoc: $(MAIN_OBJS) libmandoc.a - $(CC) -o $@ $(MAIN_OBJS) libmandoc.a $(LDADD) + $(CC) -o $@ $(LDFLAGS) $(MAIN_OBJS) libmandoc.a $(LDADD) manpage: $(MANPAGE_OBJS) libmandoc.a - $(CC) -o $@ $(MANPAGE_OBJS) libmandoc.a $(LDADD) + $(CC) -o $@ $(LDFLAGS) $(MANPAGE_OBJS) libmandoc.a $(LDADD) man.cgi: $(CGI_OBJS) libmandoc.a - $(CC) $(STATIC) -o $@ $(CGI_OBJS) libmandoc.a $(LDADD) + $(CC) $(STATIC) -o $@ $(LDFLAGS) $(CGI_OBJS) libmandoc.a $(LDADD) demandoc: $(DEMANDOC_OBJS) libmandoc.a - $(CC) -o $@ $(DEMANDOC_OBJS) libmandoc.a $(LDADD) + $(CC) -o $@ $(LDFLAGS) $(DEMANDOC_OBJS) libmandoc.a $(LDADD) soelim: $(SOELIM_OBJS) - $(CC) -o $@ $(SOELIM_OBJS) + $(CC) -o $@ $(LDFLAGS) $(SOELIM_OBJS) # --- maintainer targets --- -- To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv