From 31ade32004709a9d47e87b3ede231f8bc1322ab1 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Thu, 4 Mar 2021 23:15:31 -0600 Subject: [PATCH] Fixes for RTEMS-uC5282 with legacy stack --- configure/os/CONFIG.Common.RTEMS | 10 ++++++---- configure/os/CONFIG.Common.RTEMS-uC5282 | 4 ++++ modules/libcom/RTEMS/posix/rtems_config.c | 8 ++++++++ 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/configure/os/CONFIG.Common.RTEMS b/configure/os/CONFIG.Common.RTEMS index abb6f8716..4eae21898 100644 --- a/configure/os/CONFIG.Common.RTEMS +++ b/configure/os/CONFIG.Common.RTEMS @@ -106,11 +106,13 @@ ifeq ($(RTEMS_HAS_POSIX_API),yes) POSIX_CPPFLAGS = -D_GNU_SOURCE -D_DEFAULT_SOURCE endif -OP_SYS_LDLIBS_posix_NET_yes = -ltftpfs -lnfs -lz -telnetd +OP_SYS_LDLIBS_posix_NET_yes = -ltftpfs -lnfs -lz -ltelnetd OP_SYS_LDLIBS_posix_NET_no = -ltftpfs -lbsd -lz -OP_SYS_LDLIBS_kernel_NET_yes = -lCom -lnfs -OP_SYS_LDLIBS_kernel_NET_no = -lCom -lnfs -OP_SYS_LDLIBS += -lrtemsCom -lCom -lc -lrtemscpu $(OP_SYS_LDLIBS_$(OS_API)_NET_$(RTEMS_HAS_NETWORKING)) -lm +OP_SYS_LDLIBS_kernel_NET_yes = -lnfs +OP_SYS_LDLIBS_kernel_NET_no = -lnfs +OP_SYS_LDLIBS += -lrtemsCom -lCom +OP_SYS_LDLIBS += $(OP_SYS_LDLIBS_$(OS_API)_NET_$(RTEMS_HAS_NETWORKING)) +OP_SYS_LDLIBS += -lrtemscpu -lc -lm OP_SYS_LDFLAGS_posix = -u POSIX_Init OP_SYS_LDFLAGS_kernel = -u Init \ diff --git a/configure/os/CONFIG.Common.RTEMS-uC5282 b/configure/os/CONFIG.Common.RTEMS-uC5282 index 2cb215aca..c0cdaff74 100644 --- a/configure/os/CONFIG.Common.RTEMS-uC5282 +++ b/configure/os/CONFIG.Common.RTEMS-uC5282 @@ -9,6 +9,10 @@ RTEMS_BSP = uC5282 RTEMS_TARGET_CPU = m68k ARCH_DEP_CFLAGS += -DMY_DO_BOOTP=NULL +# Hopefully a temporary fix: +ARCH_DEP_CXXFLAGS_5 = -std=c++98 +ARCH_DEP_CXXFLAGS += $(ARCH_DEP_CXXFLAGS_$(RTEMS_VERSION)) + MUNCH_SUFFIX = .boot define MUNCH_CMD $(RTEMS_TOOLS)/bin/$(OBJCOPY_FOR_TARGET) -O binary -R .comment -S $< $@ diff --git a/modules/libcom/RTEMS/posix/rtems_config.c b/modules/libcom/RTEMS/posix/rtems_config.c index 4319013a1..d0a123b6d 100644 --- a/modules/libcom/RTEMS/posix/rtems_config.c +++ b/modules/libcom/RTEMS/posix/rtems_config.c @@ -93,6 +93,7 @@ extern void *POSIX_Init(void *argument); #include +#ifndef RTEMS_LEGACY_STACK #include #define CONFIGURE_SHELL_USER_COMMANDS \ @@ -105,6 +106,13 @@ extern void *POSIX_Init(void *argument); &rtems_shell_TCPDUMP_Command, \ &rtems_shell_PFCTL_Command, \ &rtems_shell_SYSCTL_Command +#else // LEGACY_STACK: +#define CONFIGURE_SHELL_USER_COMMANDS \ + &bsp_interrupt_shell_command, \ + &rtems_shell_PING_Command, \ + &rtems_shell_ROUTE_Command, \ + &rtems_shell_IFCONFIG_Command +#endif #define CONFIGURE_SHELL_COMMAND_CPUUSE #define CONFIGURE_SHELL_COMMAND_PERIODUSE