X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:to:from:subject:date:message-id:mime-version :content-type:content-transfer-encoding; q=dns; s=default; b=jmb SzA/UbxceUVFVwd3gd92rM6Q2Q/Ddm/qVeTZ/cVG3RTs3xOap5thaXPVoqAGPpFQ FAx4nZcDLi98QORHcEF7e4/Z/wpQ7Cn83AMcdyvMZv7gXiAU9y/0l12D0CQRD0A9 rphUI6HD8kG/W6Y7Wl0xtq5AWYR7kKQ5m1OsaMAY= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:to:from:subject:date:message-id:mime-version :content-type:content-transfer-encoding; s=default; bh=iJBCL4oyF li/u0VJ01frt7h1PwM=; b=dwW+xYWEFq9SdIpFWtSo0HTS9Vn01Lhr5/hjyeYbz olI/W+mEQ/m3L89deSb8nJk3tbySqoK4JBDISahWq/KUMzJgXv4mx2/nfD+CJh8U tlQ/Z+c4lbr7naFtYdm/x5xo1k0VsJ4rcb+eU/4Y5m7Co9iyh8tGlTQh/W6wXhS3 AA= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=1911 X-HELO: plane.gmane.org To: cygwin AT cygwin DOT com From: Andrew Schulman Subject: ld randomly assigns wrong user and group IDs to executable Date: Fri, 22 Apr 2016 13:40:06 -0400 Lines: 154 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive: encrypt X-IsSubscribed: yes This is a strange one. cygwin 2.5.1-1 binutils 2.25-4 Lately my attempt to build fish keeps failing, and I've traced it to the following problem: During configure, a particular c++ program compiles fine, but the generated executable has the wrong user and group IDs and permissions, so the configure test fails and my build fails. Here are the source files and generated executable: $ ls -l conftest* -rw-r--r-- 1 ASchulma Domain Users 1911 Apr 22 13:11 conftest.cpp -rw-r--r-- 1 ASchulma Domain Users 466 Apr 22 13:11 conftest.err -rwxr-x--- 1 Unknown+User Unknown+Group 62152 Apr 22 13:11 conftest.exe $ ls -ln conftest.exe -rwxr-x--- 1 4294967295 4294967295 62152 Apr 22 13:11 conftest.exe Note the strange, apparently random user and group ID numbers for conftest.exe. * This happens about half the time. The other half of the time, the user and group IDs are mine and so the build succeeds. I haven't been able to figure out when it will fail. * The user and group IDs are always the same, 4294967295, when the problem happens. * It only happens with this one program - other tests in configure work fine. * When I compile the program on my own, outside of configure, it builds fine, two compiler warnings aside. An excerpt of config.log is below. What could be causing this? Is it a problem with ld, or with Cygwin? Thanks, Andrew ---------- config.log ---------- configure:5219: checking if struct winsize and TIOCGWINSZ exist configure:5246: g++ -o conftest.exe -ggdb -O2 -pipe -fdebug-prefix-map=/home/ASchulma/dev/cygwin/fish/fish-2.3b1-1.x86_64/build=/usr/src/debug/fish-2.3b1-1 -fdebug-prefix-map=/home/ASchulma/dev/cygwin/fish/fish-2.3b1-1.x86_64/src/fish-2.3b1=/usr/src/debug/fish-2.3b1-1 -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64 -fno-exceptions -Wall -Wno-sign-compare conftest.cpp -lintl -lncurses >&5 conftest.cpp: In function 'int main()': conftest.cpp:80:19: warning: statement has no effect [-Wunused-value] TIOCGWINSZ; ^ conftest.cpp:79:24: warning: unused variable 'termsize' [-Wunused-variable] struct winsize termsize = {0}; ^ /usr/lib/gcc/x86_64-pc-cygwin/5.3.0/../../../../x86_64-pc-cygwin/bin/ld: cannot open output file conftest.exe: Permission denied collect2: error: ld returned 1 exit status configure:5246: $? = 1 configure: failed program was: | /* confdefs.h */ | #define PACKAGE_NAME "fish" | #define PACKAGE_TARNAME "fish" | #define PACKAGE_VERSION "2.3b1" | #define PACKAGE_STRING "fish 2.3b1" | #define PACKAGE_BUGREPORT "fish-users AT lists DOT sourceforge DOT net" | #define PACKAGE_URL "" | #define USE_GETTEXT 1 | #define HAVE__PROC_SELF_STAT 1 | #define HAVE_TRANSLATE_H 1 | #define NCURSES_NOMACROS 1 | #define NOMACROS 1 | #define HAVE_NAN 1 | #define STDC_HEADERS 1 | #define HAVE_SYS_TYPES_H 1 | #define HAVE_SYS_STAT_H 1 | #define HAVE_STDLIB_H 1 | #define HAVE_STRING_H 1 | #define HAVE_MEMORY_H 1 | #define HAVE_STRINGS_H 1 | #define HAVE_INTTYPES_H 1 | #define HAVE_STDINT_H 1 | #define HAVE_UNISTD_H 1 | #define HAVE_GETOPT_H 1 | #define HAVE_TERMIOS_H 1 | #define HAVE_SYS_RESOURCE_H 1 | #define HAVE_TERM_H 1 | #define HAVE_NCURSES_TERM_H 1 | #define HAVE_NCURSES_H 1 | #define HAVE_NCURSES_CURSES_H 1 | #define HAVE_CURSES_H 1 | #define HAVE_SYS_SELECT_H 1 | #define HAVE_SYS_IOCTL_H 1 | #define HAVE_SPAWN_H 1 | #define HAVE_LIBINTL_H 1 | #define SIZEOF_WCHAR_T 2 | #define WCHAR_T_BITS 16 | #define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 1 | #define HAVE_DIRENT_H 1 | #define HAVE_STRUCT_DIRENT_D_TYPE 1 | #define HAVE_WCSDUP 1 | #define HAVE_WCSLEN 1 | #define HAVE_WCSCASECMP 1 | #define HAVE_WCSNCASECMP 1 | #define HAVE_FWPRINTF 1 | #define HAVE_FUTIMES 1 | #define HAVE_WCWIDTH 1 | #define HAVE_WCSWIDTH 1 | #define HAVE_WCSTOK 1 | #define HAVE_FPUTWC 1 | #define HAVE_FGETWC 1 | #define HAVE_WCSTOL 1 | #define HAVE_WCSLCAT 1 | #define HAVE_WCSLCPY 1 | #define HAVE_KILLPG 1 | #define HAVE_MKOSTEMP 1 | #define HAVE_SYSCONF 1 | #define HAVE_GETIFADDRS 1 | #define HAVE_FUTIMENS 1 | #define HAVE_CLOCK_GETTIME 1 | #define HAVE_GETTEXT 1 | #define HAVE_DCGETTEXT 1 | #define HAVE_REALPATH_NULL 1 | /* end confdefs.h. */ | | | #ifdef HAVE_TERMIOS_H | #include | #endif | | #ifdef HAVE_SYS_IOCTL_H | #include | #endif | | int | main () | { | | struct winsize termsize = {0}; | TIOCGWINSZ; | | | ; | return 0; | } | configure:5256: result: no -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple