patches/glibc/ports-2.13/350-pre20040117-pt_pax.patch
author Anthony Foiani <anthony.foiani@gmail.com>
Thu May 19 23:09:43 2011 +0200 (2011-05-19)
changeset 2462 139b85d70b62
permissions -rw-r--r--
complibs/ppl: fix 0.11-0.11.2 to compile with --disable-shared

PPL 0.11 (through 0.11.2) had a small bug where it still tried to build
and test its Java interface even when shared libraries are disabled.
Since that's exactly what ct-ng does, it explodes.

This is the patch from the PPL authors (see final link below).

More information can be found in these messages/threads:

Anthony's initial report and analysis with Yann:
http://www.cygwin.com/ml/crossgcc/2011-05/msg00046.html

Ron Flory hit the same problem:
http://www.cygwin.com/ml/crossgcc/2011-05/msg00054.html

Anthony's report to the ppl-devel list:
http://www.cs.unipr.it/pipermail/ppl-devel/2011-May/017450.html

Roberto's reply with a link to the fix in the PPL git repo:
http://www.cs.unipr.it/pipermail/ppl-devel/2011-May/017455.html

Signed-Off-By: Anthony Foiani <anthony.foiani@gmail.com>
yann@2438
     1
yann@2438
     2
yann@2438
     3
diff -durN glibc-2.13.orig/elf/elf.h glibc-2.13/elf/elf.h
yann@2438
     4
--- glibc-2.13.orig/elf/elf.h	2009-04-15 02:15:54.000000000 +0200
yann@2438
     5
+++ glibc-2.13/elf/elf.h	2009-11-13 00:50:35.000000000 +0100
yann@2438
     6
@@ -580,6 +580,7 @@
yann@2438
     7
 #define PT_GNU_EH_FRAME	0x6474e550	/* GCC .eh_frame_hdr segment */
yann@2438
     8
 #define PT_GNU_STACK	0x6474e551	/* Indicates stack executability */
yann@2438
     9
 #define PT_GNU_RELRO	0x6474e552	/* Read-only after relocation */
yann@2438
    10
+#define PT_PAX_FLAGS	0x65041580	/* Indicates PaX flag markings */
yann@2438
    11
 #define PT_LOSUNW	0x6ffffffa
yann@2438
    12
 #define PT_SUNWBSS	0x6ffffffa	/* Sun Specific segment */
yann@2438
    13
 #define PT_SUNWSTACK	0x6ffffffb	/* Stack segment */
yann@2438
    14
@@ -593,6 +594,18 @@
yann@2438
    15
 #define PF_X		(1 << 0)	/* Segment is executable */
yann@2438
    16
 #define PF_W		(1 << 1)	/* Segment is writable */
yann@2438
    17
 #define PF_R		(1 << 2)	/* Segment is readable */
yann@2438
    18
+#define PF_PAGEEXEC	(1 << 4)	/* Enable  PAGEEXEC */
yann@2438
    19
+#define PF_NOPAGEEXEC	(1 << 5)	/* Disable PAGEEXEC */
yann@2438
    20
+#define PF_SEGMEXEC	(1 << 6)	/* Enable  SEGMEXEC */
yann@2438
    21
+#define PF_NOSEGMEXEC	(1 << 7)	/* Disable SEGMEXEC */
yann@2438
    22
+#define PF_MPROTECT	(1 << 8)	/* Enable  MPROTECT */
yann@2438
    23
+#define PF_NOMPROTECT	(1 << 9)	/* Disable MPROTECT */
yann@2438
    24
+#define PF_RANDEXEC	(1 << 10)	/* Enable  RANDEXEC */
yann@2438
    25
+#define PF_NORANDEXEC	(1 << 11)	/* Disable RANDEXEC */
yann@2438
    26
+#define PF_EMUTRAMP	(1 << 12)	/* Enable  EMUTRAMP */
yann@2438
    27
+#define PF_NOEMUTRAMP	(1 << 13)	/* Disable EMUTRAMP */
yann@2438
    28
+#define PF_RANDMMAP	(1 << 14)	/* Enable  RANDMMAP */
yann@2438
    29
+#define PF_NORANDMMAP	(1 << 15)	/* Disable RANDMMAP */
yann@2438
    30
 #define PF_MASKOS	0x0ff00000	/* OS-specific */
yann@2438
    31
 #define PF_MASKPROC	0xf0000000	/* Processor-specific */
yann@2438
    32