On Mon, 2 Dec 2024, Prathamesh Kulkarni wrote:

> Thanks for the suggestions! Unfortunately, it seems to me that AC_PROG_CC 
> also does run tests that
> need modified CFLAGS. I tried the following assertion before invoking 
> AC_PROG_CC (for stage-1 build):
> 
> if test -z "${CFLAGS}"; then
>   AC_MSG_ERROR([CFLAGS must be set.])
> fi
> 
> and it seems to pass. So I suppose the default setting of CFLAGS in 
> AC_PROG_CC won't be applicable anyway ? I checked what value CFLAGS was 
> set to and it turned out to be "-g -O2" (same as default setting in 
> AC_PROG_CC, altho I am not quite sure where CFLAGS were set before 
> invoking libatomic/configure). Given that the above assert passes, would 
> it be safe to add "-fno-link-libatomic" to CFLAGS before invoking 
> AC_PROG_CC (and after the assert) ?

Provided the assertion goes together with the addition to CFLAGS (to catch 
any cases of someone building libatomic outside of the toplevel GCC build 
system), it would probably be safe.

-- 
Joseph S. Myers
josmy...@redhat.com

Reply via email to