From e3813c6d457e973859f55b9f7014abc328bb86f4 Mon Sep 17 00:00:00 2001 From: brian Date: Fri, 21 May 2004 00:27:46 -0700 Subject: [PATCH] gpc support darcs-hash:20040521072746-24bed-52da8d0bde41d731130b083f86fd7861cbd4a14d.gz --- Makefile | 12 +++++++++++- upstream/Makefile | 29 +++++++++++++++++++++++++++++ upstream/patches/gpc-noutils.patch | 22 ++++++++++++++++++++++ upstream/patches/gpc-with-3.3.3.patch | 25 +++++++++++++++++++++++++ 4 files changed, 87 insertions(+), 1 deletion(-) create mode 100644 upstream/patches/gpc-noutils.patch create mode 100644 upstream/patches/gpc-with-3.3.3.patch diff --git a/Makefile b/Makefile index fa38892..d450f4b 100644 --- a/Makefile +++ b/Makefile @@ -22,6 +22,7 @@ flags = -march=mips1 MIPS_CC = mips-unknown-elf-gcc MIPS_CXX = mips-unknown-elf-g++ MIPS_G77 = mips-unknown-elf-g77 +MIPS_PC = mips-unknown-elf-gpc # Be VERY careful about changing any of these as they can break binary # compatibility and create hard to find bugs @@ -35,6 +36,8 @@ mips_optflags = -O3 -g \ -freduce-all-givs MIPS_CFLAGS = $(mips_optflags) $(flags) -I. -Wall -Wno-unused -Werror +MIPS_CXXFLAGS = $(MIPS_CFLAGS) +MIPS_PCFLAGS = $(MIPS_CFLAGS) --big-endian MIPS_LD = mips-unknown-elf-gcc MIPS_LDFLAGS= $(flags) --static -Wl,--gc-sections MIPS_STRIP = mips-unknown-elf-strip @@ -132,7 +135,11 @@ build/%.mips: build/%.o $(tasks)/build_gcc $(tasks)/build_libc build/%.mips: src/%.cc $(tasks)/build_gcc_step2 $(tasks)/build_libc @mkdir -p `dirname $@` - $(MIPS_CXX) $(MIPS_CFLAGS) $($(notdir $*)_CFLAGS) $(MIPS_LDFLAGS) $($(notdir $*)_LDFLAGS) -o $@ $< + $(MIPS_CXX) $(MIPS_CXXFLAGS) $($(notdir $*)_CXXFLAGS) $(MIPS_LDFLAGS) $($(notdir $*)_LDFLAGS) -o $@ $< + +build/%.mips: src/%.pas $(tasks)/build_gpc + @mkdir -p `dirname $@` + $(MIPS_PC) $(MIPS_PCFLAGS) $($(notdir $*)_PCFLAGS) $(MIPS_LDFLAGS) $($(notdir $*)_LDFLAGS) -o $@ $< build/%.mips.stripped: build/%.mips $(tasks)/build_linker cp $< $@ @@ -265,6 +272,9 @@ build/tests/FDTest.class: build/tests/Test.class fdtest: build/tests/FDTest.class $(JAVA) -cp build tests.FDTest +# Pascal Test +pascaltest: build/tests/PascalHello.class + $(JAVA) -cp build tests.PascalHello # Simple Simple_LDFLAGS = -nostdlib diff --git a/upstream/Makefile b/upstream/Makefile index bade846..32a90e2 100644 --- a/upstream/Makefile +++ b/upstream/Makefile @@ -9,6 +9,11 @@ patches_gcc = gcc-fixes.patch gcc-fdata-sections-bss.patch configure_gcc = --target=mips-unknown-elf --disable-threads --with-gnu-ld --with-gnu-as --with-newlib=yes --enable-sjlj-exceptions --enable-languages="c" configure_gcc_step2 = $(configure_gcc) --enable-languages="c,c++" +version_gpc = 20030830 +url_gpc = http://www.gnu-pascal.de/alpha/gpc-$(version_gpc).tar.gz +patches_gpc = $(patches_gcc) gpc-with-3.3.3.patch gpc-noutils.patch +configure_gpc = $(configure_gcc) --enable-languages="pascal" + version_binutils = 2.14 url_binutils = ftp://ftp.gnu.org/gnu/binutils/binutils-$(version_binutils).tar.gz patches_binutils = binutils-no64.patch binutils-nocompilein.patch @@ -191,6 +196,30 @@ tasks/build_gcc_step2: tasks/patch_gcc tasks/build_libc $(MAKE) install touch $@ +tasks/extract_gpc: tasks/download_gcc tasks/download_gpc + mkdir -p build/gpc.extract + cd build/gpc.extract && \ + gzip -dc ../../download/gcc-core-$(version_gcc).tar.gz | tar xf - && \ + gzip -dc ../../download/gpc-$(version_gpc).tar.gz | tar xf - && \ + test ! -e gcc-$(version_gcc)/gcc/p && \ + mv gpc-$(version_gpc)/p gcc-$(version_gcc)/gcc/p + mv build/gpc.extract/gcc-$(version_gcc) build/gpc-$(version_gpc) + rm -rf build/gpc.extract + touch $@ + +tasks/build_gpc: tasks/patch_gpc tasks/build_libc + mkdir -p $(usr) + # We need to preapply this patch because gpc's configury doesn't like 3.3.3 + cd build/gpc-$(version_gpc) && cat gcc/version.c | grep -q GPC || $(PATCH) -p0 < gcc/p/diffs/gcc-3.3.diff + + # echo | is to dismiss the gcc version warning + mkdir -p build/gpc-obj && cd build/gpc-obj && \ + echo | ../gpc-$(version_gpc)/configure --prefix=$(usr) $(configure_gpc) && \ + $(MAKE) TARGET_CFLAGS="$(MIPS_CFLAGS)" && \ + cd gcc && $(MAKE) pascal.install + + touch $@ + tasks/build_openbsdglob: tasks/download_openbsdglob tasks/build_newlib @mkdir -p $(usr)/mips-unknown-elf/{include,lib} cd build && gzip -dc ../download/openbsdglob.tar.gz | tar xf - diff --git a/upstream/patches/gpc-noutils.patch b/upstream/patches/gpc-noutils.patch new file mode 100644 index 0000000..18dc3a3 --- /dev/null +++ b/upstream/patches/gpc-noutils.patch @@ -0,0 +1,22 @@ +--- gcc/p/Make-lang.in.orig 2004-05-21 03:22:35.000000000 -0400 ++++ gcc/p/Make-lang.in 2004-05-21 03:24:03.000000000 -0400 +@@ -374,8 +374,8 @@ + MAKEINFO_ES=LANG=es_ES LC_ALL=es_ES $(MAKEINFO) $(MAKEINFOFLAGS) $(GPC_DOC_DIRS_ES) + + # Define the names for selecting Pascal in LANGUAGES. +-Pascal pascal: xgpc$(exeext) gpc1$(exeext) gpcpp$(exeext) gpc-run pascal.utils \ +- pascal.rts specs pascal.generated-files pascal.docdemos ++Pascal pascal: xgpc$(exeext) gpc1$(exeext) gpcpp$(exeext) gpc-run \ ++ pascal.rts specs pascal.generated-files + + # Tell GNU make to ignore these if they exist. + .PHONY: Pascal pascal +@@ -1026,7 +1026,7 @@ + fi; exit 0 + + pascal.install-normal: pascal.install-common pascal.install-compiler \ +- install-gpcpp pascal.install-utils pascal.install-lib pascal.install-man \ ++ install-gpcpp pascal.install-lib pascal.install-man \ + pascal.install-info pascal.install-units pascal.install-doc + + # This target will install GPC into an existing GCC installation, diff --git a/upstream/patches/gpc-with-3.3.3.patch b/upstream/patches/gpc-with-3.3.3.patch new file mode 100644 index 0000000..1cddf45 --- /dev/null +++ b/upstream/patches/gpc-with-3.3.3.patch @@ -0,0 +1,25 @@ +--- gcc/p/diffs/gcc-3.3.diff~ 2004-05-21 02:17:02.000000000 -0400 ++++ gcc/p/diffs/gcc-3.3.diff 2004-05-21 02:17:02.000000000 -0400 +@@ -727,22 +727,3 @@ + abort (); + } + +-*** gcc/varasm.c Sat Aug 16 19:06:03 2003 +---- gcc/varasm.c Sat Aug 16 19:04:13 2003 +-*************** +-*** 2411,2417 **** +- if (get_set_constructor_bytes (t2, tmp2, len) != NULL_TREE) +- return 0; +- +-! return memcmp (tmp1, tmp2, len) != 0; +- } +- else +- { +---- 2411,2417 ---- +- if (get_set_constructor_bytes (t2, tmp2, len) != NULL_TREE) +- return 0; +- +-! return memcmp (tmp1, tmp2, len) == 0; +- } +- else +- { -- 1.7.10.4