Repository navigation
Conversation
The producers of the archives the overlay/ directories download since SynoCommunity#7701, out of SynoCommunity#7391: native/gcc-8.5 with gmp, mpfr, mpc and isl, native/binutils-2.30 (v4) and native/rustc-1.82 on mk/spksrc.native-toolchain.mk and spksrc.native/toolchain-<component>.mk: arch-<arch>-<dsm>, all-<dsm>, host optimisation flags, profile-guided builds (TOOLCHAIN_PGO), TOOLCHAIN_JOBS, a generic arch built as the real arch whose archive it fetches. archive.mk writes an archive under a temporary name, then renames it; macros.mk gains the boolean helpers the producers read their knobs with. Nothing a package builds changes. native/rustc-1.98, built with gcc 8.5, stays in SynoCommunity#7391 with the switch that uses that gcc. Assisted-by: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VkzQnRy1W48Vg2QGRbwLSd
Assisted-by: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VkzQnRy1W48Vg2QGRbwLSd
The tc_vars section showed TC_CC, TC_AR and the like in tc_vars.mk, which holds the toolchain's identity and versions only: the tools and flags are in tc_vars.autotools.mk and tc_vars.flags.mk, and tc_vars.rust.mk carries the whole cargo and rustup environment. Each file is now shown as generated, for cross/zlib on qoriq-6.2.4, with who reads it; and for CMake and Meson, the per-dependency toolchain and cross files built at configure time from tc_vars.cmake and tc_vars.meson-cross plus the package's flags. Adding New Toolchain Support points at Synology's toolchain archive, the version map and download URL, and shows a toolchain Makefile and digests as they are. Assisted-by: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VkzQnRy1W48Vg2QGRbwLSd
| # Prefix for running a binary of that toolchain: the C locale. The gcc 4.7.3 of x86-5.2 | ||
| # (and x64-5.2) aborts on a current host's locale data -- "loadlocale.c:129: | ||
| # _nl_intern_locale_data: Assertion ... failed" -- on -v, -print-sysroot and every compile. | ||
| # Inline, as toolchain-rust.mk does for x.py: an export reaches $(shell) only from make 4.4. | ||
| TC_VENDOR_ENV = LC_ALL=C |
There was a problem hiding this comment.
Why not setting export LC_ALL := C applicable throughout the framework by default?
Repeated again in spksrc.native/toolchain-rust.mk
| ARCHIVE_TARGET = toolchain-pgo-no-archive | ||
| endif | ||
|
|
||
| include ../../mk/spksrc.native-cc.mk |
There was a problem hiding this comment.
Shouldn't this include be at the absolute end? only keeping what's mandatory above?
| # Generic native-toolchain front-end dispatches to mk/spksrc.native/toolchain-binutils.mk. | ||
| # Builds the archive the binutils overlay installs: mk/spksrc.native/toolchain-binutils.mk. | ||
| # make arch-ppc853x-5.2 make all-6.2.4 make TOOLCHAIN_PGO=0 arch-x86-5.2 | ||
| NATIVE_TOOLCHAIN = binutils |
There was a problem hiding this comment.
why not simply refer to PKG_NAME instead of adding yet another variable? likewise for gcc & rust?
|
|
||
| # Builds the archive the gcc overlay installs: mk/spksrc.native/toolchain-gcc.mk. | ||
| # make arch-qoriq-6.2.4 make all-6.2.4 make TOOLCHAIN_PGO=0 arch-x86-5.2 | ||
| NATIVE_TOOLCHAIN = gcc |
There was a problem hiding this comment.
same comment PKG_NAME
| @@ -1,2 +1,2 @@ | |||
| PKG_NAME = rustc | |||
| PKG_VERS = 1.82.0 | |||
There was a problem hiding this comment.
rust 1.98 is missing and need to be imported from PR #7391
| @@ -53,31 +53,3 @@ | |||
| # Generic native-toolchain front-end dispatches to mk/spksrc.native/toolchain-rust.mk. | |||
| NATIVE_TOOLCHAIN = rust | |||
There was a problem hiding this comment.
PKG_NAME could be renamed to rust to accommodate NATIVE_TOOLCHAIN and allowing to remove that variable (or the reverse to accommodate rustc thus renaming the later). similar to previous comments.
There was a problem hiding this comment.
there already exist a macro $(call tc ... why not reuse that?
| # | ||
| # Provides to the component mk and the package: | ||
| # TC_DIR toolchain/syno-<arch>-<vers> | ||
| # _tc_get $(call _tc_get,VAR) -> VAR as declared in the toolchain Makefile |
There was a problem hiding this comment.
same as above $(call tc ...
| @@ -25,6 +25,17 @@ | |||
| # TC_EXTRACT_DIR where tc-install lands the gcc toolchain (bin/, sysroot, ...) | |||
| # TC_SYSROOT_DIR the extracted toolchain's sysroot (from the declared TC_SYSROOT) | |||
| # tc-install ensures the gcc toolchain (hence its sysroot) is extracted | |||
There was a problem hiding this comment.
why? there already is status-cookies for that
| # The arch the archive is named after: TC_ARCH, or the real arch whose toolchain a generic | ||
| # one shares -- the same answer its consumer gets, so the published name is the fetched one. | ||
| include ../../mk/spksrc.overlay/dist-arch.mk |
There was a problem hiding this comment.
dist-arch.mk serves two purposes: native produce and overlay downloaders.
The only mk level-2 files being included directly falls under the spksrc.rules directory.
Move from overlay to rules.
Also, normally these rule files are included as early as possible in the mk file. move it up right below the header.
| # Component-specific logic: configuration, build/install targets, archive variables. | ||
| include ../../mk/spksrc.native/toolchain-$(NATIVE_TOOLCHAIN).mk |
There was a problem hiding this comment.
likewise this should be moved up under the header. And using PKG_NAME instead of yet another variable such as $(NATIVE_TOOLCHAIN).
| # One (arch, DSM), in the sub-make that knows it, hence its archive name: nothing to do when | ||
| # that archive exists -- an underlying arch already built for another generic one, or an | ||
| # all-<vers> resumed after a failure. Remove the archive to rebuild. | ||
| _TC_SELF = TC_ARCH=$(TC_ARCH) TC_VERS=$(TC_VERS) |
There was a problem hiding this comment.
I get it, it reduces the code repetition for a bit. But this also makes the code complex for no reason. Avoid using _TC_SELF and use TC_ARCH=$(TC_ARCH) TC_VERS=$(TC_VERS) instead.
| # The toolchains a component is built for are its consumers (TOOLCHAIN_CONSUMER), each | ||
| # brought back to the arch it builds as (toolchain_real above), once: x64-6.2.4 and | ||
| # x86-6.2.4 are one build of x86-6.2.4, x64-7.1 is apollolake-7.1. An arch whose archive | ||
| # exists is skipped (toolchain-arch), so a batch resumes where it stopped. | ||
| # | ||
| # TOOLCHAIN_KEEP_WORK = 0 drops each work dir once its archive exists; a failed one is | ||
| # kept, so a broken arch stays debuggable. | ||
| # | ||
| # Concurrency via xargs -P, deliberately NOT make's -j: -j goes into MAKEFLAGS and | ||
| # propagates into every sub-make, parallelising toolchain targets not written for it. | ||
| TOOLCHAIN_JOBS ?= 1 | ||
| TOOLCHAIN_KEEP_WORK ?= 1 |
There was a problem hiding this comment.
This should be near the top, close to the header and not hidden down below in the code between recipes.
|
|
||
| toolchain_archs = $(sort $(foreach d,$(wildcard $(BASEDIR)/overlay/syno-*-$(1)_$(TOOLCHAIN_CONSUMER)),\ | ||
| $(patsubst %-$(1),%,$(call toolchain_real,$(patsubst syno-%,%,$(firstword $(subst _, ,$(notdir $(d))))))))) | ||
|
|
There was a problem hiding this comment.
don't we have something similar part of spksrc.common.mk (sub-loading spksrc.common/archs.mk)
if not, please avoid hiding variables intertwined between recipes. If needed, this should be around the toolchain_real declaration. ... unless both toolchain_arch and toolchain_real can be moved to spksrc.common/archs.mk and loaded thru spksrc.common.mk?
Just noticed toolchain-rust.mk does include ../../mk/spksrc.common/archs.mk ... method between native toolchain building should be similar throughout.
| CONFIGURE_ARGS += --disable-werror | ||
| CONFIGURE_ARGS += --disable-libsanitizer | ||
|
|
||
| COMPILE_ARGS = MAKEINFO=missing |
There was a problem hiding this comment.
I recall adding to native cmake CONFIGURE_ARGS += -DCMAKE_INSTALL_RPATH='$$ORIGIN/../lib' so binaries can be relocatable. Is this something that should be consider throughout the binutils, gcc, rustc native builds?
- spksrc.native-toolchain.mk reads top-down: dist-arch.mk and the knobs under the header, spksrc.common.mk before the toolchain is read, the component once it is, the recipes, and spksrc.native-cc.mk last. No _TC_SELF. - PKG_NAME picks the component (toolchain-<PKG_NAME>.mk): NATIVE_TOOLCHAIN goes, and toolchain-rust.mk becomes toolchain-rustc.mk, as native/rustc-*. - dist-arch.mk serves producers and overlays: it moves to spksrc.rules/. - toolchain_real and toolchain_archs join spksrc.common/archs.mk, which every component now gets from spksrc.common.mk; toolchain-rustc.mk no longer includes it itself. - makefile_var (macros.mk) reads one variable a Makefile declares: the producers, tc-capability.mk, spksrc.toolchain.mk and the overlays use it. - native/rustc-1.98 comes from SynoCommunity#7391 with the gcc decision of overlay.mk (OVERLAY_GCC, OVERLAY_GCC_VERS, TC_OVERLAY_GCC, OVERLAY_GCC_ON), off for the tree: the producer turns it on for itself. Packages are unchanged. Assisted-by: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VkzQnRy1W48Vg2QGRbwLSd
spksrc.common.mk exports LC_ALL=C: the vendor gcc of DSM 5.2 aborts under any other locale, which made those builds depend on the caller's shell. A $(shell) running a vendor tool keeps it inline (TC_VENDOR_ENV), as make 4.3 does not export to $(shell); the inline one of the x.py recipe goes. Checked under a fr_CA.UTF-8 host locale: zlib x86-5.2 (cmake, gcc 4.7.3), file (autotools), liblc3 (meson), fd (cargo). tc-install's comment says why it is not a DEPENDS. The docs follow the review: OVERLAY_GCC and OVERLAY_GCC_VERS in the switches, rustc-1.98, toolchain-$(PKG_NAME).mk, spksrc.rules/dist-arch.mk. Assisted-by: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VkzQnRy1W48Vg2QGRbwLSd
A Fortran LAPACK build spends a fifth of its time in f951 (OpenBLAS 0.3.30, perf: f951 21%, cc1 49%), which train.c and train.cpp never ran. train.f90, generated beside them, is the numerical Fortran such builds compile: loops over real(8) and complex(8) arrays, folded constants, intrinsics, modules and derived types. gcc-pgo-train compiles it at -O2 and -O3; train.c and train.cpp stay byte-identical, so C and C++ train as before. It compiles with the gfortran 8.5 of the overlay, in 5 and 8 s. For the next rebuild of the gcc overlay. Assisted-by: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VkzQnRy1W48Vg2QGRbwLSd
- macros.mk includes spksrc.common/macros/{version,bool,list,depend,tools,archs,runlog}.mk;
every macro documented the same way, define for a multi-line body, _ for internal names.
- makefile_var -> read_makefile_var, dedup-files -> dedup_files.
- overlay_dist_arch, toolchain_real and toolchain_archs move to macros/archs.mk;
spksrc.rules/dist-arch.mk goes.
- overlay.mk reads spksrc.common/overlay/{binutils,gcc,rustc,warnings}.mk in that order;
the toolchain side moves to spksrc.toolchain/overlay/.
- The producer components move to spksrc.native-toolchain/.
- toolchain.md: the overlay archives in the caching section.
Assisted-by: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VkzQnRy1W48Vg2QGRbwLSd
- spksrc.common/macros/string.mk: upper and lower, pure make. - TRUE / FALSE replace the internal _TRUE_VALUES / _FALSE_VALUES, in lower and upper case. - The Rust triple suffixes of tc_vars.rust.mk (RUST_TARGET_UENV / _LENV) and kernel-type-lc use them instead of tr in a shell. Assisted-by: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VkzQnRy1W48Vg2QGRbwLSd
…ions The arch-group patch directory (patch.mk) and DESCRIPTION_<LANG> (spksrc.spk.mk) took their case from tr in a shell, two forks per group or language; same names, no fork. Assisted-by: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VkzQnRy1W48Vg2QGRbwLSd
Description
The producers of the overlay archives, split out of #7391. Since #7701, master downloads gcc 8.5, binutils 2.30 and rust archives into
overlay/, but it can only rebuild the rust built with the vendor gcc: itsnative/binutils-2.30still produces the older v3 archive, and there is no gcc producer. This PR brings the producers that made the published archives, so master can rebuild everything it downloads. Nothing a package builds changes.native/gcc-8.5, withnative/gmp,native/mpfr,native/mpcandnative/isl, and a patch for the PowerPC SPE soft-float attribute.native/binutils-2.30produces thev4archives the overlays download: profile-guided, a generic arch's archive under the real arch it shares a toolchain with, for thetoolchains/dsm<dsm>releases.native/rustc-1.82on the same front-end.mk/spksrc.native-toolchain.mk, which carriesarch-<arch>-<dsm>,all-<dsm>, the host optimisation flags and the two profile-guided passes (TOOLCHAIN_PGO, on for gcc and binutils: cc1 8.5% faster at-O2and 12.5% at-O3,as10%), and dispatches tomk/spksrc.native/toolchain-{gcc,binutils,rust}.mk. A generic arch is built as the real arch whose archive it fetches (mk/spksrc.overlay/dist-arch.mk), and an archive that exists is not rebuilt, soall-<dsm>builds each one once,TOOLCHAIN_JOBSat a time, and resumes where it stopped. The PGO training sources are generated per arch (toolchain-pgo-sources.sh).archive.mkwrites an archive under a temporary name and renames it when complete, so an interrupted build never leaves a truncated file under the name a producer takes as finished.macros.mk(is_true,is_false,bool,assert_bool), which the producers read their knobs with, documented in Boolean values.makefile-system.md, and the changes log.After review:
native/rustc-1.98is in, with the gcc decision ofoverlay.mk(OVERLAY_GCC,OVERLAY_GCC_VERS,TC_OVERLAY_GCC,OVERLAY_GCC_ON), off for the tree (OVERLAY_GCC ?= 0): the producer turns it on for itself. Packages keep the vendor gcc and the same rust.spksrc.native-toolchain.mkreads top-down:dist-arch.mkand the knobs under the header,spksrc.common.mkbefore the toolchain is read, the component once it is, the recipes, andspksrc.native-cc.mklast.PKG_NAMEpicks the component (toolchain-gcc.mk,toolchain-binutils.mk,toolchain-rustc.mk);NATIVE_TOOLCHAINgoes.dist-arch.mkmoves tomk/spksrc.rules/, shared by producers and overlays;toolchain_realandtoolchain_archsmove tospksrc.common/archs.mk.makefile_var(macros.mk) reads one variable a Makefile declares, used by the producers,tc-capability.mk,spksrc.toolchain.mkand the overlays.export LC_ALL := Cinspksrc.common.mk, for every build: the vendor gcc of DSM 5.2 aborts under any other locale. A$(shell)running a vendor tool keeps it inline, as make 4.3 (the CI image) does not export to$(shell).f951on a generatedtrain.f90: a Fortran LAPACK build spends a fifth of its time in it.train.candtrain.cppstay byte-identical.Tests
make -nofnative/gcc-8.5,native/binutils-2.30andnative/rustc-1.82forarch-qoriq-6.2.4parse cleanly;native/gcc-8.5 all-5.2finds its 3 archs inoverlay/.native/binutils-2.30 TOOLCHAIN_PGO=0 arch-x86-5.2buildsbinutils-2.30-x86_64-pc-linux-gnu-x86-5.2-v4.txz, the nameoverlay/syno-x86-5.2_binutils-2.30downloads.all-6.2.4finds 28, 28, 2 and 2 archs,x64-7.1builds asapollolake-7.1;rustc-1.98targetsgcc-8.5and the archive its overlay downloads,rustc-1.82the vendor gcc.LC_ALL: under afr_CA.UTF-8host locale, zlib x86-5.2 (cmake, gcc 4.7.3), file (autotools), liblc3 (meson) and fd (cargo) build.train.f90compiles with the overlay's gfortran 8.5 (5 s at-O2, 8 s at-O3).Checklist
all-supportedcompleted successfullyType of change
🤖 Generated with Claude Code
https://claude.ai/code/session_01VkzQnRy1W48Vg2QGRbwLSd