Bug 1731 - Shared library test broken
Summary: Shared library test broken
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:
 
Reported: 2004-09-07 21:23 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-07 21:23:32 UTC
First off this bug refers to the 3.0.7 code in SVN

There is a problem in configure.in regarding the Compiler flags to create shared
libraries for HP-UX and most likly more platforms.
I've been chasing these problems down and I found the problem to be that
configure used cc to link the library instead of ld.
This meant that using HP's ANSI C compiler there are ways to pass arguments to
the linker via the -Wl switch on cc's commandline.
I created a patch and submitted that changed the LDSHFLAGS variable so configure
ran correctly.
This patch has been entered into SVN.
Once the shared libratries began to compile, various other problems where found
and they took quite some doing to fix on my part.  However once they where done
and the first shared library got linked I discover that the Makefiles do not use
cc to link libraries like configure does but ld and rightly so.
This however makes LDSHFLAGS invalid since there is no need to pass ld options
via the -Wl switch to ld any more.

After discussing this with tpot on #Samba-Technical I realize that fixing
configure is a big change so close to the 3.0.7 release so I propose the
following patch for this bug:

<pre>
--- samba-3_0.orig/source/configure.in  2004-09-08 00:39:21.000000000 +0000
+++ samba-3_0/source/configure.in       2004-09-08 03:55:10.000000000 +0000
@@ -1216,7 +1216,7 @@
                        if test $ac_cv_prog_cc_Ae = yes; then
                                BLDSHARED="true"
                                SHLD="/usr/bin/ld"
-                               LDSHFLAGS="-b -Wl,-B,symbolic,-b,-z"
+                               LDSHFLAGS="-B symbolic -b -z"
                                SONAMEFLAG="+h "
                                PICFLAGS="+z"
                        elif test "${GCC}" = "yes"; then
@@ -1306,9 +1306,18 @@
    # try building a trivial shared library
    $CC $CPPFLAGS $CFLAGS $PICFLAGS -c -o \
        shlib.$PICSUFFIX ${srcdir-.}/tests/shlib.c && \
-       $CC $CPPFLAGS $CFLAGS `eval echo $LDSHFLAGS` -o "shlib.$SHLIBEXT" \
-       shlib.$PICSUFFIX && \
-       ac_cv_shlib_works=yes
+   case "$host_os" in
+       *hpux*)
+               $SHLD `eval echo $LDSHFLAGS` -o "shlib.$SHLIBEXT"
shlib.$PICSUFFIX && \
+                       ac_cv_shlib_works=yes
+               ;;
+       *)
+               $CC $CPPFLAGS $CFLAGS `eval echo $LDSHFLAGS` -o "shlib.$SHLIBEXT" \
+               shlib.$PICSUFFIX && \
+               ac_cv_shlib_works=yes
+               ;;
+   esac
+
    rm -f "shlib.$SHLIBEXT" shlib.$PICSUFFIX
 ])
 if test $ac_cv_shlib_works = no; then


This way we fix HP-UX without risking any problems with other platforms.
As it stands now, no shared libraries are possible on HP-UX.
Comment 1 Richard Allen 2004-09-07 21:34:07 UTC
Oh, I forgot to mention that my patch that was added to SVN also fixed nasty
compiler warnings due to bugs in HP's files in /usr/include.
That part of the patch is still very valid.
Comment 2 Richard Allen 2004-09-08 10:49:26 UTC
Exact SVN version I've been working on is 2248
Comment 3 Tim Potter 2004-09-08 15:37:37 UTC
According to Jerry the 3.0.7 is going to be a stability release (i.e fixes for
bad bugs in 3.0.6) with very few new features.  Basically anything that is not
already in the release branch isn't going to make it.

I propose we make the correct fix by changing the second $CC to $SHLD in the
trunk and 3.0 branches, work out the bugs in the other architectures over time
and wait for 3.0.8 to come around.
Comment 4 Tim Potter 2004-09-08 20:34:00 UTC
(Renaming summary to something a bit more relevant)

I am checking in the correct fix (replace $CC with $SHLD) into the 3.0 branch so
it can hit the build farm but it won't be merged into 3.0.7 as I mentioned before.
Comment 5 Tim Potter 2004-09-08 21:07:59 UTC
Umm - I think the value of LDSHFLAGS is supposed to change now that we use ld
instead of cc for the shared library test.  Is this correct?

The -Wl, bit should be removed at least.
Comment 6 Tim Potter 2004-09-09 02:32:11 UTC
Well the HPUX build farm machine now builds for the first time in ages.  No new
platforms seem to be broken.

However it doesn't look like the nsswitch/winbind_nss_solaris.c file is being
compiled though.
Comment 7 Richard Allen 2004-09-09 02:59:04 UTC
Sad :)    Id say that these HP-UX fixes as I've sent them in have no effects on
other platforms and do fix (serious) problems for HP-UX :)

Sounds like it really fits the bill for 3.0.7 ;)

About nsswitch/winbind_nss_solaris.c, I did put a bug up here about that with a
patch.

Comment 8 Tim Potter 2004-09-13 18:48:53 UTC
Should be fixed now, finally!  I'm expecting this to be in 3.0.8.
Comment 9 Gerald (Jerry) Carter (dead mail address) 2005-08-24 10:19:52 UTC
sorry for the same, cleaning up the database to prevent unecessary reopens of bugs.