Select the default libc, guard unsupported combos, and tidy up - #1885
Open
cmuellner wants to merge 4 commits into
Open
Select the default libc, guard unsupported combos, and tidy up#1885cmuellner wants to merge 4 commits into
cmuellner wants to merge 4 commits into
Conversation
The default make target could only be switched to the Linux/glibc toolchain, via --enable-linux. newlib was the hard-coded fallback, and musl or uclibc could only be built through their explicit "make musl" / "make uclibc" targets. Add --enable-newlib, --enable-musl and --enable-uclibc so any bundled C library can be made the default target and built with a plain "make", just like --enable-linux already allows. Teach the "build-libc" staged target to build the selected libc for musl and uclibc as well, instead of falling through to newlib. Signed-off-by: Christoph Müllner <christoph.muellner@vrull.eu>
The per-libc installation sections were near-identical boilerplate that differed only in the configure flag and the make target. Fold newlib and the Linux glibc/musl/uClibc toolchains into a single section with a small table, so the shared steps are described once and uClibc, which had no section at all, is covered too. While here, tidy the surrounding docs: correct the intro (it described only newlib and glibc), state explicitly that Newlib is the default make target, trim the multilib section, and document the toolchains' limitations -- multilib and the check/report test targets are only available for the Newlib and Linux/glibc toolchains. Signed-off-by: Christoph Müllner <christoph.muellner@vrull.eu>
The per-libc variable groups had settled into different orders: *_TUPLE led with linux and *_TARGET_FLAGS with glibc, while *_SRC_GIT and the build targets used newlib, linux, musl, uclibc. Reorder *_TUPLE and *_TARGET_FLAGS to the latter so every group follows the same order and the file is easier to scan. Signed-off-by: Christoph Müllner <christoph.muellner@vrull.eu>
The musl and uClibc toolchains build GCC with --disable-multilib and wire no per-variant runtime, so --enable-multilib was silently ignored: the user asked for a multilib toolchain and quietly got a single-variant one. Likewise --enable-llvm has no build rule for the uClibc toolchain, so it configured cleanly and then failed at make time. Reject both combinations up front when the default target does not support the requested feature. Signed-off-by: Christoph Müllner <christoph.muellner@vrull.eu>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Preparatory cleanup for picolibc.
It makes every bundled libc a first-class default make target,
rejects feature/libc combinations that cannot work, and tidies
the Makefile and README. No functional change for the existing
default (newlib) or Linux builds.
Commits
Allow selecting the default libc with
--enable-{newlib,musl,uclibc}The default make target could previously only be switched to Linux/glibc
(
--enable-linux); newlib was the hard-coded fallback and musl/uClibc couldonly be built through their explicit
make musl/make uclibctargets.Add
--enable-newlib,--enable-musland--enable-uclibcso any bundledlibc can be the default and built with a plain
make. Also teach thebuild-libcstaged target to build musl/uClibc instead of falling throughto newlib.
README: streamline the installation instructions
Fold the near-identical per-libc install sections into a single table (and
document uClibc, which had no section). Correct the intro, state that Newlib
is the default target, trim the multilib section, and document that multilib
and the
check/reporttargets are only available for the Newlib andLinux/glibc toolchains.
Makefile: order the per-libc variables consistently
*_TUPLEand*_TARGET_FLAGSused a different order than*_SRC_GITandthe build targets. Put them all in the same order.
configure: reject unsupported multilib and LLVM default targets
The musl and uClibc toolchains build GCC with
--disable-multiliband wireno per-variant runtime, so
--enable-multilibwas silently ignored — theuser asked for a multilib toolchain and quietly got a single-variant one.
Likewise
--enable-llvmhas no build rule for the uClibc toolchain, so itconfigured cleanly and then failed at make time. Reject both up front.
Testing
Configure-level smoke tests only (no behavioural change to builds):
./configure --enable-{newlib,linux,musl,uclibc}each selects the matchingdefault target (
all: <libc>); no flag defaults to newlib.--enable-{musl,uclibc} --enable-multiliband--enable-uclibc --enable-llvmnow error;
--enable-multilib(newlib default),--enable-linux --enable-multilib, and--enable-musl --enable-llvmstill pass.make build-libcbuilds the selected libc for musl/uClibc.