SHA256
3
0
forked from pool/glibc
glibc/s390-elision-enable-envvar.patch
Andreas Schwab 8c4777bd8f Accepting request 511655 from home:Andreas_Schwab:Factory
- s390-elision-enable-envvar.patch: enable TLE only if
  GLIBC_ELISION_ENABLE=yes is defined (fate#322271)

OBS-URL: https://build.opensuse.org/request/show/511655
OBS-URL: https://build.opensuse.org/package/show/Base:System/glibc?expand=0&rev=465
2017-07-20 12:59:14 +00:00

32 lines
1.1 KiB
Diff

Index: glibc-2.25/sysdeps/unix/sysv/linux/s390/elision-conf.c
===================================================================
--- glibc-2.25.orig/sysdeps/unix/sysv/linux/s390/elision-conf.c
+++ glibc-2.25/sysdeps/unix/sysv/linux/s390/elision-conf.c
@@ -21,6 +21,7 @@
#include <elision-conf.h>
#include <unistd.h>
#include <dl-procinfo.h>
+#include <string.h>
/* Reasonable initial tuning values, may be revised in the future.
This is a conservative initial value. */
@@ -64,7 +65,17 @@ elision_init (int argc __attribute__ ((u
When false elision is never attempted. */
int elision_available = (GLRO (dl_hwcap) & HWCAP_S390_TE) ? 1 : 0;
- __pthread_force_elision = __libc_enable_secure ? 0 : elision_available;
+ /* Scan the environment and conditionally enable TLE. */
+ if (elision_available != 0 && __libc_enable_secure == 0)
+ {
+ for ( ; *environ != NULL; environ++)
+ if (**environ == 'G'
+ && strcmp (*environ, "GLIBC_ELISION_ENABLE=yes") == 0)
+ {
+ __pthread_force_elision = elision_available;
+ break;
+ }
+ }
}
#ifdef SHARED