-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CogVM source as per VMMaker.oscog-eem.274.
Fix PC-mapping for NewspeakV4. Absent receiver sends must not be maped twice, once for IsNSSend and once for IsSend. So introduce class vars that state whether instructioon set uses PushImplicitReceiver (NSSendIsPCAnnotated is true) or SendAbsentImplicit (NSSendIsPCAnnotated is false). More info on optimizations to defeat for gcc 4.x compilation. git-svn-id: http://squeakvm.org/svn/squeak/branches/Cog@2704 fa1542d4-bde8-0310-ad64-8ed1123d492a
- Loading branch information
eliot
committed
Mar 19, 2013
1 parent
7ecdacc
commit 170f694
Showing
6 changed files
with
181 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
How To Build On Linux | ||
--------------------- | ||
|
||
Contents: | ||
- Checking out sources | ||
- How to build the Cog Croquet VM on Unix | ||
- Testing an external plugin has completely linked | ||
- Compiling in 32-bit mode on a 64-bit linux | ||
- Testing an external plugin has completely linked | ||
- N.B. Please read: Optimization level and gcc version | ||
|
||
|
||
Checking out sources | ||
------------------------------- | ||
To generate a VM check-out http://www.squeakvm.org/svn/squeak/branches/Cog/image | ||
which contains | ||
http://www.squeakvm.org/svn/squeak/branches/Cog/image/VMMaker-Squeak4.1.changes | ||
http://www.squeakvm.org/svn/squeak/branches/Cog/image/VMMaker-Squeak4.1.image | ||
Start up VMMaker-Squeak4.1.image. In it is a workspace containing a doit that | ||
uses something like generate:and:to:platformDir:excluding:. Doit. | ||
|
||
|
||
How to build the Cog Croquet VM on Unix | ||
------------------------------- | ||
1. Install the tools (gcc, X11-devel, etc (e.g. libpng, libX11 & libxt source)) | ||
2. Check out the following sources from svn (if you haven't already - if you're | ||
reading this in unixbuild its likely you've already got the sources) | ||
svn co http://www.squeakvm.org/svn/squeak/branches/Cog/platforms | ||
svn co http://www.squeakvm.org/svn/squeak/branches/Cog/src | ||
svn co http://www.squeakvm.org/svn/squeak/branches/Cog/unixbuild | ||
3. Open a shell, cd into the unixbuild/bld directory and execute | ||
../../platforms/unix/config/configure --without-npsqueak CFLAGS="-g -O2 -msse2 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DNDEBUG -DITIMER_HEARTBEAT=1 -DNO_VM_PROFILE=1 -DCOGMTVM=0 -DDEBUGVM=0" LIBS=-lpthread | ||
make install prefix=WhereYouWantTheVmToGo | ||
|
||
N.B. If you're on a 64-bit linux read 3e below!! | ||
N.B. On Ubuntu *do not* supply "LIBS=-lpthread", i.e. use | ||
../../platforms/unix/config/configure --without-npsqueak CFLAGS="-g -O2 -msse2 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DNDEBUG -DITIMER_HEARTBEAT=1 -DNO_VM_PROFILE=1 -DCOGMTVM=0 -DDEBUGVM=0" | ||
|
||
4. At the end of it you'll get a new VM in the path provided via -prefix | ||
|
||
N.B. The plugin set is defined by plugins.ext and plugins.int in the build dir. | ||
|
||
|
||
3a. For an assert-enabled VM do | ||
../../platforms/unix/config/configure --without-npsqueak CFLAGS="-g -O1 -msse2 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DITIMER_HEARTBEAT=1 -DNO_VM_PROFILE=1 -DCOGMTVM=0 -DDEBUGVM=0" LIBS=-lpthread | ||
|
||
3b. For a full debug VM do | ||
../../platforms/unix/config/configure --without-npsqueak CFLAGS="-g3 -msse2 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DITIMER_HEARTBEAT=1 -DNO_VM_PROFILE=1 -DCOGMTVM=0 -DDEBUGVM=1" LIBS=-lpthread | ||
|
||
3c. For a multi-threaded VM open a shell and cd to the mtbld directory. Then | ||
execute | ||
../../platforms/unix/config/configure INTERP=cointerpmt --without-npsqueak CFLAGS="-g -O2 -msse2 -DNDEBUG -DCOGMTVM=1 -DDEBUGVM=0 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DITIMER_HEARTBEAT=1 -DNO_VM_PROFILE=1" LIBS=-lpthread | ||
make squeakmt | ||
make installmt prefix=WhereYouWantTheVmToGo | ||
|
||
N.B. As of early 2010 the linux pthreads implementation doesn't appear to | ||
provide a way of setting priorities for the default thread scheduling policy | ||
SCHED_OTHER (unlike e.g. Mac OS X) and doesn't appear to allow changing the | ||
policy to one that does (e.g. SCHED_RR). So for now we use the itimer | ||
scheme. See platforms/unix/vm/sqUnixHeartbeat.c | ||
|
||
3d. If you want to get the Cog VM simulator working you'll need to build the | ||
BochsIA32Plugin/BochsIA32Plugin.xcodeproj project and to build that you'll | ||
need to first build bochs. First check-out the processor simulator source tree | ||
containing Bochs: | ||
svn co http://www.squeakvm.org/svn/squeak/branches/Cog/processors | ||
Then build libraries linuxbochs/{cpu/libcpu.a,disasm/libdisasm.a,fpu/libfpu.a} | ||
$ cd ROOT/processors/IA32/linuxbochs | ||
$ ./conf.COG | ||
$ ../bochs/makeem | ||
and build the plugin via | ||
$ cd ROOT/unixbuild/bld/BochsIA32Plugin | ||
$ make | ||
|
||
3e. (see Compiling in 32-bit mode on a 64-bit linux below) | ||
If you're building the VM on a 64-bit OS, you'll need a compiler which can | ||
compile and link to 32-bit binaries. On most Linuxes the gcc-multilib package | ||
provides the 32-bit compiler and the ia32-libs provides the 32-bit libraries. | ||
You'll also have to add the -m32 switch to all gcc & g++ invocations. The | ||
easiest way to do this is to add CC="gcc -m32" & CXX="g++ -m32" to the configure | ||
script: | ||
../../platforms/unix/config/configure CC="gcc -m32" CXX="g++ -m32" --without-npsqueak CFLAGS="-g -O2 -msse2 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DNDEBUG -DITIMER_HEARTBEAT=1 -DNO_VM_PROFILE=1 -DCOGMTVM=0 -DDEBUGVM=0" LIBS=-lpthread | ||
To run a 32-bit VM on a 64-bit OS, you'll also need the 32-bit libraries | ||
provided by the ia32-libs package. | ||
|
||
Compiling in 32-bit mode on a 64-bit linux | ||
------------------------------- | ||
Follow 3e. above. Also note that according to Paul DeBruicker the following | ||
packages need to be installed to compile in 32-bt mode on 64-bit ubuntu. YMMV. | ||
|
||
build-essential | ||
lib32asound2-dev | ||
libgl1-mesa-dev | ||
libglu1-mesa-dev | ||
ia32-libs | ||
gcc-multilib | ||
g++multilib | ||
|
||
In addition [email protected] installed libc6dev-i386. | ||
|
||
This in itself may not be enough, but persistence will pay off. See for example | ||
http://permalink.gmane.org/gmane.comp.lang.smalltalk.pharo.devel/75198. | ||
|
||
|
||
Testing an external plugin has completely linked | ||
------------------------------- | ||
You may find that an external plugin compiles and links but does not load. | ||
This is usually because it contans undefined symbols. To find undefined | ||
symbols, remake the plugin, capturing the link step and then supply | ||
-Wl,--warn-unresolved-symbols -Wl,--no-allow-shlib-undefined | ||
when manually repeating the link command | ||
|
||
|
||
Optimization level and gcc version | ||
---------------------------------- | ||
There are issues with gcc version > 4.2.1. Any of the following flags may break the build at -O2: | ||
-ftree-pre | ||
-fpartial-inlining | ||
-fcaller-saves | ||
|
||
So turn them off. e.g. | ||
../../platforms/unix/config/configure --without-npsqueak CFLAGS="-g -O2 -msse2 -fno-caller-saves -fno-partial-inlining -fno-tree-pre -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DNDEBUG -DITIMER_HEARTBEAT=1 -DNO_VM_PROFILE=1 -DCOGMTVM=0 -DDEBUGVM=0" LIBS=-lpthread | ||
|
||
Clang | ||
----- | ||
So far Clang only works at -O1. So it may also be subject to some of the same | ||
issues as gcc. Please report back successes with clang, especially at -O2. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters