Bug 853866 - Libraries built with GPRbuild 2011 don't initialize.
Libraries built with GPRbuild 2011 don't initialize.
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: gprbuild (Show other bugs)
18
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Pavel Zhukov
Fedora Extras Quality Assurance
: Reopened
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-09-03 03:45 EDT by Björn Persson
Modified: 2012-12-19 00:58 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-12-19 00:58:23 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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

  None (edit)
Description Björn Persson 2012-09-03 03:45:56 EDT
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 13:57:03 EDT
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 09:26:47 EST
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 03:38:52 EST
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 14:13:40 EST
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.