Bug 1738 - More shared library problems on HP-UX
Summary: More shared library problems on HP-UX
Status: CLOSED FIXED
Alias: None
Product: Samba 3.0
Classification: Unclassified
Component: Build environment (show other bugs)
Version: 3.0.6
Hardware: PA-RISC HP-UX
: P3 major
Target Milestone: none
Assignee: Tim Potter
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks: 1741
  Show dependency treegraph
 
Reported: 2004-09-08 08:17 UTC by Richard Allen
Modified: 2005-08-24 10:19 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Allen 2004-09-08 08:17:47 UTC
More on the quest to get samba to compile with shared libraries under HP-UX.
This time it's the DYNEXP variable which is set to "-Wl,-E"  Those switches are
for cc and make cc instruct ld to add the "-E" switch to the linker commandline.
That switch in turn exports symbols from shared libraries.

Here is where the plot thickens.   The only place where DYNEXP is actually used
is on cc commands that are linking binaries like smbd, nmbd, net and so forth.
Apparently that doesnt matter, but I dont see why exporting symbols from
executables is necessary.
All the shared libs included in the package are linked with $SHLD and a very
similar commandline and wotk fine.    Only exception is libsmbclient.sl
which adds DYNEXP to the commandline of ld.
Again ld doesnt like the -Wl prefix and fails linking.

Proposed patch:
--- samba-3_0.orig/source/Makefile.in   2004-09-08 00:38:21.000000000 +0000
+++ samba-3_0/source/Makefile.in        2004-09-08 14:45:31.000000000 +0000
@@ -989,8 +989,8 @@

 bin/libsmbclient.@SHLIBEXT@: $(LIBSMBCLIENT_PICOBJS)
        @echo Linking libsmbclient shared library $@
-       @$(SHLD) $(LDSHFLAGS) -o $@ $(LIBSMBCLIENT_PICOBJS) $(LDFLAGS) $(DYNEXP)
$(LIBS) \
-               $(KRB5LIBS) $(LDAP_LIBS) \
+       @$(SHLD) $(LDSHFLAGS) -o $@ $(LIBSMBCLIENT_PICOBJS) $(LIBS) \
+               $(KRB5LIBS) $(LDAP_LIBS) -lc \
                @SONAMEFLAG@`basename $@`.$(LIBSMBCLIENT_MAJOR)

 bin/libsmbclient.a: $(LIBSMBCLIENT_PICOBJS)
Comment 1 Richard Allen 2004-09-08 10:48:36 UTC
Forgot to mention that this bugreport is against the 3.0.7 code in SVN (Rev. 2248)
Comment 2 Tim Potter 2004-09-13 18:53:00 UTC
There's a larger issue of why we are using $(CC) to link instead of $(LD).  I
don't think this bug can be fixed without figuring this out.  As you mention,
under HPUX $(DYNEXP) is used when calling both $(CC) and $(LD).
Comment 3 Richard Allen 2004-09-13 19:31:27 UTC
Prehaps it's wise to begin with investigating if $(DYNEXP) is even necessary
when linking the executables.  If it turns out to be not useful we can continue
to use $(CC) without $(DYNEXP) to link executables and switch Shared library
creation over to use $(LD) with $(DYNEXP)

I'm going to test this idea on the platforms I have access to.
Comment 4 Tim Potter 2004-09-30 19:48:31 UTC
I'm pretty sure this is fixed now.  Please re-open if there are still any problems.
Comment 5 Gerald (Jerry) Carter (dead mail address) 2005-08-24 10:19:48 UTC
sorry for the same, cleaning up the database to prevent unecessary reopens of bugs.