From patchwork Thu Apr 27 12:50:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janne Blomqvist X-Patchwork-Id: 756020 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3wDGyf3k0Hz9s8Q for ; Thu, 27 Apr 2017 22:50:46 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="YIlEZ5o8"; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id; q=dns; s=default; b=LFka7GxiXl7Z ejwJ8kPsXF0OzQqk4MFqXkp83ABrVoliFhhnRshtKvjcTNPPI7jT6h0NzKuCulpV IYC8+2Vnj4k/gu/GEXyUDrnR3V3RIX/hN2vAfDurp9AqaYCcVRE2UgKXaae2l1ox mn+J/WUXm8LFwTyJpCiNoCruNHmO6yU= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id; s=default; bh=3tIgtmz55ZtiLS9XDz tV6nWZuYs=; b=YIlEZ5o8gzMilLso0KLgCJtuTEusih3SoH6XCUw8hAvy1ItDeb ZK8V98r76i/xTkon9RlWyvrDMUrC0pOVQgHUGeYMoneC4pefyUVw0lopu5/ZAC1v erROx69gyz8RWTQ/MjlV5YIyfpbQyQntigo/oYZA5PW+1sKRHMdXzLfLk= Received: (qmail 11135 invoked by alias); 27 Apr 2017 12:50:36 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 11115 invoked by uid 89); 27 Apr 2017 12:50:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-23.7 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=ham version=3.3.2 spammy=sk:fallbac, secure X-Spam-User: qpsmtpd, 2 recipients X-HELO: mail-lf0-f66.google.com Received: from mail-lf0-f66.google.com (HELO mail-lf0-f66.google.com) (209.85.215.66) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 27 Apr 2017 12:50:33 +0000 Received: by mail-lf0-f66.google.com with SMTP id 75so3940882lfs.3; Thu, 27 Apr 2017 05:50:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=uogqkXd/UwMeyi+x/OsK7N2R1WY3kcoqPkWxzCRH/mI=; b=m8p56n4GlFHhOra0Oj3TLxuwtVhrDtSTrAHecpaK4kJz32XVIpESx3vUOrvgQvH5Bo +KRQYJ/PKS5o8dd9FM3tSfW6LIUA2LIi71stEW28qmUKCE7vSUHMLMExHOF2InhwgZsV 0MSB4Qb9XUyKL8mdapbOt5BJ3foXR/LgJEQb7RKwpQE47AHJCgu3hD8tKMQFD1BulI0e VmlFy4VRyhJJY3IEOcl1MW3yefqhUM6uCwM8NlIukgtJ9GcH9mwidssnxdVxCKVX91X/ 0zpXSgX8NwbmGGyjQmEOIh5uxjSjgc1WPdPkyrSkOeX6Q6utTT2OZdIWZLIwJlmLmtHL Afeg== X-Gm-Message-State: AN3rC/5+pR/2f70+eN8/SvVdDKy9ytrHGtplDZ+mixbca9qGIBj15n56 oRwgds9Wwrt7Ig== X-Received: by 10.46.33.93 with SMTP id h90mr2087743ljh.53.1493297432790; Thu, 27 Apr 2017 05:50:32 -0700 (PDT) Received: from dt.lan (91-159-207-203.elisa-laajakaista.fi. [91.159.207.203]) by smtp.gmail.com with ESMTPSA id p23sm455033lfj.35.2017.04.27.05.50.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 27 Apr 2017 05:50:31 -0700 (PDT) From: Janne Blomqvist To: fortran@gcc.gnu.org, gcc-patches@gcc.gnu.org Cc: Janne Blomqvist Subject: [PATCH] Don't check for __secure_getenv Date: Thu, 27 Apr 2017 15:50:19 +0300 Message-Id: <1493297419-3667-1-git-send-email-blomqvist.janne@gmail.com> Glibc 2.17 made __secure_getenv an officially supported function, and renamed it secure_getenv. The libgfortran configure has checked for both of these, per https://sourceware.org/glibc/wiki/Tips_and_Tricks/secure_getenv. Unfortunately, while the dynamical library (libc.so) retains the __secure_getenv symbol for backwards compatibility, the static library (libc.a) does not. This means that a libgfortran.a compiled against an older glibc will not work if one tries to link against a newer libc.a. This creates problems for providing gfortran binary distributions that work on as many target systems as possible. Thus, drop the support for __secure_getenv. This implies that when libgfortran is compiled against an older glibc it instead uses the fallback secure_getenv in libgfortran/runtime/environ.c instead of glibc __secure_getenv. Regtested on x86_64-pc-linux-gnu, Ok for trunk, 7.x when it reopens, 6, 5? 2017-04-27 Janne Blomqvist * configure.ac: Don't check for presence of __secure_getenv. * libgfortran.h: HAVE_SECURE_GETENV: Don't check HAVE___SECURE_GETENV. * Makefile.in: Regenerated. * config.h.in: Regenerated. * configure: Regenerated. --- libgfortran/Makefile.in | 5 +++-- libgfortran/config.h.in | 3 --- libgfortran/configure | 7 ++----- libgfortran/configure.ac | 2 +- libgfortran/libgfortran.h | 4 +--- 5 files changed, 7 insertions(+), 14 deletions(-) diff --git a/libgfortran/Makefile.in b/libgfortran/Makefile.in index 05b183d..4914a6f 100644 --- a/libgfortran/Makefile.in +++ b/libgfortran/Makefile.in @@ -137,8 +137,9 @@ am__aclocal_m4_deps = $(top_srcdir)/../config/depstand.m4 \ $(top_srcdir)/../ltversion.m4 $(top_srcdir)/../lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/../config/acx.m4 \ $(top_srcdir)/../config/no-executables.m4 \ - $(top_srcdir)/../config/math.m4 $(top_srcdir)/../libtool.m4 \ - $(top_srcdir)/configure.ac + $(top_srcdir)/../config/math.m4 \ + $(top_srcdir)/../config/ax_check_define.m4 \ + $(top_srcdir)/../libtool.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ diff --git a/libgfortran/config.h.in b/libgfortran/config.h.in index b762d099..45e349d 100644 --- a/libgfortran/config.h.in +++ b/libgfortran/config.h.in @@ -837,9 +837,6 @@ /* Define to 1 if you have the `ynl' function. */ #undef HAVE_YNL -/* Define to 1 if you have the `__secure_getenv' function. */ -#undef HAVE___SECURE_GETENV - /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #undef LT_OBJDIR diff --git a/libgfortran/configure b/libgfortran/configure index 81238fc..dd99620 100755 --- a/libgfortran/configure +++ b/libgfortran/configure @@ -2598,7 +2598,6 @@ as_fn_append ac_func_list " geteuid" as_fn_append ac_func_list " umask" as_fn_append ac_func_list " getegid" as_fn_append ac_func_list " secure_getenv" -as_fn_append ac_func_list " __secure_getenv" as_fn_append ac_func_list " mkostemp" as_fn_append ac_func_list " strnlen" as_fn_append ac_func_list " strndup" @@ -12421,7 +12420,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 12424 "configure" +#line 12423 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -12527,7 +12526,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 12530 "configure" +#line 12529 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -16685,8 +16684,6 @@ done - - fi # Check strerror_r, cannot be above as versions with two and three arguments exist diff --git a/libgfortran/configure.ac b/libgfortran/configure.ac index 37b12d2..fe47fcd 100644 --- a/libgfortran/configure.ac +++ b/libgfortran/configure.ac @@ -310,7 +310,7 @@ else gettimeofday stat fstat lstat getpwuid vsnprintf dup \ getcwd localtime_r gmtime_r getpwuid_r ttyname_r clock_gettime \ getgid getpid getuid geteuid umask getegid \ - secure_getenv __secure_getenv mkostemp strnlen strndup newlocale \ + secure_getenv mkostemp strnlen strndup newlocale \ freelocale uselocale strerror_l) fi diff --git a/libgfortran/libgfortran.h b/libgfortran/libgfortran.h index cfa4fcf..9d9d117 100644 --- a/libgfortran/libgfortran.h +++ b/libgfortran/libgfortran.h @@ -808,9 +808,7 @@ internal_proto(get_unformatted_convert); /* Secure getenv() which returns NULL if running as SUID/SGID. */ #ifndef HAVE_SECURE_GETENV -#ifdef HAVE___SECURE_GETENV -#define secure_getenv __secure_getenv -#elif defined(HAVE_GETUID) && defined(HAVE_GETEUID) \ +#if defined(HAVE_GETUID) && defined(HAVE_GETEUID) \ && defined(HAVE_GETGID) && defined(HAVE_GETEGID) #define FALLBACK_SECURE_GETENV extern char *secure_getenv (const char *);