linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Xie XiuQi <xiexiuqi@huaweicloud.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: akpm@linux-foundation.org, irogers@google.com, acme@redhat.com,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Yang Yingliang <yangyingliang@huawei.com>
Subject: Re: [PATCH RESEND] tools/mm: fix undefined reference to pthread_once
Date: Thu, 31 Aug 2023 10:57:39 +0800	[thread overview]
Message-ID: <f07bfca6-7b9a-8a9b-91c6-b6d7e6b161a5@huaweicloud.com> (raw)
In-Reply-To: <ZO/6JcbLV7+Eb0Vz@casper.infradead.org>

Hi,

On 2023/8/31 10:25, Matthew Wilcox wrote:
> On Thu, Aug 31, 2023 at 09:13:24AM +0800, Xie XiuQi wrote:
>> Hi,
>>
>> On 2023/8/28 20:58, Matthew Wilcox wrote:
>>> On Mon, Aug 28, 2023 at 08:21:57PM +0800, Xie XiuQi wrote:
>>>> diff --git a/tools/mm/Makefile b/tools/mm/Makefile
>>>> index 6c1da51f4177..9997b2e401ae 100644
>>>> --- a/tools/mm/Makefile
>>>> +++ b/tools/mm/Makefile
>>>> @@ -9,7 +9,7 @@ LIB_DIR = ../lib/api
>>>>  LIBS = $(LIB_DIR)/libapi.a
>>>>  
>>>>  CFLAGS += -Wall -Wextra -I../lib/
>>>> -LDFLAGS += $(LIBS)
>>>> +LDFLAGS += $(LIBS) -lpthread
>>>
>>> Is this the right fix?  I'm pretty sure you're suppose to use -pthread
>>> in CFLAGS in case there are other things the compiler/linker/whatever
>>> need.
>>>
>>
>> Thanks for your comment. I'll fix it and send v2.
> 
> You added it to LDFLAGS, not CFLAGS.

Sorry, it's my fault. I'll add it to CFALGS:

  CFLAGS += -Wall -Wextra -I../lib/ -pthread

> 
>>> '-pthread'
>>>      Define additional macros required for using the POSIX threads
>>>      library.  You should use this option consistently for both
>                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>>      compilation and linking.  This option is supported on GNU/Linux
>          ^^^^^^^^^^^^^^^^^^^^^^^
>>>      targets, most other Unix derivatives, and also on x86 Cygwin and
>>>      MinGW targets.
>>>
>>
>>



      reply	other threads:[~2023-08-31  2:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-28 12:21 Xie XiuQi
2023-08-28 12:58 ` Matthew Wilcox
2023-08-31  1:13   ` Xie XiuQi
2023-08-31  2:25     ` Matthew Wilcox
2023-08-31  2:57       ` Xie XiuQi [this message]

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=f07bfca6-7b9a-8a9b-91c6-b6d7e6b161a5@huaweicloud.com \
    --to=xiexiuqi@huaweicloud.com \
    --cc=acme@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=irogers@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=willy@infradead.org \
    --cc=yangyingliang@huawei.com \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox