mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Szabolcs Nagy <nsz@port70.net>
To: musl@lists.openwall.com
Cc: j-core@j-core.org
Subject: Re: musl-cross-make / litecross improvements
Date: Tue, 3 May 2016 13:39:43 +0200	[thread overview]
Message-ID: <20160503113942.GS22574@port70.net> (raw)
In-Reply-To: <20160503044835.GA5517@brightrain.aerifal.cx>

[-- Attachment #1: Type: text/plain, Size: 2577 bytes --]

* Rich Felker <dalias@libc.org> [2016-05-03 00:48:36 -0400]:
> I've made a number of improvements and fixes to musl-cross-make which
> are in the upstream repo now, based on bug reports I got:
> 
> - Spurious dependency on flex (upstream's fault, worked around)
> - Spurious dependency on texinfo (ditto)

gcc assumes you want to install info files if BUILD_INFO
is set, which is set based on MAKEINFO, however you cannot
override that, because the configure script will find a
working makeinfo if there is one on the system anyway..

explicit gcc_cv_prog_makeinfo_modern=no solves this in gcc
directories. (the man pages are still installed)

possibly make -o info -o install-info -o install-man
can do this too (havent tested).

> - Ability to use pre-installed gmp/mpc/mpfr libs
> - Config examples for static linking, no-debug builds.

this is not enough:
COMMON_CONFIG += CFLAGS="-g0 -Os" CXXFLAGS="-g0 -Os" LDFLAGS="-s"

target libs still have the full debug path in them,
for that you also need:
COMMON_CONFIG += CFLAGS_FOR_TARGET="-g0 -Os" CXXFLAGS_FOR_TARGET="-g0 -Os" LDFLAGS_FOR_TARGET="-s"

however libgcc seems to be built specially and -g
is always passed there (after CFLAGS_FOR_TARGET),
but one can drop the build path prefix by
COMMON_CONFIG += --with-debug-prefix-map=$(PWD)=

musl is built differently (LDFLAGS is needed because of libgcc):
MUSL_CONFIG += --disable-debug LDFLAGS=-s

i'm not sure if it's a good idea distributing the
toolchain without debug info, but this is needed
if you want to avoid leaking the build path.
the abs build path is still present in all the .la
and .a files and in
lib/gcc/x86_64-linux-musl/5.2.0/install-tools/mkheaders.conf
for me the host lib path managed to get into
lib64/libcc1.so.0.0.0 (via rpath).

> 
> https://github.com/richfelker/musl-cross-make
> 
> A few things I still plan to add at some point:
> 
> - Support for GCC 6, maybe older GCC's too
> - Fixing configure bottlenecks with config.cache
> - Getting "make check" working
> - Automating multi-target builds
> - Automating building binary static-linked-vs-musl toolchains
> 
> Let me know if any major bugs/inconveniences remain that I should
> prioritize fixing.

the target libs are installed under lib64/,
i think the usr/ and lib64/ symlinks are useful
(so it can be used as rootfs without fiddling
with etc/ld-musl*.path).

i think
GCC_CONFIG += --disable-gnu-indirect-function
is important, otherwise libatomic will be broken.

gcc-6 will need
GCC_CONFIG += --disable-libmpx

and libstdc++ only uses vdso clock_gettime
with --enable-libstdcxx-time

[-- Attachment #2: mcm.diff --]
[-- Type: text/x-diff, Size: 1139 bytes --]

diff --git a/litecross/Makefile b/litecross/Makefile
index fbabe4a..d2a7bce 100644
--- a/litecross/Makefile
+++ b/litecross/Makefile
@@ -17,6 +17,7 @@ MUSL_CONFIG = CC="$(XGCC)" LIBCC="../obj_toolchain/$(TARGET)/libgcc/libgcc.a" --
 
 MAKE += INFO_DEPS= infodir=
 MAKE += ac_cv_prog_lex_root=lex.yy.c
+MAKE += gcc_cv_prog_makeinfo_modern=no
 
 FULL_TOOLCHAIN_CONFIG = $(TOOLCHAIN_CONFIG) \
 	--disable-werror \
@@ -132,10 +133,16 @@ obj_toolchain/.lc_built: | obj_toolchain/.lc_configured obj_sysroot/.lc_libs
 	cd obj_toolchain && $(MAKE) MAKE="$(MAKE)" LC_ROOT=$(PWD)
 	touch $@
 
-install-musl: | obj_musl/.lc_built
+.lc_target_links:
+	mkdir -p $(DESTDIR)$(OUTPUT)/$(TARGET)
+	ln -sf . $(DESTDIR)$(OUTPUT)/$(TARGET)/usr
+	ln -sf lib $(DESTDIR)$(OUTPUT)/$(TARGET)/lib64
+	touch $@
+
+install-musl: | obj_musl/.lc_built .lc_target_links
 	cd obj_musl && $(MAKE) $(MUSL_VARS) DESTDIR=$(DESTDIR)$(OUTPUT)/$(TARGET) install
 
-install-toolchain: | obj_toolchain/.lc_built
+install-toolchain: | obj_toolchain/.lc_built .lc_target_links
 	cd obj_toolchain && $(MAKE) MAKE="$(MAKE)" LC_ROOT=$(PWD) DESTDIR=$(DESTDIR)$(OUTPUT) install
 
 endif

  reply	other threads:[~2016-05-03 11:39 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 [this message]
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
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=20160503113942.GS22574@port70.net \
    --to=nsz@port70.net \
    --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).