LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Adrian Hunter <adrian.hunter@intel.com>
To: Josh Boyer <jwboyer@fedoraproject.org>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>,
	"Linux-Kernel@Vger. Kernel. Org" <linux-kernel@vger.kernel.org>,
	Jiri Olsa <jolsa@redhat.com>
Subject: Re: [PATCH] perf tools: Fix pthread_attr_setaffinity_np build error
Date: Wed, 25 Feb 2015 08:50:33 +0200	[thread overview]
Message-ID: <54ED70B9.9080101@intel.com> (raw)
In-Reply-To: <CA+5PVA7qZ_r2h+ANNCMMv0LzZ5xTv9do15C+Z_q5oEMZ3ZsFFw@mail.gmail.com>

On 24/02/2015 4:31 p.m., Josh Boyer wrote:
> On Tue, Feb 24, 2015 at 8:52 AM, Adrian Hunter <adrian.hunter@intel.com> wrote:
>> On 24/02/15 15:32, Josh Boyer wrote:
>>> On Tue, Feb 24, 2015 at 5:46 AM, Adrian Hunter <adrian.hunter@intel.com> wrote:
>>>> Feature detection for pthread_attr_setaffinity_np was failing,
>>>> producing this error:
>>>>
>>>> In file included from bench/futex-hash.c:17:0:
>>>> bench/futex.h:73:19: error: conflicting types for 'pthread_attr_setaffinity_np'
>>>>   static inline int pthread_attr_setaffinity_np(pthread_attr_t *attr,
>>>>                     ^
>>>> In file included from bench/futex.h:72:0,
>>>>                   from bench/futex-hash.c:17:
>>>> /usr/include/pthread.h:407:12: note: previous declaration of 'pthread_attr_setaffinity_np' was here
>>>>   extern int pthread_attr_setaffinity_np (pthread_attr_t *__attr,
>>>>              ^
>>>> make[3]: *** [bench/futex-hash.o] Error 1
>>>> make[2]: *** [bench] Error 2
>>>> make[2]: *** Waiting for unfinished jobs....
>>>>
>>>> This was because compiling test-pthread-attr-setaffinity-np.c
>>>> failed due to the function arguments:
>>>>
>>>> test-pthread-attr-setaffinity-np.c: In function 'main':
>>>> test-pthread-attr-setaffinity-np.c:11:2: warning: null argument where non-null required (argument 3) [-Wnonnull]
>>>>    ret = pthread_attr_setaffinity_np(&thread_attr, 0, NULL);
>>>>    ^
>>>> So fix the arguments.
>>>
>>> Erm, I sent a different fix for this a while ago.  It's queued in some
>>> -tip tree.  The feature test wasn't defining _GNU_SOURCE, which is
>>> required for pthread_attr_setaffinity_np.  Once that was set (passed
>>> via -D in the Makefile), the feature test worked fine.
>>>
>>> Did you have to use your patch on top of the fix already queued?
>>
>> Yes.
>>
>> The error (warning + Werror) I got definitely seemed to be about the use of
>> NULL as an argument.
>
> Hm, ok.  Which compiler/glibc are you using?  Curious that I'm not
> seeing that issue.

4.8.2

You could also see if you have the __nonnull attribute in the header e.g.

extern int pthread_attr_setaffinity_np (pthread_attr_t *__attr,
                                         size_t __cpusetsize,
                                         const cpu_set_t *__cpuset)
      __THROW __nonnull ((1, 3));


  reply	other threads:[~2015-02-25  6:50 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-24 10:46 Adrian Hunter
2015-02-24 13:32 ` Josh Boyer
2015-02-24 13:52   ` Adrian Hunter
2015-02-24 14:31     ` Josh Boyer
2015-02-25  6:50       ` Adrian Hunter [this message]
2015-03-01 16:50 ` [tip:perf/urgent] " tip-bot for Adrian Hunter
2015-03-01 16:52   ` Ingo Molnar
2015-03-02  7:59     ` [PATCH] perf tools: Initialize cpu set in pthread_attr_setaffinity_np feature test Adrian Hunter
2015-03-03  6:26       ` [tip:perf/core] " tip-bot for Adrian Hunter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54ED70B9.9080101@intel.com \
    --to=adrian.hunter@intel.com \
    --cc=acme@kernel.org \
    --cc=jolsa@redhat.com \
    --cc=jwboyer@fedoraproject.org \
    --cc=linux-kernel@vger.kernel.org \
    --subject='Re: [PATCH] perf tools: Fix pthread_attr_setaffinity_np build error' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).