mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@libc.org>
To: musl@lists.openwall.com
Cc: j-core@j-core.org
Subject: Re: Re: [J-core] musl-cross-make / litecross improvements
Date: Wed, 4 May 2016 14:09:23 -0400	[thread overview]
Message-ID: <20160504180923.GT21636@brightrain.aerifal.cx> (raw)
In-Reply-To: <20160504171656.GY22574@port70.net>

On Wed, May 04, 2016 at 07:16:56PM +0200, Szabolcs Nagy wrote:
> * Rich Felker <dalias@libc.org> [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


  reply	other threads:[~2016-05-04 18:09 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-03  4:48 Rich Felker
2016-05-03 11:39 ` Szabolcs Nagy
2016-05-03 18:02   ` Rich Felker
2016-05-03 20:16     ` Szabolcs Nagy
2016-05-03 21:57       ` Szabolcs Nagy
2016-05-04  0:16         ` Rich Felker
2016-05-04  3:53         ` Rich Felker
2016-05-04  8:15           ` Szabolcs Nagy
2016-05-06  5:14         ` Rich Felker
2016-05-04  9:28 ` [J-core] " Rob Landley
2016-05-04 11:10   ` Szabolcs Nagy
2016-05-04 11:27     ` Laurent Bercot
2016-05-04 11:52       ` Szabolcs Nagy
2016-05-04 16:33   ` Rich Felker
2016-05-04 16:48     ` Daniel Cegiełka
2016-05-04 17:16     ` Szabolcs Nagy
2016-05-04 18:09       ` Rich Felker [this message]
2016-05-04 17:54     ` Rich Felker
2016-05-05 22:43 ` Patrick Oppenlander
2016-05-06  2:44   ` Rich Felker
2016-05-06  6:03     ` Patrick Oppenlander
2016-05-06 20:49     ` Szabolcs Nagy
2016-05-08 23:04       ` Patrick Oppenlander

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=20160504180923.GT21636@brightrain.aerifal.cx \
    --to=dalias@libc.org \
    --cc=j-core@j-core.org \
    --cc=musl@lists.openwall.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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

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).