[llvm-dev] Raising the default baseline for a target

John Paul Adrian Glaubitz via llvm-dev
2022-01-18T23:16:49Z

Hello!

I'm trying to figure out how to raise the default baseline for the 32-bit
SPARC
target on Linux. Currently, this target defaults to the SPARCv7 architecture
which
lacks support for atomic instructions which is why the build of compiler-rt
fails
with, see [1]:

/usr/bin/ld: warning: -z gnu-version-script-compat ignored
/usr/bin/ld:
projects/compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommon.sparc.dir/sanitizer_libignore.cpp.o:
in function `bool
__sanitizer::atomic_compare_exchange_strong<__sanitizer::atomic_uint64_t>(__sanitizer::atomic_uint64_t
volatile*, __sanitizer::atomic_uint64_t::Type*,
__sanitizer::atomic_uint64_t::Type, __sanitizer::memory_order)':
/var/lib/buildbot/workers/debian-stadler-sparc64/clang-sparc64-linux-multistage/llvm/compiler-rt/lib/sanitizer_common/sanitizer_atomic_clang.h:80:
undefined reference to `__sync_val_compare_and_swap_8'

Since Linux distributions have been defaulting to the v9 instruction set with
32-bit
pointers for the 32-bit SPARC for quite a while, I would like to set this
baseline as
default when targeting SPARC on 32-bit Linux. If anyone wanted to build for v7,
they
could still set the target with "-mcpu=v7".

Does anyone know how to set the default baseline for a given target? Raising the
baseline would finally fix the LLVM build on the Linux sparc64 buildbot which
has
been failing for quite a long time.

Discussion for this change happens in [2].

Thanks,
Adrian

> [1] https://lab.llvm.org/staging/#/builders/113/builds/5719
> [2] https://reviews.llvm.org/D98575

--
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaubitz at debian.org
`. `'   Freie Universitaet Berlin - glaubitz at physik.fu-berlin.de
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913