Dear all,
when compiling and linking the following code I get the aforementioned link error:
$ pgcc --version
pgcc 18.4-0 64-bit target on x86-64 Linux -tp haswell
PGI Compilers and Tools
Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
$ cat >swab.c <<EOC
#include <linux/swab.h>
int main(int i, char *a[]) {
return __swab32(42u);
}
EOC
$ pgcc swab.c
/tmp/pgccG7xgGx-Pb9r0.o: In function `main':
/home/wesarg/tmp/pgi.PHHQ/./swab.c:4: undefined reference to `__builtin_constant_p'
This happens with the LLVM variant too. This happens on a recent Ubuntu installation with GCC 7. I can provide the result of preprocessing, if requested.
My workaround is to add this line to the _c_macros.h
:
#define __builtin_constant_p(x) (0)