This overlay adds Elbrus 2000 architecture support on top of the existing Gentoo upstream repository.
To make it work, new profile and keyword are added.
- Through magic of symlinks,
e2kprofile is based on upstream Gentoo profiles. - Keyword
e2kis only added to the packages that are specifically patched to support Elbrus. - As changes of getting this upstreamed are very slim due to proprietary compilers, packages that can be built as-is, are enabled through
amd64keyword, so we don't have to patch every ebuild from the upstream.It's temporarily on my machine /etc/portage, but could be added in profile, if profiles support.accept_keywords.package.accept_keywordsis landed into profile.
- The only patch is required for Gentoo portage tree is adding e2k to supported arches in
eclass/toolchain-funcs.eclass:
diff --git a/eclass/toolchain-funcs.eclass b/eclass/toolchain-funcs.eclass
index 89da26b86..8f65033c1 100644
--- a/eclass/toolchain-funcs.eclass
+++ b/eclass/toolchain-funcs.eclass
@@ -783,6 +783,7 @@ tc-ninja_magic_to_arch() {
bfin*) _tc_echo_kernel_alias blackfin bfin;;
c6x*) echo c6x;;
cris*) echo cris;;
+ e2k*) echo e2k;;
frv*) echo frv;;
hexagon*) echo hexagon;;
hppa*) _tc_echo_kernel_alias parisc hppa;;Thanks to MCST and ALT Linux Team for their efforts and publishing patches for Elbrus support, as OpenE2K is based around ~90% of their work. Thanks to Gentoo team for creating such flexible distribution and package manager.
Supported profiles:
- default/linux/e2k/23.0
- default/linux/e2k/23.0/systemd
Supported CPUs (defined as ABI in the profile):
- Elbrus 4C
- Elbrus 8CB
Supported ABIs:
- ptr32
- ptr64
- ptr128
TODO:
- Fill out missing parts above. :)
- Get rid of hardcoded stuff
- Add copyrights to ebuilds.
- Move
e2kkeyword to~e2k, as it's obviously not tested. - Remove all other keywords, so
e2kspecific packages won't get accidentally pulled on supported by upstream system.
- Build parts of lcc-libs that have source code published:
- compiler-rt
- libatomic
- libgcc
- libquadmath
- libstdc++
- Build and publish stage3
- Moar e2k packages:
- Add MCST and Unipro LLVM ports as separate packages
- Add MCST Rust port
- Add rtc (x86 binary translator) package, maybe neatly integrate as multilib, etc...
- Cross compiling support
# Set CPU_MODEL to the processor you have.
# We follow the naming scheme of LCC compiler binary packages as the sole
# reason for this variable is to know which compiler binary we need to get
# - e4c for Elbrus-4C
# - e1c for Elbrus-1C+
# - e8c for Elbrus-8C
# - e8c2 for Elbrus-8CB
# - e2c3 for Elbrus-2C3
# - e16c for Elbrus-16C
CPU_MODEL="e4c"
# Be careful with -mtune flag, with it LCC will set "forward incompatible" flag
# in the ELF header preventing you from running compiled binaries on newer CPUs
#
# OpenE2K stage3 is built for Elbrus-4C by default, which you are supposed to
# recompile for your native ISA.
COMMON_FLAGS="-O3 -pipe"
CFLAGS="${COMMON_FLAGS}"
CXXFLAGS="${COMMON_FLAGS}"
FCFLAGS="${COMMON_FLAGS}"
FFLAGS="${COMMON_FLAGS}"
MAKEOPTS="-j17 -l17"
VIDEO_CARDS="radeonsi amdgpu"