two patches
Steven Pelletier <[email protected]> Wed, 11 Oct 2017 15:11:17 -0400
| Newsgroups | gmane.comp.version-control.rcs.bugs |
|---|---|
| Message-ID | <[email protected]> |
--Apple-Mail=_AC6F541C-55D3-48DC-840C-5F24311556EF
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
charset=utf-8
Below are two patch specific to Apple/macOS versions of rcs.
With the release of macOS High Sierra (10.13), Apple is enforcing that =
printf (and related) format strings that contain a %n specifier must be =
in write-protected memory. This causes rcsdiff to take an illegal =
instruction trap shortly after startup. Running rcsdiff without =
arguments will reproduce the issue. The patch, =
rcs-apple_snprintf.patch, fixes that problem. This fix is limited to a =
one line change to lib/vasnprintf.c It is worth noting that old =
binaries will no longer function after the OS upgrade.
The second patch is for an old compile error where _Noreturn isn=E2=80=99t=
properly defined on Apple platforms. rcs-apple_noreturn.patch, fixes =
that. This fix is a one line change to lib/config.h.in
Steven Pelletier
SquareTurn Technology, Inc.
745 Atlantic Avenue, 8th Floor
Boston, MA 02111
--Apple-Mail=_AC6F541C-55D3-48DC-840C-5F24311556EF
Content-Type: multipart/mixed;
boundary="Apple-Mail=_34D10B5B-1A70-41CC-84D0-3F92729360F2"
--Apple-Mail=_34D10B5B-1A70-41CC-84D0-3F92729360F2
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
charset=utf-8
<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html; =
charset=3Dutf-8"></head><body style=3D"word-wrap: break-word; =
-webkit-nbsp-mode: space; line-break: after-white-space;" class=3D""><div =
class=3D"">Below are two patch specific to Apple/macOS versions of =
rcs.</div><div class=3D""><br class=3D""></div>With the release of macOS =
High Sierra (10.13), Apple is enforcing that printf (and related) format =
strings that contain a %n specifier must be in write-protected memory. =
This causes rcsdiff to take an illegal instruction trap shortly =
after startup. Running rcsdiff without arguments will reproduce =
the issue. The patch, rcs-apple_snprintf.patch, fixes that =
problem. This fix is limited to a one line change =
to lib/vasnprintf.c It is worth noting that old binaries will =
no longer function after the OS upgrade.<div class=3D""><br =
class=3D""></div><div class=3D""><br class=3D""></div><div class=3D""><br =
class=3D""></div><div class=3D"">The second patch is for an old compile =
error where _Noreturn isn=E2=80=99t properly defined on Apple platforms. =
rcs-apple_noreturn.patch, fixes that. This fix is a one line =
change to lib/config.h.in</div><div class=3D""><br =
class=3D""></div><div class=3D""><br class=3D""></div><div class=3D""><br =
class=3D""></div><div class=3D""></div></body></html>=
--Apple-Mail=_34D10B5B-1A70-41CC-84D0-3F92729360F2
Content-Disposition: attachment;
filename=rcs-apple_noreturn.patch
Content-Type: application/octet-stream;
x-unix-mode=0644;
name="rcs-apple_noreturn.patch"
Content-Transfer-Encoding: 7bit
--- lib/config.h.in.ORIG 2015-01-22 05:40:32.000000000 -0500
+++ lib/config.h.in 2017-10-11 11:50:43.000000000 -0400
@@ -1919,7 +1919,8 @@
/* The _Noreturn keyword of C11. */
#if ! (defined _Noreturn \
- || (defined __STDC_VERSION__ && 201112 <= __STDC_VERSION__))
+ || (defined __STDC_VERSION__ && 201112 <= __STDC_VERSION__)) \
+ || (defined __APPLE__ && defined __MACH__)
# if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) \
|| 0x5110 <= __SUNPRO_C)
# define _Noreturn __attribute__ ((__noreturn__))
--Apple-Mail=_34D10B5B-1A70-41CC-84D0-3F92729360F2
Content-Transfer-Encoding: 7bit
Content-Type: text/html;
charset=us-ascii
<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;"><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><div></div></body></html>
--Apple-Mail=_34D10B5B-1A70-41CC-84D0-3F92729360F2
Content-Disposition: attachment;
filename=rcs-apple_snprintf.patch
Content-Type: application/octet-stream;
x-unix-mode=0644;
name="rcs-apple_snprintf.patch"
Content-Transfer-Encoding: 7bit
--- lib/vasnprintf.c.ORIG 2015-01-07 20:12:58.000000000 -0500
+++ lib/vasnprintf.c 2017-10-11 14:43:49.000000000 -0400
@@ -4858,7 +4858,7 @@
#endif
*fbp = dp->conversion;
#if USE_SNPRINTF
-# if !(((__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) && !defined __UCLIBC__) || ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__))
+# if !(((__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) && !defined __UCLIBC__) || ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)) && !defined __APPLE__
fbp[1] = '%';
fbp[2] = 'n';
fbp[3] = '\0';
--Apple-Mail=_34D10B5B-1A70-41CC-84D0-3F92729360F2
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
charset=us-ascii
<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html; =
charset=3Dus-ascii"></head><body style=3D"word-wrap: break-word; =
-webkit-nbsp-mode: space; line-break: after-white-space;" class=3D""><div =
class=3D""><br class=3D""><div class=3D"">
<div style=3D"color: rgb(0, 0, 0); font-family: Helvetica; font-size: =
12px; font-style: normal; font-variant-caps: normal; font-weight: =
normal; letter-spacing: normal; orphans: auto; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; widows: =
auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=3D""><br =
class=3D"Apple-interchange-newline"><br class=3D""></div><div =
style=3D"color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; =
font-style: normal; font-variant-caps: normal; font-weight: normal; =
letter-spacing: normal; orphans: auto; text-align: start; text-indent: =
0px; text-transform: none; white-space: normal; widows: auto; =
word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=3D""><br =
class=3D""></div><div style=3D"color: rgb(0, 0, 0); font-family: =
Helvetica; font-size: 12px; font-style: normal; font-variant-caps: =
normal; font-weight: normal; letter-spacing: normal; orphans: auto; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: =
0px;" class=3D"">Steven Pelletier</div><div style=3D"color: rgb(0, 0, =
0); font-family: Helvetica; font-size: 12px; font-style: normal; =
font-variant-caps: normal; font-weight: normal; letter-spacing: normal; =
orphans: auto; text-align: start; text-indent: 0px; text-transform: =
none; white-space: normal; widows: auto; word-spacing: 0px; =
-webkit-text-stroke-width: 0px;" class=3D"">SquareTurn Technology, =
Inc.</div><div style=3D"color: rgb(0, 0, 0); font-family: Helvetica; =
font-size: 12px; font-style: normal; font-variant-caps: normal; =
font-weight: normal; letter-spacing: normal; orphans: auto; text-align: =
start; text-indent: 0px; text-transform: none; white-space: normal; =
widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" =
class=3D"">745 Atlantic Avenue, 8th Floor</div><div style=3D"color: =
rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: =
normal; font-variant-caps: normal; font-weight: normal; letter-spacing: =
normal; orphans: auto; text-align: start; text-indent: 0px; =
text-transform: none; white-space: normal; widows: auto; word-spacing: =
0px; -webkit-text-stroke-width: 0px;" class=3D"">Boston, MA 02111</div>
</div>
<br class=3D""></div></body></html>=
--Apple-Mail=_34D10B5B-1A70-41CC-84D0-3F92729360F2--
--Apple-Mail=_AC6F541C-55D3-48DC-840C-5F24311556EF--