[Vm-dev] SIZEOF_VOID_P 8 and mprotect

gettimothy gettimothy at zoho.com
Thu Jul 10 15:34:53 UTC 2014


 Hi guys.



Thx for your help. 




CFLAGS will need to specify -m32 to tell the compiler to use the 32 bit memory model.
 

Well, we thought we had that, but I guess its we are mis-using it. Our CMakeLists.txt has a -m32 in an add_definition() command. 




add_definitions(-fno-caller-saves -D_GNU_SOURCE -DUSE_GLOBAL_STRUCT=0 -msse2 -DCOGMTVM=0 -fno-tree-pre -DDEBUGVM=0 -DNDEBUG -O1 -m32 -D_FILE_OFFSET_BITS=64 -DLSB_FIRST=1 -g3)
 
However at the CHECK_TYPE_SIZE tests, they where kaputen:

CMAKE_C_FLAGS=
CMAKE_C_FLAGS_RELEASE=-O3 -DNDEBUG
CMAKE_C_FLAGS_DEBUG=-g
CMAKE_CXX_FLAGS_RELEASE=-O3 -DNDEBUG
CMAKE_CXX_FLAGS_DEBUG=-g





So, just before the CHECK_TYPE_SIZE, I explicitly set them: 



 
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -m32")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -m32")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Wall -m32")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -Wall -m32")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -m32")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wall -m32")

And the CHECK_TYPE_SIZE() command correctly set the sizes. That is pretty amazing stuff.




That brings up a nasty point about the existing CMakeVMMaker(Squeak). It is my opinion that we are not leveraging CMake the way it needs to be leveraged (I will fix that) . Also as that add_definitions() shows, it looks like we are mis-using some commands.


I will be cleaning that up, but CMake is a pretty big subsystem, so I expect some hiccups. 


We are semi-close to mimicing what Ian did. The pseudo-code for his process is:


 
1. set up global variables from command line parameters etc
2. set up configure script config.in
3. configure plugins
4. build.cmake (does stuff and writes config.h)
5. build plugins
6. install stuff
I am on 2,3.4 in bold.

Presently, all of the configuration state is maintained in the CPltoformConfig subclasses. My task is to peel that out and leverage the CMake tools without breaking the existing code flow.


Finally, CMake has oodles of configuration  tools to leverage. If you look in /usr/share/cmake-2.8/Modules there are a wealth of configuration tools (printed below to give you a sense of their scope) .





thx again for your help.


cheers.


tty

FindALSA.cmake
FindASPELL.cmake
FindAVIFile.cmake
FindArmadillo.cmake
FindBISON.cmake
FindBLAS.cmake
FindBZip2.cmake
FindBoost.cmake
FindBullet.cmake
FindCABLE.cmake
FindCUDA.cmake
FindCURL.cmake
FindCVS.cmake
FindCoin3D.cmake
FindCups.cmake
FindCurses.cmake
FindCxxTest.cmake
FindCygwin.cmake
FindDCMTK.cmake
FindDart.cmake
FindDevIL.cmake
FindDoxygen.cmake
FindEXPAT.cmake
FindFLEX.cmake
FindFLTK.cmake
FindFLTK2.cmake
FindFreetype.cmake
FindGCCXML.cmake
FindGDAL.cmake
FindGIF.cmake
FindGLEW.cmake
FindGLU.cmake
FindGLUT.cmake
FindGTK.cmake
FindGTK2.cmake
FindGTest.cmake
FindGettext.cmake
FindGit.cmake
FindGnuTLS.cmake
FindGnuplot.cmake
FindHDF5.cmake
FindHSPELL.cmake
FindHTMLHelp.cmake
FindHg.cmake
FindITK.cmake
FindIcotool.cmake
FindImageMagick.cmake
FindJNI.cmake
FindJPEG.cmake
FindJasper.cmake
FindJava.cmake
FindKDE3.cmake
FindKDE4.cmake
FindLAPACK.cmake
FindLATEX.cmake
FindLibArchive.cmake
FindLibLZMA.cmake
FindLibXml2.cmake
FindLibXslt.cmake
FindLua50.cmake
FindLua51.cmake
FindMFC.cmake
FindMPEG.cmake
FindMPEG2.cmake
FindMPI.cmake
FindMatlab.cmake
FindMotif.cmake
FindOpenAL.cmake
FindOpenGL.cmake
FindOpenMP.cmake
FindOpenSSL.cmake
FindOpenSceneGraph.cmake
FindOpenThreads.cmake
FindPHP4.cmake
FindPNG.cmake
FindPackageHandleStandardArgs.cmake
FindPackageMessage.cmake
FindPerl.cmake
FindPerlLibs.cmake
FindPhysFS.cmak
FindMPEG.cmake
FindMPEG2.cmake
FindMPI.cmake
FindMatlab.cmake
FindMotif.cmake
FindOpenAL.cmake
FindOpenGL.cmake
FindOpenMP.cmake
FindOpenSSL.cmake
FindOpenSceneGraph.cmake
FindOpenThreads.cmake
FindPHP4.cmake
FindPNG.cmake
FindPackageHandleStandardArgs.cmake
FindPackageMessage.cmake
FindPerl.cmake
FindPerlLibs.cmake
FindPhysFS.cmake
FindPike.cmake
FindPkgConfig.cmake
FindPostgreSQL.cmake
FindProducer.cmake
FindProtobuf.cmake
FindPythonInterp.cmake
FindPythonLibs.cmake
FindQt.cmake
FindQt3.cmake
FindQt4.cmake
FindQuickTime.cmake
FindRTI.cmake
FindRuby.cmake
FindSDL.cmake
FindSDL_image.cmake
FindSDL_mixer.cmake
FindSDL_net.cmake
FindSDL_sound.cmake
FindSDL_ttf.cmake
FindSWIG.cmake
FindSelfPackers.cmake
FindSquish.cmake
FindSubversion.cmake
FindTCL.cmake
FindTIFF.cmake
FindTclStub.cmake
FindTclsh.cmake
FindThreads.cmake
FindUnixCommands.cmake
FindVTK.cmake
FindWget.cmake
FindWish.cmake
FindX11.cmake
FindXMLRPC.cmake
FindZLIB.cmake
Findosg.cmake
FindosgAnimation.cmake
FindosgDB.cmake
FindosgFX.cmake
FindosgGA.cmake
FindosgIntrospection.cmake
FindosgManipulator.cmake
FindosgParticle.cmake
FindosgPresentation.cmake
FindosgProducer.cmake
FindosgQt.cmake
FindosgShadow.cmake
FindosgSim.cmake
FindosgTerrain.cmake
FindosgText.cmake
FindosgUtil.cmake
FindosgViewer.cmake
FindosgVolume.cmake
FindosgWidget.cmake
Findosg_functions.cmake
FindwxWidgets.cmake
FindwxWindows.cmake


 














-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20140710/2213ed8b/attachment.htm


More information about the Vm-dev mailing list