Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 25 Nov 2002 05:05:49 +0800 (CST)
From:      Clive Lin <clive@FreeBSD.org>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/45691: Add option to disable samba optimization.
Message-ID:  <200211242105.gAOL5nUK091021@fatpipi.cirx.org>

next in thread | raw e-mail | index | archive | help

>Number:         45691
>Category:       ports
>Synopsis:       Add option to disable samba optimization.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sun Nov 24 13:10:03 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Clive Lin
>Release:        FreeBSD 4.7-RELEASE-p1 i386
>Organization:
tongi.org
>Environment:
System: FreeBSD fatpipi.cirx.org 4.7-RELEASE-p1 FreeBSD 4.7-RELEASE-p1 #1: Mon Oct 28 03:38:43 CST 2002 root@fatpipi.cirx.org:/usr/obj/usr/src/sys/ROSE45 i386
# cc -v
Using builtin specs.
gcc version 2.95.4 20020320 [FreeBSD]

>Description:
	Disable compiling samba with -O flag to get samba functions correctly.
Otherwise samba is easy to get signal (SIGSEGV internally) and exit or core
dump (depends on sysctl kern.sugid_coredump setting) in certain condition.
 
>How-To-Repeat:
	Usually seen on RELENG_4 boxes. On -CURRENT, I haven't seen it. If
a divx/xvid/vosub/etc.. plugins equipped Windows Media Player is used, it's
more easily to trigger this.

>Fix:

diff -ruN samba.orig/Makefile samba/Makefile
--- samba.orig/Makefile	Mon Nov 25 04:20:17 2002
+++ samba/Makefile	Mon Nov 25 03:39:50 2002
@@ -21,6 +19,7 @@
 USE_GMAKE=	YES
 USE_LIBTOOL=	YES
 USE_AUTOCONF=	YES
+USE_REINPLACE=	YES
 
 # directories
 .if !defined(BATCH) && !defined(PACKAGE_BUILDING)
@@ -172,6 +171,9 @@
 .endif
 
 pre-build:
+.if defined(WITHOUT_OPTIMIZATION)
+	${REINPLACE_CMD} -e 's!-O!!g' ${WRKSRC}/Makefile
+.endif
 	${RM} -fr ${WRKSRC}/include/proto.h
 	(cd ${WRKSRC} && make proto)
 
diff -ruN samba.orig/files/patch-configure.in samba/files/patch-configure.in
--- samba.orig/files/patch-configure.in	Thu Jan  1 08:00:00 1970
+++ samba/files/patch-configure.in	Thu Nov  7 17:53:30 2002
@@ -0,0 +1,11 @@
+--- source/configure.in.orig	Thu Nov  7 17:52:42 2002
++++ source/configure.in	Thu Nov  7 17:53:09 2002
+@@ -168,7 +168,7 @@
+ AC_SUBST(LIBSMBCLIENT)
+ 
+ # compile with optimization and without debugging by default
+-CFLAGS="-O ${CFLAGS}"
++CFLAGS="${CFLAGS}"
+ 
+ AC_ARG_ENABLE(debug, 
+ [  --enable-debug          Turn on compiler debugging information (default=no)],
diff -ruN samba.orig/scripts/configure.samba samba/scripts/configure.samba
--- samba.orig/scripts/configure.samba	Thu Jul 11 21:32:55 2002
+++ samba/scripts/configure.samba	Mon Nov 25 03:23:12 2002
@@ -13,7 +13,7 @@
 else
 	/usr/bin/dialog --title "configuration options" --clear \
 		--checklist "\n\
-Please select desired options:" -1 -1 12 \
+Please select desired options:" -1 -1 13 \
 syslog		"With syslog support" OFF \
 ssl		"With ssl support" OFF \
 ldap		"With LDAP2 support" OFF \
@@ -26,6 +26,7 @@
 audit		"With Audit" OFF \
 winbind		"With Winbind" OFF \
 wbauth		"With Winbind Auth Challenge" OFF \
+nooptimize	"Without optimization" OFF \
 2> $tempfile
 
 	retval=$?
@@ -86,6 +87,9 @@
 			;;
 		\"wbauth\")
 			echo "WITH_WINBIND_AUTH_CHALLENGE=YES" >>${WRKDIRPREFIX}${REALCURDIR}/Makefile.inc
+			;;
+		\"nooptimize\")
+			echo "WITHOUT_OPTIMIZATION=YES" >>${WRKDIRPREFIX}${REALCURDIR}/Makefile.inc
 			;;
 		*)
 			echo "Invalid option: $1"


>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200211242105.gAOL5nUK091021>