Skip Menu |
 

Subject: Creation of shared libraries ignore --with-ldopts
Cc: Jim Barlow <jbarlow@ncsa.uiuc.edu>
The creation of shared libraries hardcode the arguments to ld
without allowing a user to specify possibly ABI specific information.

The particular user (Jim Barlow), is on a 64bit IRIX machine. By default
the C compiler is generating -64 libraries. He has a desire to
generate -n32 libraries (probably for 32bit machines to be able to execute
the same code). --with-ldopts is honored in the linking of the executables
(and presumably he is using --with-ccopts as well) - but
the options are not used in the creation of the shared libraries.

There are two possible fixes:

a) config/lib.in: Change the invocation of LDCOMBINE in the creation
of the library to include $(LDFLAGS)

This would make the --ldopts a global change for all architectures.

b) aclocal.m4 (1.2 series)/ config/shlib.conf (1.3 development branch)
For the specific architectures that might want to override the
shared library creation - add $(LDFALGS) to the LDCOMBINE definitions.

This would be an architecture specific change.


Personally - I would lean towards (a)
To: rt-comment@krbdev.mit.edu
Subject: Re: [krbdev.mit.edu #1261] Creation of shared libraries ignore --with-ldopts
From: Tom Yu <tlyu@mit.edu>
Date: Fri, 15 Nov 2002 19:29:58 -0500
RT-Send-Cc:
Show quoted text
>>>>> "Ezra" == Ezra Peisach via RT <rt-comment@krbdev.mit.edu> writes:

Show quoted text
Ezra> a) config/lib.in: Change the invocation of LDCOMBINE in the creation
Ezra> of the library to include $(LDFLAGS)

Show quoted text
Ezra> This would make the --ldopts a global change for all architectures.

One possible problem with this is that LDFLAGS is meant to be used
during program link time. It is therefore intended to be suitable for
passing to the compiler driver. Different architectures vary as to
whether they use ld or $(CC) to build shared libraries, and we'd have
to account for the possibility that LDFLAGS that are suitable for the
compiler driver might not be suitable for ld.

---Tom
To: rt-comment@krbdev.mit.edu
Cc: krb5-prs@mit.edu
Subject: Re: [krbdev.mit.edu #1261] Creation of shared libraries ignore --with-ldopts
From: Sam Hartman <hartmans@mit.edu>
Date: Thu, 21 Nov 2002 10:02:43 -0500
RT-Send-Cc:
Show quoted text
>>>>> "Tom" == Tom Yu via RT <rt-comment@krbdev.mit.edu> writes:

Show quoted text
>>>>> "Ezra" == Ezra Peisach via RT <rt-comment@krbdev.mit.edu> writes:

Show quoted text
Ezra> a) config/lib.in: Change the invocation of LDCOMBINE in the
Ezra> creation of the library to include $(LDFLAGS)

Show quoted text
Ezra> This would make the --ldopts a global change for all
Ezra> architectures.

Show quoted text
Tom> One possible problem with this is that LDFLAGS is meant to be
Tom> used during program link time. It is therefore intended to
Tom> be suitable for passing to the compiler driver. Different
Tom> architectures vary as to whether they use ld or $(CC) to
Tom> build shared libraries, and we'd have to account for the
Tom> possibility that LDFLAGS that are suitable for the compiler
Tom> driver might not be suitable for ld.

I contend it is almost always wrong to use ld to build shared libraries:

* cc may link against aditional libraries that are required (see
hppa/linux--using ld is guaranteed to fail)

* cc may need to include additional flags that may change over time.