<div dir="ltr">yes, it should be in compilerFlags/ linkerFlags<br><div class="gmail_extra"><br>compilerFlags <br> | releaseFlags |<br> <br> releaseFlags := self isGenerateForRelease <br> ifTrue: [ self compilerFlagsRelease ]<br>
ifFalse: [ self compilerFlagsDebug ].<br> <br> ^ String streamContents: [ :stream |<br> ((self commonCompilerFlags, releaseFlags) collect: #trimBoth as: Set)<br> asStringOn: stream <br>
delimiter: ' ' ]<br><br><br>CocoaIOSConfig>>commonCompilerFlags<br> "Common compiler flags"<br> ^{<br> '-arch i386'. <br> '-mmacosx-version-min=10.5'. <br> '-DHAVE_UUID_GENERATE'. <br>
'-DDEFAULT_IMAGE_NAME="', self executableName, '.image"'}<br><br><br></div><div class="gmail_extra">CogUnixConfig>>commonCompilerFlags<br><br> "Common compiler flags<br> <br>
<br> LSB_FIRST=1 means that target platform is little endian. <br> set it to 0 for big-endian platforms<br> <br> "<br> <br> ^ {<br> '-DLSB_FIRST=1'. <br> '-DUSE_GLOBAL_STRUCT=0'. <br>
'-DCOGMTVM=0'. <br> '-m32'.<br> '-DENABLE_FAST_BLT ' } <br><br><br><br>CogFamilyWindowsConfig>>commonCompilerFlags<br> "omit -ggdb2 to prevent generating debug info"<br>
"Some flags explanation: <br> <br> STACK_ALIGN_BYTES=16 is needed in mingw and FFI (and I suppose on other modules too).<br> DALLOCA_LIES_SO_USE_GETSP=0 Some compilers return the stack address+4 on alloca function, <br>
then FFI module needs to adjust that. It is NOT the case of mingw.<br> For more information see this thread: <a href="http://forum.world.st/There-are-something-fishy-with-FFI-plugin-td4584226.html">http://forum.world.st/There-are-something-fishy-with-FFI-plugin-td4584226.html</a><br>
"<br> ^ { <br> '-march=pentium4'.<br> '-mwindows'.<br> '-D_MT'.<br> '-msse2'. <br> '-mthreads'. <br> '-mwin32'.<br> '-mno-rtd'. <br>
'-mms-bitfields'. <br> '-mno-accumulate-outgoing-args ', self winVer.<br> '-DWIN32'. <br> '-DWIN32_FILE_SUPPORT'. <br> '-DNO_ISNAN'.<br> '-DNO_SERVICE'. <br>
'-DNO_STD_FILE_SUPPORT'.<br> '-DLSB_FIRST'. <br> '-DVM_NAME="', self executableName,'"'.<br> '-DX86 '.<br> '-DSTACK_ALIGN_BYTES=16'. <br>
'-DALLOCA_LIES_SO_USE_GETSP=0'. <br> '-DENABLE_FAST_BLT ' }<br></div><div class="gmail_extra"><br><div class="gmail_quote">On 19 June 2014 18:22, gettimothy <span dir="ltr"><<a href="mailto:gettimothy@zoho.com" target="_blank">gettimothy@zoho.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> <br><u></u><div><div style="font-size:10pt;font-family:Verdana,Arial,Helvetica,sans-serif">Hi Igor (and all)<br>
<br>My goal is to develop a documented, boilerplate, easily duplicated, correct procedure for adding or modifying a CMakeVMaker(Squeak) configuration whenever Eliot adds or modifies a configuration in the GNU tree.<br><br>
Using build.linux32x86/squeak.cog.v3/ as an example, I want to be able to examine the 'mvm' files in each build directory:<br><br><br><blockquote style="border:1px solid rgb(204,204,204);padding:7px;background-color:rgb(245,245,245)">
<div>build <br>build.assert <br>build.assert.itimerheartbeat <br>build.debug <br>build.debug.itimerheartbeat <br>build.itimerheartbeat <br>build.multithreaded <br>build.multithreaded.assert <br>build.multithreaded.debug<br>
</div></blockquote> And accurately translate that information into the appropriate CMakeVMaker(Squeak) Configuration class.<br><br>Using build.linux32x86/squeak.cog.v3/build/mvm as the example, we see that GNU system has this in their setup:<br>
<br><br><blockquote style="border:1px solid rgb(204,204,204);padding:7px;background-color:rgb(245,245,245)"><div>test -f config.h || ../../../platforms/unix/config/configure --without-npsqueak \<br> CC="gcc -m32" \<br>
CXX="g++ -m32" \<br> CFLAGS="$OPT -msse2 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DCOGMTVM=0" \<br> LIBS="-lpthread -luuid" \<br> LDFLAGS=-Wl,-z,now</div></blockquote>
<br>The reason for this email is that I want to verify/clarify that my approach is correct and to share my concerns. <br><br>Please correct me or clarify as I go.<br><br> So line-by-line....<br><br><br><blockquote style="border:1px solid rgb(204,204,204);padding:7px;background-color:rgb(245,245,245)">
<div>test -f config.h || ../../../platforms/unix/config/configure --without-npsqueak \</div></blockquote><b> We are hard-coding this (for now) in configH method. </b><br><br>(Incidently, David. I looked at Ian's code briefly a couple of nights ago and he as a config.cmake step that is run. Much of Ian's code looks very similar to what is happening in VMakeCMake(Squeak). Once release 1 of this puppy is up, I will hopefully know enought<br>
to integrate Ian's work)<br><br><br><br><blockquote style="border:1px solid rgb(204,204,204);padding:7px;background-color:rgb(245,245,245)"><div><br> CC="gcc -m32" \<br> CXX="g++ -m32" \</div>
</blockquote> <br>I "think" these are handled in <br><br><blockquote style="border:1px solid rgb(204,204,204);padding:7px;background-color:rgb(245,245,245)"><div><br>setGlobalOptions: maker<br><br> "set any CMake global options, before declaring a project in cmake file"<br>
<br> maker set: 'CMAKE_C_COMPILER' to: '/usr/bin/gcc'.<br> maker set: 'CMAKE_CXX_COMPILER' to: '/usr/bin/g++'.</div></blockquote><b> But I am not sure where to pass in the '-m32' flag. </b>I will research this on Google, but if you know, it would be much appreciated.<br>
<br><br><br><br><blockquote style="border:1px solid rgb(204,204,204);padding:7px;background-color:rgb(245,245,245)"><div> CFLAGS="$OPT -msse2 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DCOGMTVM=0" \</div></blockquote>
<br>I trust these are handled in CMakeVMaker(Squeak)<br><br><blockquote style="border:1px solid rgb(204,204,204);padding:7px;background-color:rgb(245,245,245)"><div>compilerFlags<br> ^ {<br> '-O0'. <br>
'--msse2'. <br> '-D_GNU_SOURCE'. <br> '-D_FILE_OFFSET_BITS=64'. <br> '-DCOGMTVM=0'. }<br></div></blockquote><b>Should I just throw the '-m32' in here? remember, my goal is to be boilerplate consistent going forward.<br>
<br></b><br><br>Now things get a bit confusing....<br><br>IN GNU we have<br><blockquote style="border:1px solid rgb(204,204,204);padding:7px;background-color:rgb(245,245,245)"><div> LIBS="-lpthread -luuid" \</div>
</blockquote> is represented by CMakeVMMaker(Squeak)<br><br><blockquote style="border:1px solid rgb(204,204,204);padding:7px;background-color:rgb(245,245,245)"><div>linkFlags<br> ^ '-lSM -lICE -ldl -lGL -lpthread -lm -lnsl -lX11'<br>
</div></blockquote><br></div></div></blockquote><div><br>here it is:<br><br>CogUnixConfig>>linkFlags <br> ^ super linkFlags , ' -m32'<br> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div><div style="font-size:10pt;font-family:Verdana,Arial,Helvetica,sans-serif">From google,<code> "-L</code> is the path to the directories containing the libraries. A search path for libraries." and "<code>-l</code> is the name of the library you want to link to."<br>
<b>so the heuristics of the name is "libraries to link to" and not "linker flags".</b><br><br><br><br>Finally we have linker flags:<br><br><br><blockquote style="border:1px solid rgb(204,204,204);padding:7px;background-color:rgb(245,245,245)">
<div> LDFLAGS=-Wl,-z,now</div></blockquote> <br><br>We don't have a method for this, except that setExtraTargetProperties seems to be a catch-all method....<br>Here are a couple examples at random:<br><br><blockquote style="border:1px solid rgb(204,204,204);padding:7px;background-color:rgb(245,245,245)">
<div>setExtraTargetProperties: maker<br><br> maker setTargetProperties: 'LINK_FLAGS "-m32"'.<br> <br> maker puts: 'set_source_files_properties( ${srcVMDir}/cogit.c PROPERTIES <br> COMPILE_FLAGS "-O1 -fno-omit-frame-pointer -momit-leaf-frame-pointer -mno-rtd -mno-accumulate-outgoing-args")'.<br>
<br> <br> maker <br> cmd: 'set_source_files_properties'<br> params: ' ${targetPlatform}/vm/sqUnixHeartbeat.c PROPERTIES <br> COMPILE_FLAGS "-O1 -fno-omit-frame-pointer -mno-rtd -mno-accumulate-outgoing-args"'.<br>
<br> super setExtraTargetProperties: maker.</div></blockquote> <br><br>or in another class:<br><br><br><blockquote style="border:1px solid rgb(204,204,204);padding:7px;background-color:rgb(245,245,245)">
<div> maker addExternalLibraries: <br> #(<br> 'm' "math lib"<br> 'dl' "dynamic loader"<br> 'pthread' "posix threads" <br> ).<br>
<br> maker set: 'EXECUTABLE_OUTPUT_PATH' toString: self outputDir fullName.<br> self addVMDrivers: maker.<br></div></blockquote> <br><br><br>In summary, here is what I am thinking.<br><br>I. research the CC and CXX '-m32' and if CMake doesn't handle it make sure putting it in compilerFlags is ok.<br>
2. CFlags=compilerFlags<br>3. LIBS= (I think this needs to be refactored with the method renamed in an override)<br>4. LDFlags (I think we need a new method for these in CMakeVMGenerator>generate method)<br>
<br><br><br>Anyway, I wanted to get your input before proceeding. <br>To re-iterate. I am in "boilerplate" coding mode now where I want to take an existing GNU build and create a documented, boilerplate, consistent method of porting existing GNU builds.<br>
<br></div></div></blockquote><div><br>Note that different parts of configs was filled at different times, by different people.<br></div><div>So, no surprise, things are a bit messy. Feel free to put a better order and place things into more appropriate place and properly comment/document them (as long as build will keep working, of course :).<br>
</div><div><br> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div style="font-size:10pt;font-family:Verdana,Arial,Helvetica,sans-serif">
Cheers.<br><br>tty<br></div></div></blockquote><div> </div></div>-- <br>Best regards,<br>Igor Stasenko.
</div></div>