Initial Commit

This commit is contained in:
TheBrokenRail 2025-03-20 00:38:33 -04:00
commit 0b897f219c
5 changed files with 83 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/workspace

8
build.sh Executable file
View File

@ -0,0 +1,8 @@
#!/bin/sh
set -e
cd "$(dirname "$0")"
# Build
cd workspace/build
exec ../crosstool-ng/bin/ct-ng build

51
prepare.sh Executable file
View File

@ -0,0 +1,51 @@
#!/bin/sh
set -e
cd "$(dirname "$0")"
# Versions
CT_NAME="crosstool-ng"
CT_VERSION="1.27.0"
CT="${CT_NAME}-${CT_VERSION}"
# Source Files
SRC="$(pwd)/src"
# Create Workspace
dir() {
rm -rf "$1"
mkdir "$1"
cd "$1"
}
dir workspace
WORKSPACE="$(pwd)"
# Build crosstools-ng
dir "${CT_NAME}"
PREFIX="$(pwd)"
dir src
wget "https://github.com/${CT_NAME}/${CT_NAME}/releases/download/${CT}/${CT}.tar.xz"
tar -xJf "${CT}.tar.xz" --strip-components=1
./configure \
"--prefix=${PREFIX}" \
--enable-silent-rules \
--quiet
make -j$(nproc)
make install > /dev/null
# Add Patch
cd "${PREFIX}/share/crosstool-ng/packages/binutils"
patch() {
for version in */; do
cp "${SRC}/$1" "${version}"
done
}
patch 9999-change-page-size.patch
# Configure Toolchain
export PATH="${PREFIX}/bin:${PATH}"
cd "${WORKSPACE}"
dir build
cp "${SRC}/defconfig" .
ct-ng defconfig
ct-ng show-config

View File

@ -0,0 +1,11 @@
--- a/bfd/elf32-arm.c
+++ b/bfd/elf32-arm.c
@@ -20353,7 +20353,7 @@ elf32_arm_backend_symbol_processing (bfd *abfd, asymbol *sym)
#define ELF_ARCH bfd_arch_arm
#define ELF_TARGET_ID ARM_ELF_DATA
#define ELF_MACHINE_CODE EM_ARM
-#define ELF_MAXPAGESIZE 0x1000
+#define ELF_MAXPAGESIZE 0x10000
#define ELF_COMMONPAGESIZE 0x1000
#define bfd_elf32_mkobject elf32_arm_mkobject

12
src/defconfig Normal file
View File

@ -0,0 +1,12 @@
CT_CONFIG_VERSION="4"
CT_ARCH_ARM=y
CT_ARCH_CPU="cortex-a7"
CT_OMIT_TARGET_VENDOR=y
CT_ARCH_FPU="neon-vfpv4"
CT_ARCH_FLOAT_HW=y
CT_KERNEL_LINUX=y
CT_LINUX_V_3_16=y
# CT_CC_GCC_STATIC_LIBSTDCXX is not set
CT_CC_GCC_SYSTEM_ZLIB=y
# CT_CC_GCC_USE_LTO is not set
CT_CC_LANG_CXX=y