This is the mail archive of the cygwin-developers mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Latest 64 bit test stuff on sourceware


On 21 February 2013 10:58, Corinna Vinschen wrote:
> On Feb 20 19:56, Andy Koppe wrote:
>> On 15 February 2013 15:29, Corinna Vinschen wrote:
>> > Hi guys,
>> >
>> > I just uploaded all the latest 64 bit stuff to
>> > ftp://cygwin.com/pub/cygwin/64bit/
>> >
>> > The main change here is what has been discussed in
>> > http://cygwin.com/ml/cygwin-developers/2013-02/msg00029.html
>> >
>> > - The cygwin DLL is named cygwin1.dll rather than cyg64win1.dll.
>> > - The DLL library prefix is "cyg" rather than "cyg64".
>> > - The link library search path is /usr/lib, rather than /usr/lib64.
>> >
>> > Here's what you get:
>> >
>> > - binary-toolchain-x86_64-pc-linux-x-x86_64-pc-cygwin-20130215.tar.xz
>> >
>> >     A complete binary x86_64 Linux cross toolchain, latest patches.
>>
>> Apparently this one can't find its Win32 libraries:
>>
>> $ cat test.c
>> main(){}
>>
>> $ x86_64-pc-cygwin-gcc test.c
>> /home/andy/opt/x86_64-pc-cygwin/bin/../lib/gcc/x86_64-pc-cygwin/4.8.0/../../../../x86_64-pc-cygwin/bin/ld:
>> cannot find -ladvapi32
>> /home/andy/opt/x86_64-pc-cygwin/bin/../lib/gcc/x86_64-pc-cygwin/4.8.0/../../../../x86_64-pc-cygwin/bin/ld:
>> cannot find -lshell32
>> /home/andy/opt/x86_64-pc-cygwin/bin/../lib/gcc/x86_64-pc-cygwin/4.8.0/../../../../x86_64-pc-cygwin/bin/ld:
>> cannot find -luser32
>> /home/andy/opt/x86_64-pc-cygwin/bin/../lib/gcc/x86_64-pc-cygwin/4.8.0/../../../../x86_64-pc-cygwin/bin/ld:
>> cannot find -lkernel32
>> collect2: error: ld returned 1 exit status
>
> This really puzzles me.  The toolchain I uploaded is the exact toolchain
> I'm using on Linux right now.  And for me, building applications works.
> I built the packages I uploaded to the 64bit/install dir with it and
> your STC works fine for me.
>
>> A somewhat related issue: in the mintty makefile, I tried to work
>> around the fact that there are two libuuids, one in the main library
>> directory and one in its w32api subdirectory, by adding -L`$(HOST)-gcc
>> -print-sysroot`/usr/lib/w32api to the link line, so as to pick up the
>> w32api one. (Incidentally that should also work around the issue
>> above.) Unfortunately that doesn't work with the Linux-hosted
>> cross-compiler because that returns nothing for -print-sysroot,
>> whereas Yaakov's Cygwin-32-to-64 cross-compiler does return the
>> appropriate directory.
>
> The toolchain I created on Linux is not using --with-sysroot.  All
> target files are installed into $(exec_prefix)/$(target_alias) and
> expected there by the compiler.

I see. Is it generally reasonable to assume that if `$(CC)
-print-sysroot` comes back empty, the library directory can be found
at ../$(target)/lib relative to the target-gcc's location?

> For testing I moved away
> /ext/redhat/x86_64-pc-cygwin/x86_64-pc-cygwin/lib/w32api/libkernel32.a
> and I got
>
>   $ x86_64-pc-cygwin-gcc -g test.c
>   /ext/redhat/x86_64-pc-cygwin/bin/../lib/gcc/x86_64-pc-cygwin/4.8.0/../../../../x86_64-pc-cygwin/bin/ld: cannot find -lkernel32
>   collect2: error: ld returned 1 exit status
>
> If I move libkernel32.a back, linking works.

Hmm. I tried putting the toolchain into the same location you have it
in, but that didn't make a difference. -v output at the end of this
mail. A couple of things I noticed there:
- It says 'ignoring nonexistent directory "../../include/w32api"'
- The collect2 command line contains the main lib directory
('L/ext/redhat/x86_64-pc-cygwin/bin/../lib/gcc/x86_64-pc-cygwin/4.8.0/../../../../x86_64-pc-cygwin/lib/../lib',
aka /ext/redhat/x86_64-pc-cygwin/x86_64-pc-cygwin/lib), but not its
w32api subdirectory.

It does build if I add
'-L/ext/redhat/x86_64-pc-cygwin/x86_64-pc-cygwin/lib/w32api'.

Btw, I'm using openSuse 12.2.

>> Is there a better approach for dealing with that, other than requiring
>> the library directory to be passed into the makefile?
>
> Where is the non w32api libuuid.a coming from?  I don't have such a
> file.

On Cygwin proper it comes from the libuuid-devel package. Previously I
got around this by explicitly linking in /usr/lib/w32api/libuuid.a,
but obviously that's no good for cross-compiling. I'd like to address
this "properly" rather than rely on lib/libuuid.a not appearing in
cross build setups.

Andy



~/tmp$ x86_64-pc-cygwin-gcc test.c -v
Using built-in specs.
COLLECT_GCC=x86_64-pc-cygwin-gcc
COLLECT_LTO_WRAPPER=/ext/redhat/x86_64-pc-cygwin/bin/../libexec/gcc/x86_64-pc-cygwin/4.8.0/lto-wrapper
Target: x86_64-pc-cygwin
Configured with: /home/corinna/src/cross-cygwin/gcc/configure
--target=x86_64-pc-cygwin --prefix=/usr/cygnus/x86_64-pc-cygwin
--enable-languages=c,c++ --with-newlib --disable-shared
--enable-static
Thread model: single
gcc version 4.8.0 20130215 (experimental) (GCC)
COLLECT_GCC_OPTIONS='-v' '-mtune=generic' '-march=x86-64'
 /ext/redhat/x86_64-pc-cygwin/bin/../libexec/gcc/x86_64-pc-cygwin/4.8.0/cc1
-quiet -v -iprefix
/ext/redhat/x86_64-pc-cygwin/bin/../lib/gcc/x86_64-pc-cygwin/4.8.0/
-D__CYGWIN__ -Dunix -D__unix__ -D__unix -idirafter
/ext/redhat/x86_64-pc-cygwin/bin/../lib/gcc/x86_64-pc-cygwin/4.8.0/../../../../x86_64-pc-cygwin/lib/../lib/../include/w32api
-idirafter ../../include/w32api test.c -quiet -dumpbase test.c
-mtune=generic -march=x86-64 -auxbase test -version -o /tmp/cc3VMFP7.s
GNU C (GCC) version 4.8.0 20130215 (experimental) (x86_64-pc-cygwin)
        compiled by GNU C version 4.7.2 20120921 (Red Hat 4.7.2-2),
GMP version 5.1.1, MPFR version 3.1.1, MPC version 1.0.1
GGC heuristics: --param ggc-min-expand=30 --param
ggc-min-heapsize=4096
ignoring nonexistent directory
"/ext/redhat/x86_64-pc-cygwin/bin/../lib/gcc/x86_64-pc-cygwin/4.8.0/../../../../x86_64-pc-cygwin/sys-include"
ignoring duplicate directory
"/ext/redhat/x86_64-pc-cygwin/bin/../lib/gcc/../../lib/gcc/x86_64-pc-cygwin/4.8.0/include"
ignoring duplicate directory
"/ext/redhat/x86_64-pc-cygwin/bin/../lib/gcc/../../lib/gcc/x86_64-pc-cygwin/4.8.0/include-fixed"
ignoring nonexistent directory
"/ext/redhat/x86_64-pc-cygwin/bin/../lib/gcc/../../lib/gcc/x86_64-pc-cygwin/4.8.0/../../../../x86_64-pc-cygwin/sys-include"
ignoring duplicate directory
"/ext/redhat/x86_64-pc-cygwin/bin/../lib/gcc/../../lib/gcc/x86_64-pc-cygwin/4.8.0/../../../../x86_64-pc-cygwin/include"
ignoring nonexistent directory "../../include/w32api"
#include "..." search starts here:
#include <...> search starts here:
 /ext/redhat/x86_64-pc-cygwin/bin/../lib/gcc/x86_64-pc-cygwin/4.8.0/include
 /ext/redhat/x86_64-pc-cygwin/bin/../lib/gcc/x86_64-pc-cygwin/4.8.0/include-fixed
 /ext/redhat/x86_64-pc-cygwin/bin/../lib/gcc/x86_64-pc-cygwin/4.8.0/../../../../x86_64-pc-cygwin/include
 /ext/redhat/x86_64-pc-cygwin/bin/../lib/gcc/x86_64-pc-cygwin/4.8.0/../../../../x86_64-pc-cygwin/lib/../lib/../include/w32api
End of search list.
GNU C (GCC) version 4.8.0 20130215 (experimental) (x86_64-pc-cygwin)
        compiled by GNU C version 4.7.2 20120921 (Red Hat 4.7.2-2),
GMP version 5.1.1, MPFR version 3.1.1, MPC version 1.0.1
GGC heuristics: --param ggc-min-expand=30 --param
ggc-min-heapsize=4096
Compiler executable checksum: 8527d13c6ece457755a7b6c7f6b2537a
COLLECT_GCC_OPTIONS='-v' '-mtune=generic' '-march=x86-64'
 /ext/redhat/x86_64-pc-cygwin/bin/../lib/gcc/x86_64-pc-cygwin/4.8.0/../../../../x86_64-pc-cygwin/bin/as
-o /tmp/cc1q3fg5.o /tmp/cc3VMFP7.s
COMPILER_PATH=/ext/redhat/x86_64-pc-cygwin/bin/../libexec/gcc/x86_64-pc-cygwin/4.8.0/:/ext/redhat/x86_64-pc-cygwin/bin/../libexec/gcc/:/ext/redhat/x86_64-pc-cygwin/bin/../lib/gcc/x86_64-pc-cygwin/4.8.0/../../../../x86_64-pc-cygwin/bin/
LIBRARY_PATH=/ext/redhat/x86_64-pc-cygwin/bin/../lib/gcc/x86_64-pc-cygwin/4.8.0/:/ext/redhat/x86_64-pc-cygwin/bin/../lib/gcc/:/ext/redhat/x86_64-pc-cygwin/bin/../lib/gcc/x86_64-pc-cygwin/4.8.0/../../../../x86_64-pc-cygwin/lib/../lib/:/ext/redhat/x86_64-pc-cygwin/bin/../lib/gcc/x86_64-pc-cygwin/4.8.0/../../../../x86_64-pc-cygwin/lib/
COLLECT_GCC_OPTIONS='-v' '-mtune=generic' '-march=x86-64'
 /ext/redhat/x86_64-pc-cygwin/bin/../libexec/gcc/x86_64-pc-cygwin/4.8.0/collect2
-m i386pep --wrap _Znwj --wrap _Znaj --wrap _ZdlPv --wrap _ZdaPv
--wrap _ZnwjRKSt9nothrow_t --wrap _ZnajRKSt9nothrow_t --wrap
_ZdlPvRKSt9nothrow_t --wrap _ZdaPvRKSt9nothrow_t -Bdynamic
--dll-search-prefix=cyg -tsaware
/ext/redhat/x86_64-pc-cygwin/bin/../lib/gcc/x86_64-pc-cygwin/4.8.0/../../../../x86_64-pc-cygwin/lib/../lib/crt0.o
/ext/redhat/x86_64-pc-cygwin/bin/../lib/gcc/x86_64-pc-cygwin/4.8.0/crtbegin.o
-L/ext/redhat/x86_64-pc-cygwin/bin/../lib/gcc/x86_64-pc-cygwin/4.8.0
-L/ext/redhat/x86_64-pc-cygwin/bin/../lib/gcc
-L/ext/redhat/x86_64-pc-cygwin/bin/../lib/gcc/x86_64-pc-cygwin/4.8.0/../../../../x86_64-pc-cygwin/lib/../lib
-L/ext/redhat/x86_64-pc-cygwin/bin/../lib/gcc/x86_64-pc-cygwin/4.8.0/../../../../x86_64-pc-cygwin/lib
/tmp/cc1q3fg5.o -lgcc -lcygwin -ladvapi32 -lshell32 -luser32
-lkernel32 -lgcc
/ext/redhat/x86_64-pc-cygwin/bin/../lib/gcc/x86_64-pc-cygwin/4.8.0/crtend.o
/ext/redhat/x86_64-pc-cygwin/bin/../lib/gcc/x86_64-pc-cygwin/4.8.0/../../../../x86_64-pc-cygwin/bin/ld:
cannot find -ladvapi32
/ext/redhat/x86_64-pc-cygwin/bin/../lib/gcc/x86_64-pc-cygwin/4.8.0/../../../../x86_64-pc-cygwin/bin/ld:
cannot find -lshell32
/ext/redhat/x86_64-pc-cygwin/bin/../lib/gcc/x86_64-pc-cygwin/4.8.0/../../../../x86_64-pc-cygwin/bin/ld:
cannot find -luser32
/ext/redhat/x86_64-pc-cygwin/bin/../lib/gcc/x86_64-pc-cygwin/4.8.0/../../../../x86_64-pc-cygwin/bin/ld:
cannot find -lkernel32
collect2: error: ld returned 1 exit status


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]