From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751934AbbLaQv4 (ORCPT ); Thu, 31 Dec 2015 11:51:56 -0500 Received: from www17.your-server.de ([213.133.104.17]:49490 "EHLO www17.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751215AbbLaQvw (ORCPT ); Thu, 31 Dec 2015 11:51:52 -0500 X-Greylist: delayed 1802 seconds by postgrey-1.27 at vger.kernel.org; Thu, 31 Dec 2015 11:51:52 EST Date: Thu, 31 Dec 2015 17:21:43 +0100 Subject: Re: [uml-devel] [PATCH] um: link with -lpthread Message-ID: <781be574-7acc-4891-a12a-571f9e68e2dc@email.android.com> X-Android-Message-ID: <781be574-7acc-4891-a12a-571f9e68e2dc@email.android.com> In-Reply-To: <1451577977-12990-1-git-send-email-vegard.nossum@oracle.com> From: Thomas Meyer To: Vegard Nossum Cc: linux-kernel@vger.kernel.org, user-mode-linux-devel@lists.sourceforge.net, Richard Weinberger Importance: Normal X-Priority: 3 X-MSMail-Priority: Normal MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 X-Authenticated-Sender: thomas@m3y3r.de Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id tBVGqCf2008610 Am 31.12.2015 5:06 nachm. schrieb Vegard Nossum : > > Similarly to commit fb1770aa78a43530940d0c2dd161e77bc705bdac, with gcc 5 > on Ubuntu and CONFIG_STATIC_LINK=y I was seeing these linker errors: Hi, Oops, yes this patch looks good to me. Honestly I did never test the static link case. Sorry. With kind regards Thomas > > /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/librt.a(timer_create.o): In function `__timer_create_new': > (.text+0xcd): undefined reference to `pthread_once' > /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/librt.a(timer_create.o): In function `__timer_create_new': > (.text+0x126): undefined reference to `pthread_attr_init' > /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/librt.a(timer_create.o): In function `__timer_create_new': > (.text+0x168): undefined reference to `pthread_attr_setdetachstate' > [...] > > Obviously we also need -lpthread for librt.a. > > Signed-off-by: Vegard Nossum > --- > scripts/link-vmlinux.sh | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/scripts/link-vmlinux.sh b/scripts/link-vmlinux.sh > index dacf71a..ba6c34e 100755 > --- a/scripts/link-vmlinux.sh > +++ b/scripts/link-vmlinux.sh > @@ -62,7 +62,7 @@ vmlinux_link() > -Wl,--start-group                                    \ > ${KBUILD_VMLINUX_MAIN}                      \ > -Wl,--end-group                                      \ > - -lutil -lrt ${1} > + -lutil -lrt -lpthread ${1} > rm -f linux > fi > } > -- > 1.9.1 > > > ------------------------------------------------------------------------------ > _______________________________________________ > User-mode-linux-devel mailing list > User-mode-linux-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ¥Šwÿº{.nÇ+‰·¥Š{±þG«�éÿŠ{ayºʇڙë,j­¢f£¢·hš�ï�êÿ‘êçz_è®(­éšŽŠÝ¢j"�ú¶m§ÿÿ¾«þG«�éÿ¢¸?™¨è­Ú&£ø§~�á¶iO•æ¬z·švØ^¶m§ÿÿà ÿ¶ìÿ¢¸?–I¥