7169644 math functions in ksh93 behave differently from b15
authorEdwin Beasant <Edwin.Beasant@oracle.com>
Thu, 31 May 2012 09:03:39 -0700
changeset 844 55358dcf0cb2
parent 843 190d2b5889a8
child 845 f38158deaa77
7169644 math functions in ksh93 behave differently from b15 7169642 /usr/bin/shcomp no longer exists
components/ksh93/Makefile
components/ksh93/ksh93.p5m
components/ksh93/patches/build_cflags.patch
components/ksh93/patches/compiler.patch
components/ksh93/patches/disable_dll.patch
components/ksh93/patches/multi_lang_arith.patch
make-rules/attpackagemake.mk
--- a/components/ksh93/Makefile	Thu May 31 08:41:19 2012 -0700
+++ b/components/ksh93/Makefile	Thu May 31 09:03:39 2012 -0700
@@ -56,13 +56,14 @@
 COMPONENT_ARCHIVE_HASH_1= \
     sha256:44ae3913e6c0c8992c6c3cba16864fd4c4a18c6da8e7d87c85a23060cea7cd1a
 COMPONENT_ARCHIVE_URL_1= http://www2.research.att.com/~gsf/download/tgz/$(COMPONENT_ARCHIVE_1)
-COMPONENT_PATCHES_1= solaris_alias.patch build_cflags.patch path_utmp.patch \
+COMPONENT_PATCHES_1= compiler.patch path_utmp.patch\
+					 solaris_alias.patch \
 					 CR6919590.patch CR7033181.patch \
 					 CR7071431.patch CR7036535.patch \
 					 CRXXX_Error_Catalog.patch CR7025778.patch \
 					 CR7065478.patch CR7026179.patch \
 					 CR7065900.patch CR7110983.patch \
-					 CR7105086.patch disable_dll.patch \
+					 CR7105086.patch multi_lang_arith.patch \
 					 CR7057565.patch CR7046434.patch \
 					 CR7032821.patch CR7009897.patch \
 					 CR6964621.patch CR7032068.patch \
@@ -72,8 +73,9 @@
 					 MAP_TYPE_64_Bits.patch CR7167466.patch \
 					 CR7168611.patch
 
-					 
-					 
+# Fixup HOSTTYPE to match uname output and bits
+HOSTTYPE32=sol11.$(shell uname -p)
+HOSTTYPE64=sol11.$(shell uname -p)-64
 
 # Make the unpack of the second archive relocate to a sensible place
 UNPACK_ARGS_1= -r $(COMPONENT_SRC_1)
@@ -89,13 +91,16 @@
 CC.LD.ORIGIN=
 CC.DLL.ORIGIN=
 
+# Fix up the permissions of the compiler wrapper scripts from the patch
+COMPONENT_PRE_BUILD_ACTION=($(CHMOD) +x $(@D)/src/cmd/INIT/cc.sol11.*)
+
 # Prevent nmake from taking over the entire machine
-NPROCS=1
+NPROC=1
 
 # Set the built to build all targets, install all of ast-base, and test ksh93.
 COMPONENT_BUILD_TARGETS += 
 COMPONENT_INSTALL_PACKAGES += ast-base
-COMPONENT_TEST_TARGETS += ksh93
+COMPONENT_TEST_TARGETS = ksh93
 
 # Unpack the ast-base tarball and copy it into the INIT tree,
 # mark it as un-patched 
--- a/components/ksh93/ksh93.p5m	Thu May 31 08:41:19 2012 -0700
+++ b/components/ksh93/ksh93.p5m	Thu May 31 09:03:39 2012 -0700
@@ -50,9 +50,9 @@
     preserve=renameold
 file $(MACH32)/bin/ksh path=usr/bin/$(MACH32)/ksh mode=0555
 file $(MACH32)/bin/shcomp path=usr/bin/$(MACH32)/shcomp mode=0555
-file $(MACH64)/bin/alias path=usr/bin/alias mode=0555
 file $(MACH64)/bin/ksh path=usr/bin/$(MACH64)/ksh mode=0555
 file $(MACH64)/bin/shcomp path=usr/bin/$(MACH64)/shcomp mode=0555
+file $(MACH64)/bin/alias path=usr/bin/alias mode=0555
 file alias.1.ja_JP.UTF-8 path=usr/share/man/ja_JP.UTF-8/man1/alias.1
 file jsh.1.ja_JP.UTF-8 path=usr/share/man/ja_JP.UTF-8/man1/jsh.1
 file ksh.1.ja_JP.UTF-8 path=usr/share/man/ja_JP.UTF-8/man1/ksh.1
@@ -96,6 +96,7 @@
 hardlink path=usr/bin/read target=alias
 hardlink path=usr/bin/rksh target=../lib/isaexec
 hardlink path=usr/bin/rksh93 target=../lib/isaexec
+hardlink path=usr/bin/shcomp target=../lib/isaexec
 hardlink path=usr/bin/test target=alias
 hardlink path=usr/bin/type target=alias
 hardlink path=usr/bin/ulimit target=alias
--- a/components/ksh93/patches/build_cflags.patch	Thu May 31 08:41:19 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-diff -rupN a/src/cmd/cs/Makefile b/src/cmd/cs/Makefile
---- a/src/cmd/cs/Makefile	2000-05-12 20:08:02.000000000 +0000
-+++ b/src/cmd/cs/Makefile	2011-11-02 13:55:16.327160444 +0000
[email protected]@ -22,9 +22,9 @@ pid udp :SERVICE: pid.c
- 
- rsh tcp :SERVICE: rsh.c
- 
--tst-old tcp :SERVICE: CCFLAGS=-g tst-old.c
-+tst-old tcp :SERVICE: CCFLAGS+=-g tst-old.c
- 
--tst tcp :SERVICE: CCFLAGS=-g tst.c
-+tst tcp :SERVICE: CCFLAGS+=-g tst.c
- 
- 6263 tcp :SERVICE: 6263.c
- 
-diff -rupN a/src/cmd/cs/Mamfile b/src/cmd/cs/Mamfile
---- a/src/cmd/cs/Mamfile	2011-02-09 05:47:50.000000000 +0000
-+++ b/src/cmd/cs/Mamfile	2011-11-02 13:31:23.512475642 +0000
[email protected]@ -335,7 +335,7 @@ prev ${PACKAGE_ast_INCLUDE}/cs.h implici
- done tst-old.c
- meta tst-old.o %.c>%.o tst-old.c tst-old
- prev tst-old.c
--exec - ${CC} -g -I${PACKAGE_ast_INCLUDE} -D_PACKAGE_ast -c tst-old.c
-+exec - ${CC}  ${mam_cc_FLAGS} ${CCFLAGS} -g -I${PACKAGE_ast_INCLUDE} -D_PACKAGE_ast -c tst-old.c
- done tst-old.o generated
- exec - ${CC} ${CCLDFLAGS} -g ${LDFLAGS} ${mam_cc_L+-L${INSTALLROOT}/lib} -o tst-old.svc tst-old.o ${mam_libcs} ${mam_libast}
- done tst-old.svc generated
[email protected]@ -350,7 +350,7 @@ meta tst.o %.c>%.o tst.c tst
- prev tst.c
- exec - ${CC} -g -I${PACKAGE_ast_INCLUDE} -D_PACKAGE_ast -c tst.c
- done tst.o generated
--exec - ${CC} ${CCLDFLAGS} -g ${LDFLAGS} ${mam_cc_L+-L${INSTALLROOT}/lib} -o tst.svc tst.o ${mam_libcs} ${mam_libast}
-+exec - ${CC} ${mam_cc_FLAGS} ${CCFLAGS} ${CCLDFLAGS} -g ${LDFLAGS} ${mam_cc_L+-L${INSTALLROOT}/lib} -o tst.svc tst.o ${mam_libcs} ${mam_libast}
- done tst.svc generated
- make 6263.svc
- make 6263.o
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/ksh93/patches/compiler.patch	Thu May 31 09:03:39 2012 -0700
@@ -0,0 +1,52 @@
+diff -rupN INIT.2011-02-08/src/cmd/INIT/cc.sol11.i386-64 INIT.2011-02-08.patched/src/cmd/INIT/cc.sol11.i386-64
+diff -rupN INIT.2011-02-08/src/cmd/INIT/cc.sol11.i386-64 INIT.2011-02-08.patched/src/cmd/INIT/cc.sol11.i386-64
+--- INIT.2011-02-08/src/cmd/INIT/cc.sol11.i386-64	1970-01-01 01:00:00.000000000 +0100
++++ INIT.2011-02-08.patched/src/cmd/INIT/cc.sol11.i386-64	2012-05-18 10:49:31.008310676 +0100
[email protected]@ -0,0 +1,9 @@
++: solaris.i386-64 cc wrapper for reasonable ansi C defaults and 64 bit : 2012-05-18 :
++
++HOSTTYPE=sol11.i386-64
++
++case " $* " in
++*" -dumpmachine "*) echo $HOSTTYPE; exit ;;
++esac
++
++$CC_EXPLICIT -m64 -xc99 -D_XPG6 "[email protected]"
+--- INIT.2011-02-08/src/cmd/INIT/cc.sol11.i386	1970-01-01 01:00:00.000000000 +0100
++++ INIT.2011-02-08.patched/src/cmd/INIT/cc.sol11.i386	2012-05-18 10:49:31.008310676 +0100
[email protected]@ -0,0 +1,9 @@
++: solaris.i386 cc wrapper for reasonable ansi C defaults and 32 bit : 2012-05-18 :
++
++HOSTTYPE=sol11.i386
++
++case " $* " in
++*" -dumpmachine "*) echo $HOSTTYPE; exit ;;
++esac
++
++$CC_EXPLICIT -m32 -xc99 -D_XPG6 "[email protected]"
+diff -rupN INIT.2011-02-08/src/cmd/INIT/cc.sol11.sun4-64 INIT.2011-02-08.patched/src/cmd/INIT/cc.sol11.sun4-64
+--- INIT.2011-02-08/src/cmd/INIT/cc.sol11.sun4-64	1970-01-01 01:00:00.000000000 +0100
++++ INIT.2011-02-08.patched/src/cmd/INIT/cc.sol11.sun4-64	2012-05-18 10:49:20.339537677 +0100
[email protected]@ -0,0 +1,9 @@
++: solaris.sun4-64 cc wrapper for reasonable ansi C defaults and 64 bit : 2012-05-18 :
++
++HOSTTYPE=sol11.sun4-64
++
++case " $* " in
++*" -dumpmachine "*) echo $HOSTTYPE; exit ;;
++esac
++
++$CC_EXPLICIT -m64 -xc99 -D_XPG6 "[email protected]"
+diff -rupN INIT.2011-02-08/src/cmd/INIT/cc.sol11.sun4 INIT.2011-02-08.patched/src/cmd/INIT/cc.sol11.sun4-64
+--- INIT.2011-02-08/src/cmd/INIT/cc.sol11.sun4	1970-01-01 01:00:00.000000000 +0100
++++ INIT.2011-02-08.patched/src/cmd/INIT/cc.sol11.sun4	2012-05-18 10:49:20.339537677 +0100
[email protected]@ -0,0 +1,9 @@
++: solaris.sun4 cc wrapper for reasonable ansi C defaults and 32 bit : 2012-05-18 :
++
++HOSTTYPE=sol11.sun4
++
++case " $* " in
++*" -dumpmachine "*) echo $HOSTTYPE; exit ;;
++esac
++
++$CC_EXPLICIT -m32 -xc99 -D_XPG6  "[email protected]"
--- a/components/ksh93/patches/disable_dll.patch	Thu May 31 08:41:19 2012 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,16 +0,0 @@
-diff -rupN INIT.2011-02-08.clean/src/cmd/ksh93/Makefile INIT.2011-02-08/src/cmd/ksh93/Makefile
---- INIT.2011-02-08.clean/src/cmd/ksh93/Makefile	2012-04-11 17:12:31.210695651 +0100
-+++ INIT.2011-02-08/src/cmd/ksh93/Makefile	2012-04-11 17:19:23.339887285 +0100
[email protected]@ -167,12 +167,6 @@ shell$(RELEASE) $(VERSION) id=shell :LIB
- "sol*.i386*"	:NOOPTIMIZE: main.c
- "win32*"	:NOOPTIMIZE: strdata.c trestore.c
- 
--if CC.HOSTTYPE == "win32*"
--:DLL: $(CC.DEBUG)
--else
--:DLL: $(CC.OPTIMIZE)
--end
--
- :READONLY: $(DATAFILES)
- 
- $(INCLUDEDIR) :INSTALLPROTO: nval.h shell.h history.h
--- a/components/ksh93/patches/multi_lang_arith.patch	Thu May 31 08:41:19 2012 -0700
+++ b/components/ksh93/patches/multi_lang_arith.patch	Thu May 31 09:03:39 2012 -0700
@@ -6,7 +6,7 @@
  			fraction = digits;
  		}
 -		else if (c != thousand)
-+		else if (c != thousand || (c == thousand && decimal == -1)
++		else if (c != thousand || (c == thousand && decimal == -1))
  			break;
  		else if (!(m = digits))
  		{
--- a/make-rules/attpackagemake.mk	Thu May 31 08:41:19 2012 -0700
+++ b/make-rules/attpackagemake.mk	Thu May 31 09:03:39 2012 -0700
@@ -47,21 +47,22 @@
 # Environment variables and arguments passed into the build and install
 # environment(s).  These are the initial settings.
 COMPONENT_BUILD_ENV += \
-	CC="$(CC)" \
-	CCFLAGS="$(CFLAGS)" \
-	CCFLAGS.FORCE="$(CXXFLAGS)" \
-	CC.RUNPATH="$(CC.RUNPATH)" \
-	CC.LD.RUNPATH="$(CC.LD.RUNPATH)" \
-	CC.LD.ORIGIN="$(CC.LD.ORIGIN)" \
-	CC.DLL.ORIGIN="$(CC.DLL.ORIGIN)" \
-	CCLDFLAGS="$(CXXFLAGS)" \
-	LDOPTIONS="$(CXXFLAGS)" \
-	NPROCS="$(NPROCS)" \
-	LDFLAGS="$(CXXFLAGS)"
+    CC_EXPLICIT="$(CC)" \
+	PATH=$(shell dirname $(CC)):$(PATH) \
+	CC=$(shell basename $(CC)) 
+	NPROC="$(NPROC)" 
 
-# This is a workaround for the AT&T nmake failing to always use
-# the environmental CCFLAGS in sub-compiles
-COMPONENT_BUILD_ARGS= $(COMPONENT_BUILD_ENV)
+# This explicitly exports the build type for 32/64 bit distinction 
+COMPONENT_BUILD_ARGS = \
+						HOSTTYPE="$(HOSTTYPE$(BITS))" \
+						CCFLAGS="$(CFLAGS)" \
+						LDFLAGS="$(CXXFLAGS)" 
+
+# The install and test process needs the same environment as the build
+COMPONENT_INSTALL_ENV = $(COMPONENT_BUILD_ENV)
+COMPONENT_TEST_ENV = $(COMPONENT_BUILD_ENV)
+COMPONENT_INSTALL_ARGS = HOSTTYPE="$(HOSTTYPE$(BITS))"
+COMPONENT_TEST_ARGS = HOSTTYPE="$(HOSTTYPE$(BITS))"
 
 # build the configured source
 $(BUILD_DIR)/%/.built:	$(SOURCE_DIR)/.prep
@@ -77,8 +78,9 @@
 $(BUILD_DIR)/%/.installed:	$(BUILD_DIR)/%/.built
 	$(COMPONENT_PRE_INSTALL_ACTION)
 	$(RM) -r $(PROTO_DIR)/$(MACH$(BITS)); $(MKDIR) $(PROTO_DIR)/$(MACH$(BITS));
-	cd $(@D) ; $(ENV) $(COMPONENT_INSTALL_ENV) \
+	cd $(@D); $(ENV) $(COMPONENT_INSTALL_ENV) \
 		bin/package flat $(COMPONENT_INSTALL_TARGETS) \
+		$(COMPONENT_INSTALL_ARGS) \
 		$(PROTO_DIR)/$(MACH$(BITS)) $(COMPONENT_INSTALL_PACKAGES) 
 	$(COMPONENT_POST_INSTALL_ACTION)
 	$(TOUCH) [email protected]
@@ -86,8 +88,9 @@
 # test the built source
 $(BUILD_DIR)/%/.tested: $(BUILD_DIR)/%/.built
 	$(COMPONENT_PRE_TEST_ACTION)
-	cd $(@D) ; $(ENV) $(COMPONENT_TEST_ENV) bin/package \
-		test $(COMPONENT_TEST_TARGETS) 
+	cd $(@D); $(ENV) $(COMPONENT_TEST_ENV) \
+		bin/package test $(COMPONENT_TEST_TARGETS) \
+		$(COMPONENT_TEST_ARGS)
 	$(COMPONENT_POST_TEST_ACTION)
 	$(TOUCH) [email protected]