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.
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.
Exact SVN version I've been working on is 2248
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.
(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.
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.
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.
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.
Should be fixed now, finally! I'm expecting this to be in 3.0.8.
sorry for the same, cleaning up the database to prevent unecessary reopens of bugs.