Parrot takes flight atop RTEMS was Fwd: RTEMS makefile.

Jonathan Leto jonathan at leto.net
Sat Oct 31 22:25:09 UTC 2009


Howdy,

I am excited to announce to everyone that Parrot Virtual Machine [0]
is gearing up for a port to a real-time, embedded OS, namely, RTEMS
[1]. Attached is a Makefile, hand-written by core RTEMS developer
Chris Johns, which allows cross-compiling to the RTEMS OS. What we
need now is to create a proper hints file and/or change the Parrot
build system to support cross-compiling.

The RTEMS devs are happy to help with this, so a few of us should join
their users mailing list [2] and vice versa. I have already
volunteered myself, and darbelo and Whiteknight seem to be on board.
Who else is up for the karma points?

Chris Johns also mentioned that there were no errors getting Parrot to
compile on RTEMS, only Configure-time bugs (because we have never
supported cross-compiling), which is really rare when porting software
to RTEMS. Nice work people!

PS: You can find info about getting the RTEMS source at

http://rtems.com/wiki/index.php/RTEMS_CVS_Repository

Duke


[0] http://www.parrot.org/
[1] http://rtems.com/
[2] http://www.rtems.org/mailman/listinfo/rtems-users
[3] http://lists.parrot.org/mailman/listinfo/parrot-dev



---------- Forwarded message ----------
From: Chris Johns <chrisj at rtems.org>
Date: Sat, Oct 31, 2009 at 2:40 PM
Subject: RTEMS makefile.
To: jonathan at leto.net


Hi Jonathan,

Attached in the make file. What is missing is the patch with the
changes to remove configured bit of Linux that are not present.

Please feel free to ask for any help.

Need to head for the morning but will be back later.

Regards
Chris

# RTEMS Makefile for Parrot
#
# Chris Johns <chrisj at rtems.org>
#
# This is sample makefile to show the commands needed to get Parrot to build
# for RTEMS. Built on a
#
# This makefile cross compiles the source created by the Parrot build system
# when building for an FC Linux box. There is a patch tot he Linux
# configuration that is require before starting this build. The patch only
# changes the confugration. No source needed to be change. The Parrot build
# system genetates the source from PMC files so a Linux build is performed
# before running make with this file. You need to clean the object files built
# after the Linux build.
#
# This makefile currently supports the PC BSP as this is the architecture of
# the native Linux build of Parrot.
#
# RTEMS is defined by the form <arch>-rtems<version> where <arch> can be i386,
# m68k, arm, powerpc, sparc and more. The <version> is the RTEMS version,
# currently 4.10. The BSP defines a specific target and provides the specific
# compiler flags. The configuuration for the PC is here:
#
# http://www.rtems.org/cgi-bin/viewcvs.cgi/rtems/c/src/lib/libbsp/i386/pc386/make/custom/
#
# These files are installed into the RTEMS install path and thetefore available
# to Parrot to use.
#
# RTEMS also supports multilib builds. This is based on the gcc multilib list
# and in some ways may be a cleaner solution for Parrot. A BSP can only build
# RTEMS as a multilib variant.
#
# A further complication for RTEMS or cross builds is building in the source
# tree. We tend to have a number of targets and build from a single
# source. There is always a chance an object file is not cleaned away before
# building the next target. I understand the need to build the C sources so
# some sort of configure and then source building phase is needed but it would
# be nice if we could have a makefile that allows us to build outside the
# source tree.
#
#
#

PARROT_INC = $(PARROT_SRC)/include

ARCH = i386
VERSION = 4.10
BSP = pc586

RTEMS_TRIPLE = $(ARCH)-rtems$(VERSION)

RTEMS_PATH = /local/ccj/rtems/$(VERSION)
BSP_PATH = $(RTEMS_PATH)/$(RTEMS_TRIPLE)/$(BSP)
BSP_INC = $(BSP_PATH)/lib/include
BSP_LIB = $(BSP_PATH)/lib

CC = $(RTEMS_TRIPLE)-gcc
AR = $(RTEMS_TRIPLE)-ar

CFLAGS = -I $(BSP_INC) -I $(PARROT_INC) -O2 -g \
       -DCLOCK_BEST=CLOCK_REALTIME -D__BSD_VISIBLE=1

SRC = \
       src/string/api.c \
       src/ops/core_ops.c \
       src/ops/core_ops_switch.c \
       src/byteorder.c \
       src/string/charset.c \
       src/core_pmcs.c \
       src/datatypes.c \
       src/debug.c \
       src/dynext.c \
       src/embed.c \
       src/string/encoding.c \
       src/events.c \
       src/exceptions.c \
       src/exit.c \
       src/extend.c \
       src/extend_vtable.c \
       src/gc/alloc_memory.c \
       src/gc/api.c \
       src/gc/generational_ms.c \
       src/gc/incremental_ms.c \
       src/gc/gc_ms.c \
       src/gc/gc_inf.c \
       src/gc/mark_sweep.c \
       src/gc/system.c \
       src/global.c \
       src/global_setup.c \
       src/hash.c \
       src/hll.c \
       src/call/pcc.c \
       src/interp/inter_cb.c \
       src/interp/inter_create.c \
       src/interp/inter_misc.c \
       src/call/ops.c \
       src/call/context.c \
       src/key.c \
       src/library.c \
       src/list.c \
       src/longopt.c \
       src/misc.c \
       src/multidispatch.c \
       src/nci.c \
       src/oo.c \
       src/packfile.c \
       src/packout.c \
       src/pic_jit.c \
       src/pic.c \
       src/platform.c \
       src/pmc_freeze.c \
       src/pmc.c \
       src/runcore/main.c \
       src/runcore/cores.c \
       src/runcore/profiling.c \
       src/scheduler.c \
       src/spf_render.c \
       src/spf_vtable.c \
       src/string/primitives.c \
       src/sub.c \
       src/thread.c \
       src/runcore/trace.c \
       src/tsq.c \
       src/utils.c \
       src/vtables.c \
       src/warnings.c \
       src/packfile/pf_items.c \
       src/ops/core_ops_cg.c \
       src/ops/core_ops_cgp.c \
       src/gc/alloc_resources.c \
       src/string/charset/ascii.c \
       src/string/charset/binary.c \
       src/string/charset/iso-8859-1.c \
       src/string/charset/tables.c \
       src/string/charset/unicode.c \
       src/io/core.c \
       src/io/api.c \
       src/io/utf8.c \
       src/io/buffer.c \
       src/io/unix.c \
       src/io/win32.c \
       src/io/portable.c \
       src/io/filehandle.c \
       src/io/socket_api.c \
       src/io/socket_unix.c \
       src/io/socket_win32.c \
       src/pmc/default.c \
       src/pmc/null.c \
       src/pmc/env.c \
       src/pmc/key.c \
       src/pmc/unmanagedstruct.c \
       src/pmc/managedstruct.c \
       src/pmc/exception.c \
       src/pmc/parrotlibrary.c \
       src/pmc/parrotinterpreter.c \
       src/pmc/parrotthread.c \
       src/pmc/lexpad.c \
       src/pmc/timer.c \
       src/pmc/pointer.c \
       src/pmc/sub.c \
       src/pmc/continuation.c \
       src/pmc/retcontinuation.c \
       src/pmc/coroutine.c \
       src/pmc/eval.c \
       src/pmc/nci.c \
       src/pmc/float.c \
       src/pmc/integer.c \
       src/pmc/bigint.c \
       src/pmc/bignum.c \
       src/pmc/complex.c \
       src/pmc/string.c \
       src/pmc/boolean.c \
       src/pmc/array.c \
       src/pmc/fixedintegerarray.c \
       src/pmc/iterator.c \
       src/pmc/fixedstringarray.c \
       src/pmc/hash.c \
       src/pmc/orderedhash.c \
       src/pmc/os.c \
       src/pmc/file.c \
       src/pmc/addrregistry.c \
       src/pmc/arrayiterator.c \
       src/pmc/callsignature.c \
       src/pmc/capture.c \
       src/pmc/class.c \
       src/pmc/codestring.c \
       src/pmc/context.c \
       src/pmc/cpointer.c \
       src/pmc/eventhandler.c \
       src/pmc/exceptionhandler.c \
       src/pmc/exporter.c \
       src/pmc/filehandle.c \
       src/pmc/fixedbooleanarray.c \
       src/pmc/fixedfloatarray.c \
       src/pmc/fixedpmcarray.c \
       src/pmc/handle.c \
       src/pmc/hashiterator.c \
       src/pmc/hashiteratorkey.c \
       src/pmc/lexinfo.c \
       src/pmc/multisub.c \
       src/pmc/namespace.c \
       src/pmc/object.c \
       src/pmc/orderedhashiterator.c \
       src/pmc/packfile.c \
       src/pmc/packfileannotation.c \
       src/pmc/packfileannotations.c \
       src/pmc/packfileconstanttable.c \
       src/pmc/packfiledirectory.c \
       src/pmc/packfilefixupentry.c \
       src/pmc/packfilefixuptable.c \
       src/pmc/packfilerawsegment.c \
       src/pmc/packfilesegment.c \
       src/pmc/parrotrunningthread.c \
       src/pmc/pccmethod_test.c \
       src/pmc/pmcproxy.c \
       src/pmc/resizablebooleanarray.c \
       src/pmc/resizablefloatarray.c \
       src/pmc/resizableintegerarray.c \
       src/pmc/resizablepmcarray.c \
       src/pmc/resizablestringarray.c \
       src/pmc/role.c \
       src/pmc/scalar.c \
       src/pmc/scheduler.c \
       src/pmc/schedulermessage.c \
       src/pmc/sockaddr.c \
       src/pmc/socket.c \
       src/pmc/stringhandle.c \
       src/pmc/stringiterator.c \
       src/pmc/task.c \
       src/pmc/undef.c \
       src/string/encoding/fixed_8.c \
       src/string/encoding/ucs2.c \
       src/string/encoding/utf16.c \
       src/string/encoding/utf8.c \
       compilers/imcc/imcparser.c \
       compilers/imcc/imclexer.c \
       compilers/imcc/imc.c \
       compilers/imcc/main.c \
       compilers/imcc/symreg.c \
       compilers/imcc/instructions.c \
       compilers/imcc/cfg.c \
       compilers/imcc/reg_alloc.c \
       compilers/imcc/sets.c \
       compilers/imcc/debug.c \
       compilers/imcc/optimizer.c \
       compilers/imcc/pbc.c \
       compilers/imcc/parser_util.c \
       compilers/imcc/pcc.c

ABS_SRC = $(addprefix $(PARROT_SRC)/, $(SRC))

OBJ = $(addsuffix .o, $(basename $(ABS_SRC)))

all: libparrot.a

clean:
       rm -f $(OBJ)

libparrot.a: $(OBJ)
       $(AR) rc $@ $?




-- 

Jonathan Leto
jonathan at leto.net
http://leto.net
-------------- next part --------------
# RTEMS Makefile for Parrot
#
# Chris Johns <chrisj at rtems.org>
#
# This is sample makefile to show the commands needed to get Parrot to build
# for RTEMS. Built on a 
#
# This makefile cross compiles the source created by the Parrot build system
# when building for an FC Linux box. There is a patch tot he Linux
# configuration that is require before starting this build. The patch only
# changes the confugration. No source needed to be change. The Parrot build
# system genetates the source from PMC files so a Linux build is performed
# before running make with this file. You need to clean the object files built
# after the Linux build.
#
# This makefile currently supports the PC BSP as this is the architecture of
# the native Linux build of Parrot.
#
# RTEMS is defined by the form <arch>-rtems<version> where <arch> can be i386,
# m68k, arm, powerpc, sparc and more. The <version> is the RTEMS version,
# currently 4.10. The BSP defines a specific target and provides the specific
# compiler flags. The configuuration for the PC is here:
#
# http://www.rtems.org/cgi-bin/viewcvs.cgi/rtems/c/src/lib/libbsp/i386/pc386/make/custom/
#
# These files are installed into the RTEMS install path and thetefore available
# to Parrot to use.
#
# RTEMS also supports multilib builds. This is based on the gcc multilib list
# and in some ways may be a cleaner solution for Parrot. A BSP can only build
# RTEMS as a multilib variant.
#
# A further complication for RTEMS or cross builds is building in the source
# tree. We tend to have a number of targets and build from a single
# source. There is always a chance an object file is not cleaned away before
# building the next target. I understand the need to build the C sources so
# some sort of configure and then source building phase is needed but it would
# be nice if we could have a makefile that allows us to build outside the
# source tree.
#
# 
#

PARROT_INC = $(PARROT_SRC)/include

ARCH = i386
VERSION = 4.10
BSP = pc586

RTEMS_TRIPLE = $(ARCH)-rtems$(VERSION)

RTEMS_PATH = /local/ccj/rtems/$(VERSION)
BSP_PATH = $(RTEMS_PATH)/$(RTEMS_TRIPLE)/$(BSP)
BSP_INC = $(BSP_PATH)/lib/include
BSP_LIB = $(BSP_PATH)/lib

CC = $(RTEMS_TRIPLE)-gcc
AR = $(RTEMS_TRIPLE)-ar

CFLAGS = -I $(BSP_INC) -I $(PARROT_INC) -O2 -g \
	-DCLOCK_BEST=CLOCK_REALTIME -D__BSD_VISIBLE=1

SRC = \
	src/string/api.c \
	src/ops/core_ops.c \
	src/ops/core_ops_switch.c \
	src/byteorder.c \
	src/string/charset.c \
	src/core_pmcs.c \
	src/datatypes.c \
	src/debug.c \
	src/dynext.c \
	src/embed.c \
	src/string/encoding.c \
	src/events.c \
	src/exceptions.c \
	src/exit.c \
	src/extend.c \
	src/extend_vtable.c \
	src/gc/alloc_memory.c \
	src/gc/api.c \
	src/gc/generational_ms.c \
	src/gc/incremental_ms.c \
	src/gc/gc_ms.c \
	src/gc/gc_inf.c \
	src/gc/mark_sweep.c \
	src/gc/system.c \
	src/global.c \
	src/global_setup.c \
	src/hash.c \
	src/hll.c \
	src/call/pcc.c \
	src/interp/inter_cb.c \
	src/interp/inter_create.c \
	src/interp/inter_misc.c \
	src/call/ops.c \
	src/call/context.c \
	src/key.c \
	src/library.c \
	src/list.c \
	src/longopt.c \
	src/misc.c \
	src/multidispatch.c \
	src/nci.c \
	src/oo.c \
	src/packfile.c \
	src/packout.c \
	src/pic_jit.c \
	src/pic.c \
	src/platform.c \
	src/pmc_freeze.c \
	src/pmc.c \
	src/runcore/main.c \
	src/runcore/cores.c \
	src/runcore/profiling.c \
	src/scheduler.c \
	src/spf_render.c \
	src/spf_vtable.c \
	src/string/primitives.c \
	src/sub.c \
	src/thread.c \
	src/runcore/trace.c \
	src/tsq.c \
	src/utils.c \
	src/vtables.c \
	src/warnings.c \
	src/packfile/pf_items.c \
	src/ops/core_ops_cg.c \
	src/ops/core_ops_cgp.c \
	src/gc/alloc_resources.c \
	src/string/charset/ascii.c \
	src/string/charset/binary.c \
	src/string/charset/iso-8859-1.c \
	src/string/charset/tables.c \
	src/string/charset/unicode.c \
	src/io/core.c \
	src/io/api.c \
	src/io/utf8.c \
	src/io/buffer.c \
	src/io/unix.c \
	src/io/win32.c \
	src/io/portable.c \
	src/io/filehandle.c \
	src/io/socket_api.c \
	src/io/socket_unix.c \
	src/io/socket_win32.c \
	src/pmc/default.c \
	src/pmc/null.c \
	src/pmc/env.c \
	src/pmc/key.c \
	src/pmc/unmanagedstruct.c \
	src/pmc/managedstruct.c \
	src/pmc/exception.c \
	src/pmc/parrotlibrary.c \
	src/pmc/parrotinterpreter.c \
	src/pmc/parrotthread.c \
	src/pmc/lexpad.c \
	src/pmc/timer.c \
	src/pmc/pointer.c \
	src/pmc/sub.c \
	src/pmc/continuation.c \
	src/pmc/retcontinuation.c \
	src/pmc/coroutine.c \
	src/pmc/eval.c \
	src/pmc/nci.c \
	src/pmc/float.c \
	src/pmc/integer.c \
	src/pmc/bigint.c \
	src/pmc/bignum.c \
	src/pmc/complex.c \
	src/pmc/string.c \
	src/pmc/boolean.c \
	src/pmc/array.c \
	src/pmc/fixedintegerarray.c \
	src/pmc/iterator.c \
	src/pmc/fixedstringarray.c \
	src/pmc/hash.c \
	src/pmc/orderedhash.c \
	src/pmc/os.c \
	src/pmc/file.c \
	src/pmc/addrregistry.c \
	src/pmc/arrayiterator.c \
	src/pmc/callsignature.c \
	src/pmc/capture.c \
	src/pmc/class.c \
	src/pmc/codestring.c \
	src/pmc/context.c \
	src/pmc/cpointer.c \
	src/pmc/eventhandler.c \
	src/pmc/exceptionhandler.c \
	src/pmc/exporter.c \
	src/pmc/filehandle.c \
	src/pmc/fixedbooleanarray.c \
	src/pmc/fixedfloatarray.c \
	src/pmc/fixedpmcarray.c \
	src/pmc/handle.c \
	src/pmc/hashiterator.c \
	src/pmc/hashiteratorkey.c \
	src/pmc/lexinfo.c \
	src/pmc/multisub.c \
	src/pmc/namespace.c \
	src/pmc/object.c \
	src/pmc/orderedhashiterator.c \
	src/pmc/packfile.c \
	src/pmc/packfileannotation.c \
	src/pmc/packfileannotations.c \
	src/pmc/packfileconstanttable.c \
	src/pmc/packfiledirectory.c \
	src/pmc/packfilefixupentry.c \
	src/pmc/packfilefixuptable.c \
	src/pmc/packfilerawsegment.c \
	src/pmc/packfilesegment.c \
	src/pmc/parrotrunningthread.c \
	src/pmc/pccmethod_test.c \
	src/pmc/pmcproxy.c \
	src/pmc/resizablebooleanarray.c \
	src/pmc/resizablefloatarray.c \
	src/pmc/resizableintegerarray.c \
	src/pmc/resizablepmcarray.c \
	src/pmc/resizablestringarray.c \
	src/pmc/role.c \
	src/pmc/scalar.c \
	src/pmc/scheduler.c \
	src/pmc/schedulermessage.c \
	src/pmc/sockaddr.c \
	src/pmc/socket.c \
	src/pmc/stringhandle.c \
	src/pmc/stringiterator.c \
	src/pmc/task.c \
	src/pmc/undef.c \
	src/string/encoding/fixed_8.c \
	src/string/encoding/ucs2.c \
	src/string/encoding/utf16.c \
	src/string/encoding/utf8.c \
	compilers/imcc/imcparser.c \
	compilers/imcc/imclexer.c \
	compilers/imcc/imc.c \
	compilers/imcc/main.c \
	compilers/imcc/symreg.c \
	compilers/imcc/instructions.c \
	compilers/imcc/cfg.c \
	compilers/imcc/reg_alloc.c \
	compilers/imcc/sets.c \
	compilers/imcc/debug.c \
	compilers/imcc/optimizer.c \
	compilers/imcc/pbc.c \
	compilers/imcc/parser_util.c \
	compilers/imcc/pcc.c

ABS_SRC = $(addprefix $(PARROT_SRC)/, $(SRC))

OBJ = $(addsuffix .o, $(basename $(ABS_SRC)))

all: libparrot.a

clean:
	rm -f $(OBJ)

libparrot.a: $(OBJ)
	$(AR) rc $@ $?


More information about the parrot-dev mailing list