On Sun, Mar 26, 2017 at 03:56:18PM +0000, Antti Kantee wrote:
> On 26/03/17 09:11, Francesco Lattanzio wrote:
> >> Yes and no. Yes in that it's a bug, but no in that configure.ac is also
> >> wrong. exporting CC in buildrump.sh in the snippet that runs configure
> >> should fix it, at least assuming you're running buildrump.sh with
> >> "CC=clang ./buildrump.sh". Want to try it (and submit a pull req if so)?
> >
> > Done. See below.
>
> I don't see a pull req in buildrump.sh?
Sorry, I got confused and answered with the wrong answer.
The correct answer is: I couldn't reproduce this issue (that is, gcc
used to check for pthread_setname_np() and Clang to compile
librumpuser). I think I mixed the config.log and the buildrump.sh output
from different runs.
> But speaking of your patch to librumpuser, please just add the necessary
> things for FreeBSD using the existing conventions. For example, you
> cannot add a requirement for -lpthread, since some systems have the same
> functionality in libc without supplying a libpthread at all, and they
> would now be broken.
You're right -- I was mislead by the LIBS="${LIBS} -lpthread" line to
think libpthread to be a required library. I'll fix it.
> Thinking about it, that might be the reason the
> configure script uses AC_TRY_COMPILE instead of LINK to check for
> pthread stuff -- can't remember for sure anymore.
Using AC_TRY_COMPILE implies that the LIBS="${LIBS} -lpthread" is
superfluos. Ain't it?
> Furthermore, there's
> nothing which says that you cannot have pthread_set_name_np() without
> pthread_np.h; you might as well use #ifdef FreeBSD and not bother with
> autoconf at all.
Correct. I'll fix this too.
> Autoconf scripts work best when you test the minimum,
> and draw absolutely no a=>b type conclusions along the way.
>
> Does -Wimplicit instead of -Wimplicit-function-declaration work? That
> flag is already used by buildrump.sh, so reusing it in the configure
> script would avoid adding a dependency on a new compiler flag.
I'll try it.
> It's not necessary to post the autogenerated parts. I'll regen anyway
> as part of the merging and pulling and grinding process.
>
> So in summary, thanks, but the patch needs a bit more work to be
> conservative enough. Somewhere down the line I got tired of fixing
> things back and forth and got careful ...
I understand.
--
Francesco Lattanzio