llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
28.86k stars 11.91k forks source link

[bug] D18557 still valid in aarch64/fbsd #69524

Open gczuczy opened 1 year ago

gczuczy commented 1 year ago

I've been building a petproject of mine, and hit D18557. I've disabled PCH and it got fixed.

Codebase: https://github.com/gczuczy/aegir/tree/master/aegir-brewd Error:

$ gmake
[  4%] Building CXX object CMakeFiles/brewd.dir/src/Exception.cc.o
/usr/home/aegir/aegir/aegir-brewd/src/Exception.cc:12:5: error: non-const lvalue reference to type '__builtin_va_list' cannot bind to a value of unrelated type 'va_list' (aka 'std::__va_list')
    va_start(args, _fmt);
    ^~~~~~~~~~~~~~~~~~~~
/usr/include/sys/_stdarg.h:42:47: note: expanded from macro 'va_start'
#define va_start(ap, last)      __builtin_va_start((ap), (last))
                                                   ^~~~
/usr/home/aegir/aegir/aegir-brewd/src/Exception.cc:14:12: error: non-const lvalue reference to type '__builtin_va_list' cannot bind to a value of unrelated type 'va_list' (aka 'std::__va_list')
    va_end(args);
           ^~~~
/usr/include/sys/_stdarg.h:48:38: note: expanded from macro 'va_end'
#define va_end(ap)              __builtin_va_end(ap)
                                                 ^~
2 errors generated.

After disabling pch, it built successfully.

Sys/tooling info:

$ clang -v
FreeBSD clang version 16.0.6 (https://github.com/llvm/llvm-project.git llvmorg-16.0.6-0-g7cbf1a259152)
Target: aarch64-unknown-freebsd14.0
Thread model: posix
InstalledDir: /usr/bin
$ uname -a
FreeBSD aegir 14.0-RC1 FreeBSD 14.0-RC1 #0 releng/14.0-n265264-b82c5a3429bb: Sun Oct 15 07:21:56 UTC 2023     toor@xx:/tank/rpi3/obj/tank/rpi3/src/arm64.aarch64/sys/AEGIR arm64

Could you please check D18557's relevance on aarch64?

llvmbot commented 1 year ago

@llvm/issue-subscribers-clang-frontend

Author: Gergely Czuczy (gczuczy)

I've been building a petproject of mine, and hit [D18557](https://reviews.llvm.org/D18557). I've disabled PCH and it got fixed. Codebase: https://github.com/gczuczy/aegir/tree/master/aegir-brewd Error: ``` $ gmake [ 4%] Building CXX object CMakeFiles/brewd.dir/src/Exception.cc.o /usr/home/aegir/aegir/aegir-brewd/src/Exception.cc:12:5: error: non-const lvalue reference to type '__builtin_va_list' cannot bind to a value of unrelated type 'va_list' (aka 'std::__va_list') va_start(args, _fmt); ^~~~~~~~~~~~~~~~~~~~ /usr/include/sys/_stdarg.h:42:47: note: expanded from macro 'va_start' #define va_start(ap, last) __builtin_va_start((ap), (last)) ^~~~ /usr/home/aegir/aegir/aegir-brewd/src/Exception.cc:14:12: error: non-const lvalue reference to type '__builtin_va_list' cannot bind to a value of unrelated type 'va_list' (aka 'std::__va_list') va_end(args); ^~~~ /usr/include/sys/_stdarg.h:48:38: note: expanded from macro 'va_end' #define va_end(ap) __builtin_va_end(ap) ^~ 2 errors generated. ``` After [disabling pch](https://github.com/gczuczy/aegir/blob/bb0d140676ac67c3c4cfe52f300f5208125c351e/aegir-brewd/include/CMakeLists.txt#L23), it built successfully. Sys/tooling info: ``` $ clang -v FreeBSD clang version 16.0.6 (https://github.com/llvm/llvm-project.git llvmorg-16.0.6-0-g7cbf1a259152) Target: aarch64-unknown-freebsd14.0 Thread model: posix InstalledDir: /usr/bin $ uname -a FreeBSD aegir 14.0-RC1 FreeBSD 14.0-RC1 #0 releng/14.0-n265264-b82c5a3429bb: Sun Oct 15 07:21:56 UTC 2023 toor@xx:/tank/rpi3/obj/tank/rpi3/src/arm64.aarch64/sys/AEGIR arm64 ``` Could you please check D18557's relevance on aarch64?