public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* ada gnat import library missing ?
@ 2017-10-28 14:37 Marco Atzeri
  2017-10-30  9:56 ` JonY
  0 siblings, 1 reply; 10+ messages in thread
From: Marco Atzeri @ 2017-10-28 14:37 UTC (permalink / raw)
  To: cygwin

Jon,
the simple hello program
https://gcc.gnu.org/onlinedocs/gnat_ugn/Running-a-Simple-Ada-Program.html

with shared option fails

$ gnatbind -v -shared hello 
gnatbind -v -shared hello
GNATBIND 6.4.0
Copyright (C) 1995-2016, Free Software Foundation, Inc.
Binding: hello.ali
No errors

$ gnatlink -v -shared hello
GNATLINK 6.4.0
Copyright (C) 1995-2016, Free Software Foundation, Inc.
gcc -c -mtune=generic -march=x86-64 -gnatA -gnatWb -gnatiw -gnatws 
/tmp/ada/b~hello.adb
/usr/bin/gcc.exe b~hello.o ./hello.o -shared -o hello.exe -L./ 
-L/usr/lib/gcc/x86_64-pc-cygwin/6.4.0/adalib/ -lgnat-6 
-Wl,--stack=0x2000000 -shared-libgcc
/usr/lib/gcc/x86_64-pc-cygwin/6.4.0/../../../../x86_64-pc-cygwin/bin/ld: 
cannot find -lgnat-6
collect2: error: ld returned 1 exit status
gnatlink: error when calling /usr/bin/gcc.exe


as I do not find any import library for
/usr/bin/cyggnat-6.dll

can you check ?

Regards
Marco

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: ada gnat import library missing ?
  2017-10-28 14:37 ada gnat import library missing ? Marco Atzeri
@ 2017-10-30  9:56 ` JonY
  2017-10-30 14:15   ` Marco Atzeri
  0 siblings, 1 reply; 10+ messages in thread
From: JonY @ 2017-10-30  9:56 UTC (permalink / raw)
  To: cygwin


[-- Attachment #1.1: Type: text/plain, Size: 1199 bytes --]

On 10/28/2017 02:37 PM, Marco Atzeri wrote:
> Jon,
> the simple hello program
> https://gcc.gnu.org/onlinedocs/gnat_ugn/Running-a-Simple-Ada-Program.html
> 
> with shared option fails
> 
> $ gnatbind -v -shared hello gnatbind -v -shared hello
> GNATBIND 6.4.0
> Copyright (C) 1995-2016, Free Software Foundation, Inc.
> Binding: hello.ali
> No errors
> 
> $ gnatlink -v -shared hello
> GNATLINK 6.4.0
> Copyright (C) 1995-2016, Free Software Foundation, Inc.
> gcc -c -mtune=generic -march=x86-64 -gnatA -gnatWb -gnatiw -gnatws
> /tmp/ada/b~hello.adb
> /usr/bin/gcc.exe b~hello.o ./hello.o -shared -o hello.exe -L./
> -L/usr/lib/gcc/x86_64-pc-cygwin/6.4.0/adalib/ -lgnat-6
> -Wl,--stack=0x2000000 -shared-libgcc
> /usr/lib/gcc/x86_64-pc-cygwin/6.4.0/../../../../x86_64-pc-cygwin/bin/ld:
> cannot find -lgnat-6
> collect2: error: ld returned 1 exit status
> gnatlink: error when calling /usr/bin/gcc.exe
> 
> 
> as I do not find any import library for
> /usr/bin/cyggnat-6.dll
> 
> can you check ?


Looks like the Makefile neglected to generate the import libs, can you
copy the dll over to see if it links right while I do a new gcc build to
fix this, thanks.


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 858 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: ada gnat import library missing ?
  2017-10-30  9:56 ` JonY
@ 2017-10-30 14:15   ` Marco Atzeri
  2017-10-30 23:18     ` JonY
  0 siblings, 1 reply; 10+ messages in thread
From: Marco Atzeri @ 2017-10-30 14:15 UTC (permalink / raw)
  To: cygwin

On 30/10/2017 10:54, JonY wrote:
> On 10/28/2017 02:37 PM, Marco Atzeri wrote:
>>
>> as I do not find any import library for
>> /usr/bin/cyggnat-6.dll
>>
>> can you check ?
> 
> 
> Looks like the Makefile neglected to generate the import libs, can you
> copy the dll over to see if it links right while I do a new gcc build to
> fix this, thanks.

Hi Jon,
if the idea is to copy
/usr/bin/cyggnat-6.dll as /usr/lib/libgnat-6.dll.a

it links but the program fails

$ ./hello.exe
-bash: ./hello.exe: cannot execute binary file: Exec format error

Regards
Marco

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: ada gnat import library missing ?
  2017-10-30 14:15   ` Marco Atzeri
@ 2017-10-30 23:18     ` JonY
  2017-10-31  6:30       ` Marco Atzeri
  2017-11-01 16:07       ` Marco Atzeri
  0 siblings, 2 replies; 10+ messages in thread
From: JonY @ 2017-10-30 23:18 UTC (permalink / raw)
  To: cygwin


[-- Attachment #1.1: Type: text/plain, Size: 994 bytes --]

On 10/30/2017 02:14 PM, Marco Atzeri wrote:
> On 30/10/2017 10:54, JonY wrote:
>> On 10/28/2017 02:37 PM, Marco Atzeri wrote:
>>>
>>> as I do not find any import library for
>>> /usr/bin/cyggnat-6.dll
>>>
>>> can you check ?
>>
>>
>> Looks like the Makefile neglected to generate the import libs, can you
>> copy the dll over to see if it links right while I do a new gcc build to
>> fix this, thanks.
> 
> Hi Jon,
> if the idea is to copy
> /usr/bin/cyggnat-6.dll as /usr/lib/libgnat-6.dll.a
> 
> it links but the program fails
> 
> $ ./hello.exe
> -bash: ./hello.exe: cannot execute binary file: Exec format error
> 

That's what the ADA Makefile is doing during the build. What does that
error mean in win32 terms? can you run it under cmd with the appropriate
PATHs?

Can you also post your hello world example setup? I don't know much
about ADA.

-2 with the appropriate import libraries should be coming along by the
end of the week if all goes well.



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 858 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: ada gnat import library missing ?
  2017-10-30 23:18     ` JonY
@ 2017-10-31  6:30       ` Marco Atzeri
  2017-11-01 16:07       ` Marco Atzeri
  1 sibling, 0 replies; 10+ messages in thread
From: Marco Atzeri @ 2017-10-31  6:30 UTC (permalink / raw)
  To: cygwin; +Cc: irwin

On 31/10/2017 00:17, JonY wrote:
> On 10/30/2017 02:14 PM, Marco Atzeri wrote:
>> On 30/10/2017 10:54, JonY wrote:
>>> On 10/28/2017 02:37 PM, Marco Atzeri wrote:

> 
> That's what the ADA Makefile is doing during the build. What does that
> error mean in win32 terms? can you run it under cmd with the appropriate
> PATHs?

error 193.
The program has very basic dependency

$ cygcheck ./hello.exe |grep -v "     "
E:\cygwin64\tmp\ada\hello.exe
   E:\cygwin64\bin\cygwin1.dll
     C:\Windows\system32\KERNEL32.dll
   E:\cygwin64\bin\cyggcc_s-seh-1.dll
   E:\cygwin64\bin\cyggnat-6.dll
     C:\Windows\system32\ADVAPI32.dll
     C:\Windows\system32\WS2_32.dll


> Can you also post your hello world example setup? I don't know much
> about ADA.

I know less, but used

https://gcc.gnu.org/onlinedocs/gnat_ugn/Running-a-Simple-Ada-Program.html

  gcc -c hello.adb
  gnatbind -v -shared hello
  gnatlink -v -shared hello


> -2 with the appropriate import libraries should be coming along by the
> end of the week if all goes well.

thanks

Alan will appreciate
https://public.kitware.com/pipermail/cmake/2017-October/066468.html

Regards
Marco

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: ada gnat import library missing ?
  2017-10-30 23:18     ` JonY
  2017-10-31  6:30       ` Marco Atzeri
@ 2017-11-01 16:07       ` Marco Atzeri
  2017-11-02 10:28         ` JonY
  1 sibling, 1 reply; 10+ messages in thread
From: Marco Atzeri @ 2017-11-01 16:07 UTC (permalink / raw)
  To: cygwin

On 31/10/2017 00:17, JonY wrote:

> -2 with the appropriate import libraries should be coming along by the
> end of the week if all goes well.

It is up but I see the same

$ ./hello.exe
  -bash: ./hello.exe: cannot execute binary file: Exec format error

Does it work for you ?

Marco

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: ada gnat import library missing ?
  2017-11-01 16:07       ` Marco Atzeri
@ 2017-11-02 10:28         ` JonY
  2017-11-02 12:13           ` Marco Atzeri
  0 siblings, 1 reply; 10+ messages in thread
From: JonY @ 2017-11-02 10:28 UTC (permalink / raw)
  To: cygwin


[-- Attachment #1.1: Type: text/plain, Size: 484 bytes --]

On 11/01/2017 04:07 PM, Marco Atzeri wrote:
> On 31/10/2017 00:17, JonY wrote:
> 
>> -2 with the appropriate import libraries should be coming along by the
>> end of the week if all goes well.
> 
> It is up but I see the same
> 
> $ ./hello.exe
>  -bash: ./hello.exe: cannot execute binary file: Exec format error
> 
> Does it work for you ?
> 

I think I solved the mystery, this generates a dll instead of an exe,
see the verbose output calling the compiler.




[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 858 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: ada gnat import library missing ?
  2017-11-02 10:28         ` JonY
@ 2017-11-02 12:13           ` Marco Atzeri
  2017-11-02 12:25             ` Arjen Markus
  0 siblings, 1 reply; 10+ messages in thread
From: Marco Atzeri @ 2017-11-02 12:13 UTC (permalink / raw)
  To: cygwin

On 02/11/2017 11:28, JonY wrote:
> On 11/01/2017 04:07 PM, Marco Atzeri wrote:
>> On 31/10/2017 00:17, JonY wrote:
>>
>>> -2 with the appropriate import libraries should be coming along by the
>>> end of the week if all goes well.
>>
>> It is up but I see the same
>>
>> $ ./hello.exe
>>   -bash: ./hello.exe: cannot execute binary file: Exec format error
>>
>> Does it work for you ?
>>
> 
> I think I solved the mystery, this generates a dll instead of an exe,
> see the verbose output calling the compiler.
> 

you are right; "-shared" should be used only on the 2nd step
not on the third.

$ gcc -c hello.adb

$ gnatbind -v -shared hello
gnatbind -v -shared hello
GNATBIND 6.4.0
Copyright (C) 1995-2016, Free Software Foundation, Inc.
Binding: hello.ali
No errors

$ gnatlink -v  hello

GNATLINK 6.4.0
Copyright (C) 1995-2016, Free Software Foundation, Inc.
gcc -c -mtune=generic -march=x86-64 -gnatA -gnatWb -gnatiw -gnatws 
/tmp/ada/b~hello.adb
/usr/bin/gcc.exe b~hello.o ./hello.o -o hello.exe -L./ 
-L/usr/lib/gcc/x86_64-pc-cygwin/6.4.0/adalib/ -lgnat-6 
-Wl,--stack=0x2000000 -shared-libgcc

$ ./hello.exe
Hello WORLD!

$ cygcheck ./hello.exe |grep -v Windows
E:\cygwin64\tmp\ada\hello.exe
   E:\cygwin64\bin\cygwin1.dll
   E:\cygwin64\bin\cyggnat-6.dll
     E:\cygwin64\bin\cyggcc_s-seh-1.dll

Thanks
Marco

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: ada gnat import library missing ?
  2017-11-02 12:13           ` Marco Atzeri
@ 2017-11-02 12:25             ` Arjen Markus
  2017-11-06  5:22               ` Arjen Markus
  0 siblings, 1 reply; 10+ messages in thread
From: Arjen Markus @ 2017-11-02 12:25 UTC (permalink / raw)
  To: Andrey Repin

Hello Marco, Jon,

good to hear this - I will try this updated GNU version within the
context of the PLplot project.

Regards,

Arjen

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: ada gnat import library missing ?
  2017-11-02 12:25             ` Arjen Markus
@ 2017-11-06  5:22               ` Arjen Markus
  0 siblings, 0 replies; 10+ messages in thread
From: Arjen Markus @ 2017-11-06  5:22 UTC (permalink / raw)
  To: Andrey Repin

Hi Marco, Jon,

I have ran a simple test (a "hello, world" program with "static" and
"shared" build options) and that worked fine. The only strange thing
is that it leaves a file ".hello.adb.swp" of around 133 MB. I do not
know if that file is just garbage or whether it is somehow referred to
by the program, but it seems rather odd.

(The tests within the PLplot project are less successful, but that has
to do with the identification of the gnat library by CMake)

Regards,

Arjen

2017-11-02 13:25 GMT+01:00 Arjen Markus <arjen.markus895@gmail.com>:
> Hello Marco, Jon,
>
> good to hear this - I will try this updated GNU version within the
> context of the PLplot project.
>
> Regards,
>
> Arjen

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2017-11-06  5:22 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-28 14:37 ada gnat import library missing ? Marco Atzeri
2017-10-30  9:56 ` JonY
2017-10-30 14:15   ` Marco Atzeri
2017-10-30 23:18     ` JonY
2017-10-31  6:30       ` Marco Atzeri
2017-11-01 16:07       ` Marco Atzeri
2017-11-02 10:28         ` JonY
2017-11-02 12:13           ` Marco Atzeri
2017-11-02 12:25             ` Arjen Markus
2017-11-06  5:22               ` Arjen Markus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).