RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login
    Please do not post a support request without first reading and following the advice in https://retropie.org.uk/forum/topic/3/read-this-first

    Advance MAME won't make a working compile on Ubuntu 17.10

    Scheduled Pinned Locked Moved Help and Support
    ubuntuadvance mamecompile failed
    7 Posts 2 Posters 1.9k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • N
      Neo-Rio
      last edited by Neo-Rio

      Advance MAME (advmame) doesn't work on ubuntu 17.10 (x64) with Retropie 4.3.7

      It seemed to compile OK, but games would not start.
      Looking at /dev/shm I get the error:

      *** stack smashing detected ***: <unknown> terminated

      mituM 1 Reply Last reply Reply Quote 0
      • mituM
        mitu Global Moderator @Neo-Rio
        last edited by

        @neo-rio It's probably because Ubuntu 17.10 turned on the -fstack-protector compiler option by default. Try to disable this when compiling advmame and see if it fixes the error.

        N 1 Reply Last reply Reply Quote 0
        • N
          Neo-Rio @mitu
          last edited by

          @mitu
          Do you know which config file this is in so that I can turn it off and try compiling again?

          mituM 1 Reply Last reply Reply Quote 0
          • mituM
            mitu Global Moderator @Neo-Rio
            last edited by mitu

            @neo-rio Try modifying the advmame compile line in ~/RetroPie-Setup/scriptmodules/emulators/advmame.sh (make a backup of the file first). Around line 40 (https://github.com/RetroPie/RetroPie-Setup/blob/master/scriptmodules/emulators/advmame.sh#L40) replace

            /configure --prefix="$md_inst"
            

            with

            CFLAGS="-fno-stack-protector" /configure --prefix="$md_inst"
            

            After this modification, try to re-build from source and see if you get the same error while running a ROM. Make sure you revert the change after you're done, since an update of the RetroPie-Setup script will fail because of a local modification.

            1 Reply Last reply Reply Quote 0
            • N
              Neo-Rio
              last edited by

              Good news is that this fix worked. I got advanceMame working now.

              I suppose this mod will have to be added to updated versions of retro-pie.

              mituM 1 Reply Last reply Reply Quote 0
              • mituM
                mitu Global Moderator @Neo-Rio
                last edited by

                @neo-rio IMHO it should be reported upstream, since this error is triggered when checking for buffer overflows:

                -fstack-protector
                Emit extra code to check for buffer overflows, such as stack smashing attacks. This is done by adding a guard variable to functions with vulnerable objects. This includes functions that call alloca, and functions with buffers larger than 8 bytes. The guards are initialized when a function is entered and then checked when the function exits. If a guard check fails, an error message is printed and the program exits.

                1 Reply Last reply Reply Quote 0
                • N
                  Neo-Rio
                  last edited by

                  @mitu said in Advance MAME won't make a working compile on Ubuntu 17.10:

                  CFLAGS="-fno-stack-protector"

                  I created a pull request in github.

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post

                  Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.

                  Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.