Re: configure sets GCC=yes for clang

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Tomas Vondra <tomas(dot)vondra(at)enterprisedb(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: configure sets GCC=yes for clang
Date: 2022-02-04 19:41:29
Message-ID: 424007.1644003689@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tomas Vondra <tomas(dot)vondra(at)enterprisedb(dot)com> writes:
> I've been doing some experiments with compilers, and I've noticed that
> when using clang configure still ends up setting
> GCC='yes'
> which seems somewhat strange.

I'm pretty sure that's intentional. clang tries to be a gcc-alike,
and mostly succeeds, other than variations in command line options.
It's better to set GCC=yes and deal with the small discrepancies
than not set it and have to deal with clang as a whole separate case.

> FWIW I've noticed because when building
> with "-Ofast" (yeah, I'm just playing with stuff) it fails like this:

> checking whether the C compiler still works... yes
> configure: error: do not put -ffast-math in CFLAGS

> which is in $GCC=yes check, and clang doesn't even have such option.

Well, the error is correct, even if clang doesn't spell the switch the
same way: you enabled fast-math optimizations and we don't want that.

[ wanders away wondering how meson handles this stuff ... ]

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2022-02-04 19:45:36 Re: Removing more vacuumlazy.c special cases, relfrozenxid optimizations
Previous Message Peter Geoghegan 2022-02-04 19:41:19 Re: Removing more vacuumlazy.c special cases, relfrozenxid optimizations