samba 2.2.5-pre and solaris 9
Juergen Hasch
Hasch at t-online.de
Fri Jun 7 12:55:08 GMT 2002
Am Freitag, 7. Juni 2002 20:12 schrieb Mike Gerdts:
> On Fri, 2002-06-07 at 13:30, Andrew Morgan wrote:
> > It seems like the proper method is to use gcc to do the linking rather
> > than ld, if the compiler is gcc. I remember doing this when I compiled
> > pam_ldap on Solaris 8.
> >
> > If you are using Sun's Workshop compiler, use the linker in
> > /usr/ccs/bin/ld.
> >
> > Andy
>
> But gcc just calls a whatever linker it is supposed to use. That is,
> gcc does not link the object itself, it relies upon an external linker.
> Depending on how gcc was ./configure'd, that linker may be Sun's ld, GNU
> ld, or some other ld.
>
> Looking at the build instructions for gcc 2.95.3
> (gcc-2.95.3/install/SPECIFIC), Sun's ld seems to be quite fine to use
> with gcc (unless compiling c++):
>
> binutils 2.9.1 has known bugs on this platform. We recommend to use
> binutils 2.10 or the vendor tools (Sun as, Sun ld).
>
> Unfortunately, C++ shared libraries, including libstdc++, won't work
> properly if assembled with Sun as: the linker will complain about
> relocations in read-only sections, in the definition of virtual
> tables. Also, Sun as fails to process long symbols resulting from
> mangling template-heavy C++ function names.
>
> The C++ problem does seem to suggest that the use of gnu ld has at least
> one advantage. If only gnu ld supported -R../lib like Sun's ld.
As I am the one who submitted the patch for DYNFLAG="-Wl,-E", it's all my
fault :-)
On my test machine I use gcc and gnu ld. After I read the message on
samba-technical I found a machine which uses /usr/ccs/bin/ld and gcc, so I
can see the problem.
I suggest checking if we use GNU ld:
--- configure.in.orig Wed Jun 5 19:56:19 2002
+++ configure.in Fri Jun 7 21:33:25 2002
@@ -202,7 +202,9 @@
AC_DEFINE(HAVE_VOLATILE)
fi
+dnl Check if we use GNU ld
+LD=ld
+AC_PROG_LD_GNU
AC_CANONICAL_SYSTEM
@@ -858,7 +860,9 @@
SONAMEFLAG="-h "
if test "${GCC}" = "yes"; then
PICFLAG="-fPIC"
- DYNEXP="-Wl,-E"
+ if test "${ac_cv_prog_gnu_ld}" = "yes"; then
+ DYNEXP="-Wl,-E"
+ fi
else
PICFLAG="-KPIC"
## ${CFLAGS} added for building 64-bit shared
How about this ?
...Juergen
More information about the samba-technical
mailing list