[email protected] (Jérémie Courrèges-Anglas) writes:

[...]

> I asked for advice[1] on the tech@ mailing-list; -z relro is a no-op,
> and -z now doesn't bring anything to mosh.

Uh oh, wrong.  Well, as Philip Gunther points out, -z now isn't much
useful for single-threaded programs, but mosh indirectly uses pthreads
through the protobuf library.  A quick test shows that -z now increases
mosh-client's startup time only by about 25%, and this shouldn't matter
anyway.

New diff with a comment.

(btw patches should soon go into upstream repo)

> OK to import, with the following modification?
>
> [1] http://marc.info/?l=openbsd-tech&m=136597510228697&w=2

-- 
Jérémie Courrèges-Anglas
PGP Key fingerprint: 61DB D9A0 00A4 67CF 2A90  8961 6191 8FBF 06A1 1494

--- Makefile.old        Tue Apr 16 11:52:14 2013
+++ Makefile    Tue Apr 16 12:13:31 2013
@@ -24,7 +24,10 @@
 
 SEPARATE_BUILD =       Yes
 CONFIGURE_STYLE =      gnu
-CONFIGURE_ENV =                ac_cv_have_decl_htobe64=yes
+# --enable-hardening forces PIE on, which doesn't work on all arches
+# pick only ld(1) -z now to match upstream
+CONFIGURE_ARGS =       --disable-hardening
+CONFIGURE_ENV =                ac_cv_have_decl_htobe64=yes LDFLAGS="-Wl,-z,now"
 
 # upstream says 1.3 will ship with tests
 NO_TEST =              Yes

Reply via email to