• Explicitly linking -latomic

    From Joachim Reichel@21:1/5 to All on Sun Feb 20 19:30:01 2022
    Dear mips porters,

    I would like to get your input on bug #1005696. Is every C++ program using <atomic> supposed to add architecture-specific code to its build system to link with -latomic on mipsel? (Which apparently is not necessary on other architectures.) Or is this some implementation detail that the compiler/linker should take care of automatically?

    Best regards,
    Joachim

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Mathieu Malaterre@21:1/5 to joachim.reichel@posteo.de on Mon Feb 21 09:20:01 2022
    Hi Joachim

    On Sun, Feb 20, 2022 at 7:24 PM Joachim Reichel
    <joachim.reichel@posteo.de> wrote:

    Dear mips porters,

    I would like to get your input on bug #1005696. Is every C++ program using <atomic> supposed to add architecture-specific code to its build system to link
    with -latomic on mipsel?

    Yes !

    (Which apparently is not necessary on other
    architectures.)

    If you are unlucky, you'll need to tweak armel, mispel, powerpc and riscv64.

    Or is this some implementation detail that the compiler/linker
    should take care of automatically?

    The issue will not be fixed at cmake level, and fixing it at the spec
    level of gcc has proved to be difficult:

    * https://gitlab.kitware.com/cmake/cmake/-/issues/23021

    Basically you'll need to maintain your own libatomic patch...

    Best regards,
    Joachim


    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)