Bug 853866 - Libraries built with GPRbuild 2011 don't initialize.
Summary: Libraries built with GPRbuild 2011 don't initialize.
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: gprbuild
Version: 18
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Pavel Zhukov
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-09-03 07:45 UTC by Björn Persson
Modified: 2012-12-19 05:58 UTC (History)
1 user (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2012-12-19 05:58:23 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
test case (1.62 KB, application/x-gzip)
2012-11-18 14:26 UTC, Björn Persson
no flags Details

Description Björn Persson 2012-09-03 07:45:56 UTC
Description of problem:
Shared libraries built with GPRbuild 2011 don't initialize and finalize themselves properly. The bug seems to be gone in GPRbuild 2012.

Version-Release number of selected component (if applicable):
2011-4.fc17

How reproducible:
Always.

Steps to Reproduce:
1. Check out zlib-ada from Fedora's Git.
2. Edit the spec to use GPRbuild instead of Gnatmake.
3. Build the package locally and install it.
4. Compile and run one of the demo programs in /usr/share/doc/zlib-ada-devel-*.

Actual results:
All the demo programs raise Zlib_Error because ZLib.Thin.ZLIB_VERSION is uninitialized.

Expected results:
The demo programs work as they should when the library has been compiled with Gnatmake or GPRbuild 2012.

Comment 1 Pavel Zhukov 2012-09-10 17:57:03 UTC
I've added 
   package Linker is
          for Linker_Options use ("-lz");
   end Linker;
to zlib_ada.gpr and recompliled it with gprbuild and then successfully compiled samples
without linker_options I can compile sample with -largs -lz option

$ cat test.gpr 
with "directories";
with "zlib_ada";
project Test is 
    for Main use ("read");
end Test;


$ gprbuild -Ptest  -f 
gcc -c read.adb
gprbind read.bexch
gnatbind read.ali
gcc -c b__read.adb
gcc read.o -lz -o read


$ ./read 
ZLib 1.2.5
Level =-1 100000 -> 8837
Level = 0 100000 -> 100026
Level = 1 100000 -> 9044
Level = 2 100000 -> 9044
Level = 3 100000 -> 9044
Level = 4 100000 -> 8837
Level = 5 100000 -> 8837
Level = 6 100000 -> 8837
Level = 7 100000 -> 8837
Level = 8 100000 -> 8837
Level = 9 100000 -> 8837


gprbuild-2011-4.fc17.x86_64

Comment 2 Björn Persson 2012-11-18 14:26:47 UTC
Created attachment 647184 [details]
test case

I finally got around to writing a test case for this. Unpack the tarball and run the script "run". This is what I get in Fedora 17 with GPRbuild 2011:

Testing initialization of a shared library built with gnatmake:
-a passed to gnatbind: Yes.
"inittestlibinit" mentioned in relocation section: Yes.
Inittestlib is being elaborated.
Global: 2012
Local:  2012
Test PASSED.
Testing initialization of a shared library built with gprbuild:
-a passed to gnatbind: No.
"inittestlibinit" mentioned in relocation section: No.
Global: 0
Local:  2012
Test FAILED.

After installing GPRbuild 2012 I get this:

Testing initialization of a shared library built with gnatmake:
-a passed to gnatbind: Yes.
"inittestlibinit" mentioned in relocation section: Yes.
Inittestlib is being elaborated.
Global: 2012
Local:  2012
Test PASSED.
Testing initialization of a shared library built with gprbuild:
-a passed to gnatbind: Yes.
"inittestlibinit" mentioned in relocation section: Yes.
Inittestlib is being elaborated.
Global: 2012
Local:  2012
Test PASSED.

So, can we hope to see GPRbuild 2012 in Fedora 19?

Comment 3 Pavel Zhukov 2012-12-17 08:38:52 UTC
I've built gprbuild 2012 in rawhide. 

The tests from your attachment completed and passed with Gprbuild-2012. Please test.

Comment 4 Björn Persson 2012-12-18 19:13:40 UTC
I have tested gprbuild-2012-2 on Thulsadoom (Kevin Fenzi's Rawhide test server), and confirmed that this problem is gone.


Note You need to log in before you can comment on or make changes to this bug.