<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: &#39; &#39; ]<br><br><br>CocoaIOSConfig&gt;&gt;commonCompilerFlags<br>    &quot;Common compiler flags&quot;<br>    ^{<br>    &#39;-arch i386&#39;. <br>    &#39;-mmacosx-version-min=10.5&#39;. <br>    &#39;-DHAVE_UUID_GENERATE&#39;. <br>
    &#39;-DDEFAULT_IMAGE_NAME=&quot;&#39;, self executableName, &#39;.image&quot;&#39;}<br><br><br></div><div class="gmail_extra">CogUnixConfig&gt;&gt;commonCompilerFlags<br><br>    &quot;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>    &quot;<br>    <br>    ^ {<br>        &#39;-DLSB_FIRST=1&#39;. <br>        &#39;-DUSE_GLOBAL_STRUCT=0&#39;. <br>
        &#39;-DCOGMTVM=0&#39;. <br>        &#39;-m32&#39;.<br>        &#39;-DENABLE_FAST_BLT &#39; }     <br><br><br><br>CogFamilyWindowsConfig&gt;&gt;commonCompilerFlags<br>    &quot;omit -ggdb2 to prevent generating debug info&quot;<br>
    &quot;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>
    &quot;<br>    ^ {  <br>        &#39;-march=pentium4&#39;.<br>        &#39;-mwindows&#39;.<br>        &#39;-D_MT&#39;.<br>        &#39;-msse2&#39;. <br>        &#39;-mthreads&#39;. <br>        &#39;-mwin32&#39;.<br>        &#39;-mno-rtd&#39;. <br>
        &#39;-mms-bitfields&#39;. <br>        &#39;-mno-accumulate-outgoing-args &#39;, self winVer.<br>        &#39;-DWIN32&#39;. <br>        &#39;-DWIN32_FILE_SUPPORT&#39;. <br>        &#39;-DNO_ISNAN&#39;.<br>        &#39;-DNO_SERVICE&#39;. <br>
        &#39;-DNO_STD_FILE_SUPPORT&#39;.<br>        &#39;-DLSB_FIRST&#39;. <br>        &#39;-DVM_NAME=&quot;&#39;, self executableName,&#39;&quot;&#39;.<br>        &#39;-DX86 &#39;.<br>        &#39;-DSTACK_ALIGN_BYTES=16&#39;. <br>
        &#39;-DALLOCA_LIES_SO_USE_GETSP=0&#39;. <br>        &#39;-DENABLE_FAST_BLT &#39; }<br></div><div class="gmail_extra"><br><div class="gmail_quote">On 19 June 2014 18:22, gettimothy <span dir="ltr">&lt;<a href="mailto:gettimothy@zoho.com" target="_blank">gettimothy@zoho.com</a>&gt;</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 &#39;mvm&#39; 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=&quot;gcc -m32&quot; \<br>
        CXX=&quot;g++ -m32&quot; \<br>        CFLAGS=&quot;$OPT -msse2 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DCOGMTVM=0&quot; \<br>        LIBS=&quot;-lpthread -luuid&quot; \<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&#39;s code briefly a couple of nights ago and he as a config.cmake step that is run. Much of Ian&#39;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&#39;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=&quot;gcc -m32&quot; \<br>        CXX=&quot;g++ -m32&quot; \</div>
</blockquote> <br>I &quot;think&quot; 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>    &quot;set any CMake global options, before declaring a project in cmake file&quot;<br>
    <br>    maker set: &#39;CMAKE_C_COMPILER&#39; to: &#39;/usr/bin/gcc&#39;.<br>    maker set: &#39;CMAKE_CXX_COMPILER&#39; to: &#39;/usr/bin/g++&#39;.</div></blockquote><b> But I am not sure where to pass in the &#39;-m32&#39; 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=&quot;$OPT -msse2 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -DCOGMTVM=0&quot; \</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>        &#39;-O0&#39;. <br>
        &#39;--msse2&#39;. <br>        &#39;-D_GNU_SOURCE&#39;. <br>        &#39;-D_FILE_OFFSET_BITS=64&#39;. <br>        &#39;-DCOGMTVM=0&#39;.  }<br></div></blockquote><b>Should I just throw the &#39;-m32&#39; 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=&quot;-lpthread -luuid&quot; \</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>     ^ &#39;-lSM -lICE -ldl -lGL -lpthread -lm -lnsl -lX11&#39;<br>
</div></blockquote><br></div></div></blockquote><div><br>here it is:<br><br>CogUnixConfig&gt;&gt;linkFlags <br>    ^ super linkFlags , &#39; -m32&#39;<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> &quot;-L</code> is the path to the directories containing the libraries.  A search path for libraries.&quot; and &quot;<code>-l</code> is the name of the library you want to link to.&quot;<br>
<b>so the heuristics of the name is &quot;libraries to link to&quot; and not &quot;linker flags&quot;.</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&#39;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: &#39;LINK_FLAGS &quot;-m32&quot;&#39;.<br>        <br>    maker puts: &#39;set_source_files_properties( ${srcVMDir}/cogit.c PROPERTIES <br>        COMPILE_FLAGS &quot;-O1 -fno-omit-frame-pointer -momit-leaf-frame-pointer -mno-rtd -mno-accumulate-outgoing-args&quot;)&#39;.<br>
        <br>    <br>    maker <br>        cmd: &#39;set_source_files_properties&#39;<br>        params: &#39; ${targetPlatform}/vm/sqUnixHeartbeat.c PROPERTIES <br>        COMPILE_FLAGS &quot;-O1 -fno-omit-frame-pointer -mno-rtd -mno-accumulate-outgoing-args&quot;&#39;.<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>            &#39;m&#39;  &quot;math lib&quot;<br>            &#39;dl&#39;  &quot;dynamic loader&quot;<br>            &#39;pthread&#39; &quot;posix threads&quot; <br>        ).<br>
        <br>    maker set: &#39;EXECUTABLE_OUTPUT_PATH&#39; 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  &#39;-m32&#39; and if CMake doesn&#39;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&gt;generate method)<br>
<br><br><br>Anyway, I wanted to get your input before proceeding. <br>To re-iterate. I am in &quot;boilerplate&quot; 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>