From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/9983 Path: news.gmane.org!not-for-mail From: Szabolcs Nagy Newsgroups: gmane.linux.lib.musl.general Subject: Re: musl-cross-make / litecross improvements Date: Tue, 3 May 2016 13:39:43 +0200 Message-ID: <20160503113942.GS22574@port70.net> References: <20160503044835.GA5517@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="i7F3eY7HS/tUJxUd" X-Trace: ger.gmane.org 1462275601 22972 80.91.229.3 (3 May 2016 11:40:01 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 3 May 2016 11:40:01 +0000 (UTC) Cc: j-core@j-core.org To: musl@lists.openwall.com Original-X-From: musl-return-9996-gllmg-musl=m.gmane.org@lists.openwall.com Tue May 03 13:40:01 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 1axYgI-0006Ok-Ed for gllmg-musl@m.gmane.org; Tue, 03 May 2016 13:39:58 +0200 Original-Received: (qmail 28085 invoked by uid 550); 3 May 2016 11:39:55 -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 28064 invoked from network); 3 May 2016 11:39:54 -0000 Mail-Followup-To: musl@lists.openwall.com, j-core@j-core.org Content-Disposition: inline In-Reply-To: <20160503044835.GA5517@brightrain.aerifal.cx> User-Agent: Mutt/1.5.24 (2015-08-30) Xref: news.gmane.org gmane.linux.lib.musl.general:9983 Archived-At: --i7F3eY7HS/tUJxUd Content-Type: text/plain; charset=us-ascii Content-Disposition: inline * Rich Felker [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 --i7F3eY7HS/tUJxUd Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="mcm.diff" 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 --i7F3eY7HS/tUJxUd--