+TRIPLET = arm-pc-acess2
ARM_CPUNAME = gerneric-armv7
-CC = arm-eabi-gcc -mcpu=$(ARM_CPUNAME)
-AS = arm-eabi-gcc -mcpu=$(ARM_CPUNAME) -c
-CXX = arm-eabi-g++ -mcpu=$(ARM_CPUNAME)
-LD = arm-eabi-ld
-OBJDUMP = arm-eabi-objdump
+#AS = $(TRIPLET)-gcc -mcpu=$(ARM_CPUNAME) -c
DISASM := $(OBJDUMP) -d -S
ARCHDIR = armv7
-STRIP = arm-eabi-strip
ASSUFFIX = S
-
-
+#
+#
+#
-include ../config.mk
GCC_ARCHIVE:=$(lastword $(sort $(wildcard gcc-*.tar.bz2)))
$(error No archive found)
endif
-BINUTILS_CHANGES := config.sub bfd/config.bfd gas/configure.tgt ld/configure.tgt ld/emulparams/acess2_i386.sh ld/emulparams/acess2_amd64.sh ld/Makefile.in
+BINUTILS_CHANGES := config.sub bfd/config.bfd gas/configure.tgt ld/configure.tgt ld/emulparams/acess2_i386.sh ld/emulparams/acess2_amd64.sh ld/emulparams/acess2_arm.sh ld/Makefile.in
GCC_CHANGES := config.sub gcc/config.gcc gcc/config/acess2.h libgcc/config.host gcc/config/acess2.opt
# libstdc++-v3/crossconfig.m4 config/override.m4
# target-libstdc++-v3
PREFIX := $(OUTDIR)-BUILD
-BDIR_GCC := build-$(ARCH)/gcc
-BDIR_BINUTILS := build-$(ARCH)/binutils
+BDIR_GCC := build-$(ARCH)/gcc/
+BDIR_BINUTILS := build-$(ARCH)/binutils/
.PHONY: all clean binutils gcc include
$(PREFIX)/bin/$(TARGET)-gcc: $(BDIR_GCC)/Makefile
@PATH=$(PREFIX)/bin:$$PATH make -C $(BDIR_GCC) $(GCC_TARGETS:%=all-%) -j $(PARLEVEL)
+ @PATH=$(PREFIX)/bin:$$PATH make -C $(BDIR_GCC)libstdc++-v3/ all-target-libsupc++ -j $(PARLEVEL)
@PATH=$(PREFIX)/bin:$$PATH make -C $(BDIR_GCC) $(GCC_TARGETS:%=install-%)
+ want64=true
+ ;;
+ arm-*-acess2)
-+ targ_defvec=bfd_elf32_arm_vec
-+ targ_selvecs="bfd_elf32_arm_vec"
++ targ_defvec=bfd_elf32_littlearm_vec
++ targ_selvecs="bfd_elf32_bigarm_vec"
+ ;;
# END OF targmatch.h
--- gas/configure.tgt 2011-07-29 00:00:00.000000 +0000
+++ gas/configure.tgt 2013-03-01 10:45:00.000000 +0800
-@@ -173,2 +173,3 @@
+@@ -173,2 +173,4 @@
i386-sequent-bsd*) fmt=aout em=dynix ;;
+ i386-*-acess2*) fmt=elf ;;
++ arm-*-acess2*) fmt=elf ;;
i386-*-beospe*) fmt=coff em=pe ;;
--- ld/Makefile.in
+++ ld/Makefile.in
-@@ -2627,2 +2627,6 @@
+@@ -2627,2 +2627,8 @@
${GENSCRIPTS} elf32xtensa "$(tdir_elf32xtensa)"
+eacess2_i386.c: $(srcdir)/emulparams/acess2_i386.sh $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} acess2_i386 "$(tdir_acess2_i386)"
+eacess2_amd64.c: $(srcdir)/emulparams/acess2_amd64.sh $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
+ ${GENSCRIPTS} acess2_amd64 "$(tdir_acess2_amd64)"
++eacess2_arm.c: $(srcdir)/emulparams/acess2_arm.sh $(ELF_DEPS) $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
++ ${GENSCRIPTS} acess2_arm "$(tdir_acess2_arm)"
eelf_i386.c: $(srcdir)/emulparams/elf_i386.sh \
--- ld/configure.tgt
+++ ld/configure.tgt
-@@ -167,1 +167,3 @@
+@@ -167,1 +167,4 @@
i[3-7]86-*-nto-qnx*) targ_emul=i386nto ;;
+i[3-7]86-*-acess2*) targ_emul=acess2_i386 ;;
+x86_64-*-acess2*) targ_emul=acess2_amd64 ;;
++arm-*-acess2*) targ_emul=acess2_arm ;;
--- /dev/null
+SCRIPT_NAME=elf
+OUTPUT_FORMAT="elf32-littlearm"
+BIG_OUTPUT_FORMAT="elf32-bigarm"
+LITTLE_OUTPUT_FORMAT="elf32-littlearm"
+TEXT_START_ADDR=0x8000
+MAXPAGESIZE="CONSTANT (MAXPAGESIZE)"
+COMMONPAGESIZE="CONSTANT (COMMONPAGESIZE)"
+TEMPLATE_NAME=elf32
+
+ARCH=arm
+MACHINE=
+GENERATE_SHLIB_SCRIPT=yes
+GENERATE_PIE_SCRIPT=yes
+
+NO_SMALL_DATA=yes
+SEPARATE_GOTPLT=12
+
+ELF_INTERPRETER_NAME=\"/Acess/Libs/ld-acess.so\"
+
+ ;;
*-*-darwin*)
-@@ -1192,2 +1196,12 @@
+@@ -1192,2 +1196,17 @@
;;
+i[3-7]86-*-acess2*)
+ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h i386/i386elf.h newlib-stdint.h acess2.h"
+ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h newlib-stdint.h i386/i386elf.h i386/x86-64.h acess2.h"
+ tmake_file="i386/t-i386elf i386/t-crtstuff t-svr4"
+ use_fixproto=yes
++ ;;
++arm-*-acess2*)
++ tm_file="dbxelf.h elfos.h arm/unknown-elf.h arm/elf.h arm/bpabi.h newlib-stdint.h acess2.h arm/aout.h arm/arm.h"
++ tmake_file="arm/t-arm arm/t-arm-elf arm/t-bpabi"
++ use_fixproto=yes
+ ;;
i[34567]86-*-elf*)
--- libgcc/config.host
+++ libgcc/config.host
-@@ -523,4 +523,12 @@
+@@ -523,4 +523,18 @@
x86_64-*-elf*)
tmake_file="$tmake_file i386/t-crtstuff t-crtstuff-pic t-libgcc-pic"
;;
+x86_64-*-acess2*)
+ extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o crtendT.o"
+ tmake_file="$tmake_file i386/t-crtstuff t-crtstuff-pic t-libgcc-pic"
++ ;;
++arm-*-acess2*)
++ extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o crtendT.o"
++ tmake_file="${tmake_file} arm/t-arm arm/t-elf t-fixedpoint-gnu-prefix arm/t-bpabi t-softfp-sfdf t-softfp-excl arm/t-softfp t-softfp"
++ tm_file="$tm_file arm/bpabi-lib.h"
++ unwind_header=config/arm/unwind-arm.h
+ ;;
i[34567]86-*-freebsd*)
# Acess2 Build Configuration
#
+V ?= @
+
ACESSDIR := $(dir $(lastword $(MAKEFILE_LIST)))
ACESSDIR := $(shell cd $(ACESSDIR) && pwd)
# Default build programs
#CC := gcc
#LD := ld
-AS := nasm
DISASM := objdump -d -S
RM := @rm -f
STRIP := strip
CXX = $(COMPILERDIR)bin/$(TRIPLET)-g++
LD = $(COMPILERDIR)bin/$(TRIPLET)-ld
OBJDUMP = $(COMPILERDIR)bin/$(TRIPLET)-objdump
+ ifeq ($(AS),as)
+ AS = $(COMPILERDIR)bin/$(TRIPLET)-gcc -c
+ endif
endif
ifneq ($(ARCH),host)
--- /dev/null
+.section .init
+.global _init
+.type _init, function
+_init:
+#ifdef __thumb__
+ .thumb
+
+ push {r3, r4, r5, r6, r7, lr}
+#else
+ .arm
+ mov ip, sp
+ stmdb sp!, {r3, r4, r5, r6, r7, r8, r9, sl, fp, ip, lr, pc}
+ sub fp, ip, #4
+#endif
+ /* gcc will nicely put the contents of crtbegin.o's .init section here. */
+
+.section .fini
+.global _fini
+.type _fini, function
+_fini:
+#ifdef __thumb__
+ .thumb
+
+ push {r3, r4, r5, r6, r7, lr}
+#else
+ .arm
+ mov ip, sp
+ stmdb sp!, {r3, r4, r5, r6, r7, r8, r9, sl, fp, ip, lr, pc}
+ sub fp, ip, #4
+#endif
+ /* gcc will nicely put the contents of crtbegin.o's .fini section here. */
--- /dev/null
+.section .init
+ /* gcc will nicely put the contents of crtend.o's .init section here. */
+#ifdef __thumb__
+ .thumb
+
+ pop {r3, r4, r5, r6, r7}
+ pop {r3}
+ mov lr, r3
+#else
+ .arm
+
+ sub sp, fp, #40
+ ldmfd sp, {r4, r5, r6, r7, r8, r9, sl, fp, sp, lr}
+#endif
+
+#if defined __THUMB_INTERWORK__ || defined __thumb__
+ bx lr
+#else
+ mov pc, lr
+#endif
+
+.section .fini
+ /* gcc will nicely put the contents of crtend.o's .fini section here. */
+#ifdef __thumb__
+ .thumb
+
+ pop {r3, r4, r5, r6, r7}
+ pop {r3}
+ mov lr, r3
+#else
+ .arm
+
+ sub sp, fp, #40
+ ldmfd sp, {r4, r5, r6, r7, r8, r9, sl, fp, sp, lr}
+#endif
+
+#if defined __THUMB_INTERWORK__ || defined __thumb__
+ bx lr
+#else
+ mov pc, lr
+#endif
# create libld-acess.so
$(_XBIN): $(_OBJPREFIX)_stublib.o
@echo [LD] -o -shared libld-acess.so
- $(LD) -shared -o $@ $<
+ $V$(LD) -shared -o $@ $<
# @$(LD) $(LDFLAGS) -o $@ $(OBJ)
# Override .ao to look in the object prefix for the source
-$(_OBJPREFIX)arch/$(ARCHDIR).ao_: $(_OBJPREFIX)arch/$(ARCHDIR).$(ASSUFFIX)
+$(_OBJPREFIX)arch/$(ARCHDIR).ao_: $(_OBJPREFIX)arch/$(ARCHDIR).$(ASSUFFIX) Makefile
@echo [AS] -o $@
@mkdir -p $(dir $@)
- @$(AS) $(ASFLAGS) -o $@ $<
+ #$V$(AS) $(ASFLAGS) -o $@ $<
+ $V$(CC) -c $(ASFLAGS) -o $@ $<
#.PRECIOUS: $(OBJ:%.ao=%.asm)
$(_OBJPREFIX)arch/$(ARCHDIR).$(ASSUFFIX): arch/$(ARCHDIR).$(ASSUFFIX).h arch/syscalls.s.h
@echo [CPP] -o $@
@mkdir -p $(dir $@)
- @$(CPP) $(CPPFLAGS) -P -D__ASSEMBLER__ $< -o $@
+ $V$(CPP) $(CPPFLAGS) -P -D__ASSEMBLER__ $< -o $@
$(_OBJPREFIX)arch/$(ARCHDIR).$(ASSUFFIX): $(ACESSDIR)/KernelLand/Kernel/include/syscalls.h
b _exit
-@ Stupid GCC
+// Stupid GCC
.globl __ucmpdi2
__ucmpdi2:
cmp r0, r2
mov r0, #1
mov pc, lr
-@ Well, can't blame it
-@ - Clear the instruction cache
+//@ Well, can't blame it
+// - Clear the instruction cache
.globl __clear_cache
__clear_cache:
svc #0x1001
#ifndef _LIBCXX__TYPEINFO_
#define _LIBCXX__TYPEINFO_
+#include <cstddef>
+
namespace std {
// Type information class
const char* name() const;
// acess
- bool __is_child(const type_info &, unsigned long&) const;
+ bool __is_child(const type_info &, size_t&) const;
private:
type_info (const type_info& rhs);
type_info& operator= (const type_info& rhs);
}
// Acess-defined
-bool type_info::__is_child(const type_info &poss_child, unsigned long &offset) const
+bool type_info::__is_child(const type_info &poss_child, size_t &offset) const
{
_SysDebug("typeids = this:%s , poss_child:%s", typeid(*this).name(), typeid(poss_child).name());