Bug 6637

Summary: Would be nice to support --enable-shared=gnat
Product: gcc Reporter: Joseph S. Myers <jsm28>
Component: adaAssignee: Not yet assigned to anyone <unassigned>
Status: RESOLVED FIXED    
Severity: enhancement CC: charlet, gcc-bugs
Priority: P2 Keywords: build
Version: 3.2   
Target Milestone: 4.0.0   
Host: i686-pc-linux-gnu Target: i686-pc-linux-gnu
Build: i686-pc-linux-gnu Known to work:
Known to fail: Last reconfirmed: 2004-05-22 23:09:53

Description Joseph S. Myers 2002-05-11 14:56:00 UTC
As recently discussed on the gcc list, the Ada libraries do not honour
--enable-shared, instead using another (undocumented) mechanism to
build shared libraries.

They should honour --enable-shared, as other libraries do.  They
should also honour --enable-shared=package, with an appropriate
package name (which should be listed in the --enable-shared
documentation), so that, as with other libraries, the use of shared
libraries for them can be controlled independently from that for other
libraries.  The default for them should be documented there, and
should probably default to shared libraries being enabled, as with
most other language libraries.  Shared libraries should be installed
in $(libdir).  Any of the Ada programs that link against the libraries
should (in the installed versions) be linked against the shared
libraries.

When shared libraries are disabled, dead symlinks libgnarl.so and
libgnat.so should not be installed, although they are at present.

This is related to Zack's PR ada/5910 (that no separate "make
gnatlib_and_tools" should be needed); in both cases the normal
"configure" and "make bootstrap" interface to the build should be
followed, and additional user-visible complexity for Ada should be
avoided.

Release:
3.2 20020510 (experimental)

Environment:
System: Linux digraph 2.2.20 #2 Sat Nov 10 16:44:22 UTC 2001 i686 unknown
Architecture: i686

	
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: ../gcc-cvs/configure --prefix=/opt/gcc/mainline --disable-shared --enable-threads=posix --with-system-zlib
Comment 1 Andrew Pinski 2003-08-16 03:46:21 UTC
Ada should really be reorgized.
Comment 2 Arnaud Charlet 2003-10-21 13:47:12 UTC
<<
When shared libraries are disabled, dead symlinks libgnarl.so and
libgnat.so should not be installed, although they are at present.
>>

This issue is fixed with the recent Ada merge.

Arno
Comment 3 Arnaud Charlet 2003-10-21 17:00:19 UTC
The remaining issue is not directly related to PR 5910 (or 5911),
so I am removing the dependency to avoid confusion.

Arno
Comment 4 CVS Commits 2003-10-27 14:03:46 UTC
Subject: Bug 6637

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	libada-branch
Changes by:	charlet@gcc.gnu.org	2003-10-27 14:03:42

Modified files:
	libada         : ChangeLog Makefile.in configure configure.in 

Log message:
	PR ada/6637, ada/5911
	* configure.in: Add support for --enable/disable-shared
	* Makefile.in: Add initial, simple support for gnatlib/gnattools
	for native and cross configurations.
	* configure: Regenerate

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libada/ChangeLog.diff?cvsroot=gcc&only_with_tag=libada-branch&r1=1.1.2.3&r2=1.1.2.4
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libada/Makefile.in.diff?cvsroot=gcc&only_with_tag=libada-branch&r1=1.1.2.1&r2=1.1.2.2
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libada/configure.diff?cvsroot=gcc&only_with_tag=libada-branch&r1=1.1.2.2&r2=1.1.2.3
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libada/configure.in.diff?cvsroot=gcc&only_with_tag=libada-branch&r1=1.1.2.2&r2=1.1.2.3

Comment 5 Dara Hazeghi 2003-12-09 18:53:39 UTC
Arno, I see you committed a fix for this to the libada-branch. Are there plans to merge libada-
branch into mainline before 3.4 goes out?
Comment 6 charlet 2003-12-09 22:09:31 UTC
Subject: Re:  Ada libraries should honour --enable-shared

> Arno, I see you committed a fix for this to the libada-branch. Are there plans to merge libada-
> branch into mainline before 3.4 goes out?

Not at this time. We discussed it with Mark, and felt that this was
not important enough to warrant an inclusion before 3.5

Arno
Comment 7 CVS Commits 2004-02-10 10:44:19 UTC
Subject: Bug 6637

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	charlet@gcc.gnu.org	2004-02-10 10:44:14

Added files:
	libada         : ChangeLog Makefile.in configure configure.in 

Log message:
	2003-02-10  Arnaud Charlet  <charlet@act-europe.fr>
	
	PR ada/6637, PR ada/5911
	* configure.in, Makefile.in, configure: Merge with libada-branch

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libada/ChangeLog.diff?cvsroot=gcc&r1=1.1&r2=1.2
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libada/Makefile.in.diff?cvsroot=gcc&r1=1.1&r2=1.2
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libada/configure.diff?cvsroot=gcc&r1=1.1&r2=1.2
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libada/configure.in.diff?cvsroot=gcc&r1=1.1&r2=1.2

Comment 8 CVS Commits 2004-02-10 10:51:38 UTC
Subject: Bug 6637

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	charlet@gcc.gnu.org	2004-02-10 10:51:33

Modified files:
	gcc/ada        : ChangeLog config-lang.in 

Log message:
	PR ada/6637, PR ada/5911
	Merge with libada-branch:
	* config-lang.in: Build libada only when ada is built.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ada/ChangeLog.diff?cvsroot=gcc&r1=1.445&r2=1.446
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ada/config-lang.in.diff?cvsroot=gcc&r1=1.9&r2=1.10

Comment 9 CVS Commits 2004-02-10 10:54:54 UTC
Subject: Bug 6637

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	charlet@gcc.gnu.org	2004-02-10 10:54:48

Modified files:
	.              : configure.in configure Makefile.def Makefile.in 
	                 ChangeLog 

Log message:
	PR ada/6637, PR ada/5911
	Merge with libada-branch:
	* configure.in, Makefile.tpl, Makefile.def: Add target-libada,
	with appropriate dependencies. Add --enable-libada configure switch.
	* configure, Makefile.in: Regenerate.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/configure.in.diff?cvsroot=gcc&r1=1.267&r2=1.268
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/configure.diff?cvsroot=gcc&r1=1.127&r2=1.128
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/Makefile.def.diff?cvsroot=gcc&r1=1.12&r2=1.13
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/Makefile.in.diff?cvsroot=gcc&r1=1.196&r2=1.197
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/ChangeLog.diff?cvsroot=gcc&r1=1.865&r2=1.866

Comment 10 Arnaud Charlet 2004-02-10 11:01:51 UTC
--enable-shared is now supported.

It would be nice to also support --enable-shared=gnat as suggested in this PR.
It shouldn't be too hard to implement for someone that knows the gcc
configure well (which is not my case) now that the libada-branch has been
merged.

So keeping this PR open for this remaining issue.

Arno
Comment 11 Joseph S. Myers 2004-02-10 17:07:54 UTC
Subject: Re:  Ada libraries should honour --enable-shared

On Tue, 10 Feb 2004, charlet at gcc dot gnu dot org wrote:

> It would be nice to also support --enable-shared=gnat as suggested in this PR.
> It shouldn't be too hard to implement for someone that knows the gcc
> configure well (which is not my case) now that the libada-branch has been
> merged.
> 
> So keeping this PR open for this remaining issue.

Also:

The shared libraries should go in $(libdir), not somewhere under
libsubdir, so the dynamic linker can find them by default without needing
an rpath.

The installed Ada programs should be linked against the shared libraries
if possible.

Comment 12 Arnaud Charlet 2004-06-08 10:49:10 UTC
mainline now supports enable-shared=ada|libada

Arno
Comment 13 Joseph S. Myers 2004-06-08 19:15:35 UTC
Subject: Re:  Would be nice to support --enable-shared=gnat

On Tue, 8 Jun 2004, charlet at gcc dot gnu dot org wrote:

> mainline now supports enable-shared=ada|libada

Thanks - but I don't see the documentation for this in install.texi.

Are the other issues listed in the original PR - that the shared libraries
should go in $(libdir) not $(libsubdir), and that any installed Ada
programs using the libraries should be linked against the shared libraries
rather than the static versions - now fixed, or would you like separate
PRs opened for each of those issues?  I think everything else listed is
definitely working fine (or was before the tree-ssa merge).

(Linking installed programs against the shared libraries is on the general
principle that all programs should be linked against shared rather than
static libraries except in a few cases where something needs to work when
the system shared libraries may be broken, e.g. ldconfig.  But given that
testing programs linked against new shared libraries, and handling
multi-stage bootstrap in such a configuration, is harder than with static
linking, I realise doing so may be lower priority.)

Comment 14 charlet 2004-06-08 21:20:25 UTC
Subject: Re:  Would be nice to support --enable-shared=gnat

> Thanks - but I don't see the documentation for this in install.texi.

I guess the person who implemented this forgot this part :-)

Could you give a pointer/location as to where this should be added ?

For the other issues, please open separate PRs, thanks.

Arno
Comment 15 Joseph S. Myers 2004-06-08 21:25:17 UTC
Subject: Re:  Would be nice to support --enable-shared=gnat

On Tue, 8 Jun 2004, charlet at act-europe dot fr wrote:

> > Thanks - but I don't see the documentation for this in install.texi.
> 
> I guess the person who implemented this forgot this part :-)
> 
> Could you give a pointer/location as to where this should be added ?

In the documentation of --enable-shared, where it says "Package names
currently recognized in the GCC tree are ...".

Comment 16 CVS Commits 2004-06-09 08:42:35 UTC
Subject: Bug 6637

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	charlet@gcc.gnu.org	2004-06-09 08:42:27

Modified files:
	gcc            : ChangeLog 
	gcc/doc        : install.texi 

Log message:
	PR ada/6637
	* doc/install.texi: List ada, libada as options to --enable-shared

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.3885&r2=2.3886
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/doc/install.texi.diff?cvsroot=gcc&r1=1.283&r2=1.284