[Vm-dev] [commit][3238] Compile for 32 or 64 bit host or image, 4 or 8 byte sqInt, squeakvm or squeakvm64.

David T. Lewis lewis at mail.msen.com
Fri Jan 30 01:21:14 UTC 2015


On Fri, Jan 30, 2015 at 01:53:30AM +0100, Tobias Pape wrote:
> 
> YaY!
> 
> Thank you!
> 
> Best
> 	-Tobias

Hi Tobias,

I have not actually tested to verify that the plugin works on a 64-bit host
VM, which would be the main concern. Can you help me with that?

If you can give me a pointer to a simple test for SSL, I will give it a try
on a 64 bit VM and let you know if it works. Or if you do not mind compiling
it yourself, just check out a copy of the sources:

  $ svn co http://squeakvm.org/svn/squeak/trunk/platforms
  $ svn co http://squeakvm.org/svn/squeak/trunk/src

Then use the attached Makefile to build the VM. Run it in a ./build directory
next to your ./platforms and ./src directories. If the plugin works on a VM
compiled for 64 bits, then I'll close out the Mantis 7751 issue.

I am travelling tomorrow but I'll try to follow up on this over the weekend.

Thanks!

Dave


> 
> On 30.01.2015, at 01:37, commits at squeakvm.org wrote:
> 
> > 
> > Revision: 3238
> > Author:   lewis
> > Date:     2015-01-29 16:37:29 -0800 (Thu, 29 Jan 2015)
> > Log Message:
> > -----------
> > Compile for 32 or 64 bit host or image, 4 or 8 byte sqInt, squeakvm or squeakvm64.
> > Change signature of sqGetIntPropertySSL to match declaration in Cross/plugins/SqueakSSL/SqueakSSL.h
> > For debug printing, cast sqInt to long and print with %ld to prevent warnings when sizeof(sqInt) is 8.
> > Reference Mantis 7751 (http://bugs.squeak.org/view.php?id=7751)
> > 
> > Modified Paths:
> > --------------
> >    trunk/platforms/unix/plugins/SqueakSSL/sqUnixOpenSSL.c
> > 
> > Modified: trunk/platforms/unix/plugins/SqueakSSL/sqUnixOpenSSL.c
> > ===================================================================
> > --- trunk/platforms/unix/plugins/SqueakSSL/sqUnixOpenSSL.c	2015-01-29 22:46:44 UTC (rev 3237)
> > +++ trunk/platforms/unix/plugins/SqueakSSL/sqUnixOpenSSL.c	2015-01-30 00:37:29 UTC (rev 3238)
> > @@ -36,8 +36,8 @@
> > sqInt sqCopyBioSSL(sqSSL *ssl, BIO *bio, char *dstBuf, sqInt dstLen) {
> >   int nbytes = BIO_ctrl_pending(bio);
> > 
> > -  if(ssl->loglevel) printf("sqCopyBioSSL: %d bytes pending; buffer size %d\n", 
> > -	 nbytes, dstLen);
> > +  if(ssl->loglevel) printf("sqCopyBioSSL: %d bytes pending; buffer size %ld\n", 
> > +	 nbytes, (long)dstLen);
> >   if(nbytes > dstLen) return -1;
> >   return BIO_read(bio, dstBuf, dstLen);
> > }
> > @@ -156,7 +156,7 @@
> > 	X509 *cert;
> > 	sqSSL *ssl = sslFromHandle(handle);
> > 
> > -	if(ssl->loglevel) printf("sqConnectSSL: %x\n", (int)ssl);
> > +	if(ssl->loglevel) printf("sqConnectSSL: %lx\n", (long)ssl);
> > 
> > 	/* Verify state of session */
> > 	if(ssl == NULL || (ssl->state != SQSSL_UNUSED && ssl->state != SQSSL_CONNECTING)) {
> > @@ -172,7 +172,7 @@
> > 		SSL_set_connect_state(ssl->ssl);
> > 	}
> > 
> > -	if(ssl->loglevel) printf("sqConnectSSL: BIO_write %d bytes\n", srcLen);
> > +	if(ssl->loglevel) printf("sqConnectSSL: BIO_write %ld bytes\n", (long)srcLen);
> > 
> > 	n = BIO_write(ssl->bioRead, srcBuf, srcLen);
> > 
> > @@ -202,7 +202,7 @@
> > 
> > 	if(ssl->loglevel) printf("sqConnectSSL: SSL_get_peer_certificate\n");
> > 	cert = SSL_get_peer_certificate(ssl->ssl);
> > -	if(ssl->loglevel) printf("sqConnectSSL: cert = %x\n", (int)cert);
> > +	if(ssl->loglevel) printf("sqConnectSSL: cert = %lx\n", (long)cert);
> > 	/* Fail if no cert received. */
> > 	if(cert) {
> > 		X509_NAME_get_text_by_NID(X509_get_subject_name(cert), 
> > @@ -252,7 +252,7 @@
> > 		SSL_set_accept_state(ssl->ssl);
> > 	}
> > 
> > -	if(ssl->loglevel) printf("sqAcceptSSL: BIO_write %d bytes\n", srcLen);
> > +	if(ssl->loglevel) printf("sqAcceptSSL: BIO_write %ld bytes\n", (long)srcLen);
> > 
> > 	n = BIO_write(ssl->bioRead, srcBuf, srcLen);
> > 
> > @@ -286,7 +286,7 @@
> > 
> > 	if(ssl->loglevel) printf("sqAcceptSSL: SSL_get_peer_certificate\n");
> > 	cert = SSL_get_peer_certificate(ssl->ssl);
> > -	if(ssl->loglevel) printf("sqAcceptSSL: cert = %x\n", (int)cert);
> > +	if(ssl->loglevel) printf("sqAcceptSSL: cert = %lx\n", (long)cert);
> > 
> > 	if(cert) {
> > 	  X509_NAME_get_text_by_NID(X509_get_subject_name(cert), 
> > @@ -322,7 +322,7 @@
> > 
> > 	if(ssl == NULL || ssl->state != SQSSL_CONNECTED) return SQSSL_INVALID_STATE;
> > 
> > -	if(ssl->loglevel) printf("sqEncryptSSL: Encrypting %d bytes\n", srcLen);
> > +	if(ssl->loglevel) printf("sqEncryptSSL: Encrypting %ld bytes\n", (long)srcLen);
> > 
> > 	nbytes = SSL_write(ssl->ssl, srcBuf, srcLen);
> > 	if(nbytes != srcLen) return SQSSL_GENERIC_ERROR;
> > @@ -414,7 +414,7 @@
> > 		propID - the property id to retrieve
> > 	Returns: The integer value of the property.
> > */
> > -int sqGetIntPropertySSL(sqInt handle, int propID) {
> > +sqInt sqGetIntPropertySSL(sqInt handle, sqInt propID) {
> > 	sqSSL *ssl = sslFromHandle(handle);
> > 
> > 	if(ssl == NULL) return 0;
> > @@ -424,7 +424,7 @@
> > 		case SQSSL_PROP_VERSION: return 1;
> > 		case SQSSL_PROP_LOGLEVEL: return ssl->loglevel;
> > 		default:
> > -			if(ssl->loglevel) printf("sqGetIntPropertySSL: Unknown property ID %d\n", propID);
> > +			if(ssl->loglevel) printf("sqGetIntPropertySSL: Unknown property ID %ld\n", (long)propID);
> > 			return 0;
> > 	}
> > 	return 0;
> > @@ -444,7 +444,7 @@
> > 	switch(propID) {
> > 		case SQSSL_PROP_LOGLEVEL: ssl->loglevel = propValue; break;
> > 		default:
> > -			if(ssl->loglevel) printf("sqSetIntPropertySSL: Unknown property ID %d\n", propID);
> > +			if(ssl->loglevel) printf("sqSetIntPropertySSL: Unknown property ID %ld\n", (long)propID);
> > 			return 0;
> > 	}
> > 	return 1;
-------------- next part --------------
# Thu Jan 29 20:12:32 EST 2015
#
# Makefile to build and install a 32-bit and 64-bit object memory VM. This
# makefile can be run with /usr/sbin/checkinstall to create an RPM or Debian
# install package.
#
# Assume platforms is ../platforms and src is ../src
# 
# The SqueakSSL plugin cannot yet be built for image64, otherwise the 32-bit
# and 64-bit object memory VMs should be the same.

# CFLAGS setting to pass to cmake configure. If undefined, use compiler defaults.
CFLAGS_PARAM="--CFLAGS='-O3 -D_FILE_OFFSET_BITS=64'"
#CFLAGS_PARAM="--CFLAGS='-O0 -g'"

squeakvm:	build/squeakvm build64/squeakvm64

build/squeakvm:	build/CMakeCache.txt
	(cd build; make)

build/CMakeCache.txt:
	mkdir build || true
	(cd build; ../../platforms/unix/cmake/configure --src=../../src ${CFLAGS_PARAM})

build64/squeakvm64:	build64/CMakeCache.txt
	(cd build64; make)

build64/CMakeCache.txt:
	mkdir build64 || true
	(cd build64; ../../platforms/unix/cmake/configure --src=../../src --image64 --vm-only ${CFLAGS_PARAM})

install:	squeakvm
	(cd build; make install)
	(cd build64; make install)

clean:
	rm -rf build build64



More information about the Vm-dev mailing list