From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/10111 Path: news.gmane.org!not-for-mail From: Lei Zhang Newsgroups: gmane.linux.lib.musl.general,gmane.comp.compilers.llvm.cvs,gmane.comp.compilers.clang.scm Subject: Re: [gentoo-musl] Re: Add support for musl-libc on Linux Date: Mon, 13 Jun 2016 21:50:16 +0800 Message-ID: References: <20160612190745.GA21691@britannica.bec.de> <20160613132155.GA31934@nyan> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1465825863 29935 80.91.229.3 (13 Jun 2016 13:51:03 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 13 Jun 2016 13:51:03 +0000 (UTC) To: Lei Zhang , llvm-commits , cfe-commits cfe , gentoo-musl@lists.gentoo.org, musl@lists.openwall.com Original-X-From: musl-return-10124-gllmg-musl=m.gmane.org@lists.openwall.com Mon Jun 13 15:50:56 2016 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1bCSG8-0004XJ-Ip for gllmg-musl@m.gmane.org; Mon, 13 Jun 2016 15:50:32 +0200 Original-Received: (qmail 20285 invoked by uid 550); 13 Jun 2016 13:50:30 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 20261 invoked from network); 13 Jun 2016 13:50:29 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=Qk03nwOmtAOIRAjTK2YKKNcLc3FlBk19k84wk7Wjl5w=; b=KQNwLMsCG9ChBcvr3nBCNFC9Z86gSMZWr72PRUg+gXMP9KunQ+v4BwnIifa4Y2fVqq a4Nrc3JbFwCMknKao9sAXhfDL9koAnczDu8Er/DyDCDBpseCkhc+13dX66LLW0KX06NU RRL3ufvNZC0hG/ULBLfJ2MS+K+LAr7XcUCzOYPqZO8DsQ/6XBN6J/Eibzn5OaYPQCWrE n0wn/Qnk7Kchhp7AK4s/Cb5p5xgwMaQypML+TXCiOkuyvLqqaDZJp782D6QaM1Sw2RIq 21TIcgHkz4sTmA4IDzJdvTeZC1ZdF0lGvAvMYKM/xBA7v2Tpr2LdPcE6XJZdpap6GidE I2qA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=Qk03nwOmtAOIRAjTK2YKKNcLc3FlBk19k84wk7Wjl5w=; b=jtxAZCVWRzEnNo3O8TnuXwWVzNfzY3cJhOlQEwKe/2DUUIjjnL5OUWbCVfII5zLFv0 Pp2rxzulXQmGqckmeGMTs6D6IKHVrJB4kJk8VOD+OfuXfx8KtfSJqsjTPAsSmalVzvCD uEWLXYXz+dYPh38Ek1ZDyeGEUZV9Emzc3YLCabpJ2l1FxxIff4Ep/tWD9aMs8FX7eX+s HPW5zEHqiO0k1spirzSSAa7o8f2mfTVbFVNwRBrIAmCpk6bd47DOaQkX/40WGAYpOc5a zGrqiDjSAfJ5vQRVHoBfYPruco7FvRSIK7mTn4hdNVRmRPcJ6Ak4J05sCy47BlNqXEfx pphg== X-Gm-Message-State: ALyK8tKV4lreaznzZuqb4frTaKMraOSaFUltXgdkgXpFwQmu9gJ/yOyeWBpJbo29cHh4a8SngkASEUrQe6vhvQ== X-Received: by 10.157.12.72 with SMTP id 66mr7811865otr.192.1465825817125; Mon, 13 Jun 2016 06:50:17 -0700 (PDT) In-Reply-To: <20160613132155.GA31934@nyan> Xref: news.gmane.org gmane.linux.lib.musl.general:10111 gmane.comp.compilers.llvm.cvs:335382 gmane.comp.compilers.clang.scm:155201 Archived-At: 2016-06-13 21:21 GMT+08:00 Felix Janda : > [Added CC to the musl list] > > Lei Zhang wrote: >> 2016-06-13 3:07 GMT+08:00 Joerg Sonnenberger : >> > On Sun, Jun 12, 2016 at 10:51:11AM +0800, Lei Zhang via llvm-commits wrote: >> >> Hi, >> >> >> >> I'm replying to this thread; sorry I wasn't subscribed to the list, >> >> thus cannot reply to it directly. >> >> >> >> http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20160606/161733.html >> >> >> >> Joerg, thanks for your reply. Could you please tell me what kind of >> >> test cases I should prepare? >> > >> > The target/triple parser has a unit test in >> > unittests/ADT/TripleTest.cpp. The rest should get output validation in >> > clang's test/Driver directory. Not sure which one is the primary >> > GNU/Linux test. >> >> Thanks for the pointer :) >> >> The patches are re-attached with test cases included. Do they look sane enough? > >> --- lib/Driver/ToolChains.cpp (revision 272546) >> +++ lib/Driver/ToolChains.cpp (working copy) >> @@ -4152,6 +4152,8 @@ >> >> if (Triple.isAndroid()) >> return Triple.isArch64Bit() ? "/system/bin/linker64" : "/system/bin/linker"; >> + else if (Triple.getEnvironment() == llvm::Triple::Musl) >> + return "/lib/ld-musl-" + Triple.getArchName().str() + ".so.1"; > > It does not seem to me that the dynamic linker name detection will work > on most archs not in the test cases. For example, the arm gentoo musl > stage3's have the target triple You're right. Frankly I've only had x86 platforms on my mind so far; but I agree with Rafael that we could extend this to other archs in the future. > It seems difficult to get all cases right and some of them might not be > very interesting, but it would be nice to have a more intelligent patch. > See for example > > http://git.alpinelinux.org/cgit/aports/plain/main/clang/clang-0004-Add-musl-targets-and-dynamic-linker.patch This looks neat :) Lei