Hello,

I've been banging my head against the wall on this one.  For some inexplicable 
reason, both gcc and clang broke at the same time right after I updated 
cygwin64.  To try to resolve the issue, I tried to uninstall and then reinstall 
a fresh copy of cygwin64 with just a minimal install to try to diagnose the 
problem.

When I try to compile the following simple program, gcc hangs.  I have to go 
into task manager and kill cc1.exe to recover the session.  clang on the other 
hand gives a 'weird' error about collect2 having a fatal error.  The program 
that I am trying to compile is below:

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <strings.h>
#include <errno.h>
#include <sys/cdefs.h>

typedef struct data_tag__ data_t;
struct data_tag__
{
int data1;
int data2;
int *ptrx;
int data3;
int data4;
};

int main(void)
{
data_t *p;
data_t s;
int *ip;

ip = &s.data4;
p = (data_t *)(ip - (offsetof(data_t, data4) / sizeof(int)));

printf("s:%p  ip:%p  p:%p\n", &s, ip, p);

return(0);
}


And here is the clang error:

Restricted User@HARDROCK ~
$ clang -o test test.c
collect2: fatal error: no arguments
compilation terminated.
clang-3.7: error: linker (via gcc) command failed with exit code 1 (use -v to 
see invocation)


So when I try using the -v option to see what's going on, I get this:

$ clang -v -o test test.c
clang version 3.7.1 (tags/RELEASE_371/final)
Target: x86_64-unknown-windows-cygnus
Thread model: posix
"/usr/bin/clang-3.7" -cc1 -triple x86_64-unknown-windows-cygnus -emit-obj 
-mrelax-all -disable-free -disable-llvm-verifier -main-file-name test.c 
-mrelocation-model pic -pic-level 2 -mthread-model posix -fmath-errno 
-masm-verbose -mconstructor-aliases -munwind-tables -target-cpu x86-64 
-momit-leaf-frame-pointer -v -dwarf-column-info -resource-dir 
/usr/bin/../lib/clang/3.7.1 -fdebug-compilation-dir /home/Restricted_User 
-ferror-limit 19 -fmessage-length 80 -mstackrealign -fobjc-runtime=gcc 
-fdiagnostics-show-option -fcolor-diagnostics -o /tmp/test-46cf78.o -x c test.c
clang -cc1 version 3.7.1 based upon LLVM 3.7.1 default target 
x86_64-unknown-windows-cygnus
ignoring nonexistent directory "/usr/local/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/bin/../lib/clang/3.7.1/include
/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/include
/usr/include
/usr/include/w32api
End of search list.
"/usr/bin/gcc" -v -m64 -o test /tmp/test-46cf78.o
Using built-in specs.
COLLECT_GCC=/usr/bin/gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/lto-wrapper.exe
Target: x86_64-pc-cygwin
Configured with: 
/cygdrive/i/szsz/tmpp/gcc/gcc-5.3.0-3.x86_64/src/gcc-5.3.0/configure 
--srcdir=/cygdrive/i/szsz/tmpp/gcc/gcc-5.3.0-3.x86_64/src/gcc-5.3.0 
--prefix=/usr --exec-prefix=/usr --localstatedir=/var --sysconfdir=/etc 
--docdir=/usr/share/doc/gcc --htmldir=/usr/share/doc/gcc/html -C 
--build=x86_64-pc-cygwin --host=x86_64-pc-cygwin --target=x86_64-pc-cygwin 
--without-libiconv-prefix --without-libintl-prefix --libexecdir=/usr/lib 
--enable-shared --enable-shared-libgcc --enable-static 
--enable-version-specific-runtime-libs --enable-bootstrap --enable-__cxa_atexit 
--with-dwarf2 --with-tune=generic 
--enable-languages=ada,c,c++,fortran,lto,objc,obj-c++ --enable-graphite 
--enable-threads=posix --enable-libatomic --enable-libcilkrts --enable-libgomp 
--enable-libitm --enable-libquadmath --enable-libquadmath-support 
--enable-libssp --enable-libada --enable-libgcj-sublibs --disable-java-awt 
--disable-symvers --with-ecj-jar=/usr/share/java/ecj.jar --with-gnu-ld 
--with-gnu-as --with-cloog-include=/usr/include/cloog-isl 
--without-libiconv-prefix --without-libintl-prefix --with-system-zlib 
--enable-linker-build-id --with-default-libstdcxx-abi=gcc4-compatible
Thread model: posix
gcc version 5.3.0 (GCC)
COMPILER_PATH=/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/:/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/:/usr/lib/gcc/x86_64-pc-cygwin/:/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/:/usr/lib/gcc/x86_64-pc-cygwin/:/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/../../../../x86_64-pc-cygwin/bin/
LIBRARY_PATH=/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/:/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/../../../../x86_64-pc-cygwin/lib/../lib/:/usr/lib/../lib/:/lib/../lib/:/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/../../../../x86_64-pc-cygwin/lib/:/usr/lib/:/lib/:/usr/lib/w32api/
COLLECT_GCC_OPTIONS='-v' '-m64' '-o' 'test.exe' '-mtune=generic' '-march=x86-64'
/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/collect2.exe -plugin 
/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/cyglto_plugin.dll 
-plugin-opt=/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/lto-wrapper.exe 
-plugin-opt=-fresolution=/tmp/cczdJ47B.res -plugin-opt=-pass-through=-lgcc_s 
-plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lcygwin 
-plugin-opt=-pass-through=-ladvapi32 -plugin-opt=-pass-through=-lshell32 
-plugin-opt=-pass-through=-luser32 -plugin-opt=-pass-through=-lkernel32 
-plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc --build-id -m 
i386pep --wrap _Znwm --wrap _Znam --wrap _ZdlPv --wrap _ZdaPv --wrap 
_ZnwmRKSt9nothrow_t --wrap _ZnamRKSt9nothrow_t --wrap _ZdlPvRKSt9nothrow_t 
--wrap _ZdaPvRKSt9nothrow_t -Bdynamic --dll-search-prefix=cyg --tsaware -o 
test.exe /usr/lib/../lib/crt0.o /usr/lib/gcc/x86_64-pc-cygwin/5.3.0/crtbegin.o 
-L/usr/lib/gcc/x86_64-pc-cygwin/5.3.0 
-L/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/../../../../x86_64-pc-cygwin/lib/../lib 
-L/usr/lib/../lib -L/lib/../lib 
-L/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/../../../../x86_64-pc-cygwin/lib 
-L/usr/lib/w32api /tmp/test-46cf78.o -lgcc_s -lgcc -lcygwin -ladvapi32 
-lshell32 -luser32 -lkernel32 -lgcc_s -lgcc /usr/lib/../lib/default-manifest.o 
/usr/lib/gcc/x86_64-pc-cygwin/5.3.0/crtend.o
collect2: fatal error: no arguments
compilation terminated.
clang-3.7: error: linker (via gcc) command failed with exit code 1 (use -v to 
see invocation)


At this point I have no idea as to what is going on.

Attachment: cygcheck.out
Description: Binary data

--
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

Reply via email to