summaryrefslogtreecommitdiffstats
path: root/rules
diff options
context:
space:
mode:
Diffstat (limited to 'rules')
-rw-r--r--rules/architecture.in10
-rw-r--r--rules/cross-binutils.in5
-rw-r--r--rules/cross-binutils.make11
-rw-r--r--rules/cross-clang.make16
-rw-r--r--rules/cross-elf2flt.make4
-rw-r--r--rules/cross-gcc-first.make2
-rw-r--r--rules/cross-gcc.make28
-rw-r--r--rules/cross-gdb.make10
-rw-r--r--rules/cross-lld.make2
-rw-r--r--rules/cross-llvm.in4
-rw-r--r--rules/cross-llvm.make39
-rw-r--r--rules/cross-rustc.in55
-rw-r--r--rules/cross-rustc.make126
-rw-r--r--rules/ffmpeg.make1
-rw-r--r--rules/glibc-crt.make15
-rw-r--r--rules/glibc-first.make1
-rw-r--r--rules/glibc.in2
-rw-r--r--rules/glibc.make17
-rw-r--r--rules/host-fake-makeinfo.make6
-rw-r--r--rules/host-system-expat.make2
-rw-r--r--rules/host-system-gmp.make2
-rw-r--r--rules/host-system-isl.make2
-rw-r--r--rules/host-system-mpc.make2
-rw-r--r--rules/host-system-mpfr.make2
-rw-r--r--rules/host-system-openssl.in4
-rw-r--r--rules/host-system-openssl.make27
-rw-r--r--rules/host-system-xz.make2
-rw-r--r--rules/host-system-zlib.make2
-rw-r--r--rules/libelf.make1
-rw-r--r--rules/libgmp.make1
-rw-r--r--rules/newlib.make4
-rw-r--r--rules/post/ptxd_make_world_install.make14
-rw-r--r--rules/pre/toolchain.make43
-rw-r--r--rules/zlib.make1
34 files changed, 376 insertions, 87 deletions
diff --git a/rules/architecture.in b/rules/architecture.in
index d2f5ce2..4db4bf5 100644
--- a/rules/architecture.in
+++ b/rules/architecture.in
@@ -13,6 +13,9 @@ choice
config ARCH_MIPS
bool "mips "
+ config ARCH_MIPS64
+ bool "mips64 "
+
config ARCH_POWERPC
bool "powerpc"
@@ -31,6 +34,9 @@ choice
config ARCH_RISCV64
bool "RISCV64"
+ config ARCH_LOONGARCH
+ bool "LoongArch"
+
help
This option specifies the toolchain architecture. It corresponds to
the arch/ directory of the Linux kernel.
@@ -47,8 +53,10 @@ config ARCH
default "i386" if ARCH_I386
default "x86_64" if ARCH_X86_64
default "mips" if ARCH_MIPS
+ default "mips" if ARCH_MIPS64
default "powerpc" if ARCH_POWERPC
default "riscv" if ARCH_RISCV64
+ default "loongarch" if ARCH_LOONGARCH
config GNU_TARGET
string
@@ -63,5 +71,5 @@ config GNU_TARGET
config SIZEOF_LONG_DOUBLE
string
default "12" if ARCH_I386
- default "16" if ARCH_X86_64 || ARCH_ARM64 || ARCH_RISCV64
+ default "16" if ARCH_X86_64 || ARCH_ARM64 || ARCH_RISCV64 || ARCH_LOONGARCH
default "8"
diff --git a/rules/cross-binutils.in b/rules/cross-binutils.in
index 1cc2244..b1d5d42 100644
--- a/rules/cross-binutils.in
+++ b/rules/cross-binutils.in
@@ -30,4 +30,9 @@ config CROSS_BINUTILS_LICENSE_FILES
config CROSS_BINUTILS_LD_REAL
bool
+config CROSS_BINUTILS_GOLD
+ bool
+ default y
+ prompt "build gold linker"
+
endif
diff --git a/rules/cross-binutils.make b/rules/cross-binutils.make
index be043f3..9ad7ee5 100644
--- a/rules/cross-binutils.make
+++ b/rules/cross-binutils.make
@@ -38,6 +38,12 @@ CROSS_BINUTILS_CONF_ENV := \
CFLAGS="-ggdb3 -O2" \
CXXFLAGS="-ggdb3 -O2"
+ifneq ($(PTXCONF_ARCH_ARM64)$(PTXCONF_ARCH_X86_64)$(PTXCONF_ARCH_MIPS64),)
+CROSS_BINUTILS_LIBDIR := lib64
+else
+CROSS_BINUTILS_LIBDIR := lib
+endif
+
#
# autoconf
#
@@ -45,10 +51,11 @@ CROSS_BINUTILS_CONF_TOOL := autoconf
CROSS_BINUTILS_CONF_OPT := \
$(PTX_HOST_CROSS_AUTOCONF) \
$(PTXCONF_TOOLCHAIN_CONFIG_SYSROOT) \
- --with-lib-path="=/../$(PTX_TOUPLE_TARGET)/lib:=/lib:=/usr/lib" \
+ --with-lib-path="=/../$(PTX_TOUPLE_TARGET)/$(CROSS_BINUTILS_LIBDIR):=/$(CROSS_BINUTILS_LIBDIR):=/usr/$(CROSS_BINUTILS_LIBDIR)" \
\
- --enable-gold \
+ --$(call ptx/endis,PTXCONF_CROSS_BINUTILS_GOLD)-gold \
--enable-ld=default \
+ --disable-gprofng \
--disable-werror \
--disable-nls \
\
diff --git a/rules/cross-clang.make b/rules/cross-clang.make
index f1eafc7..c13b770 100644
--- a/rules/cross-clang.make
+++ b/rules/cross-clang.make
@@ -26,10 +26,6 @@ CROSS_CLANG_DIR := $(CROSS_BUILDDIR)/$(CROSS_CLANG)
CROSS_CLANG_LICENSE := $(call remove_quotes,$(PTXCONF_CROSS_CLANG_LICENSE))
CROSS_CLANG_LICENSE_FILES := $(call remove_quotes,$(PTXCONF_CROSS_CLANG_LICENSE_FILES))
-ifndef PTXCONF_ARCH_X86_64
-CROSS_CLANG_PATCHES := none
-endif
-
# ----------------------------------------------------------------------------
# Prepare
# ----------------------------------------------------------------------------
@@ -39,7 +35,7 @@ endif
#
CROSS_CLANG_CONF_TOOL := cmake
CROSS_CLANG_CONF_OPT = \
- $(HOST_CMAKE_OPT) \
+ $(HOST_CROSS_CMAKE_OPT) \
-G Ninja \
-DCMAKE_INSTALL_PREFIX=$(PTXCONF_PREFIX_CROSS) \
-DCMAKE_SKIP_INSTALL_RPATH=ON \
@@ -47,11 +43,19 @@ CROSS_CLANG_CONF_OPT = \
-DENABLE_LINKER_BUILD_ID=ON \
-DLLVM_ENABLE_LIBXML2=OFF \
-DLLVM_INSTALL_TOOLCHAIN_ONLY=ON \
- -DLLVM_CONFIG=$(CROSS_LLVM_DIR)-build/bin/llvm-config
+ -DLLVM_CMAKE_DIR=$(CROSS_LLVM_DIR)-build \
+ -DCMAKE_MODULE_PATH=$(CROSS_LLVM_DIR)/cmake/modules \
+ -DLLVM_MAIN_INCLUDE_DIR=$(CROSS_LLVM_DIR)/include \
+ -DLLVM_BINARY_DIR=$(CROSS_LLVM_DIR)-build
CROSS_CLANG_LDFLAGS := \
-Wl,-rpath,$$ORIGIN/../lib
+# Some tools that use libLLVM-*.so are executed at runtime in the build
+# directory. So the rpath specified above does not work
+CROSS_CLANG_MAKE_ENV := \
+ LD_LIBRARY_PATH=$(PTXDIST_SYSROOT_CROSS)$(PTXCONF_PREFIX_CROSS)/lib
+
# ----------------------------------------------------------------------------
# Install
# ----------------------------------------------------------------------------
diff --git a/rules/cross-elf2flt.make b/rules/cross-elf2flt.make
index a9f00d4..a79abe9 100644
--- a/rules/cross-elf2flt.make
+++ b/rules/cross-elf2flt.make
@@ -14,8 +14,8 @@ CROSS_PACKAGES-$(PTXCONF_CROSS_ELF2FLT) += cross-elf2flt
#
# Paths and names
#
-CROSS_ELF2FLT_VERSION := 2019.12
-CROSS_ELF2FLT_MD5 := 83389dd2cf4310f6d11a39c121fc772d
+CROSS_ELF2FLT_VERSION := 2020.09
+CROSS_ELF2FLT_MD5 := a3a688720de19f2d0883583729b7e093
CROSS_ELF2FLT := elf2flt-$(CROSS_ELF2FLT_VERSION)
CROSS_ELF2FLT_SUFFIX := tar.gz
CROSS_ELF2FLT_URL := https://github.com/uclinux-dev/elf2flt/archive/v$(CROSS_ELF2FLT_VERSION).$(CROSS_ELF2FLT_SUFFIX)
diff --git a/rules/cross-gcc-first.make b/rules/cross-gcc-first.make
index ebd4709..4879c10 100644
--- a/rules/cross-gcc-first.make
+++ b/rules/cross-gcc-first.make
@@ -65,7 +65,7 @@ CROSS_GCC_FIRST_MAKE_ENV := \
ifdef PTXDIST_ICECC
CROSS_GCC_FIRST_MAKE_ENV += \
- STAGE_CC_WRAPPER=icerun
+ STAGE_CC_WRAPPER=$(PTXDIST_ICERUN)
endif
# ----------------------------------------------------------------------------
diff --git a/rules/cross-gcc.make b/rules/cross-gcc.make
index 4faa421..5643dc8 100644
--- a/rules/cross-gcc.make
+++ b/rules/cross-gcc.make
@@ -21,8 +21,7 @@ CROSS_GCC_MD5 := $(call remove_quotes,$(PTXCONF_CROSS_GCC_MD5))
CROSS_GCC := gcc-$(CROSS_GCC_DL_VERSION)
CROSS_GCC_SUFFIX := tar.xz
CROSS_GCC_SOURCE := $(SRCDIR)/$(CROSS_GCC).$(CROSS_GCC_SUFFIX)
-CROSS_GCC_DIR := $(BUILDDIR_CROSS_DEBUG)/$(CROSS_GCC)
-CROSS_GCC_BUILDDIR := $(CROSS_BUILDDIR)/$(CROSS_GCC)-build
+CROSS_GCC_DIR := $(CROSS_BUILDDIR)/$(CROSS_GCC)
CROSS_GCC_BUILD_OOT := YES
CROSS_GCC_LICENSE := $(call remove_quotes,$(PTXCONF_CROSS_GCC_LICENSE))
CROSS_GCC_LICENSE_FILES := $(call remove_quotes,$(PTXCONF_CROSS_GCC_LICENSE_FILES))
@@ -41,7 +40,7 @@ ptx/abs2rel := $(PTXDIST_WORKSPACE)/scripts/ptxd_abs2rel.sh
$(STATEDIR)/cross-gcc.extract:
@$(call targetinfo)
@$(call clean, $(CROSS_GCC_DIR))
- @$(call extract, CROSS_GCC, $(BUILDDIR_CROSS_DEBUG))
+ @$(call extract, CROSS_GCC)
@$(call patchin, CROSS_GCC, $(CROSS_GCC_DIR))
ifdef PTXCONF_CROSS_ECJ
@cp $(CROSS_ECJ_SOURCE) $(CROSS_GCC_DIR)/ecj.jar
@@ -91,15 +90,13 @@ CROSS_GCC_AUTOCONF_COMMON := \
$(call ptx/ifdef,PTXCONF_HOST_SYSTEM_MPC,--with-mpc) \
$(call ptx/ifdef,PTXCONF_HOST_SYSTEM_ISL,--with-isl)
-ifndef PTXCONF_TOOLCHAIN_DEBUG
CROSS_GCC_AUTOCONF_COMMON += \
- --with-debug-prefix-map="$(TOOLCHAIN_CROSS_DEBUG_MAP)" \
- --enable-libstdcxx-debug-flags="-gdwarf-4 -O0 $(TOOLCHAIN_CROSS_DEBUG_FLAGS)"
+ --with-debug-prefix-map="$(call ptx/toolchain-cross-debug-map, CROSS_GCC)" \
+ --enable-libstdcxx-debug-flags="-gdwarf-4 -O0 -D_GLIBCXX_ASSERTIONS $(call ptx/toolchain-cross-debug-flags, CROSS_GCC)"
CROSS_GCC_CONF_ENV += \
- CFLAGS_FOR_TARGET="$(TOOLCHAIN_CROSS_DEBUG_FLAGS)" \
- CXXFLAGS_FOR_TARGET="$(TOOLCHAIN_CROSS_DEBUG_FLAGS)"
-endif
+ CFLAGS_FOR_TARGET="$(call ptx/toolchain-cross-debug-flags, CROSS_GCC)" \
+ CXXFLAGS_FOR_TARGET="$(call ptx/toolchain-cross-debug-flags, CROSS_GCC)"
# --enable-tls enable or disable generation of tls code
# overriding the assembler check for tls support
@@ -141,7 +138,7 @@ $(STATEDIR)/cross-gcc.prepare:
@$(call world/prepare, CROSS_GCC)
sed -i -e '/TOPLEVEL_CONFIGURE_ARGUMENTS/s;$(PTXDIST_WORKSPACE);$(PTXCONF_PROJECT);g' \
-e '/TOPLEVEL_CONFIGURE_ARGUMENTS/s;$(call ptx/sh, realpath $(PTXDIST_WORKSPACE));$(PTXCONF_PROJECT);g' \
- $(CROSS_GCC_BUILDDIR)/Makefile
+ $(CROSS_GCC_DIR)-build/Makefile
@$(call touch)
# ----------------------------------------------------------------------------
@@ -153,7 +150,7 @@ CROSS_GCC_MAKE_ENV := \
ifdef PTXDIST_ICECC
CROSS_GCC_MAKE_ENV += \
- STAGE_CC_WRAPPER=icerun
+ STAGE_CC_WRAPPER=$(PTXDIST_ICERUN)
endif
CROSS_GCC_MAKE_OPT := \
@@ -167,6 +164,10 @@ CROSS_GCC_MAKE_OPT := \
$(STATEDIR)/cross-gcc.install: $(STATEDIR)/cross-gcc.report
@$(call targetinfo)
@$(call world/install, CROSS_GCC)
+ifdef PTXCONF_CROSS_GCC_LANG_CXX
+ @test -e $(CROSS_GCC_PKGDIR)$(PTXCONF_PREFIX_CROSS)/$(PTXCONF_GNU_TARGET)/$(CROSS_BINUTILS_LIBDIR)/libstdc++.so.6 || \
+ ptxd_bailout "CROSS_BINUTILS_LIBDIR incorrect!"
+endif
@$(call world/env, CROSS_GCC) \
pkg_license_target=gcclibs \
@@ -183,9 +184,9 @@ $(STATEDIR)/cross-gcc.install: $(STATEDIR)/cross-gcc.report
ifneq ($(call remove_quotes,$(PTXDIST_SYSROOT_CROSS)),)
sed -i -e 's;$(call remove_quotes,$(PTXDIST_SYSROOT_CROSS));;' \
$(CROSS_GCC_PKGDIR)$(PTXCONF_PREFIX_CROSS)/lib/gcc/$(PTXCONF_GNU_TARGET)/$(CROSS_GCC_VERSION)/install-tools/mkheaders.conf
- if [ -e $(CROSS_GCC_PKGDIR)$(PTXCONF_PREFIX_CROSS)/lib/gcc/$(PTXCONF_GNU_TARGET)/$(CROSS_GCC_VERSION)/include-fixed/bits/statx.h ]; then \
+ if [ -e $(CROSS_GCC_PKGDIR)$(PTXCONF_PREFIX_CROSS)/lib/gcc/$(PTXCONF_GNU_TARGET)/$(CROSS_GCC_VERSION)/include-fixed/pthread.h ]; then \
sed -i -e 's;$(call remove_quotes,$(PTXDIST_SYSROOT_CROSS));;' \
- $(CROSS_GCC_PKGDIR)$(PTXCONF_PREFIX_CROSS)/lib/gcc/$(PTXCONF_GNU_TARGET)/$(CROSS_GCC_VERSION)/include-fixed/bits/statx.h; \
+ $(CROSS_GCC_PKGDIR)$(PTXCONF_PREFIX_CROSS)/lib/gcc/$(PTXCONF_GNU_TARGET)/$(CROSS_GCC_VERSION)/include-fixed/pthread.h; \
fi
endif
@$(call touch)
@@ -193,6 +194,7 @@ endif
$(STATEDIR)/cross-gcc.install.post:
@$(call targetinfo)
@$(call world/install.post, CROSS_GCC)
+ @$(call world/install-src, CROSS_GCC)
@ptxd_make_setup_target_compiler $(PTXDIST_SYSROOT_CROSS)$(PTXCONF_PREFIX_CROSS)/bin
@$(call touch)
diff --git a/rules/cross-gdb.make b/rules/cross-gdb.make
index dc958cd..69462d8 100644
--- a/rules/cross-gdb.make
+++ b/rules/cross-gdb.make
@@ -47,13 +47,7 @@ CROSS_GDB_CONF_OPT := \
\
--disable-werror \
--enable-tui \
- --with-expat
-
-# define this from the outside to build without python
-ifeq ($(CROSS_GDB_WITHOUT_PYTHON),y)
-CROSS_GDB_CONF_OPT += --without-python
-else
-CROSS_GDB_CONF_OPT += --with-python=python3
-endif
+ --with-expat \
+ --with-python=python3
# vim: syntax=make
diff --git a/rules/cross-lld.make b/rules/cross-lld.make
index 97b8291..e46bb86 100644
--- a/rules/cross-lld.make
+++ b/rules/cross-lld.make
@@ -35,7 +35,7 @@ CROSS_LLD_LICENSE_FILES := $(call remove_quotes,$(PTXCONF_CROSS_LLD_LICENSE_FILE
#
CROSS_LLD_CONF_TOOL := cmake
CROSS_LLD_CONF_OPT := \
- $(HOST_CMAKE_OPT) \
+ $(HOST_CROSS_CMAKE_OPT) \
-G Ninja \
-DCMAKE_INSTALL_PREFIX=$(PTXCONF_PREFIX_CROSS) \
-DCMAKE_SKIP_INSTALL_RPATH=ON \
diff --git a/rules/cross-llvm.in b/rules/cross-llvm.in
index 42682f2..7ca3d7a 100644
--- a/rules/cross-llvm.in
+++ b/rules/cross-llvm.in
@@ -20,6 +20,10 @@ config CROSS_LLVM_MD5
string
prompt "llvm source md5sum"
+config CROSS_LLVM_CMAKE_MODULES_MD5
+ string
+ prompt "llvm cmake source md5sum"
+
config CROSS_LLVM_LICENSE
string
prompt "LLVM license"
diff --git a/rules/cross-llvm.make b/rules/cross-llvm.make
index 62ae313..527c7b0 100644
--- a/rules/cross-llvm.make
+++ b/rules/cross-llvm.make
@@ -26,6 +26,19 @@ CROSS_LLVM_DIR := $(CROSS_BUILDDIR)/$(CROSS_LLVM)
CROSS_LLVM_LICENSE := $(call remove_quotes,$(PTXCONF_CROSS_LLVM_LICENSE))
CROSS_LLVM_LICENSE_FILES := $(call remove_quotes,$(PTXCONF_CROSS_LLVM_LICENSE_FILES))
+CROSS_LLVM_CMAKE_MODULES_VERSION := $(CROSS_LLVM_VERSION)
+CROSS_LLVM_CMAKE_MODULES_MD5 := $(call remove_quotes,$(PTXCONF_CROSS_LLVM_CMAKE_MODULES_MD5))
+CROSS_LLVM_CMAKE_MODULES := cmake-$(CROSS_LLVM_CMAKE_MODULES_VERSION)
+CROSS_LLVM_CMAKE_MODULES_SUFFIX := src.tar.xz
+CROSS_LLVM_CMAKE_MODULES_URL := \
+ https://releases.llvm.org/$(CROSS_LLVM_CMAKE_MODULES_VERSION)/$(CROSS_LLVM_CMAKE_MODULES).$(CROSS_LLVM_CMAKE_MODULES_SUFFIX) \
+ https://github.com/llvm/llvm-project/releases/download/llvmorg-$(CROSS_LLVM_CMAKE_MODULES_VERSION)/$(CROSS_LLVM_CMAKE_MODULES).$(CROSS_LLVM_CMAKE_MODULES_SUFFIX)
+CROSS_LLVM_CMAKE_MODULES_SOURCE := $(SRCDIR)/$(CROSS_LLVM_CMAKE_MODULES).$(CROSS_LLVM_SUFFIX)
+CROSS_LLVM_CMAKE_MODULES_DIR := $(CROSS_BUILDDIR)/cmake
+CROSS_LLVM_CMAKE_MODULES_STRIP_LEVEL := 1
+$(CROSS_LLVM_CMAKE_MODULES_SOURCE) := CROSS_LLVM_CMAKE_MODULES
+CROSS_LLVM_SOURCES += $(CROSS_LLVM_CMAKE_MODULES_SOURCE)
+
# ----------------------------------------------------------------------------
# Prepare
# ----------------------------------------------------------------------------
@@ -47,9 +60,15 @@ endif
ifdef PTXCONF_ARCH_MIPS
CROSS_LLVM_TARGET_ARCH := Mips
endif
+ifdef PTXCONF_ARCH_MIPS64
+CROSS_LLVM_TARGET_ARCH := Mips
+endif
ifdef PTXCONF_ARCH_POWERPC
CROSS_LLVM_TARGET_ARCH := PowerPC
endif
+ifdef PTXCONF_ARCH_LOONGARCH
+CROSS_LLVM_TARGET_ARCH := LoongArch
+endif
ifdef PTXCONF_CROSS_LLVM
ifndef CROSS_LLVM_TARGET_ARCH
@@ -67,7 +86,7 @@ CROSS_LLVM_TARGETS_TO_BUILD := \
#
CROSS_LLVM_CONF_TOOL := cmake
CROSS_LLVM_CONF_OPT := \
- $(HOST_CMAKE_OPT) \
+ $(HOST_CROSS_CMAKE_OPT) \
-G Ninja \
-DCMAKE_INSTALL_PREFIX=$(PTXCONF_PREFIX_CROSS) \
-DLLVM_ENABLE_BINDINGS=OFF \
@@ -76,8 +95,10 @@ CROSS_LLVM_CONF_OPT := \
-DLLVM_ENABLE_LIBPFM=OFF \
-DLLVM_ENABLE_LIBXML2=OFF \
-DLLVM_ENABLE_RTTI=ON \
- -DLLVM_INSTALL_UTILS=OFF \
+ -DLLVM_INCLUDE_BENCHMARKS=OFF \
+ -DLLVM_INCLUDE_TESTS=OFF \
-DLLVM_INSTALL_TOOLCHAIN_ONLY=ON \
+ -DLLVM_INSTALL_UTILS=OFF \
-DLLVM_LINK_LLVM_DYLIB=ON \
-DLLVM_TARGETS_TO_BUILD="$(subst $(space),;,$(CROSS_LLVM_TARGETS_TO_BUILD))" \
-DLLVM_TARGET_ARCH=host \
@@ -86,4 +107,18 @@ CROSS_LLVM_CONF_OPT := \
CROSS_LLVM_LDFLAGS := \
-Wl,-rpath,$$ORIGIN/../lib
+$(STATEDIR)/cross-llvm.extract:
+ @$(call targetinfo)
+ @$(call clean, $(CROSS_LLVM_DIR))
+ @$(call extract, CROSS_LLVM)
+ @$(call extract, CROSS_LLVM_CMAKE_MODULES)
+ @$(call touch)
+
+$(STATEDIR)/cross-llvm.install:
+ @$(call targetinfo)
+ @$(call world/install, CROSS_LLVM)
+ @install -v -m644 -D -t $(CROSS_LLVM_PKGDIR)/usr/lib/cmake/llvm \
+ $(CROSS_LLVM_DIR)-build/lib/cmake/llvm/*
+ @$(call touch)
+
# vim: syntax=make
diff --git a/rules/cross-rustc.in b/rules/cross-rustc.in
new file mode 100644
index 0000000..2af2ca3
--- /dev/null
+++ b/rules/cross-rustc.in
@@ -0,0 +1,55 @@
+menuconfig CROSS_RUSTC
+ tristate
+ select HOST_SYSTEM_OPENSSL
+ select CROSS_LLVM
+ prompt "rustc "
+ help
+ FIXME
+
+if CROSS_RUSTC
+
+config CROSS_RUSTC_VERSION
+ string
+ prompt "rustc version"
+ help
+ Specify the version of rustc here.
+
+config CROSS_RUSTC_MD5
+ string
+ prompt "rustc source md5sum"
+
+config CROSS_RUSTC_TARGET
+ string
+ default "${PTXCONF_GNU_TARGET}"
+ prompt "rust target triple"
+
+config CROSS_RUSTC_BUILD_VERSION
+ string
+ prompt "build version"
+ help
+ version of the prebuilt rust compiler. It will be used to bootstrap
+ the rust compiler.
+ Note: During updates, only change CROSS_RUSTC_VERSION at first.
+ The compile stage will then try (and fail) to download the
+ version (and build date) needed here. It is defined in
+ src/stage0.json in the source tarball.
+
+config CROSS_RUSTC_BUILD_DATE
+ string
+ prompt "build date"
+ help
+ needed to download the prebuilt rust compiler.
+
+config CROSS_RUSTC_BUILD_STD_MD5
+ string
+ prompt "rust-std binary md5sum"
+
+config CROSS_RUSTC_BUILD_RUSTC_MD5
+ string
+ prompt "rustc binary md5sum"
+
+config CROSS_RUSTC_BUILD_CARGO_MD5
+ string
+ prompt "cargo binary md5sum"
+
+endif
diff --git a/rules/cross-rustc.make b/rules/cross-rustc.make
new file mode 100644
index 0000000..423cdb8
--- /dev/null
+++ b/rules/cross-rustc.make
@@ -0,0 +1,126 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2019 by Michael Olbrich <m.olbrich@pengutronix.de>
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+#
+# We provide this package
+#
+CROSS_PACKAGES-$(PTXCONF_CROSS_RUSTC) += cross-rustc
+
+#
+# Paths and names
+#
+CROSS_RUSTC_VERSION := $(call remove_quotes,$(PTXCONF_CROSS_RUSTC_VERSION))
+CROSS_RUSTC_MD5 := $(call remove_quotes,$(PTXCONF_CROSS_RUSTC_MD5))
+CROSS_RUSTC := rustc-$(CROSS_RUSTC_VERSION)
+CROSS_RUSTC_SUFFIX := tar.xz
+CROSS_RUSTC_URL := https://static.rust-lang.org/dist/$(CROSS_RUSTC)-src.$(CROSS_RUSTC_SUFFIX)
+CROSS_RUSTC_SOURCE := $(SRCDIR)/$(CROSS_RUSTC)-src.$(CROSS_RUSTC_SUFFIX)
+CROSS_RUSTC_DIR := $(CROSS_BUILDDIR)/$(CROSS_RUSTC)
+
+CROSS_RUSTC_BUILD_VERSION := $(call remove_quotes,$(PTXCONF_CROSS_RUSTC_BUILD_VERSION))
+CROSS_RUSTC_BUILD_DATE := $(call remove_quotes,$(PTXCONF_CROSS_RUSTC_BUILD_DATE))
+
+CROSS_RUSTC_BUILD_STD_VERSION := $(CROSS_RUSTC_BUILD_VERSION)
+CROSS_RUSTC_BUILD_STD_MD5 := $(call remove_quotes,$(PTXCONF_CROSS_RUSTC_BUILD_STD_MD5))
+CROSS_RUSTC_BUILD_STD := rust-std-$(CROSS_RUSTC_BUILD_STD_VERSION)-$(GNU_BUILD)
+CROSS_RUSTC_BUILD_STD_SUFFIX := tar.xz
+CROSS_RUSTC_BUILD_STD_URL := https://static.rust-lang.org/dist/$(CROSS_RUSTC_BUILD_DATE)/$(CROSS_RUSTC_BUILD_STD).$(CROSS_RUSTC_BUILD_STD_SUFFIX)
+CROSS_RUSTC_BUILD_STD_SOURCE := $(SRCDIR)/$(CROSS_RUSTC_BUILD_STD).$(CROSS_RUSTC_BUILD_STD_SUFFIX)
+$(CROSS_RUSTC_BUILD_STD_SOURCE) := CROSS_RUSTC_BUILD_STD
+CROSS_RUSTC_SOURCES += $(CROSS_RUSTC_BUILD_STD_SOURCE)
+
+CROSS_RUSTC_BUILD_RUSTC_VERSION := $(CROSS_RUSTC_BUILD_VERSION)
+CROSS_RUSTC_BUILD_RUSTC_MD5 := $(call remove_quotes,$(PTXCONF_CROSS_RUSTC_BUILD_RUSTC_MD5))
+CROSS_RUSTC_BUILD_RUSTC := rustc-$(CROSS_RUSTC_BUILD_RUSTC_VERSION)-$(GNU_BUILD)
+CROSS_RUSTC_BUILD_RUSTC_SUFFIX := tar.xz
+CROSS_RUSTC_BUILD_RUSTC_URL := https://static.rust-lang.org/dist/$(CROSS_RUSTC_BUILD_DATE)/$(CROSS_RUSTC_BUILD_RUSTC).$(CROSS_RUSTC_BUILD_RUSTC_SUFFIX)
+CROSS_RUSTC_BUILD_RUSTC_SOURCE := $(SRCDIR)/$(CROSS_RUSTC_BUILD_RUSTC).$(CROSS_RUSTC_BUILD_RUSTC_SUFFIX)
+$(CROSS_RUSTC_BUILD_RUSTC_SOURCE) := CROSS_RUSTC_BUILD_RUSTC
+CROSS_RUSTC_SOURCES += $(CROSS_RUSTC_BUILD_RUSTC_SOURCE)
+
+CROSS_RUSTC_BUILD_CARGO_VERSION := $(CROSS_RUSTC_BUILD_VERSION)
+CROSS_RUSTC_BUILD_CARGO_MD5 := $(call remove_quotes,$(PTXCONF_CROSS_RUSTC_BUILD_CARGO_MD5))
+CROSS_RUSTC_BUILD_CARGO := cargo-$(CROSS_RUSTC_BUILD_CARGO_VERSION)-$(GNU_BUILD)
+CROSS_RUSTC_BUILD_CARGO_SUFFIX := tar.xz
+CROSS_RUSTC_BUILD_CARGO_URL := https://static.rust-lang.org/dist/$(CROSS_RUSTC_BUILD_DATE)/$(CROSS_RUSTC_BUILD_CARGO).$(CROSS_RUSTC_BUILD_CARGO_SUFFIX)
+CROSS_RUSTC_BUILD_CARGO_SOURCE := $(SRCDIR)/$(CROSS_RUSTC_BUILD_CARGO).$(CROSS_RUSTC_BUILD_CARGO_SUFFIX)
+$(CROSS_RUSTC_BUILD_CARGO_SOURCE) := CROSS_RUSTC_BUILD_CARGO
+CROSS_RUSTC_SOURCES += $(CROSS_RUSTC_BUILD_CARGO_SOURCE)
+
+CROSS_RUSTC_CONFIG := $(call ptx/in-path, PTXDIST_PATH_LAYERS, config/rustc.toml)
+CROSS_RUSTC_TARGET := $(call remove_quotes,$(PTXCONF_CROSS_RUSTC_TARGET))
+CROSS_RUSTC_TARGET_PATH := $(PTXDIST_WORKSPACE)/config/rust
+
+# ----------------------------------------------------------------------------
+# Prepare
+# ----------------------------------------------------------------------------
+
+CROSS_RUSTC_CONF_ENV := \
+ BUILD_TRIPLE=$(GNU_BUILD) \
+ TARGET_TRIPLE=$(CROSS_RUSTC_TARGET) \
+ PREFIX=$(PTXCONF_PREFIX_CROSS) \
+ COMPILER_PREFIX=$(COMPILER_PREFIX)
+
+$(STATEDIR)/cross-rustc.prepare:
+ @$(call targetinfo)
+ @mkdir -p $(CROSS_RUSTC_DIR)/build/cache/$(CROSS_RUSTC_BUILD_DATE)
+ @cp -v \
+ $(CROSS_RUSTC_BUILD_STD_SOURCE) \
+ $(CROSS_RUSTC_BUILD_RUSTC_SOURCE) \
+ $(CROSS_RUSTC_BUILD_CARGO_SOURCE) \
+ $(CROSS_RUSTC_DIR)/build/cache/$(CROSS_RUSTC_BUILD_DATE)/
+ $(CROSS_RUSTC_CONF_ENV) ptxd_replace_magic \
+ $(CROSS_RUSTC_CONFIG) > $(CROSS_RUSTC_DIR)/config.toml
+ @$(call touch)
+
+# ----------------------------------------------------------------------------
+# Compile
+# ----------------------------------------------------------------------------
+
+CROSS_RUSTC_MAKE_ENV := \
+ RUST_TARGET_PATH=$(CROSS_RUSTC_TARGET_PATH)
+
+$(STATEDIR)/cross-rustc.compile:
+ @$(call targetinfo)
+ @$(call world/execute, CROSS_RUSTC, ./x.py build)
+ @$(call touch)
+
+# ----------------------------------------------------------------------------
+# Install
+# ----------------------------------------------------------------------------
+
+define ptx/cross-rustc-wrapper-impl
+echo "Creating '$(1)'..."
+rm -f '$(1)'
+echo '#!/bin/sh' > '$(1)'
+echo 'd="$$(dirname $$(readlink -f "$${0}"))"' >> '$(1)'
+echo 'export RUST_TARGET_PATH="$$d"' >> '$(1)'
+echo 'exec "$$d/rustc" --target $(CROSS_RUSTC_TARGET) "$$@"' >> '$(1)'
+chmod +x '$(1)'
+endef
+
+define ptx/cross-rustc-wrapper
+$(call ptx/cross-rustc-wrapper-impl,$(strip \
+ $(CROSS_RUSTC_PKGDIR)$(PTXCONF_PREFIX_CROSS)/bin/$(COMPILER_PREFIX)rustc))
+endef
+
+$(STATEDIR)/cross-rustc.install:
+ @$(call targetinfo)
+ @$(call world/execute, CROSS_RUSTC, \
+ DESTDIR=$(CROSS_RUSTC_PKGDIR) ./x.py install)
+ @cp -v $(CROSS_RUSTC_TARGET_PATH)/$(CROSS_RUSTC_TARGET).json \
+ $(CROSS_RUSTC_PKGDIR)$(PTXCONF_PREFIX_CROSS)/bin/
+ @$(call ptx/cross-rustc-wrapper)
+ @rm -v $(CROSS_RUSTC_PKGDIR)$(PTXCONF_PREFIX_CROSS)/lib/rustlib/install.log
+ifneq ($(call remove_quotes,$(PTXDIST_SYSROOT_CROSS)),)
+ sed -i -e 's;$(PTXDIST_WORKSPACE);OSELAS.Toolchain;' \
+ $(CROSS_RUSTC_PKGDIR)$(PTXCONF_PREFIX_CROSS)/lib/rustlib/manifest*
+endif
+ @$(call touch)
+
+# vim: syntax=make
diff --git a/rules/ffmpeg.make b/rules/ffmpeg.make
deleted file mode 100644
index 04e0b0b..0000000
--- a/rules/ffmpeg.make
+++ /dev/null
@@ -1 +0,0 @@
-# this file is left intentionally blank
diff --git a/rules/glibc-crt.make b/rules/glibc-crt.make
index f6335b6..3162e30 100644
--- a/rules/glibc-crt.make
+++ b/rules/glibc-crt.make
@@ -38,8 +38,7 @@ GLIBC_CRT_ENV := \
ac_cv_path_GREP=grep \
ac_cv_sizeof_long_double=$(PTXCONF_SIZEOF_LONG_DOUBLE) \
libc_cv_c_cleanup=yes \
- libc_cv_forced_unwind=yes \
- libc_cv_slibdir='/lib'
+ libc_cv_forced_unwind=yes
#
# autoconf
@@ -52,12 +51,20 @@ GLIBC_CRT_MAKE_OPT := csu/subdir_lib
# Install
# ----------------------------------------------------------------------------
+GLIBC_CRT_LIBDIR := lib
+ifdef PTXCONF_ARCH_RISCV64
+GLIBC_CRT_LIBDIR := lib64/lp64d
+endif
+ifneq ($(PTXCONF_ARCH_ARM64)$(PTXCONF_ARCH_X86_64)$(PTXCONF_ARCH_MIPS64)$(PTXCONF_ARCH_LOONGARCH),)
+GLIBC_CRT_LIBDIR := lib64
+endif
+
$(STATEDIR)/glibc-crt.install:
@$(call targetinfo)
- @mkdir -vp $(SYSROOT)/usr/lib
+ @mkdir -vp $(SYSROOT)/usr/$(GLIBC_CRT_LIBDIR)
@for file in {S,}crt1.o crt{i,n}.o; do \
$(INSTALL) -v -m 644 $(GLIBC_CRT_BUILDDIR)/csu/$$file \
- $(SYSROOT)/usr/lib/$$file || exit 1; \
+ $(SYSROOT)/usr/$(GLIBC_CRT_LIBDIR)/$$file || exit 1; \
done
@$(call touch)
diff --git a/rules/glibc-first.make b/rules/glibc-first.make
index 9fcd9bb..e29c3e8 100644
--- a/rules/glibc-first.make
+++ b/rules/glibc-first.make
@@ -41,7 +41,6 @@ GLIBC_FIRST_ENV := \
libc_cv_c_cleanup=yes \
libc_cv_forced_unwind=yes \
libc_cv_fpie=yes \
- libc_cv_slibdir='/lib' \
libc_cv_ssp=yes \
libc_cv_visibility_attribute=yes \
libc_cv_broken_visibility_attribute=no \
diff --git a/rules/glibc.in b/rules/glibc.in
index 72a3692..0ea31a9 100644
--- a/rules/glibc.in
+++ b/rules/glibc.in
@@ -99,7 +99,7 @@ config GLIBC_HEADERS_FAKE_CROSS
string
prompt "fake cross args"
default "-D__ARM_EABI__" if ARCH_ARM
- default "-DBOOTSTRAP_GCC" if ARCH_MIPS
+ default "-DBOOTSTRAP_GCC" if ARCH_MIPS || ARCH_MIPS64
help
Add these args to fake a crosscompiler during glibc-header extraction stage.
diff --git a/rules/glibc.make b/rules/glibc.make
index 674118a..f09830c 100644
--- a/rules/glibc.make
+++ b/rules/glibc.make
@@ -22,8 +22,8 @@ GLIBC_MD5 := $(call remove_quotes,$(PTXCONF_GLIBC_MD5))
GLIBC := glibc-$(GLIBC_DL_VERSION)
GLIBC_SUFFIX := tar.gz
GLIBC_SOURCE := $(SRCDIR)/$(GLIBC).$(GLIBC_SUFFIX)
-GLIBC_DIR := $(BUILDDIR_DEBUG)/$(GLIBC)
-GLIBC_BUILDDIR := $(BUILDDIR)/$(GLIBC)-build
+GLIBC_DIR := $(BUILDDIR)/$(GLIBC)
+GLIBC_BUILD_OOT := YES
GLIBC_URL := \
$(call ptx/mirror, GNU, glibc/$(GLIBC).$(GLIBC_SUFFIX)) \
https://repo.or.cz/glibc.git/snapshot/$(GLIBC).$(GLIBC_SUFFIX) \
@@ -41,8 +41,6 @@ GLIBC_ENV := \
BUILD_CC=$(HOSTCC) \
MAKEINFO=: \
\
- libc_cv_slibdir='/lib' \
- \
ac_cv_path_BASH_SHELL=/bin/bash \
ac_cv_sizeof_long_double=$(PTXCONF_SIZEOF_LONG_DOUBLE)
@@ -76,8 +74,8 @@ GLIBC_CONF_OPT := \
--enable-shared \
--enable-static-nss
-GLIBC_CFLAGS = $(TOOLCHAIN_CROSS_DEBUG_FLAGS)
-GLIBC_CXXFLAGS = $(TOOLCHAIN_CROSS_DEBUG_FLAGS)
+GLIBC_CFLAGS := $(call ptx/toolchain-cross-debug-flags, GLIBC)
+GLIBC_CXXFLAGS := $(call ptx/toolchain-cross-debug-flags, GLIBC)
# ----------------------------------------------------------------------------
# Install
@@ -86,6 +84,8 @@ GLIBC_CXXFLAGS = $(TOOLCHAIN_CROSS_DEBUG_FLAGS)
$(STATEDIR)/glibc.install: $(STATEDIR)/glibc.report
@$(call targetinfo)
@$(call world/install, GLIBC)
+ @test -e $(GLIBC_PKGDIR)/usr/$(GLIBC_CRT_LIBDIR)/crt1.o || \
+ ptxd_bailout "GLIBC_CRT_LIBDIR incorrect!"
@$(call world/env, GLIBC) ptxd_make_world_copy_license
#
@@ -99,7 +99,12 @@ $(STATEDIR)/glibc.install: $(STATEDIR)/glibc.report
echo ' libraries :-( So try them secondarily. */' >> "$(GLIBC_PKGDIR)/usr/lib/libc.a" && \
echo 'GROUP ( /usr/lib/libc_ns.a /usr/lib/libnss_files.a /usr/lib/libnss_dns.a /usr/lib/libresolv.a )' >> "$(GLIBC_PKGDIR)/usr/lib/libc.a" ; \
fi
+ @$(call touch)
+$(STATEDIR)/glibc.install.post:
+ @$(call targetinfo)
+ @$(call world/install.post, GLIBC)
+ @$(call world/install-src, GLIBC)
@$(call touch)
# vim: syntax=make
diff --git a/rules/host-fake-makeinfo.make b/rules/host-fake-makeinfo.make
index 4d5a704..d87cc53 100644
--- a/rules/host-fake-makeinfo.make
+++ b/rules/host-fake-makeinfo.make
@@ -23,9 +23,9 @@ HOST_FAKE_MAKEINFO_LICENSE := ignore
$(STATEDIR)/host-fake-makeinfo.install:
@$(call targetinfo)
- install -d $(HOST_FAKE_MAKEINFO_PKGDIR)/bin
- echo 'if [ "$${1}" == "--version" ]; then echo "makeinfo (GNU texinfo) 5.2"; fi' > $(HOST_FAKE_MAKEINFO_PKGDIR)/bin/makeinfo
- chmod +x $(HOST_FAKE_MAKEINFO_PKGDIR)/bin/makeinfo
+ install -d $(HOST_FAKE_MAKEINFO_PKGDIR)/usr/bin
+ echo 'if [ "$${1}" == "--version" ]; then echo "makeinfo (GNU texinfo) 5.2"; fi' > $(HOST_FAKE_MAKEINFO_PKGDIR)/usr/bin/makeinfo
+ chmod +x $(HOST_FAKE_MAKEINFO_PKGDIR)/usr/bin/makeinfo
@$(call touch)
# vim: syntax=make
diff --git a/rules/host-system-expat.make b/rules/host-system-expat.make
index f53f129..6acf9ed 100644
--- a/rules/host-system-expat.make
+++ b/rules/host-system-expat.make
@@ -21,7 +21,7 @@ $(STATEDIR)/host-system-expat.prepare:
@echo "Checking for expat ..."
@pkg-config expat || \
ptxd_bailout "expat development files not found!" \
- "Please install libexpat1-dev (debian)"
+ "Please install libexpat1-dev (debian) or expat-devel (fedora)"
@$(call touch)
# vim: syntax=make
diff --git a/rules/host-system-gmp.make b/rules/host-system-gmp.make
index afcc4c8..609d2f6 100644
--- a/rules/host-system-gmp.make
+++ b/rules/host-system-gmp.make
@@ -21,7 +21,7 @@ $(STATEDIR)/host-system-gmp.prepare:
@echo "Checking for gmp ..."
@echo "#include <gmp.h>" | $(HOSTCC) -x c -c -o /dev/null - 2>/dev/null || \
ptxd_bailout "gmp development files not found!" \
- "Please install libgmp-dev (debian)"
+ "Please install libgmp-dev (debian) or gmp-devel (fedora)"
@$(call touch)
diff --git a/rules/host-system-isl.make b/rules/host-system-isl.make
index 6ff580d..03f9028 100644
--- a/rules/host-system-isl.make
+++ b/rules/host-system-isl.make
@@ -17,7 +17,7 @@ $(STATEDIR)/host-system-isl.prepare:
@echo "Checking for isl ..."
@echo "#include <isl/version.h>" | $(HOSTCC) -x c -c -o /dev/null - 2>/dev/null || \
ptxd_bailout "isl development files not found!" \
- "Please install libisl-dev (debian)"
+ "Please install libisl-dev (debian) or isl-devel (fedora)"
@$(call touch)
# vim: syntax=make
diff --git a/rules/host-system-mpc.make b/rules/host-system-mpc.make
index ec2991d..1f6337a 100644
--- a/rules/host-system-mpc.make
+++ b/rules/host-system-mpc.make
@@ -21,7 +21,7 @@ $(STATEDIR)/host-system-mpc.prepare:
@echo "Checking for mpc ..."
@echo "#include <mpc.h>" | $(HOSTCC) -x c -c -o /dev/null - 2>/dev/null || \
ptxd_bailout "mpc development files not found!" \
- "Please install libmpc-dev (debian)"
+ "Please install libmpc-dev (debian) or libmpc-devel (fedora)"
@$(call touch)
# vim: syntax=make
diff --git a/rules/host-system-mpfr.make b/rules/host-system-mpfr.make
index 9dab7bb..bcff0a0 100644
--- a/rules/host-system-mpfr.make
+++ b/rules/host-system-mpfr.make
@@ -21,7 +21,7 @@ $(STATEDIR)/host-system-mpfr.prepare:
@echo "Checking for mpfr ..."
@echo "#include <mpfr.h>" | $(HOSTCC) -x c -c -o /dev/null - 2>/dev/null || \
ptxd_bailout "mpfr development files not found!" \
- "Please install libmpfr-dev (debian)"
+ "Please install libmpfr-dev (debian) or mpfr-devel (fedora)"
@$(call touch)
# vim: syntax=make
diff --git a/rules/host-system-openssl.in b/rules/host-system-openssl.in
new file mode 100644
index 0000000..b602ec1
--- /dev/null
+++ b/rules/host-system-openssl.in
@@ -0,0 +1,4 @@
+## SECTION=hosttools_noprompt
+
+config HOST_SYSTEM_OPENSSL
+ tristate
diff --git a/rules/host-system-openssl.make b/rules/host-system-openssl.make
new file mode 100644
index 0000000..e1f30a4
--- /dev/null
+++ b/rules/host-system-openssl.make
@@ -0,0 +1,27 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2021 by Michael Olbrich <m.olbrich@pengutronix.de>
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+#
+# We provide this package
+#
+HOST_PACKAGES-$(PTXCONF_HOST_SYSTEM_OPENSSL) += host-system-openssl
+HOST_SYSTEM_OPENSSL_LICENSE := ignore
+
+# ----------------------------------------------------------------------------
+# Prepare
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/host-system-openssl.prepare:
+ @$(call targetinfo)
+ @echo "Checking for openssl ..."
+ @pkg-config openssl || \
+ ptxd_bailout "openssl development files not found!" \
+ "Please install libssl-dev (debian) or openssl-devel (fedora)"
+ @$(call touch)
+
+# vim: syntax=make
diff --git a/rules/host-system-xz.make b/rules/host-system-xz.make
index 3de62c8..c4f089e 100644
--- a/rules/host-system-xz.make
+++ b/rules/host-system-xz.make
@@ -21,7 +21,7 @@ $(STATEDIR)/host-system-xz.prepare:
@echo "Checking for expat ..."
@pkg-config liblzma || \
ptxd_bailout "xz (lzma) development files not found!" \
- "Please install liblzma-dev (debian)"
+ "Please install liblzma-dev (debian) or xz-devel (fedora)"
@$(call touch)
# vim: syntax=make
diff --git a/rules/host-system-zlib.make b/rules/host-system-zlib.make
index 33c3cd7..ceb56c1 100644
--- a/rules/host-system-zlib.make
+++ b/rules/host-system-zlib.make
@@ -21,7 +21,7 @@ $(STATEDIR)/host-system-zlib.prepare:
@echo "Checking for zlib ..."
@pkg-config zlib || \
ptxd_bailout "zlib development files not found!" \
- "Please install zlib1g-dev (debian)"
+ "Please install zlib1g-dev (debian) or zlib-devel (fedora)"
@$(call touch)
# vim: syntax=make
diff --git a/rules/libelf.make b/rules/libelf.make
deleted file mode 100644
index 04e0b0b..0000000
--- a/rules/libelf.make
+++ /dev/null
@@ -1 +0,0 @@
-# this file is left intentionally blank
diff --git a/rules/libgmp.make b/rules/libgmp.make
deleted file mode 100644
index 04e0b0b..0000000
--- a/rules/libgmp.make
+++ /dev/null
@@ -1 +0,0 @@
-# this file is left intentionally blank
diff --git a/rules/newlib.make b/rules/newlib.make
index 0565087..be48f1d 100644
--- a/rules/newlib.make
+++ b/rules/newlib.make
@@ -20,8 +20,8 @@ NEWLIB := newlib-$(NEWLIB_VERSION)
NEWLIB_SUFFIX := tar.gz
NEWLIB_URL := https://sourceware.org/pub/newlib/$(NEWLIB).$(NEWLIB_SUFFIX)
NEWLIB_SOURCE := $(SRCDIR)/$(NEWLIB).$(NEWLIB_SUFFIX)
-NEWLIB_DIR := $(BUILDDIR_DEBUG)/$(NEWLIB)
-NEWLIB_BUILDDIR := $(BUILDDIR)/$(NEWLIB)-build
+NEWLIB_DIR := $(BUILDDIR)/$(NEWLIB)
+NEWLIB_BUILD_OOT:= YES
# ----------------------------------------------------------------------------
# Prepare
diff --git a/rules/post/ptxd_make_world_install.make b/rules/post/ptxd_make_world_install.make
new file mode 100644
index 0000000..48c1353
--- /dev/null
+++ b/rules/post/ptxd_make_world_install.make
@@ -0,0 +1,14 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2022 by Michael Olbrich <m.olbrich@pengutronix.de>
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+world/install-src = \
+ $(call world/env, $(1)) \
+ ptxd_make_world_install_src
+
+# vim: syntax=make
+
diff --git a/rules/pre/toolchain.make b/rules/pre/toolchain.make
index 063f5ac..64c3773 100644
--- a/rules/pre/toolchain.make
+++ b/rules/pre/toolchain.make
@@ -47,26 +47,34 @@ PTX_HOST_CROSS_AUTOCONF := \
#
PTXDIST_HOST_LDFLAGS := -L${PTXDIST_PATH_SYSROOT_HOST_PREFIX}/lib
-ifndef PTXCONF_TOOLCHAIN_DEBUG
-TOOLCHAIN_CROSS_DEBUG_MAP := \
- $(PTXDIST_WORKSPACE)/platform-=$(call remove_quotes,$(PTXCONF_PROJECT))/platform- \
- $(PTXDIST_SYSROOT_CROSS)=
+TOOLCHAIN_WORKSPACE_SYMLINK := $(subst $(PTXDIST_WORKSPACE),,$(call ptx/sh, realpath $(PTXDIST_WORKSPACE)))
-ifneq ($(PTXDIST_SYSROOT_CROSS),$(call ptx/sh, realpath $(PTXDIST_SYSROOT_CROSS)))
-TOOLCHAIN_CROSS_DEBUG_MAP += \
- $(call ptx/sh, realpath $(PTXDIST_WORKSPACE))/platform-=$(call remove_quotes,$(PTXCONF_PROJECT))/platform- \
- $(call ptx/sh, realpath $(PTXDIST_SYSROOT_CROSS))=
-endif
+define ptx/toolchain-map
+$(1)=$(2) $(if $(TOOLCHAIN_WORKSPACE_SYMLINK),$(call ptx/sh, realpath $(1))=$(2))
+endef
+
+TOOLCHAIN_CROSS_DEBUG_MAP := \
+ $(call ptx/toolchain-map,$(BUILDDIR)) \
+ $(call ptx/toolchain-map,$(CROSS_BUILDDIR)) \
+ $(call ptx/toolchain-map,$(PTXDIST_SYSROOT_CROSS))
PTXDIST_HOST_CPPFLAGS := \
$(PTXDIST_HOST_CPPFLAGS) \
$(addprefix -fdebug-prefix-map=,$(TOOLCHAIN_CROSS_DEBUG_MAP))
TOOLCHAIN_CROSS_DEBUG_FLAGS := \
+ -O2 \
-g3 \
- -gno-record-gcc-switches \
- $(addprefix -ffile-prefix-map=,$(TOOLCHAIN_CROSS_DEBUG_MAP))
-endif
+ -gno-record-gcc-switches
+
+define ptx/toolchain-cross-debug-map
+$(if $(PTXCONF_TOOLCHAIN_DEBUG),$(call ptx/toolchain-map,$($(strip $(1))_DIR),$(PTXCONF_PREFIX_CROSS)/src/$($(strip $(1))))) \
+$(TOOLCHAIN_CROSS_DEBUG_MAP)
+endef
+define ptx/toolchain-cross-debug-flags
+$(TOOLCHAIN_CROSS_DEBUG_FLAGS) \
+$(addprefix -ffile-prefix-map=,$(call ptx/toolchain-cross-debug-map,$(1)))
+endef
#
# gcc-first
@@ -76,17 +84,6 @@ CROSS_PATH := $(PTXDIST_SYSROOT_HOST)/lib/wrapper:$(PTXDIST_SYSROOT_CROSS)$(PTX
HOST_CROSS_PATH := $(CROSS_PATH)
#
-# debuggable gcc/glibc
-#
-ifdef PTXCONF_TOOLCHAIN_DEBUG
-BUILDDIR_DEBUG := $(PTXDIST_SYSROOT_CROSS)$(PTXCONF_PREFIX_CROSS)/src/target
-BUILDDIR_CROSS_DEBUG := $(PTXDIST_SYSROOT_CROSS)$(PTXCONF_PREFIX_CROSS)/src/cross
-else
-BUILDDIR_DEBUG := $(BUILDDIR)
-BUILDDIR_CROSS_DEBUG := $(CROSS_BUILDDIR)
-endif
-
-#
# images
#
diff --git a/rules/zlib.make b/rules/zlib.make
deleted file mode 100644
index 04e0b0b..0000000
--- a/rules/zlib.make
+++ /dev/null
@@ -1 +0,0 @@
-# this file is left intentionally blank