From patchwork Tue Feb 20 10:46:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Metzger, Markus T" X-Patchwork-Id: 25975 Received: (qmail 61574 invoked by alias); 20 Feb 2018 10:46:10 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 61560 invoked by uid 89); 20 Feb 2018 10:46:10 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, MIME_BASE64_BLANKS, SPF_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=Hx-languages-length:2291 X-HELO: mga05.intel.com Received: from mga05.intel.com (HELO mga05.intel.com) (192.55.52.43) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 20 Feb 2018 10:46:08 +0000 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Feb 2018 02:46:06 -0800 X-ExtLoop1: 1 Received: from irsmsx108.ger.corp.intel.com ([163.33.3.3]) by orsmga004.jf.intel.com with ESMTP; 20 Feb 2018 02:46:05 -0800 Received: from irsmsx104.ger.corp.intel.com ([169.254.5.101]) by IRSMSX108.ger.corp.intel.com ([169.254.11.9]) with mapi id 14.03.0319.002; Tue, 20 Feb 2018 10:46:04 +0000 From: "Metzger, Markus T" To: Yao Qi , "Eli Zaretskii (eliz@gnu.org)" CC: GDB Patches Subject: RE: [PATCH v2 1/7] common: add scoped_fd Date: Tue, 20 Feb 2018 10:46:04 +0000 Message-ID: References: <1516976072-19282-1-git-send-email-markus.t.metzger@intel.com> <1516976072-19282-2-git-send-email-markus.t.metzger@intel.com> In-Reply-To: x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiM2ExZDQ1NjQtY2M5NC00MGI5LWExY2YtNTRkNWQ0MjI4OTllIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjIuNS4xOCIsIlRydXN0ZWRMYWJlbEhhc2giOiJ3djF0Q2oxRHF0UUxFYkcrUHBZMHVkVW5WNmxvUzB5QkdkNjg2Znd3RkMxYkhNN0hOeFRtQVZEQVZtQmZ2SjhaIn0= dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action MIME-Version: 1.0 X-IsSubscribed: yes Hello Yao, Eli, > > How about checking for mkstemp and, if not available, falling back to tmpnam. > > Can we unconditionally use tmpnam+open which are more portable? I know it is > racy, but mkstemp is only used in a test case. It is overkill to me to do the configure > check or import gnulib module. > > If we use mkstemp in gdb source (not test case) one day in the future, I prefer > importing gnulib module. What do you think? I'd rather not use tmpnam. This is really only a fallback for old systems. I added mkstemp to update-gnulib.sh ... --- --- ... cloned gnulib, updated my automake, ran that script, and ended up with: # modified: gdb/gnulib/aclocal.m4 # modified: gdb/gnulib/config.in # modified: gdb/gnulib/configure # modified: gdb/gnulib/import/Makefile.am # modified: gdb/gnulib/import/Makefile.in # modified: gdb/gnulib/import/m4/gnulib-cache.m4 # modified: gdb/gnulib/import/m4/gnulib-comp.m4 # new file: gdb/gnulib/import/m4/mkstemp.m4 # new file: gdb/gnulib/import/m4/secure_getenv.m4 # new file: gdb/gnulib/import/m4/tempname.m4 # new file: gdb/gnulib/import/mkstemp.c # new file: gdb/gnulib/import/secure_getenv.c # new file: gdb/gnulib/import/tempname.c # new file: gdb/gnulib/import/tempname.h # modified: gdb/gnulib/update-gnulib.sh If I did everything correctly, it looks like gnulib would only provide mkstemp as a fall-back. On my system, it would still use the glibc version. Good. I wouldn't want to replace a standard glibc function. I have not tried building GDB with mingw cross tools, yet. Would you be able to test whether this solves your build problem, Yao? thanks, Markus. Intel Deutschland GmbH Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany Tel: +49 89 99 8853-0, www.intel.de Managing Directors: Christin Eisenschmid, Christian Lamprechter Chairperson of the Supervisory Board: Nicole Lau Registered Office: Munich Commercial Register: Amtsgericht Muenchen HRB 186928 diff --git a/gdb/gnulib/update-gnulib.sh b/gdb/gnulib/update-gnulib.sh index 55cd6e0..d026536 100755 --- a/gdb/gnulib/update-gnulib.sh +++ b/gdb/gnulib/update-gnulib.sh @@ -59,6 +59,7 @@ IMPORTED_GNULIB_MODULES="\ update-copyright \ wchar \ wctype-h \ + mkstemp \ " # The gnulib commit ID to use for the update.