[Dune-devel] Please review: pthread in dune/istl/paamg/test

Christoph Grüninger christoph.grueninger at iws.uni-stuttgart.de
Wed Nov 27 22:26:43 CET 2013


Hi Markus,
thanks for having a look, I'll apply my patch.

> looks OK to me, but I did not test it. (Having CFLAGS in 
> LDFLAGS makes absolutely no sense.) 

My first though was "Do'h!" and then how I could make a lame
excuse that I only changed Dominic's code. But it turned
out that C is an inexhaustible source of surprises:

> Compiler flags and linker flags are not mutually-exclusive sets, not
> least because linking is typically done via the compiler frontend (cc)
> and not by invoking the linker (ld) directly. Any flags that you can use
> in the compile step (e.g. -O2, -DFOO, -I/tmp/include) will generally be
> accepted in the linking step, even if it's not applicable then. [..]
> 
> Given that, it's a lot less error-prone to use PTHREAD_CFLAGS (and other
> CFLAGS variables) when linking, rather than duplicating the applicable
> flags into PTHREAD_LIBS/LDFLAGS/etc. variables and not using any CFLAGS
> variables then.

http://lists.gnu.org/archive/html/autoconf-archive-maintainers/2013-06/msg00021.html

So we should stick to using the PTHREAD_CFLAGS for the 
LDFLAGS.
Or do you prefer to move them to LDADD?

>> I mimics the other,
>> not failing pthread test and now it works. With the patch it
>> works with CMake, too.
> 
> ??? There are no changes to CMake in the patch, are there?

Sure, but the patch fixed the crashing application. I wanted 
to
point out, that CMake does not need further changes.

Bye
Christoph

-- 
Die meisten Gebäude stammen aus einer Zeit, in der man auch
Türklinken aus Beton gemacht hätte, wenn das denn ginge.
[Spiegel Online, 25. Februar 2013]
*********************************************
CMWR 2014: 10th - 13th June 2014 in Stuttgart
          Please visit www.cmwr14.de
*********************************************




More information about the Dune-devel mailing list