Menu

#1223 Update to SDCC compiler options

Undefined
applied
nobody
Patch
2022-03-07
2022-03-03
No

With the forthcoming release of SDCC version 4.2.0, I have updated the SDCC compiler options file to bring it up to date and bring some enhancements. Please find attached a patch to options_sdcc.xml.

Summary of the changes:

  • Reorganised with some new categories: code generation, debugging, warnings.
  • Added many new options, removed some old defunct options.
  • Added new target CPU architectures: z80n, r2ka, r3ka, mos6502, sm83 (renaming of gbz80).
  • Made some newer features conditional on detected SDCC version (e.g. sm83 vs. gbz80) as not all users may have latest SDCC version.
1 Attachments

Discussion

  • Miguel Gimenez

    Miguel Gimenez - 2022-03-03

    Which is the output of sdcc --version?. If it is something like 4.2.0, there is a new group of more clear and reliable tests; for example, in options_common_architecture.xml you have this:

            <if exec="C -dumpversion"
                version_greater_equal="4.5"
                default="true">
                <Option name="Intel Atom (MMX, SSE, SSE2, SSE3 SSSE3, 64-bit extensions)"
                        option="-march=atom"/>
            </if>
    

    There are more tests, like version_greater or version_equal. You can compare with "4", "4.2" or "4.2.0", for example.

    On the other side, the patch is not created by SVN and is not directly usable. I would prefer a proper SVN patch or the complete file.

     
    • Basil Hussain

      Basil Hussain - 2022-03-03

      The output of sdcc --version is as follows:

      SDCC : mcs51/z80/z180/r2k/r2ka/r3ka/sm83/tlcs90/ez80_z80/z80n/ds390/pic16/pic14/TININative/ds400/hc08/s08/stm8/pdk13/pdk14/pdk15/mos6502 4.2.0 #13081 (MINGW64)
      published under GNU General Public License (GPL)
      

      There is no command line option to output just the version number - no equivalent of GCC's -dumpversion. If those new tests expect precisely just a version number string (e.g. "4.2.0"), then I think unfortunately we will not be able to take advantage of them.

      By the way, are those new tests available in the current release (20.03), or just trunk? Even if there were the possibility to use them, I wanted the options file to work in the current release.

      As for the patch, what is not directly unusable? I apologise, but I'm not going to check out the entire SVN source tree just to make a diff against one file. I can provide the complete file, though - see attached.

       
  • Miguel Gimenez

    Miguel Gimenez - 2022-03-04

    The new tests are not present in 20.03, but they are present in the nightlies. IMHO, the current nightly is far more stable than 20.03 and you can just delete it if you do not like it.

     
  • Miguel Gimenez

    Miguel Gimenez - 2022-03-04
    • status: open --> applied
     
  • Miguel Gimenez

    Miguel Gimenez - 2022-03-04

    Applied in [r12737], thank you.

     

    Related

    Commit: [r12737]


    Last edit: Miguel Gimenez 2022-03-04
  • Miguel Gimenez

    Miguel Gimenez - 2022-03-04

    FYI, I have just modified the regex test to simplify comparations.
    I have also modified options_sdcc.xml in [r12739] to benefit from the changes.

     

    Related

    Commit: [r12739]

    • Basil Hussain

      Basil Hussain - 2022-03-04

      That's pretty neat.

      What happens if the regex needs to contain a ';' though? Is there some kind of escape mechanism?

       
  • Miguel Gimenez

    Miguel Gimenez - 2022-03-04

    wxSplit() has a built-in escape mechanism (prepending a backslash).

    Anyway, the original "regex" test has been replaced everywhere with the new "version_XXX" test, so there is little to worry about.

     
  • Miguel Gimenez

    Miguel Gimenez - 2022-03-07

    Updated, please review...

     

Log in to post a comment.

MongoDB Logo MongoDB