From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/10002 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: Re: [J-core] musl-cross-make / litecross improvements Date: Wed, 4 May 2016 14:09:23 -0400 Message-ID: <20160504180923.GT21636@brightrain.aerifal.cx> References: <20160503044835.GA5517@brightrain.aerifal.cx> <5729C0B2.5080707@landley.net> <20160504163329.GR21636@brightrain.aerifal.cx> <20160504171656.GY22574@port70.net> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1462385381 7885 80.91.229.3 (4 May 2016 18:09:41 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 4 May 2016 18:09:41 +0000 (UTC) Cc: j-core@j-core.org To: musl@lists.openwall.com Original-X-From: musl-return-10015-gllmg-musl=m.gmane.org@lists.openwall.com Wed May 04 20:09:40 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 1ay1Ex-0007CG-IX for gllmg-musl@m.gmane.org; Wed, 04 May 2016 20:09:39 +0200 Original-Received: (qmail 29967 invoked by uid 550); 4 May 2016 18:09:36 -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 29938 invoked from network); 4 May 2016 18:09:36 -0000 Content-Disposition: inline In-Reply-To: <20160504171656.GY22574@port70.net> User-Agent: Mutt/1.5.21 (2010-09-15) Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:10002 Archived-At: On Wed, May 04, 2016 at 07:16:56PM +0200, Szabolcs Nagy wrote: > * Rich Felker [2016-05-04 12:33:29 -0400]: > > On Wed, May 04, 2016 at 04:28:18AM -0500, Rob Landley wrote: > > > Still no native toolchains. :) > > > > In theory all you have to do to get a native toolchain is first build > > and install the cross toolchain so that the cross tools are in your > > path, then COMMON_CONFIG += --host=$(TARGET). I can test and see if it > > works. > > > > Of course it's somewhat large to install on small systems like J2 but > > I think you could run it from the sdcard. > > i tried it for x86_64 and with the following config.mak change > > ifeq ($(NATIVE),yes) > COMMON_CONFIG += --host=$(TARGET) > OUTPUT = $(PWD)/output-native In principle I think OUTPUT should be left to the user, but native compilers are somewhat different since you can't install a bunch of them in the same location. Not sure what the best way to handle that is. > BUILD_DIR = build-$(TARGET)-native > XGCC = $(TARGET)-gcc Also the AR and RANLIB passed to musl's make are wrong (they don't run on the build system). Passing --host to musl's build system (always) and omitting the AR/RANLIB vars on the make command line (in NATIVE mode only) is the right solution, I think. > PATH_ORIG := $(PATH) > export PATH = $(PWD)/output/bin:$(PATH_ORIG) This type of approach makes sense for scripting a build in the same tree, but I don't think we're ready for integrating that sort of process. It would require rules/dependencies to build the appropriate cross compiler to begin with and install it to a controlled location under the build dir. Since native compilers are not really the point (and easy to do by yourself without litecross; arguably even easier) I think I'd rather just assume that if the user wants to use litecross for a native compiler they can either install the necessary cross compiler in their path or update PATH on their own. > endif > > make install && make install NATIVE=yes > > built a native toolchain into output-native > (it still installs musl into a $(TARGET) subdir, but > i think that's just a matter of copying things around.) It's easy to change that just by changing the DESTDIR passed to musl's "make install". Rich