Open
Description
Link error on x86_64-pc-cygwin occurs.
Is configure option wrong?
Or gcc's bug?
$ cat hello.rs
fn main() {
println!("Hello, world!");
}
$ TMPDIR=/tmp /tmp/gcc-rust/usr/local/bin/gccrs.exe -v hello.rs
Using built-in specs.
COLLECT_GCC=/tmp/gcc-rust/usr/local/bin/gccrs
COLLECT_LTO_WRAPPER=/tmp/gcc-rust/usr/local/bin/../libexec/gcc/x86_64-pc-cygwin/10.0.0/lto-wrapper.exe
Target: x86_64-pc-cygwin
Configured with: ./configure --disable-bootstrap --enable-multilib --enable-languages=c,c++,rust
Thread model: single
Supported LTO compression algorithms: zlib zstd
gcc version 10.0.0 20191127 (experimental) (GCC)
COLLECT_GCC_OPTIONS='-v' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
/tmp/gcc-rust/usr/local/bin/../libexec/gcc/x86_64-pc-cygwin/10.0.0/rust1.exe hello.rs -quiet -dumpbase hello.rs -mtune=generic -march=x86-64 -auxbase hello -version -L/tmp/gcc-rust/usr/local/bin/../lib/gcc/x86_64-pc-cygwin/10.0.0 -L/tmp/gcc-rust/usr/local/bin/../lib/gcc -L/tmp/gcc-rust/usr/local/bin/../lib/gcc/x86_64-pc-cygwin/10.0.0/../../../../lib -L/lib/../lib -L/usr/lib/../lib -L/tmp/gcc-rust/usr/local/bin/../lib/gcc/x86_64-pc-cygwin/10.0.0/../../.. -o /tmp/ccr9IdMy.s
GNU Rust (GCC) version 10.0.0 20191127 (experimental) (x86_64-pc-cygwin)
compiled by GNU C version 9.3.0, GMP version 6.2.0, MPFR version 4.0.2-p6, MPC version 1.1.0, isl version isl-0.22.1-GMP
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
GNU Rust (GCC) version 10.0.0 20191127 (experimental) (x86_64-pc-cygwin)
compiled by GNU C version 9.3.0, GMP version 6.2.0, MPFR version 4.0.2-p6, MPC version 1.1.0, isl version isl-0.22.1-GMP
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
Preparing to parse files.
about to parse expr (in expr without block method)
beginning null denotation identifier handling
current peek token when starting path pratt parse: '!'
current token (just about to return path to null denotation): '!'
finished null denotation identifier path parsing - next is branching
new delim token tree parsing begun
ast token created with str 'Hello, world!'
finished parsing new delim token tree - peeked token is now ';' while t is ')'
successfully parsed macro invocation (via partial)
finished parsing null denotation
null denotation is not null - going on to left denotation
initial rbp: '0', initial lbp: '0' (for ';')
successfully parsed expr in parse_expr - returning
successfully parsed expr (in expr without block method)
about to call the impl for clone expr without block
expr to expr without block conversion didn't error
expr to expr without block conversion was successful; returning
SUCCESSFULLY PARSED CRATE
ran register_plugins (with no body)
SUCCESSFULLY REGISTERED PLUGINS
started injection
finished injection
SUCCESSFULLY FINISHED INJECTION
started expansion
finished expansion
SUCCESSFULLY FINISHED EXPANSION
started name resolution
finished name resolution
SUCCESSFULLY FINISHED RESOLUTION
COLLECT_GCC_OPTIONS='-v' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
as -o /tmp/ccpwggue.o /tmp/ccr9IdMy.s
COMPILER_PATH=/tmp/gcc-rust/usr/local/bin/../libexec/gcc/x86_64-pc-cygwin/10.0.0/:/tmp/gcc-rust/usr/local/bin/../libexec/gcc/
LIBRARY_PATH=/tmp/gcc-rust/usr/local/bin/../lib/gcc/x86_64-pc-cygwin/10.0.0/:/tmp/gcc-rust/usr/local/bin/../lib/gcc/:/tmp/gcc-rust/usr/local/bin/../lib/gcc/x86_64-pc-cygwin/10.0.0/../../../../lib/:/lib/../lib/:/usr/lib/../lib/:/tmp/gcc-rust/usr/local/bin/../lib/gcc/x86_64-pc-cygwin/10.0.0/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-shared-libgcc' '-mtune=generic' '-march=x86-64'
/tmp/gcc-rust/usr/local/bin/../libexec/gcc/x86_64-pc-cygwin/10.0.0/collect2.exe -plugin /tmp/gcc-rust/usr/local/bin/../libexec/gcc/x86_64-pc-cygwin/10.0.0/cyglto_plugin-0.dll -plugin-opt=/tmp/gcc-rust/usr/local/bin/../libexec/gcc/x86_64-pc-cygwin/10.0.0/lto-wrapper.exe -plugin-opt=-fresolution=/tmp/ccHmliAY.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 -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 /lib/../lib/crt0.o /tmp/gcc-rust/usr/local/bin/../lib/gcc/x86_64-pc-cygwin/10.0.0/crtbegin.o -L/tmp/gcc-rust/usr/local/bin/../lib/gcc/x86_64-pc-cygwin/10.0.0 -L/tmp/gcc-rust/usr/local/bin/../lib/gcc -L/tmp/gcc-rust/usr/local/bin/../lib/gcc/x86_64-pc-cygwin/10.0.0/../../../../lib -L/lib/../lib -L/usr/lib/../lib -L/tmp/gcc-rust/usr/local/bin/../lib/gcc/x86_64-pc-cygwin/10.0.0/../../.. /tmp/ccpwggue.o -lgcc_s -lgcc -lcygwin -ladvapi32 -lshell32 -luser32 -lkernel32 -lgcc_s -lgcc /lib/../lib/default-manifest.o /tmp/gcc-rust/usr/local/bin/../lib/gcc/x86_64-pc-cygwin/10.0.0/crtend.o
/usr/bin/ld: /lib/../lib/libcygwin.a(libcmain.o): in function `main':
/usr/src/debug/cygwin-3.1.4-1/winsup/cygwin/lib/libcmain.c:37: undefined reference to `WinMain'
/usr/src/debug/cygwin-3.1.4-1/winsup/cygwin/lib/libcmain.c:37:(.text.startup+0x7f): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `WinMain'
collect2: error: ld returned 1 exit status
$ TMPDIR=/tmp /tmp/gcc-rust/usr/local/bin/gccrs.exe -c hello.rs
$ objdump -t hello.o | grep __main
$