Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Gnat says libraries are not supported.

101 views
Skip to first unread message

Björn Persson

unread,
Jun 20, 2009, 1:56:46 PM6/20/09
to
I have a problem with Gnat of GCC 4.4.0 on Fedora 11. When Gnatmake
encounters a Library_Name attribute in a project file, it says "warning:
libraries are not supported on this platform", and I can't get it to
generate any shared libraries.

Does anyone know what that warning means? That Fedora wouldn't support
libraries is just plain wrong. Has Gnat somehow been built without support
for libraries?

--
Bj�rn Persson
PGP key A88682FD

Ludovic Brenta

unread,
Jun 20, 2009, 5:41:03 PM6/20/09
to

This indicates that GCC was compiled with the wrong version of mlib-
tgt.adb. In GCC 4.4, the proper version was renamed from mlib-tgt-
linux.adb to mlib-tgt-specific-linux.adb. I know because I had to
fix this problem for the Debian package, which is now in the NEW queue
awaiting inspection by an FTP master.

--
Ludovic Brenta.

Björn Persson

unread,
Jun 21, 2009, 10:20:31 AM6/21/09
to
Ludovic Brenta wrote:

> This indicates that GCC was compiled with the wrong version of mlib-
> tgt.adb. In GCC 4.4, the proper version was renamed from mlib-tgt-
> linux.adb to mlib-tgt-specific-linux.adb. I know because I had to
> fix this problem for the Debian package, which is now in the NEW queue
> awaiting inspection by an FTP master.

Thank you Ludovic. Now I can write a good bug report.

Ludovic Brenta

unread,
Jun 22, 2009, 3:35:54 AM6/22/09
to
Björn Persson wrote on comp.lang.ada:

Out of curiosity, does Fedora include GNAT by default or did your
package come from a third party repository?

--
Ludovic Brenta.


Tomek Wałkuski

unread,
Jun 22, 2009, 5:25:44 AM6/22/09
to
On 22 Cze, 09:35, Ludovic Brenta <ludo...@ludovic-brenta.org> wrote:

> Out of curiosity, does Fedora include GNAT by default or did your
> package come from a third party repository?
>

Fedora includes GNAT and GtkAda by default.

Martin Krischik

unread,
Jun 22, 2009, 12:14:00 PM6/22/09
to
Björn Persson schrieb:

> I have a problem with Gnat of GCC 4.4.0 on Fedora 11. When Gnatmake
> encounters a Library_Name attribute in a project file, it says "warning:
> libraries are not supported on this platform", and I can't get it to
> generate any shared libraries.

Funny that you say - the Mac OS X 4.3 says the same.

Martin

--
mailto://kris...@users.sourceforge.net
Ada programming at: http://ada.krischik.com

Tero Koskinen

unread,
Jun 22, 2009, 12:33:38 PM6/22/09
to
On Mon, 22 Jun 2009 18:14:00 +0200 Martin Krischik wrote:

> Björn Persson schrieb:
> > I have a problem with Gnat of GCC 4.4.0 on Fedora 11. When Gnatmake
> > encounters a Library_Name attribute in a project file, it says "warning:
> > libraries are not supported on this platform", and I can't get it to
> > generate any shared libraries.
>
> Funny that you say - the Mac OS X 4.3 says the same.
>
> Martin

I have seen same with GNAT GPL 2008 on Windows and FSF GCC 4.5 on OpenBSD.

The warning comes from gcc/ada/prj-nmsc.adb:
> if Data.Library then
> if Get_Mode = Multi_Language then
> Support_For_Libraries := Data.Config.Lib_Support;
>
> else
> Support_For_Libraries := MLib.Tgt.Support_For_Libraries;
> end if;
>
> if Support_For_Libraries = Prj.None then
> Error_Msg
> (Project, In_Tree,
> "?libraries are not supported on this platform",
> Lib_Name.Location);
> Data.Library := False;
>
> else
...

--
Tero Koskinen - http://iki.fi/tero.koskinen/

John B. Matthews

unread,
Jun 22, 2009, 1:31:48 PM6/22/09
to
In article <4a3f...@news.post.ch>,
Martin Krischik <kris...@users.sourceforge.net> wrote:

> Björn Persson schrieb:
> > I have a problem with Gnat of GCC 4.4.0 on Fedora 11. When Gnatmake
> > encounters a Library_Name attribute in a project file, it says "warning:
> > libraries are not supported on this platform", and I can't get it to
> > generate any shared libraries.
>
> Funny that you say - the Mac OS X 4.3 says the same.

Shared libraries work OK on Mac OS X [1], so I guess it's a limitation
of GNAT project files on the platform.

[1] <http://home.roadrunner.com/~jbmatthews/misc/shared.html>

--
John B. Matthews
trashgod at gmail dot com
<http://sites.google.com/site/drjohnbmatthews>

sjw

unread,
Jun 22, 2009, 4:03:10 PM6/22/09
to
On Jun 22, 5:14 pm, Martin Krischik <krisc...@users.sourceforge.net>
wrote:

> Björn Persson schrieb:
>
> > I have a problem with Gnat of GCC 4.4.0 on Fedora 11. When Gnatmake
> > encounters a Library_Name attribute in a project file, it says "warning:
> > libraries are not supported on this platform", and I can't get it to
> > generate any shared libraries.
>
> Funny that you say - the Mac OS X 4.3 says the same.

gprbuild is quite capable of building shared libraries on (intel) Mac
OS X with both GCC 4.3.3 and GNAT GPL 2009. So is gnatmake so long as
there are only Ada sources.

Where there is an issue is with locating the shared libraries at run
time. GNAT GPL 2009 gets this right - to an extent - but sometimes
it's easier to just set DYLD_LIBRARY_PATH.

Or to use static libraries!

Martin Krischik

unread,
Jun 29, 2009, 5:24:54 AM6/29/09
to
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ludovic Brenta schrieb:

So, how did you fix it?

Martin
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFKSIhjijwKaHyem9cRAicYAKDvilICqjjj4Y9NBcCsWq+uv77GCwCeIYHQ
gsmWpPFFU6sI5CDDvievsKg=
=lYYB
-----END PGP SIGNATURE-----

Ludovic Brenta

unread,
Jun 29, 2009, 6:15:14 AM6/29/09
to
On Jun 29, 11:24 am, Martin Krischik <krisc...@me.com> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Ludovic Brenta schrieb:
>
> > Björn Persson wrote:
> >> I have a problem with Gnat of GCC 4.4.0 on Fedora 11. When Gnatmake
> >> encounters a Library_Name attribute in a project file, it says "warning:
> >> libraries are not supported on this platform", and I can't get it to
> >> generate any shared libraries.
>
> >> Does anyone know what that warning means? That Fedora wouldn't support
> >> libraries is just plain wrong. Has Gnat somehow been built without support
> >> for libraries?
>
> > This indicates that GCC was compiled with the wrong version of mlib-
> > tgt.adb.  In GCC 4.4, the proper version was renamed from mlib-tgt-
> > linux.adb to mlib-tgt-specific-linux.adb.   I know because I had to
> > fix this problem for the Debian package, which is now in the NEW queue
> > awaiting inspection by an FTP master.
>
> So, how did you fix it?

By adjusting the TOOLS_TARGET_PAIRS in src/gcc/ada/gcc-interface/
Makefile.in where mlib-tgt{,-specific} appears. In Debian, this is
actually part of a much larger and invasive patch that builds
libgnatprj, the project manager library used by all GNAT tools and by
GPS, so the TOOLS_TARGET_PAIRS are now in src/libgnatprj/Makefile.in.
(Note that the value of TOOLS_TARGET_PAIRS depends on the target
triplet).

Since the pristine version of src/gcc/ada/gcc-interface/Makefile.in
seems fine, I think the problem on Fedora 11 was triggered by a patch
that was not adjusted for the change from mlib-tgt to mlib-tgt-
specific.

--
Ludovic Brenta.

Björn Persson

unread,
Jul 25, 2009, 2:23:13 PM7/25/09
to
Ludovic Brenta wrote:

> By adjusting the TOOLS_TARGET_PAIRS in src/gcc/ada/gcc-interface/
> Makefile.in where mlib-tgt{,-specific} appears. In Debian, this is
> actually part of a much larger and invasive patch that builds
> libgnatprj, the project manager library used by all GNAT tools and by
> GPS, so the TOOLS_TARGET_PAIRS are now in src/libgnatprj/Makefile.in.
> (Note that the value of TOOLS_TARGET_PAIRS depends on the target
> triplet).
>
> Since the pristine version of src/gcc/ada/gcc-interface/Makefile.in
> seems fine, I think the problem on Fedora 11 was triggered by a patch
> that was not adjusted for the change from mlib-tgt to mlib-tgt-
> specific.

I've finally found the error. It's in gnattools/Makefile.in. It makes
symbolic links pointing to the wrong directory. This is the patch I applied:

--- gnattools/Makefile.in~ 2009-04-14 16:25:44.000000000 +0200
+++ gnattools/Makefile.in 2009-07-25 04:31:38.000000000 +0200
@@ -164,7 +164,7 @@
-(cd $(GCC_DIR)/ada/tools; $(LN_S) ../sdefault.adb .)
-$(foreach PAIR,$(TOOLS_TARGET_PAIRS), \
rm -f $(GCC_DIR)/ada/tools/$(word 1,$(subst <, ,$(PAIR)));\
- $(LN_S) $(fsrcdir)/$(word 2,$(subst <, ,$(PAIR))) \
+ $(LN_S) $(fsrcdir)/ada/$(word 2,$(subst <, ,$(PAIR))) \
$(GCC_DIR)/ada/tools/$(word 1,$(subst <, ,$(PAIR)));)
touch $(GCC_DIR)/stamp-tools

It wasn't caused by a Fedora patch. The error is present in the GCC 4.4.0
release, but it's been fixed in 4.4.1.

I can't see that TOOLS_TARGET_PAIRS in gcc/ada/gcc-interface/Makefile.in is
used for anything. The value of TOOLS_TARGET_PAIRS in gnattools/Makefile.in
most likely comes from gnattools/configure. But the GCC build system is deep
magic to me so I may have missed something.

Tomek Wałkuski

unread,
Jul 25, 2009, 3:22:55 PM7/25/09
to
On 25 Lip, 20:23, Björn Persson <bj...@xn--rombobjrn-67a.se> wrote:
> I've finally found the error. It's in gnattools/Makefile.in. It makes
> symbolic links pointing to the wrong directory. This is the patch I applied:
Have you submited this patch to Fedora?

Ludovic Brenta

unread,
Jul 26, 2009, 6:13:22 AM7/26/09
to
Björn Persson wrote:
> [...] The error is present in the GCC 4.4.0

> release, but it's been fixed in 4.4.1.

That explains why several people saw it on other platforms (OpenBSD
and Mac OS X were mentioned), whereas Debian never had the problem.
The Debian patches hide it by replacing gnattools/Makefile.in almost
completely.

> I can't see that TOOLS_TARGET_PAIRS in gcc/ada/gcc-interface/Makefile.in is
> used for anything. The value of TOOLS_TARGET_PAIRS in gnattools/Makefile.in
> most likely comes from gnattools/configure. But the GCC build system is deep
> magic to me so I may have missed something.

Mmh, that's a good point. I cannot see any references to gcc/ada/gcc-
interface/Makefile.in's TOOLS_TARGET_PAIRS either. I think this is
worth reporting upstream.

--
Ludovic Brenta.

Björn Persson

unread,
Jul 26, 2009, 8:35:27 AM7/26/09
to

Tomek Wałkuski

unread,
Aug 21, 2009, 2:59:56 AM8/21/09
to
Today I got update of gcc-gnat, libgnat and libgnat-devel and problem
is gone.

Björn Persson

unread,
Aug 21, 2009, 5:35:56 AM8/21/09
to
Tomek Wa?kuski wrote:

> Today I got update of gcc-gnat, libgnat and libgnat-devel and problem
> is gone.

And in the changelog there's a reference to
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40166, where I see that the
problem was identified and fixed a month before I first encountered it. I
could have saved a lot of time by searching in GCC Bugzilla. Oh well, it's
easy to be wise after the event.

0 new messages