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.
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
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?
I've built gprbuild 2012 in rawhide. The tests from your attachment completed and passed with Gprbuild-2012. Please test.
I have tested gprbuild-2012-2 on Thulsadoom (Kevin Fenzi's Rawhide test server), and confirmed that this problem is gone.