latomic
authorDebian LibreOffice Maintainers <debian-openoffice@lists.debian.org>
Mon, 2 Sep 2019 17:17:30 +0000 (18:17 +0100)
committerRene Engelhard <rene@debian.org>
Mon, 2 Sep 2019 17:17:30 +0000 (18:17 +0100)
commita91f43584daf702d095c9f828d1de6108e5bf787
tree2a66aaa3c2ee3697b8846628204a1112d059c5a2
parent0db36246da657cbc1d7107fa2b2410df8c79837f
latomic

commit 71ad51b81443681014662c61d486c510966c6510 (HEAD -> master)
Author: Stephan Bergmann <sbergman@redhat.com>
Date:   Mon Sep 2 10:20:24 2019 +0200

    Add -latomic to the end of Linux C++ linker command lines

    b11763dbaa0c7f427ea47abe9b98995cb49a8595 "link with -latomic on mips(el),
    armel, powerpc, m68k" had added -latomic to the linker command lines of just
    some Linux platforms (which apparently happened to actually require it).  But
    there were three issues with that:

    * The -latomic came too early on the command line, so that it wasn't used to
      satisfy dependencies of .o files that came later.  See the discussion at
      <https://gerrit.libreoffice.org/#/c/78319/> "set -Wl,--no-as-needed for
      -latomic".

    * There is presumably no need to include -latomic on C linker command lines.

    * <https://gcc.gnu.org/onlinedocs/gcc-7.3.0/libstdc++/manual/manual/using.html
      #manual.intro.using.flags> (matching our Linux libstdc++ 7.3.0 baseline as
      per README.md) states:  "Linking to libatomic is required for some uses of
      ISO C++11 <atomic>."  So we should better include -latomic on every Linux C++
      linker command line that uses libstdc++.  (This patch assumes that we always
      use libstdc++ on Linux.)

    Ideally we could rely on -latomic always being available with our baseline
    libstdc++ 7.3.0, but when using Red Hat Developer Toolset 7 that appears not to
    be the case, as reported by a Jenkins build for an older version of this change
    (see below), so use ATOMIC_LIB from the preceding commit
    <https://gerrit.libreoffice.org/#/c/78336/> "add -latomic configure check...".

    <https://ci.libreoffice.org/job/gerrit_linux_gcc_release/40298/console>:
    > [build LNK] Executable/unoapploader
    > /opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: cannot find -latomic
    > collect2: error: ld returned 1 exit status
    > /home/tdf/lode/jenkins/workspace/lo_gerrit/Config/linux_gcc_release_64/solenv/gbuild/LinkTarget.mk:636: recipe for target '/home/tdf/lode/jenkins/workspace/lo_gerrit/Config/linux_gcc_release_64/workdir/LinkTarget/Executable/idxdict' failed

    This patch adds -latomic only on Linux.  Similar changes can be made for other
    platforms if need be.

    Change-Id: I75df5410677f4c31c796d7ba85532bcdb47eb111

commit 7bdac5b1567089b9ccb239c5031f03fa0d918fca
Author: Rene Engelhard <rene@debian.org>
Date:   Fri Aug 30 21:00:55 2019 +0200

    add -latomic configure check...

    ...in preparation for <https://gerrit.libreoffice.org/#/c/78380/> "Add -latomic to the end of Linux C++ linker command lines"

    (copied from https://github.com/zelcash/zelcash/blob/master/build-aux/m4/l_atomic.m4)

    Change-Id: I8879a72d730cc08a72c2d8b132ff9f5d2efe7b9f

Gbp-Pq: Name latomic.diff
config_host.mk.in
configure.ac
m4/l_atomic.m4 [new file with mode: 0644]
solenv/gbuild/LinkTarget.mk
solenv/gbuild/platform/LINUX_ARM_GCC.mk
solenv/gbuild/platform/LINUX_GODSON_GCC.mk
solenv/gbuild/platform/LINUX_M68K_GCC.mk
solenv/gbuild/platform/LINUX_POWERPC_GCC.mk
solenv/gbuild/platform/linux.mk
solenv/gbuild/platform/unxgcc.mk