Skip to content

Commit

Permalink
Merge 4394081 into c196052
Browse files Browse the repository at this point in the history
  • Loading branch information
brendanchandler committed Jan 22, 2021
2 parents c196052 + 4394081 commit 8cc0378
Show file tree
Hide file tree
Showing 81 changed files with 3,126 additions and 61 deletions.
2 changes: 1 addition & 1 deletion .ci
Submodule .ci updated 1 files
+14 −9 cue.py
12 changes: 12 additions & 0 deletions .github/workflows/ci-scripts-build.yml
Expand Up @@ -33,7 +33,9 @@ jobs:
BCFG: ${{ matrix.configuration }}
WINE: ${{ matrix.wine }}
RTEMS: ${{ matrix.rtems }}
RTEMS_TARGET: ${{ matrix.rtems_target }}
EXTRA: ${{ matrix.extra }}
TEST: ${{ matrix.test }}
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -68,17 +70,27 @@ jobs:
extra: "CMD_CXXFLAGS=-std=c++11"
name: "Ub-20 clang-10 C++11"

- os: ubuntu-20.04
cmp: gcc
configuration: default
rtems: "5"
rtems_target: RTEMS-pc686-qemu
name: "Ub-20 gcc-9 + RT-5.1"
test: NO

- os: ubuntu-20.04
cmp: gcc
configuration: default
rtems: "4.10"
name: "Ub-20 gcc-9 + RT-4.10"
rtems_target: RTEMS-pc386-qemu

- os: ubuntu-20.04
cmp: gcc
configuration: default
rtems: "4.9"
name: "Ub-20 gcc-9 + RT-4.9"
rtems_target: RTEMS-pc386-qemu

- os: ubuntu-16.04
cmp: gcc-4.8
Expand Down
3 changes: 3 additions & 0 deletions configure/CONFIG
Expand Up @@ -62,6 +62,9 @@ include $(CONFIG)/os/CONFIG.$(EPICS_HOST_ARCH).Common
RELEASE_TOPS := $(shell $(CONVERTRELEASE) -T $(TOP) releaseTops)

ifdef T_A
# Information from the target's compiler
#
-include $(EPICS_BASE)/cfg/TOOLCHAIN.$(EPICS_HOST_ARCH).$(T_A)

# Cross compile specific definitions
#
Expand Down
3 changes: 2 additions & 1 deletion configure/CONFIG_COMMON
Expand Up @@ -142,9 +142,10 @@ BUILDLIB_SUFFIX = $(BUILDLIB_SUFFIX_$(SHARED_LIBRARIES))
#--------------------------------------------------
# vpath directories
POSIX_YES = os/posix
OS_IMPL_DIRS = $(if $(OS_API),os/$(OS_CLASS)-$(OS_API),) os/$(OS_CLASS)
GENERIC_SRC_DIRS = .. $(SRC_DIRS)
OS_SRC_DIRS += . $(foreach dir, .. $(SRC_DIRS), \
$(addprefix $(dir)/, os/$(OS_CLASS) $(POSIX_$(POSIX)) os/default ))
$(addprefix $(dir)/, $(OS_IMPL_DIRS) $(POSIX_$(POSIX)) os/default ))
CMPLR_SRC_DIRS += . $(foreach dir, .. $(SRC_DIRS), \
$(addprefix $(dir)/, compiler/$(CMPLR_CLASS) compiler/default ))
ALL_SRC_DIRS = $(CMPLR_SRC_DIRS) $(OS_SRC_DIRS) $(GENERIC_SRC_DIRS)
Expand Down
1 change: 0 additions & 1 deletion configure/CONFIG_SITE
Expand Up @@ -103,7 +103,6 @@
# Which target architectures to cross-compile for.
# Definitions in configure/os/CONFIG_SITE.<host>.Common
# may override this setting.
CROSS_COMPILER_TARGET_ARCHS=
#CROSS_COMPILER_TARGET_ARCHS=vxWorks-ppc32

# If only some of your host architectures can compile the
Expand Down
7 changes: 6 additions & 1 deletion configure/Makefile
Expand Up @@ -15,7 +15,8 @@ include $(TOP)/configure/CONFIG
TOOLS = $(TOP)/src/tools

CONFIGS += $(subst ../,,$(wildcard ../CONFIG*))
CONFIGS += $(subst ../,,$(wildcard ../os/CONFIG*))
CONFIGS += $(subst ../,,$(wildcard ../os/CONFIG.*))
CONFIGS += $(subst ../,,$(wildcard ../os/CONFIG_SITE.*))

CONFIGS += $(subst ../,,$(wildcard ../RELEASE*))
CONFIGS += $(subst ../,,$(wildcard ../RULES*))
Expand All @@ -29,5 +30,9 @@ CFG += CONFIG_CA_VERSION
CFG += CONFIG_DATABASE_MODULE
CFG += CONFIG_DATABASE_VERSION

CFG += TOOLCHAIN.$(EPICS_HOST_ARCH).$(T_A)

include $(TOP)/configure/RULES

TOOLCHAIN.$(EPICS_HOST_ARCH).$(T_A): toolchain.c
$(PREPROCESS.cpp)
49 changes: 42 additions & 7 deletions configure/os/CONFIG.Common.RTEMS
Expand Up @@ -28,20 +28,21 @@ ifneq ($(CONFIG),$(TOP)/configure)
endif

#--------------------------------------------------
# Set RTEMS_BSP from T_A if not already done
# Set RTEMS_BSP and GNU_TARGET if not already done
RTEMS_BSP ?= $(subst RTEMS-,,$(T_A))
GNU_TARGET ?= $(RTEMS_TARGET_CPU)-rtems

#-------------------------------------------------------
# Pick up the RTEMS tool/path definitions from the RTEMS BSP directory.
include $(RTEMS_BASE)/$(RTEMS_TARGET_CPU)-rtems$(RTEMS_VERSION)/$(RTEMS_BSP)/Makefile.inc
include $(RTEMS_BASE)/$(GNU_TARGET)$(RTEMS_VERSION)/$(RTEMS_BSP)/Makefile.inc
include $(RTEMS_CUSTOM)
include $(CONFIG.CC)

#-------------------------------------------------------
# RTEMS cross-development tools
CC = $(RTEMS_TOOLS)/bin/$(CC_FOR_TARGET) $(GCCSPECS) -fasm
CCC = $(RTEMS_TOOLS)/bin/$(CXX)
CPP = $(RTEMS_TOOLS)/bin/$(CC_FOR_TARGET) -x c -E
CPP = $(RTEMS_TOOLS)/bin/$(CC_FOR_TARGET) -x c -E $(GCCSPECS)
AR = $(RTEMS_TOOLS)/bin/$(AR_FOR_TARGET)
LD = $(RTEMS_TOOLS)/bin/$(LD_FOR_TARGET) -r

Expand Down Expand Up @@ -95,15 +96,49 @@ MODEXT=.obj
OS_CLASS = RTEMS

#--------------------------------------------------
# Operating system flags
OP_SYS_LDLIBS += -lrtemsCom -lc -lrtemscpu -lCom -lnfs -lm
OP_SYS_LDFLAGS += $(CPU_CFLAGS) -u Init \
ifeq ($(RTEMS_HAS_POSIX_API),no)
ifeq ($(EPICS_VERSION),7)
$(error Warning: Epics Version $(EPICS_VERSION) must not be used without POSIX enabled on RTEMS !!!)
endif
endif

# operating system API (src/os/<os_class>-<os-api>)
ifeq ($(RTEMS_HAS_POSIX_API),yes)
OS_API = posix
POSIX_CPPFLAGS = -D_GNU_SOURCE -D_DEFAULT_SOURCE
else
OS_API = kernel
endif

# Operating system compile & link flags
OP_SYS_CFLAGS += $(OP_SYS_CFLAGS_API_$(OS_API))
OP_SYS_CFLAGS += -D__LINUX_ERRNO_EXTENSIONS__

OP_SYS_CFLAGS_NET_yes = -DRTEMS_LEGACY_STACK
OP_SYS_CFLAGS_NET_no = -DHAVE_SOCKADDR_SA_LEN=1
OP_SYS_CFLAGS += $(OP_SYS_CFLAGS_NET_$(RTEMS_HAS_NETWORKING))

OP_SYS_LDLIBS_posix = -ltftpfs -lbsd -lz
OP_SYS_LDLIBS_kernel = -lCom -lnfs
OP_SYS_LDLIBS += -lrtemsCom -lCom -lc -lrtemscpu $(OP_SYS_LDLIBS_$(OS_API)) -lm

ifeq ($(RTEMS_API),5)
OP_SYS_LDLIBS_NET_yes := -lCom -ltelnetd -lnfs
OP_SYS_LDLIBS_NET_no := -lbsd -lz
OP_SYS_LDLIBS += -lrtemsCom -lc -lrtemscpu -ltftpfs -lm
OP_SYS_LDLIBS += $(OP_SYS_LDLIBS_NET_$(RTEMS_HAS_NETWORKING))
else
OP_SYS_LDLIBS += -lrtemsCom -lc -lnfs -lm
endif

OP_SYS_LDFLAGS_posix = -u POSIX_Init
OP_SYS_LDFLAGS_kernel = -u Init \
$(PROJECT_RELEASE)/lib/no-dpmem.rel \
$(PROJECT_RELEASE)/lib/no-mp.rel \
$(PROJECT_RELEASE)/lib/no-part.rel \
$(PROJECT_RELEASE)/lib/no-signal.rel \
$(PROJECT_RELEASE)/lib/no-rtmon.rel

OP_SYS_LDFLAGS += $(CPU_CFLAGS) $(OP_SYS_LDFLAGS_$(OS_API))
MOD_SYS_LDFLAGS += $(CPU_CFLAGS) -Wl,-r -nostdlib

# Do not link against libraries which are part of the Generic Image
Expand Down
18 changes: 18 additions & 0 deletions configure/os/CONFIG.Common.RTEMS-beagleboneblack
@@ -0,0 +1,18 @@
#
# CONFIG.Common.RTEMS-beaglebineblack
# Author: Heinz Junkes <junkes@fhi-berlin.mpg.de>
#
# All RTEMS targets use the same Makefile fragment
#
#EXE = .elf
RTEMS_BSP = beagleboneblack
RTEMS_TARGET_CPU = arm
GNU_TARGET = arm-rtems

OP_SYS_LDLIBS += -Wl,--gc-sections
ARCH_DEP_LDFLAGS = -L$(RTEMS_BASE)/$(GNU_TARGET)$(RTEMS_VERSION)/beagleboneblack/lib/

include $(CONFIG)/os/CONFIG.Common.RTEMS



8 changes: 6 additions & 2 deletions configure/os/CONFIG.Common.RTEMS-beatnik
Expand Up @@ -8,14 +8,18 @@ EXE = .elf
RTEMS_BSP = beatnik
RTEMS_TARGET_CPU = powerpc
GNU_TARGET = powerpc-rtems
ARCH_DEP_CFLAGS += -DMY_DO_BOOTP=NULL
# optimization trouble in postfix.c
ARCH_DEP_CFLAGS += -DRTEMS_HAS_ALTIVEC
#will use bootp
#ARCH_DEP_CFLAGS += -DMY_DO_BOOTP=NULL
ARCH_DEP_CFLAGS += -DHAVE_MOTLOAD
ARCH_DEP_CFLAGS += -DRTEMS_NETWORK_CONFIG_MBUF_SPACE=2048
ARCH_DEP_CFLAGS += -DRTEMS_NETWORK_CONFIG_CLUSTER_SPACE=5120

OP_SYS_LDLIBS += -lbspExt
OP_SYS_LDLIBS += -lbspExt #does not use posix stuff ... want to ignore

MUNCH_SUFFIX = .boot
MUNCHNAME = $(PRODNAME:%$(EXE)=%$(MUNCH_SUFFIX))
define MUNCH_CMD
$(RTEMS_TOOLS)/bin/$(OBJCOPY_FOR_TARGET) -O binary $< $@
endef
Expand Down
18 changes: 13 additions & 5 deletions configure/os/CONFIG.Common.RTEMS-pc386
@@ -1,12 +1,13 @@
# CONFIG.Common.RTEMS-pc386
#
# Author: W. Eric Norum
# Canadian Light Source
# eric@cls.usask.ca
#
# All RTEMS targets use the same Makefile fragment
# Definitions for the RTEMS-pc386 target, RTEMS 4.x only
# Site-specific overrides go in CONFIG_SITE.Common.RTEMS-pc386
#
#-------------------------------------------------------

RTEMS_BSP = pc386
RTEMS_TARGET_CPU = i386
GNU_TARGET = i386-rtems

MUNCH_SUFFIX = .boot
define MUNCH_CMD
Expand All @@ -22,3 +23,10 @@ include $(CONFIG)/os/CONFIG.Common.RTEMS
# Put text segment where it will work with etherboot
#
OP_SYS_LDFLAGS += -Wl,-Ttext,0x100000

# This check must appear after the above include
ifeq ($(RTEMS_VERSION),5)
$(info *** This target is not compatible with the configured RTEMS version.)
$(info *** Build the RTEMS-pc686 (-qemu) target for RTEMS 5.x)
$(error Can't continue)
endif
3 changes: 2 additions & 1 deletion configure/os/CONFIG.Common.RTEMS-pc386-qemu
Expand Up @@ -6,6 +6,7 @@
#-------------------------------------------------------

# Include definitions from RTEMS-pc386
include $(CONFIG)/os/CONFIG.Common.RTEMS-pc386
# For Tests overwrite it with pc686
include $(CONFIG)/os/CONFIG.Common.RTEMS-pc686

RTEMS_QEMU_FIXUPS = YES
39 changes: 39 additions & 0 deletions configure/os/CONFIG.Common.RTEMS-pc686
@@ -0,0 +1,39 @@
# CONFIG.Common.RTEMS-pc686
#
# Definitions for the RTEMS-pc686 target, RTEMS 5.x only
# Site-specific overrides go in CONFIG_SITE.Common.RTEMS-pc686
#
#-------------------------------------------------------

#
# Author: W. Eric Norum
# Canadian Light Source
# eric@cls.usask.ca
#
# All RTEMS targets use the same Makefile fragment
#
RTEMS_BSP = pc686
RTEMS_TARGET_CPU = i386
GNU_TARGET = i386-rtems

MUNCH_SUFFIX = .boot
define MUNCH_CMD
$(RTEMS_TOOLS)/bin/$(OBJCOPY_FOR_TARGET) -O binary -R .comment -S $< $@
endef

OP_SYS_LDLIBS += -Wl,--gc-sections
ARCH_DEP_LDFLAGS = -L$(RTEMS_BASE)/$(GNU_TARGET)$(RTEMS_VERSION)/pc686/lib/

include $(CONFIG)/os/CONFIG.Common.RTEMS

#
# Put text segment where it will work with etherboot
#
OP_SYS_LDFLAGS += -Wl,-Ttext,0x100000

# This check must appear after the above include
ifneq ($(RTEMS_VERSION),5)
$(info *** This target is not compatible with the configured RTEMS version.)
$(info *** Build the RTEMS-pc386 (-qemu) target for RTEMS 4.x)
$(error Can't continue)
endif
11 changes: 11 additions & 0 deletions configure/os/CONFIG.Common.RTEMS-pc686-qemu
@@ -0,0 +1,11 @@
# CONFIG.Common.RTEMS-pc686-qemu
#
# Definitions for the RTEMS-pc686-qemu target
# Site-specific overrides go in CONFIG_SITE.Common.RTEMS-pc686-qemu
#
#-------------------------------------------------------

# Include definitions from RTEMS-pc686
include $(CONFIG)/os/CONFIG.Common.RTEMS-pc686

RTEMS_QEMU_FIXUPS = YES
48 changes: 48 additions & 0 deletions configure/os/CONFIG.Common.RTEMS-qoriq_e500
@@ -0,0 +1,48 @@
#
# CONFIG.Common.RTEMS-qoriq_e500
# Author: Heinz Junkes <junkes@fhi-berlin.mpg.de>
#
# All RTEMS targets use the same Makefile fragment
#
EXE = .elf
RTEMS_BSP = qoriq_e500
RTEMS_TARGET_CPU = powerpc
GNU_TARGET = powerpc-rtems
# optimization trouble in postfix.c
ARCH_DEP_CFLAGS += -DRTEMS_HAS_ALTIVEC
#will use bootp
#ARCH_DEP_CFLAGS += -DMY_DO_BOOTP=NULL

#ARCH_DEP_CFLAGS += -DRTEMS_NETWORK_CONFIG_MBUF_SPACE=2048
#ARCH_DEP_CFLAGS += -DRTEMS_NETWORK_CONFIG_CLUSTER_SPACE=5120

#netbsdlib
#ARCH_DEP_CFLAGS += -I$(RTEMS_BASE)/powerpc-rtems5/qoriq_e500/lib/include

#OP_SYS_LDLIBS += -lbspExt #does not use posix stuff ... want to ignore
OP_SYS_LDLIBS += -Wl,--gc-sections
#ARCH_DEP_LDFLAGS = -mcpu=8540 -meabi -msdata=sysv -mstrict-align -mspe -mabi=spe -mfloat-gprs=double
ARCH_DEP_LDFLAGS = -L$(RTEMS_BASE)/powerpc-rtems5/qoriq_e500/lib

MUNCH_SUFFIX = .img
MUNCHNAME = $(PRODNAME:%$(EXE)=%$(MUNCH_SUFFIX))
define MUNCH_CMD
$(RTEMS_TOOLS)/bin/$(OBJCOPY_FOR_TARGET) -O binary $< $@
gzip -9 -f $@
mkimage -A ppc -O linux -T kernel -a 0x4000 -e 0x4000 -n $* -d $@.gz $*.img
endef

include $(CONFIG)/os/CONFIG.Common.RTEMS

RTEMSSYMS=$(PRODNAME:%$(EXE)=%.sym)
RTEMSIMGS=$(PRODNAME:%$(EXE)=%.bin)
INSTALL_RTEMSSYMS=$(RTEMSSYMS:%=$(INSTALL_BIN)/%)
INSTALL_RTEMSIMGS=$(RTEMSIMGS:%=$(INSTALL_BIN)/%)

%.sym: %$(EXE)
$(XSYMS) $^ $@

%.bin: %$(EXE)
$(OBJCOPY) -Obinary $^ $@

#PRODTARGETS+=$(INSTALL_RTEMSSYMS) $(INSTALL_RTEMSIMGS)
20 changes: 20 additions & 0 deletions configure/os/CONFIG.Common.RTEMS-xilinx_zynq_a9_qemu
@@ -0,0 +1,20 @@
#
# CONFIG.Common.RTEMS-xilinx_zynq_a9_qemu
# Author: Heinz Junkes <junkes@fhi-berlin.mpg.de>
#
# All RTEMS targets use the same Makefile fragment
#
#EXE = .elf
RTEMS_BSP = xilinx_zynq_a9_qemu
RTEMS_TARGET_CPU = arm
GNU_TARGET = arm-rtems

#use dhcp/bootp
ARCH_DEP_CFLAGS += -DMY_DO_BOOTP=NULL

OP_SYS_LDLIBS += -Wl,--gc-sections
ARCH_DEP_LDFLAGS = -L$(RTEMS_BASE)/$(GNU_TARGET)$(RTEMS_VERSION)/xilinx_zynq_a9_qemu/lib/


include $(CONFIG)/os/CONFIG.Common.RTEMS

19 changes: 19 additions & 0 deletions configure/os/CONFIG.Common.RTEMS-xilinx_zynq_zedboard
@@ -0,0 +1,19 @@
#
# CONFIG.Common.RTEMS-xilinx_zynq_zedboard
# Author: Heinz Junkes <junkes@fhi-berlin.mpg.de>
#
# All RTEMS targets use the same Makefile fragment
#
#EXE = .elf
RTEMS_BSP = xilinx_zynq_zedboard
RTEMS_TARGET_CPU = arm
GNU_TARGET = arm-rtems

OP_SYS_LDLIBS += -Wl,--gc-sections
ARCH_DEP_LDFLAGS = -L$(RTEMS_BASE)/$(GNU_TARGET)$(RTEMS_VERSION)/xilinx_zynq_zedboard/lib/


include $(CONFIG)/os/CONFIG.Common.RTEMS



3 changes: 2 additions & 1 deletion configure/os/CONFIG.darwin-x86.Common
Expand Up @@ -3,6 +3,7 @@
# Definitions for darwin-x86 host builds
# Sites may override these definitions in CONFIG_SITE.darwin-x86.Common
#-------------------------------------------------------

#support for IPv6 etc.
OP_SYS_CFLAGS += -DHAVE_SOCKADDR_SA_LEN=1
#Include definitions common to unix hosts
include $(CONFIG)/os/CONFIG.UnixCommon.Common

0 comments on commit 8cc0378

Please sign in to comment.