mirror of
https://github.com/EnderIce2/Fennix.git
synced 2025-05-28 15:34:31 +00:00
toolchain: update architecture support and improve toolchain configuration
Added arm and aarch64 support tools/Makefile has been refactored Signed-off-by: EnderIce2 <enderice2@protonmail.com>
This commit is contained in:
parent
61b1e95629
commit
eb602e12c2
@ -54,13 +54,13 @@ USE_LIBC = internal
|
|||||||
# you know what you are doing.
|
# you know what you are doing.
|
||||||
|
|
||||||
# Available architectures. Do not change
|
# Available architectures. Do not change
|
||||||
export AVAILABLE_ARCHS := amd64 i386 aarch64
|
export AVAILABLE_ARCHS := amd64 i386 arm aarch64
|
||||||
|
|
||||||
ifneq ($(filter $(OSARCH),$(AVAILABLE_ARCHS)),$(OSARCH))
|
ifneq ($(filter $(OSARCH),$(AVAILABLE_ARCHS)),$(OSARCH))
|
||||||
$(error OSARCH=$(OSARCH) is not a supported architecture. Choose one of: $(AVAILABLE_ARCHS))
|
$(error OSARCH=$(OSARCH) is not a supported architecture. Choose one of: $(AVAILABLE_ARCHS))
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ARCH_MAP := amd64=x86_64 i386=i386 aarch64=aarch64
|
ARCH_MAP := amd64=x86_64 i386=i386 arm=arm aarch64=aarch64
|
||||||
COMPILER_ARCH := $(patsubst $(OSARCH)=%,%,$(filter $(OSARCH)=%,$(ARCH_MAP)))
|
COMPILER_ARCH := $(patsubst $(OSARCH)=%,%,$(filter $(OSARCH)=%,$(ARCH_MAP)))
|
||||||
__CONF_QEMU_PATH := $(__CONF_QEMU_PATH)/bin/qemu-system-$(COMPILER_ARCH)
|
__CONF_QEMU_PATH := $(__CONF_QEMU_PATH)/bin/qemu-system-$(COMPILER_ARCH)
|
||||||
TOOLCHAIN_PREFIX := $(COMPILER_PATH)/bin/$(COMPILER_ARCH)-fennix-
|
TOOLCHAIN_PREFIX := $(COMPILER_PATH)/bin/$(COMPILER_ARCH)-fennix-
|
||||||
|
133
tools/Makefile
133
tools/Makefile
@ -2,7 +2,9 @@ WORKING_DIR = $(CURDIR)
|
|||||||
CROSS_DIR=$(WORKING_DIR)/cross
|
CROSS_DIR=$(WORKING_DIR)/cross
|
||||||
export PATH := $(CROSS_DIR):$(PATH)
|
export PATH := $(CROSS_DIR):$(PATH)
|
||||||
|
|
||||||
QEMU_VERSION = 9.2.0
|
BINUTILS_TAG = binutils-2_43_1
|
||||||
|
GCC_TAG = releases/gcc-14.2.0
|
||||||
|
QEMU_TAG = v9.2.0
|
||||||
|
|
||||||
default:
|
default:
|
||||||
$(error Please specify a target)
|
$(error Please specify a target)
|
||||||
@ -30,12 +32,12 @@ endif
|
|||||||
|
|
||||||
__clone_qemu:
|
__clone_qemu:
|
||||||
ifeq ("$(wildcard ./qemu)", "")
|
ifeq ("$(wildcard ./qemu)", "")
|
||||||
git clone --depth 1 -b v${QEMU_VERSION} --single-branch https://gitlab.com/qemu-project/qemu.git qemu
|
git clone --depth 1 -b ${QEMU_TAG} --single-branch https://gitlab.com/qemu-project/qemu.git qemu
|
||||||
else
|
else
|
||||||
$(info > TOOLS: Reseting qemu...)
|
$(info > TOOLS: Reseting qemu...)
|
||||||
cd qemu && \
|
cd qemu && \
|
||||||
git fetch origin && \
|
git fetch origin && \
|
||||||
git reset --hard v${QEMU_VERSION} && \
|
git reset --hard ${QEMU_TAG} && \
|
||||||
git clean -dfx
|
git clean -dfx
|
||||||
$(info > TOOLS: Operation completed for qemu)
|
$(info > TOOLS: Operation completed for qemu)
|
||||||
endif
|
endif
|
||||||
@ -44,24 +46,24 @@ endif
|
|||||||
|
|
||||||
__clone_binutils:
|
__clone_binutils:
|
||||||
ifeq ("$(wildcard ./binutils-gdb)", "")
|
ifeq ("$(wildcard ./binutils-gdb)", "")
|
||||||
git clone --depth 1 -b binutils-2_43_1 --single-branch git://sourceware.org/git/binutils-gdb.git binutils-gdb
|
git clone --depth 1 -b $(BINUTILS_TAG) --single-branch git://sourceware.org/git/binutils-gdb.git binutils-gdb
|
||||||
else
|
else
|
||||||
$(info > TOOLS: Reseting binutils-gdb...)
|
$(info > TOOLS: Reseting binutils-gdb...)
|
||||||
cd binutils-gdb && \
|
cd binutils-gdb && \
|
||||||
git fetch origin && \
|
git fetch origin && \
|
||||||
git reset --hard binutils-2_43_1 && \
|
git reset --hard $(BINUTILS_TAG) && \
|
||||||
git clean -dfx
|
git clean -dfx
|
||||||
$(info > TOOLS: Operation completed for binutils-gdb)
|
$(info > TOOLS: Operation completed for binutils-gdb)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
__clone_gcc:
|
__clone_gcc:
|
||||||
ifeq ("$(wildcard ./gcc)", "")
|
ifeq ("$(wildcard ./gcc)", "")
|
||||||
git clone --depth 1 -b releases/gcc-14.2.0 --single-branch git://gcc.gnu.org/git/gcc.git gcc
|
git clone --depth 1 -b $(GCC_TAG) --single-branch git://gcc.gnu.org/git/gcc.git gcc
|
||||||
else
|
else
|
||||||
$(info > TOOLS: Reseting gcc...)
|
$(info > TOOLS: Reseting gcc...)
|
||||||
cd gcc && \
|
cd gcc && \
|
||||||
git fetch origin && \
|
git fetch origin && \
|
||||||
git reset --hard releases/gcc-14.2.0 && \
|
git reset --hard $(GCC_TAG) && \
|
||||||
git clean -dfx
|
git clean -dfx
|
||||||
$(info > TOOLS: Operation completed for gcc)
|
$(info > TOOLS: Operation completed for gcc)
|
||||||
endif
|
endif
|
||||||
@ -94,30 +96,57 @@ __clone_all_no_qemu: __clone_binutils __clone_gcc
|
|||||||
|
|
||||||
__clone_all: __clone_qemu __clone_all_no_qemu
|
__clone_all: __clone_qemu __clone_all_no_qemu
|
||||||
|
|
||||||
do_qemu: __prep_cross
|
cross_dev:
|
||||||
|
$(MAKE) __clone_binutils
|
||||||
|
$(MAKE) __clone_gcc
|
||||||
|
$(MAKE) __clone_qemu
|
||||||
|
$(MAKE) __patch_cross_binutils
|
||||||
|
$(MAKE) __patch_cross_gcc
|
||||||
|
$(MAKE) __patch_cross_qemu
|
||||||
|
|
||||||
|
update_patches:
|
||||||
|
ifeq ("$(wildcard ./binutils-gdb.patch.bk)", "")
|
||||||
|
mv binutils-gdb.patch binutils-gdb.patch.bk
|
||||||
|
endif
|
||||||
|
ifeq ("$(wildcard ./gcc.patch.bk)", "")
|
||||||
|
mv gcc.patch gcc.patch.bk
|
||||||
|
endif
|
||||||
|
ifeq ("$(wildcard ./qemu.patch.bk)", "")
|
||||||
|
mv qemu.patch qemu.patch.bk
|
||||||
|
endif
|
||||||
|
# binutils-gdb
|
||||||
|
cd binutils-gdb && \
|
||||||
|
git add . && \
|
||||||
|
git diff --cached > ../binutils-gdb.patch
|
||||||
|
# gcc
|
||||||
|
cd gcc && \
|
||||||
|
git add . && \
|
||||||
|
git diff --cached > ../gcc.patch
|
||||||
|
# qemu
|
||||||
|
cd qemu && \
|
||||||
|
git add . && \
|
||||||
|
git diff --cached > ../qemu.patch
|
||||||
|
|
||||||
|
do_qemu:
|
||||||
$(MAKE) __patch_cross_qemu
|
$(MAKE) __patch_cross_qemu
|
||||||
$(MAKE) __prep_cross
|
$(MAKE) __prep_cross
|
||||||
cd qemu && \
|
cd qemu && \
|
||||||
bash ./configure --target-list=x86_64-softmmu,i386-softmmu,aarch64-softmmu \
|
bash ./configure --target-list=x86_64-softmmu,i386-softmmu,arm-softmmu,aarch64-softmmu \
|
||||||
--prefix="$(CROSS_DIR)" \
|
--prefix="$(CROSS_DIR)" \
|
||||||
--enable-gtk --disable-tools \
|
--enable-gtk --disable-tools \
|
||||||
--disable-gio --disable-virtfs --disable-vnc \
|
--disable-gio --disable-virtfs --disable-vnc \
|
||||||
--disable-opengl && \
|
--disable-opengl && \
|
||||||
make --quiet -j$(shell nproc) && make --quiet install
|
make --quiet -j$(shell nproc) && make --quiet install
|
||||||
|
|
||||||
do_binutils:
|
__do_binutils_x86_64:
|
||||||
# x86_64
|
|
||||||
$(MAKE) __patch_cross_binutils
|
|
||||||
$(MAKE) __prep_cross
|
|
||||||
cd binutils-gdb/__build && \
|
cd binutils-gdb/__build && \
|
||||||
../configure --target=x86_64-fennix \
|
../configure --target=x86_64-fennix \
|
||||||
--prefix="$(CROSS_DIR)" --disable-nls --quiet \
|
--prefix="$(CROSS_DIR)" --disable-nls --quiet \
|
||||||
--with-sysroot --enable-shared --disable-werror && \
|
--with-sysroot --enable-shared --disable-werror && \
|
||||||
make --quiet all -j$(shell nproc) && \
|
make --quiet all -j$(shell nproc) && \
|
||||||
make --quiet install
|
make --quiet install
|
||||||
# i386
|
|
||||||
$(MAKE) __patch_cross_binutils
|
__do_binutils_i386:
|
||||||
$(MAKE) __prep_cross
|
|
||||||
cd binutils-gdb/__build && \
|
cd binutils-gdb/__build && \
|
||||||
../configure --target=i386-fennix \
|
../configure --target=i386-fennix \
|
||||||
--prefix="$(CROSS_DIR)" --disable-nls --quiet \
|
--prefix="$(CROSS_DIR)" --disable-nls --quiet \
|
||||||
@ -125,10 +154,37 @@ do_binutils:
|
|||||||
make --quiet all -j$(shell nproc) && \
|
make --quiet all -j$(shell nproc) && \
|
||||||
make --quiet install
|
make --quiet install
|
||||||
|
|
||||||
do_gcc:
|
__do_binutils_arm:
|
||||||
# x86_64
|
cd binutils-gdb/__build && \
|
||||||
$(MAKE) __patch_cross_gcc
|
../configure --target=arm-fennix \
|
||||||
|
--prefix="$(CROSS_DIR)" --disable-nls --quiet \
|
||||||
|
--with-sysroot --enable-shared --disable-werror && \
|
||||||
|
make --quiet all -j$(shell nproc) && \
|
||||||
|
make --quiet install
|
||||||
|
|
||||||
|
__do_binutils_aarch64:
|
||||||
|
cd binutils-gdb/__build && \
|
||||||
|
../configure --target=aarch64-fennix \
|
||||||
|
--prefix="$(CROSS_DIR)" --disable-nls --quiet \
|
||||||
|
--with-sysroot --enable-shared --disable-werror && \
|
||||||
|
make --quiet all -j$(shell nproc) && \
|
||||||
|
make --quiet install
|
||||||
|
|
||||||
|
__reset_binutils:
|
||||||
|
$(MAKE) __patch_cross_binutils
|
||||||
$(MAKE) __prep_cross
|
$(MAKE) __prep_cross
|
||||||
|
|
||||||
|
do_binutils:
|
||||||
|
$(MAKE) __reset_binutils
|
||||||
|
$(MAKE) __do_binutils_x86_64
|
||||||
|
$(MAKE) __reset_binutils
|
||||||
|
$(MAKE) __do_binutils_i386
|
||||||
|
$(MAKE) __reset_binutils
|
||||||
|
$(MAKE) __do_binutils_arm
|
||||||
|
$(MAKE) __reset_binutils
|
||||||
|
$(MAKE) __do_binutils_aarch64
|
||||||
|
|
||||||
|
__do_gcc_x86_64:
|
||||||
cd gcc/__build && \
|
cd gcc/__build && \
|
||||||
../configure --target=x86_64-fennix --quiet \
|
../configure --target=x86_64-fennix --quiet \
|
||||||
--prefix="$(CROSS_DIR)" --disable-nls --enable-default-pie \
|
--prefix="$(CROSS_DIR)" --disable-nls --enable-default-pie \
|
||||||
@ -137,9 +193,8 @@ do_gcc:
|
|||||||
make --quiet all-target-libgcc -j$(shell nproc) && \
|
make --quiet all-target-libgcc -j$(shell nproc) && \
|
||||||
make --quiet install-gcc -j$(shell nproc) && \
|
make --quiet install-gcc -j$(shell nproc) && \
|
||||||
make --quiet install-target-libgcc -j$(shell nproc)
|
make --quiet install-target-libgcc -j$(shell nproc)
|
||||||
# i386
|
|
||||||
$(MAKE) __patch_cross_gcc
|
__do_gcc_i386:
|
||||||
$(MAKE) __prep_cross
|
|
||||||
cd gcc/__build && \
|
cd gcc/__build && \
|
||||||
../configure --target=i386-fennix --quiet \
|
../configure --target=i386-fennix --quiet \
|
||||||
--prefix="$(CROSS_DIR)" --disable-nls --enable-default-pie \
|
--prefix="$(CROSS_DIR)" --disable-nls --enable-default-pie \
|
||||||
@ -148,3 +203,37 @@ do_gcc:
|
|||||||
make --quiet all-target-libgcc -j$(shell nproc) && \
|
make --quiet all-target-libgcc -j$(shell nproc) && \
|
||||||
make --quiet install-gcc -j$(shell nproc) && \
|
make --quiet install-gcc -j$(shell nproc) && \
|
||||||
make --quiet install-target-libgcc -j$(shell nproc)
|
make --quiet install-target-libgcc -j$(shell nproc)
|
||||||
|
|
||||||
|
__do_gcc_arm:
|
||||||
|
cd gcc/__build && \
|
||||||
|
../configure --target=arm-fennix --quiet \
|
||||||
|
--prefix="$(CROSS_DIR)" --disable-nls --enable-default-pie \
|
||||||
|
--enable-languages=c,c++ --enable-shared --without-headers && \
|
||||||
|
make --quiet all-gcc -j$(shell nproc) && \
|
||||||
|
make --quiet all-target-libgcc -j$(shell nproc) && \
|
||||||
|
make --quiet install-gcc -j$(shell nproc) && \
|
||||||
|
make --quiet install-target-libgcc -j$(shell nproc)
|
||||||
|
|
||||||
|
__do_gcc_aarch64:
|
||||||
|
cd gcc/__build && \
|
||||||
|
../configure --target=aarch64-fennix --quiet \
|
||||||
|
--prefix="$(CROSS_DIR)" --disable-nls --enable-default-pie \
|
||||||
|
--enable-languages=c,c++ --enable-shared --without-headers && \
|
||||||
|
make --quiet all-gcc -j$(shell nproc) && \
|
||||||
|
make --quiet all-target-libgcc -j$(shell nproc) && \
|
||||||
|
make --quiet install-gcc -j$(shell nproc) && \
|
||||||
|
make --quiet install-target-libgcc -j$(shell nproc)
|
||||||
|
|
||||||
|
__reset_gcc:
|
||||||
|
$(MAKE) __patch_cross_gcc
|
||||||
|
$(MAKE) __prep_cross
|
||||||
|
|
||||||
|
do_gcc:
|
||||||
|
$(MAKE) __reset_gcc
|
||||||
|
$(MAKE) __do_gcc_x86_64
|
||||||
|
$(MAKE) __reset_gcc
|
||||||
|
$(MAKE) __do_gcc_i386
|
||||||
|
$(MAKE) __reset_gcc
|
||||||
|
$(MAKE) __do_gcc_arm
|
||||||
|
$(MAKE) __reset_gcc
|
||||||
|
$(MAKE) __do_gcc_aarch64
|
||||||
|
@ -22,4 +22,6 @@ In this directory, you will find:
|
|||||||
## Useful links
|
## Useful links
|
||||||
|
|
||||||
- [Create git patches](https://stackoverflow.com/a/15438863/9352057)
|
- [Create git patches](https://stackoverflow.com/a/15438863/9352057)
|
||||||
|
- [binutils git tags](https://sourceware.org/git/?p=binutils-gdb.git;a=tags)
|
||||||
|
- [gcc git tags](https://gcc.gnu.org/git/?p=gcc.git;a=tags)
|
||||||
- [QEMU git tags](https://gitlab.com/qemu-project/qemu/-/tags)
|
- [QEMU git tags](https://gitlab.com/qemu-project/qemu/-/tags)
|
||||||
|
@ -1,8 +1,17 @@
|
|||||||
|
diff --git a/.gitignore b/.gitignore
|
||||||
|
index 0a40764c..9aa17853 100644
|
||||||
|
--- a/.gitignore
|
||||||
|
+++ b/.gitignore
|
||||||
|
@@ -74,3 +74,4 @@ stamp-*
|
||||||
|
/gmp*
|
||||||
|
/isl*
|
||||||
|
/gettext*
|
||||||
|
+/__build
|
||||||
diff --git a/bfd/config.bfd b/bfd/config.bfd
|
diff --git a/bfd/config.bfd b/bfd/config.bfd
|
||||||
index 6553aac1e99..40429e9bf43 100644
|
index 6553aac1..39008568 100644
|
||||||
--- a/bfd/config.bfd
|
--- a/bfd/config.bfd
|
||||||
+++ b/bfd/config.bfd
|
+++ b/bfd/config.bfd
|
||||||
@@ -1502,6 +1502,20 @@ case "${targ}" in
|
@@ -1502,6 +1502,31 @@ case "${targ}" in
|
||||||
;;
|
;;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -12,121 +21,30 @@ index 6553aac1e99..40429e9bf43 100644
|
|||||||
+ targ64_selvecs=x86_64_elf64_vec
|
+ targ64_selvecs=x86_64_elf64_vec
|
||||||
+ ;;
|
+ ;;
|
||||||
+
|
+
|
||||||
|
+ arm*-*-fennix*)
|
||||||
|
+ targ_defvec=arm_elf32_le_vec
|
||||||
|
+ targ_selvecs="arm_elf32_fdpic_le_vec arm_elf32_be_vec arm_elf32_fdpic_be_vec"
|
||||||
|
+ ;;
|
||||||
|
+
|
||||||
+#ifdef BFD64
|
+#ifdef BFD64
|
||||||
+ x86_64-*-fennix*)
|
+ x86_64-*-fennix*)
|
||||||
+ targ_defvec=x86_64_elf64_vec
|
+ targ_defvec=x86_64_elf64_vec
|
||||||
+ targ_selvecs=i386_elf32_vec
|
+ targ_selvecs=i386_elf32_vec
|
||||||
+ want64=true
|
+ want64=true
|
||||||
+ ;;
|
+ ;;
|
||||||
|
+
|
||||||
|
+ aarch64-*-fennix*)
|
||||||
|
+ targ_defvec=aarch64_elf64_le_vec
|
||||||
|
+ targ_selvecs="aarch64_elf64_be_vec arm_elf32_le_vec arm_elf32_be_vec"
|
||||||
|
+ want64=true
|
||||||
|
+ ;;
|
||||||
+#endif
|
+#endif
|
||||||
+
|
+
|
||||||
# END OF targmatch.h
|
# END OF targmatch.h
|
||||||
bpf-*-*)
|
bpf-*-*)
|
||||||
echo "*** Configuration $targ is not fully supported." >&2
|
echo "*** Configuration $targ is not fully supported." >&2
|
||||||
diff --git a/config.sub b/config.sub
|
|
||||||
index 2c6a07ab3c3..d279b50dc8b 100755
|
|
||||||
--- a/config.sub
|
|
||||||
+++ b/config.sub
|
|
||||||
@@ -1768,7 +1768,7 @@ case $os in
|
|
||||||
| onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \
|
|
||||||
| midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \
|
|
||||||
| nsk* | powerunix* | genode* | zvmoe* | qnx* | emx* | zephyr* \
|
|
||||||
- | fiwix* | mlibc* | cos* | mbr* | ironclad* )
|
|
||||||
+ | fiwix* | mlibc* | cos* | mbr* | ironclad* | fennix* )
|
|
||||||
;;
|
|
||||||
# This one is extra strict with allowed versions
|
|
||||||
sco3.2v2 | sco3.2v[4-9]* | sco5v6*)
|
|
||||||
diff --git a/gas/configure.tgt b/gas/configure.tgt
|
|
||||||
index d58f21873a3..fa4215b9cff 100644
|
|
||||||
--- a/gas/configure.tgt
|
|
||||||
+++ b/gas/configure.tgt
|
|
||||||
@@ -267,6 +267,7 @@ case ${generic_target} in
|
|
||||||
i386-*-*nt*) fmt=coff em=pe ;;
|
|
||||||
i386-*-rdos*) fmt=elf ;;
|
|
||||||
i386-*-darwin*) fmt=macho ;;
|
|
||||||
+ i386-*-fennix*) fmt=elf em=gnu ;;
|
|
||||||
|
|
||||||
ia16-*-elf*) fmt=elf ;;
|
|
||||||
|
|
||||||
diff --git a/ld/Makefile.am b/ld/Makefile.am
|
|
||||||
index 6a9833e5775..fb4f866ef55 100644
|
|
||||||
--- a/ld/Makefile.am
|
|
||||||
+++ b/ld/Makefile.am
|
|
||||||
@@ -279,6 +279,7 @@ ALL_EMULATION_SOURCES = \
|
|
||||||
eelf_i386.c \
|
|
||||||
eelf_i386_be.c \
|
|
||||||
eelf_i386_fbsd.c \
|
|
||||||
+ eelf_i386_fennix.c \
|
|
||||||
eelf_i386_haiku.c \
|
|
||||||
eelf_i386_ldso.c \
|
|
||||||
eelf_i386_sol2.c \
|
|
||||||
@@ -463,6 +464,7 @@ ALL_64_EMULATION_SOURCES = \
|
|
||||||
eelf_x86_64.c \
|
|
||||||
eelf_x86_64_cloudabi.c \
|
|
||||||
eelf_x86_64_fbsd.c \
|
|
||||||
+ eelf_x86_64_fennix.c \
|
|
||||||
eelf_x86_64_haiku.c \
|
|
||||||
eelf_x86_64_sol2.c \
|
|
||||||
ehppa64linux.c \
|
|
||||||
diff --git a/ld/configure.tgt b/ld/configure.tgt
|
|
||||||
index f937f78b876..ea5491a1447 100644
|
|
||||||
--- a/ld/configure.tgt
|
|
||||||
+++ b/ld/configure.tgt
|
|
||||||
@@ -409,6 +409,11 @@ i[3-7]86-*-elf* | i[3-7]86-*-rtems* | i[3-7]86-*-genode*)
|
|
||||||
i[3-7]86-*-dragonfly*) targ_emul=elf_i386
|
|
||||||
targ_extra_emuls="elf_iamcu i386bsd"
|
|
||||||
;;
|
|
||||||
+i[3-7]86-*-fennix*)
|
|
||||||
+ targ_emul=elf_i386_fennix
|
|
||||||
+ targ_extra_emuls=elf_i386
|
|
||||||
+ targ64_extra_emuls="elf_x86_64_fennix elf_x86_64"
|
|
||||||
+ ;;
|
|
||||||
i[3-7]86-*-freebsd* | i[3-7]86-*-kfreebsd*-gnu)
|
|
||||||
targ_emul=elf_i386_fbsd
|
|
||||||
targ_extra_emuls="elf_i386 elf_iamcu i386bsd"
|
|
||||||
@@ -1045,6 +1050,9 @@ x86_64-*-elf* | x86_64-*-rtems* | x86_64-*-fuchsia* | x86_64-*-genode*)
|
|
||||||
x86_64-*-dragonfly*) targ_emul=elf_x86_64
|
|
||||||
targ_extra_emuls="elf_i386 elf_iamcu"
|
|
||||||
;;
|
|
||||||
+x86_64-*-fennix*) targ_emul=elf_x86_64_fennix
|
|
||||||
+ targ_extra_emuls="elf_i386_fennix elf_x86_64 elf_i386"
|
|
||||||
+ ;;
|
|
||||||
x86_64-*-freebsd* | x86_64-*-kfreebsd*-gnu)
|
|
||||||
targ_emul=elf_x86_64_fbsd
|
|
||||||
targ_extra_emuls="elf_i386_fbsd elf_x86_64 elf_i386 elf_iamcu"
|
|
||||||
@@ -1112,6 +1120,10 @@ case "${target}" in
|
|
||||||
NATIVE_LIB_DIRS='/lib /usr/lib /usr/pkg/lib /usr/local/lib'
|
|
||||||
;;
|
|
||||||
|
|
||||||
+*-*-fennix*)
|
|
||||||
+ NATIVE_LIB_DIRS='/lib /usr/lib'
|
|
||||||
+ ;;
|
|
||||||
+
|
|
||||||
*-*-freebsd*)
|
|
||||||
NATIVE_LIB_DIRS='/lib /usr/lib /usr/local/lib'
|
|
||||||
;;
|
|
||||||
diff --git a/ld/emulparams/elf_i386_fennix.sh b/ld/emulparams/elf_i386_fennix.sh
|
|
||||||
new file mode 100644
|
|
||||||
index 00000000000..19b75a06cf9
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/ld/emulparams/elf_i386_fennix.sh
|
|
||||||
@@ -0,0 +1,4 @@
|
|
||||||
+source_sh ${srcdir}/emulparams/elf_i386.sh
|
|
||||||
+GENERATE_SHLIB_SCRIPT=yes
|
|
||||||
+GENERATE_PIE_SCRIPT=yes
|
|
||||||
+TEXT_START_ADDR=0x400000
|
|
||||||
diff --git a/ld/emulparams/elf_x86_64_fennix.sh b/ld/emulparams/elf_x86_64_fennix.sh
|
|
||||||
new file mode 100644
|
|
||||||
index 00000000000..1509ec7fe53
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/ld/emulparams/elf_x86_64_fennix.sh
|
|
||||||
@@ -0,0 +1,4 @@
|
|
||||||
+source_sh ${srcdir}/emulparams/elf_x86_64.sh
|
|
||||||
+GENERATE_SHLIB_SCRIPT=yes
|
|
||||||
+GENERATE_PIE_SCRIPT=yes
|
|
||||||
+TEXT_START_ADDR=0x400000
|
|
||||||
diff --git a/binutils/readelf.c b/binutils/readelf.c
|
diff --git a/binutils/readelf.c b/binutils/readelf.c
|
||||||
index 5d1cf9c3..671a8081 100644
|
index 5d1cf9c3..2606967f 100644
|
||||||
--- a/binutils/readelf.c
|
--- a/binutils/readelf.c
|
||||||
+++ b/binutils/readelf.c
|
+++ b/binutils/readelf.c
|
||||||
@@ -20909,6 +20909,30 @@ get_gnu_elf_note_type (unsigned e_type)
|
@@ -20909,6 +20909,30 @@ get_gnu_elf_note_type (unsigned e_type)
|
||||||
@ -272,6 +190,47 @@ index 5d1cf9c3..671a8081 100644
|
|||||||
else if (startswith (pnote->namedata, "stapsdt"))
|
else if (startswith (pnote->namedata, "stapsdt"))
|
||||||
return print_stapsdt_note (pnote);
|
return print_stapsdt_note (pnote);
|
||||||
else if (startswith (pnote->namedata, "CORE"))
|
else if (startswith (pnote->namedata, "CORE"))
|
||||||
|
diff --git a/config.sub b/config.sub
|
||||||
|
index 2c6a07ab..d279b50d 100755
|
||||||
|
--- a/config.sub
|
||||||
|
+++ b/config.sub
|
||||||
|
@@ -1768,7 +1768,7 @@ case $os in
|
||||||
|
| onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \
|
||||||
|
| midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \
|
||||||
|
| nsk* | powerunix* | genode* | zvmoe* | qnx* | emx* | zephyr* \
|
||||||
|
- | fiwix* | mlibc* | cos* | mbr* | ironclad* )
|
||||||
|
+ | fiwix* | mlibc* | cos* | mbr* | ironclad* | fennix* )
|
||||||
|
;;
|
||||||
|
# This one is extra strict with allowed versions
|
||||||
|
sco3.2v2 | sco3.2v[4-9]* | sco5v6*)
|
||||||
|
diff --git a/gas/configure.tgt b/gas/configure.tgt
|
||||||
|
index d58f2187..bd76e187 100644
|
||||||
|
--- a/gas/configure.tgt
|
||||||
|
+++ b/gas/configure.tgt
|
||||||
|
@@ -127,6 +127,7 @@ generic_target=${cpu_type}-$vendor-$os
|
||||||
|
# Note: This table is alpha-sorted, please try to keep it that way.
|
||||||
|
case ${generic_target} in
|
||||||
|
aarch64*-*-elf*) fmt=elf;;
|
||||||
|
+ aarch64*-*-fennix*) fmt=elf em=gnu ;;
|
||||||
|
aarch64*-*-fuchsia*) fmt=elf;;
|
||||||
|
aarch64*-*-haiku*) fmt=elf em=haiku ;;
|
||||||
|
aarch64*-*-genode*) fmt=elf;;
|
||||||
|
@@ -167,6 +168,7 @@ case ${generic_target} in
|
||||||
|
arm-wince-pe | arm-*-wince | arm*-*-mingw32ce* | arm*-*-cegcc*)
|
||||||
|
fmt=coff em=wince-pe ;;
|
||||||
|
arm-*-pe) fmt=coff em=pe ;;
|
||||||
|
+ arm*-*-fennix*) fmt=elf em=gnu ;;
|
||||||
|
arm-*-fuchsia*) fmt=elf ;;
|
||||||
|
arm-*-haiku*) fmt=elf em=haiku ;;
|
||||||
|
|
||||||
|
@@ -267,6 +269,7 @@ case ${generic_target} in
|
||||||
|
i386-*-*nt*) fmt=coff em=pe ;;
|
||||||
|
i386-*-rdos*) fmt=elf ;;
|
||||||
|
i386-*-darwin*) fmt=macho ;;
|
||||||
|
+ i386-*-fennix*) fmt=elf em=gnu ;;
|
||||||
|
|
||||||
|
ia16-*-elf*) fmt=elf ;;
|
||||||
|
|
||||||
diff --git a/include/elf/common.h b/include/elf/common.h
|
diff --git a/include/elf/common.h b/include/elf/common.h
|
||||||
index c9920e77..a714bb2a 100644
|
index c9920e77..a714bb2a 100644
|
||||||
--- a/include/elf/common.h
|
--- a/include/elf/common.h
|
||||||
@ -292,12 +251,147 @@ index c9920e77..a714bb2a 100644
|
|||||||
/* Values for notes in non-core files using name "GNU". */
|
/* Values for notes in non-core files using name "GNU". */
|
||||||
|
|
||||||
#define NT_GNU_ABI_TAG 1
|
#define NT_GNU_ABI_TAG 1
|
||||||
diff --git a/.gitignore b/.gitignore
|
diff --git a/ld/Makefile.am b/ld/Makefile.am
|
||||||
index 0a40764c..9aa17853 100644
|
index 6a9833e5..bf4c134d 100644
|
||||||
--- a/.gitignore
|
--- a/ld/Makefile.am
|
||||||
+++ b/.gitignore
|
+++ b/ld/Makefile.am
|
||||||
@@ -74,3 +74,4 @@ stamp-*
|
@@ -165,6 +165,7 @@ ALL_EMULATION_SOURCES = \
|
||||||
/gmp*
|
earcv2elfx.c \
|
||||||
/isl*
|
earm_wince_pe.c \
|
||||||
/gettext*
|
earmelf.c \
|
||||||
+/__build
|
+ earmelf_fennix.c \
|
||||||
|
earmelf_fbsd.c \
|
||||||
|
earmelf_fuchsia.c \
|
||||||
|
earmelf_haiku.c \
|
||||||
|
@@ -279,6 +280,7 @@ ALL_EMULATION_SOURCES = \
|
||||||
|
eelf_i386.c \
|
||||||
|
eelf_i386_be.c \
|
||||||
|
eelf_i386_fbsd.c \
|
||||||
|
+ eelf_i386_fennix.c \
|
||||||
|
eelf_i386_haiku.c \
|
||||||
|
eelf_i386_ldso.c \
|
||||||
|
eelf_i386_sol2.c \
|
||||||
|
@@ -383,6 +385,7 @@ ALL_64_EMULATION_SOURCES = \
|
||||||
|
eaarch64elf32.c \
|
||||||
|
eaarch64elf32b.c \
|
||||||
|
eaarch64elfb.c \
|
||||||
|
+ eaarch64fennix.c \
|
||||||
|
eaarch64fbsd.c \
|
||||||
|
eaarch64fbsdb.c \
|
||||||
|
eaarch64haiku.c \
|
||||||
|
@@ -463,6 +466,7 @@ ALL_64_EMULATION_SOURCES = \
|
||||||
|
eelf_x86_64.c \
|
||||||
|
eelf_x86_64_cloudabi.c \
|
||||||
|
eelf_x86_64_fbsd.c \
|
||||||
|
+ eelf_x86_64_fennix.c \
|
||||||
|
eelf_x86_64_haiku.c \
|
||||||
|
eelf_x86_64_sol2.c \
|
||||||
|
ehppa64linux.c \
|
||||||
|
diff --git a/ld/configure.tgt b/ld/configure.tgt
|
||||||
|
index f937f78b..3aa8c738 100644
|
||||||
|
--- a/ld/configure.tgt
|
||||||
|
+++ b/ld/configure.tgt
|
||||||
|
@@ -92,6 +92,9 @@ aarch64-*-elf | aarch64-*-rtems* | aarch64-*-genode*)
|
||||||
|
aarch64-*-cloudabi*) targ_emul=aarch64cloudabi
|
||||||
|
targ_extra_emuls=aarch64cloudabib
|
||||||
|
;;
|
||||||
|
+aarch64-*-fennix*) targ_emul=aarch64fennix
|
||||||
|
+ targ_extra_emuls="aarch64fennixb aarch64elf"
|
||||||
|
+ ;;
|
||||||
|
aarch64-*-freebsd*) targ_emul=aarch64fbsd
|
||||||
|
targ_extra_emuls="aarch64fbsdb aarch64elf"
|
||||||
|
;;
|
||||||
|
@@ -183,6 +186,10 @@ arm-wince-pe | arm-*-wince | arm*-*-mingw32ce*)
|
||||||
|
arm-*-pe) targ_emul=armpe
|
||||||
|
targ_extra_ofiles="deffilep.o pe-dll.o"
|
||||||
|
;;
|
||||||
|
+arm*-*-fennix*)
|
||||||
|
+ targ_emul=armelf_fennix
|
||||||
|
+ targ_extra_emuls="armelfb_fennix armelf"
|
||||||
|
+ ;;
|
||||||
|
arm*b-*-freebsd*) targ_emul=armelfb_fbsd
|
||||||
|
targ_extra_emuls="armelf_fbsd armelf"
|
||||||
|
;;
|
||||||
|
@@ -409,6 +416,11 @@ i[3-7]86-*-elf* | i[3-7]86-*-rtems* | i[3-7]86-*-genode*)
|
||||||
|
i[3-7]86-*-dragonfly*) targ_emul=elf_i386
|
||||||
|
targ_extra_emuls="elf_iamcu i386bsd"
|
||||||
|
;;
|
||||||
|
+i[3-7]86-*-fennix*)
|
||||||
|
+ targ_emul=elf_i386_fennix
|
||||||
|
+ targ_extra_emuls=elf_i386
|
||||||
|
+ targ64_extra_emuls="elf_x86_64_fennix elf_x86_64"
|
||||||
|
+ ;;
|
||||||
|
i[3-7]86-*-freebsd* | i[3-7]86-*-kfreebsd*-gnu)
|
||||||
|
targ_emul=elf_i386_fbsd
|
||||||
|
targ_extra_emuls="elf_i386 elf_iamcu i386bsd"
|
||||||
|
@@ -1045,6 +1057,9 @@ x86_64-*-elf* | x86_64-*-rtems* | x86_64-*-fuchsia* | x86_64-*-genode*)
|
||||||
|
x86_64-*-dragonfly*) targ_emul=elf_x86_64
|
||||||
|
targ_extra_emuls="elf_i386 elf_iamcu"
|
||||||
|
;;
|
||||||
|
+x86_64-*-fennix*) targ_emul=elf_x86_64_fennix
|
||||||
|
+ targ_extra_emuls="elf_i386_fennix elf_x86_64 elf_i386"
|
||||||
|
+ ;;
|
||||||
|
x86_64-*-freebsd* | x86_64-*-kfreebsd*-gnu)
|
||||||
|
targ_emul=elf_x86_64_fbsd
|
||||||
|
targ_extra_emuls="elf_i386_fbsd elf_x86_64 elf_i386 elf_iamcu"
|
||||||
|
@@ -1112,6 +1127,10 @@ case "${target}" in
|
||||||
|
NATIVE_LIB_DIRS='/lib /usr/lib /usr/pkg/lib /usr/local/lib'
|
||||||
|
;;
|
||||||
|
|
||||||
|
+*-*-fennix*)
|
||||||
|
+ NATIVE_LIB_DIRS='/lib /usr/lib'
|
||||||
|
+ ;;
|
||||||
|
+
|
||||||
|
*-*-freebsd*)
|
||||||
|
NATIVE_LIB_DIRS='/lib /usr/lib /usr/local/lib'
|
||||||
|
;;
|
||||||
|
diff --git a/ld/emulparams/aarch64fennix.sh b/ld/emulparams/aarch64fennix.sh
|
||||||
|
new file mode 100644
|
||||||
|
index 00000000..ff5d1e20
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/ld/emulparams/aarch64fennix.sh
|
||||||
|
@@ -0,0 +1,4 @@
|
||||||
|
+source_sh ${srcdir}/emulparams/aarch64elf.sh
|
||||||
|
+
|
||||||
|
+COMMONPAGESIZE="CONSTANT (COMMONPAGESIZE)"
|
||||||
|
+TEXT_START_ADDR=0x00400000
|
||||||
|
diff --git a/ld/emulparams/armelf_fennix.sh b/ld/emulparams/armelf_fennix.sh
|
||||||
|
new file mode 100644
|
||||||
|
index 00000000..694377d8
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/ld/emulparams/armelf_fennix.sh
|
||||||
|
@@ -0,0 +1,4 @@
|
||||||
|
+source_sh ${srcdir}/emulparams/armelf.sh
|
||||||
|
+
|
||||||
|
+GENERATE_SHLIB_SCRIPT=yes
|
||||||
|
+GENERATE_PIE_SCRIPT=yes
|
||||||
|
diff --git a/ld/emulparams/armelfb_fennix.sh b/ld/emulparams/armelfb_fennix.sh
|
||||||
|
new file mode 100644
|
||||||
|
index 00000000..694377d8
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/ld/emulparams/armelfb_fennix.sh
|
||||||
|
@@ -0,0 +1,4 @@
|
||||||
|
+source_sh ${srcdir}/emulparams/armelf.sh
|
||||||
|
+
|
||||||
|
+GENERATE_SHLIB_SCRIPT=yes
|
||||||
|
+GENERATE_PIE_SCRIPT=yes
|
||||||
|
diff --git a/ld/emulparams/elf_i386_fennix.sh b/ld/emulparams/elf_i386_fennix.sh
|
||||||
|
new file mode 100644
|
||||||
|
index 00000000..a7210cc0
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/ld/emulparams/elf_i386_fennix.sh
|
||||||
|
@@ -0,0 +1,4 @@
|
||||||
|
+source_sh ${srcdir}/emulparams/elf_i386.sh
|
||||||
|
+GENERATE_SHLIB_SCRIPT=yes
|
||||||
|
+GENERATE_PIE_SCRIPT=yes
|
||||||
|
+TEXT_START_ADDR=0x00400000
|
||||||
|
diff --git a/ld/emulparams/elf_x86_64_fennix.sh b/ld/emulparams/elf_x86_64_fennix.sh
|
||||||
|
new file mode 100644
|
||||||
|
index 00000000..6612131d
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/ld/emulparams/elf_x86_64_fennix.sh
|
||||||
|
@@ -0,0 +1,4 @@
|
||||||
|
+source_sh ${srcdir}/emulparams/elf_x86_64.sh
|
||||||
|
+GENERATE_SHLIB_SCRIPT=yes
|
||||||
|
+GENERATE_PIE_SCRIPT=yes
|
||||||
|
+TEXT_START_ADDR=0x00400000
|
||||||
|
3476
tools/gcc.patch
3476
tools/gcc.patch
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user