Please use compiler that supports __attribute__((constructor))

270 Views Asked by At

I just compiled my own version of gcc/9.2.0 using gcc/4.8.2. After successful compilation and installation of gcc/9.2.0 I try compiling ucx-1.5.1. When I try to run the ucx configure script I get the following message "checking attribute((constructor))... configure: error: Cannot continue. Please use compiler that supports attribute((constructor))". When I run the script using the old gcc/4.8.2 I get no error at all.

Any idea what went wrong?

3

There are 3 best solutions below

0
emacs drives me nuts On

Any idea what went wrong? No.

You can have a look at the respective config.log file, it usually contains additional information. In general, not every compilation error during configue indicates a problem, it's usually just feature test that just revealed a specific feature is not available.

0
prudenko On

Ucx uses next code to determine support of attribute __attribute__((constructor)). You can test it by yourself:

gcc -x c - <<EOF 
static int rc = 1;
static void constructor_test() __attribute__((constructor));
static void constructor_test() { rc = 0; }
int main() { return rc; }
EOF

And post here if you have some errors.

0
user17512841 On

I had the same problem, because I installed a software named "binutils-devel" on CentOS 8.4.

When "binutils-devel" was removed, the compile of ucx was successful.