32 bit lib dirs on cygwin64, advice sought

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

32 bit lib dirs on cygwin64, advice sought

Jason Pyeron
I feel I am making things way too complicated.

I have a Makefile, which is building a static library [1] in both 32 and 64
bit. The current issue is it creates a static lib (.a file) and installs
both the 32 and 64 to /usr/lib/, which is not working because the 64 and 32
bit lib overwrite each other.

I found the following gcc queries give me the correct target install dir on
cygwin64 [2]:

$ gcc -m64 -print-search-dirs | grep ^libraries | sed 's/^libraries: =//;
s/:/\n/g;' | grep -v ^/usr/lib/gcc | grep -v "^/usr/lib/$(gcc
-dumpmachine)/" | head -n 1
/usr/lib/../lib/

$ gcc -m32 -print-search-dirs | grep ^libraries | sed 's/^libraries: =//;
s/:/\n/g;' | grep -v ^/usr/lib/gcc | grep -v "^/usr/lib/$(gcc
-dumpmachine)/" | head -n 1
/usr/lib/../lib32/

My Google fu has failed to identify a more simple method for identifying the
"32 bit" lib dir with regards to the 64 bit gcc.

For now I am going to hard code the /usr/lib32/ in the Makefile on target
ia32 for cygwin64.

Obviously the ability for compiling 64 bin on cygwin 32 bit is a non-issue
because of the following gcc [3] error: "sorry, unimplemented: 64-bit mode
not compiled in"

Thanks!

Jason Pyeron

1: GNU EFI - https://github.com/pdinc-oss/gnu-efi/tree/cygwin-fixes

2: $ cygcheck -cd  | egrep '^(Cygwin|Package|cygwin |gcc-core)'
Cygwin Package Information
Package                  Version
cygwin                   2.5.1-1
gcc-core                 5.3.0-5

3: $ cygcheck -cd  | egrep '^(Cygwin|Package|cygwin |gcc-core)'
Cygwin Package Information
Package                                  Version
cygwin                                   2.4.1-1
gcc-core                                 4.9.3-1

--
410-424-5524
Jason Pyeron
PMC Member
CipherShed
www.ciphershed.org


--
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 | Threaded
Open this post in threaded view
|

Re: 32 bit lib dirs on cygwin64, advice sought

Achim Gratz
Jason Pyeron <jpyeron <at> pdinc.us> writes:
> I feel I am making things way too complicated.
>
> I have a Makefile, which is building a static library [1] in both 32 and 64
> bit. The current issue is it creates a static lib (.a file) and installs
> both the 32 and 64 to /usr/lib/, which is not working because the 64 and 32
> bit lib overwrite each other.

No, it's not working because on Cygwin64 there are no 32bit libraries at all
and no 64bit libraries on Cygwin32, vice-versa.

> For now I am going to hard code the /usr/lib32/ in the Makefile on target
> ia32 for cygwin64.

Whatever you are trying to do there, you will likely need to use a
cross-compiler.  In any case the result is completely useless on Cygwin64,
so you might just as well not build it in the first place.


Regards,
Achim.




--
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 | Threaded
Open this post in threaded view
|

Re: 32 bit lib dirs on cygwin64, advice sought

Warren Young-2
In reply to this post by Jason Pyeron
On May 29, 2016, at 6:30 PM, Jason Pyeron <[hidden email]> wrote:
>
> I feel I am making things way too complicated.

Yes. :)

> I have a Makefile, which is building a static library [1] in both 32 and 64
> bit.

Don’t do that.  The 32-bit and 64-bit Cygwins are fundamentally incompatible:

  http://stackoverflow.com/a/18333049

If you must do 32- and 64-bit Cygwin development on a single machine, it’s best to have separate 32- and 64-bit Cygwin installations which do not share any files.

I’ll add one exception to that, which is that it is fine to share a tree for building packages with cygport between two Cygwins since it knows how to segregate the build products for you.  It is possible to do this by hand, too, but it’s enough of a hassle that you could easily skip a step and end up commingling binaries of different word size, causing yourself problems.
--
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