[llvm-bugs] [Bug 48623] New: mips stdatomic.h usage includes gcc headers (and fails)
via llvm-bugs
llvm-bugs at lists.llvm.org
Tue Dec 29 05:42:45 PST 2020
https://bugs.llvm.org/show_bug.cgi?id=48623
Bug ID: 48623
Summary: mips stdatomic.h usage includes gcc headers (and
fails)
Product: clang
Version: 11.0
Hardware: PC
OS: MacOS X
Status: NEW
Severity: normal
Priority: P
Component: Driver
Assignee: unassignedclangbugs at nondot.org
Reporter: saurik at saurik.com
CC: llvm-bugs at lists.llvm.org, neeilans at live.com,
richard-llvm at metafoo.co.uk
There have been a number of issues filed that are similar to this over the
years, notably including #22740. This issue was considered fixed a long time
ago, and in fact I generally can't replicate it... except when compiling for
MIPS (which I'm doing using a sysroot based on Debian Stretch).
#include <stdatomic.h>
static inline void CRYPTO_UP_REF(_Atomic int *val, int *ret, void *lock) {
*ret = atomic_fetch_add_explicit(val, 1, memory_order_relaxed) + 1; }
/usr/local/opt/llvm/bin/clang --sysroot
/Users/saurik/orchid/cli-shared/out-wrt/sysroot -target mips-linux-gnu -c -o
test.o test.c -v
clang -cc1 version 11.0.0 based upon LLVM 11.0.0 default target
x86_64-apple-darwin18.7.0
ignoring nonexistent directory
"/Users/saurik/orchid/cli-shared/out-wrt/sysroot/usr/local/include"
ignoring nonexistent directory
"/Users/saurik/orchid/cli-shared/out-wrt/sysroot/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/local/Cellar/llvm/11.0.0/lib/clang/11.0.0/include
/Users/saurik/orchid/cli-shared/out-wrt/sysroot/usr/lib/gcc/mips-linux-gnu/6/include
/Users/saurik/orchid/cli-shared/out-wrt/sysroot/usr/include/mips-linux-gnu
/Users/saurik/orchid/cli-shared/out-wrt/sysroot/usr/include
End of search list.
test.c:3:12: error: address argument to atomic operation must be a pointer to
integer or pointer ('_Atomic(int) *' invalid)
*ret = atomic_fetch_add_explicit(val, 1, memory_order_relaxed) + 1; }
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/saurik/orchid/cli-shared/out-wrt/sysroot/usr/lib/gcc/mips-linux-gnu/6/include/stdatomic.h:195:6:
note: expanded from macro 'atomic_fetch_add_explicit'
__atomic_fetch_add ((PTR), (VAL), (MO))
^ ~~~~~
1 error generated.
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20201229/c85cd3ea/attachment.html>
More information about the llvm-bugs
mailing list