pthreads linking in devel/F-13 issue

Roland McGrath roland at redhat.com
Wed Feb 24 22:52:27 UTC 2010


-pthread is indeed sufficient when it's really given to the linking $CC run.

> Does someone know why this is going wrong?

In unbound.spec I see:

%{__make} CFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE" QUIET=no %{?_smp_mflags}

This overrides the CFLAGS setting written into Makefile by configure.

You should never override CFLAGS in this way.  
The place to set CFLAGS is in the configure line.

You use %configure, which uses CFLAGS="${CFLAGS:-%optflags}".
(%optflags is the same as $RPM_OPT_FLAGS.)

So what would work is:

%configure ... \
	   CFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE"

However, what I would really suggest is that you instead put -D_GNU_SOURCE
into CFLAGS in the source package itself.  If you need that, it should not
be a Fedora-specific issue.  e.g., early in configure.ac you can use:

CFLAGS="$CFLAGS -D_GNU_SOURCE"


Thanks,
Roland


More information about the devel mailing list