Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

os/Makefile.unix, external, apps: include entire archives in common binary #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions apps/platform/gnu/Make.defs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ ifeq ($(CONFIG_HAVE_CXXINITIALIZE),y)
CSRCS += gnu_cxxinitialize.c
endif

CSRCS += gnu_unwind_find_exidx.c
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can it be also included only for CXX?


# Add the gnu/ sub-directory to the build

VPATH += :gnu
Expand Down
50 changes: 50 additions & 0 deletions apps/platform/gnu/gnu_unwind_find_exidx.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/****************************************************************************
*
* Copyright 2023 Samsung Electronics All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the specific
* language governing permissions and limitations under the License.
*
****************************************************************************/

/****************************************************************************
* Included Files
****************************************************************************/

#include <unwind.h>

/****************************************************************************
* Private Data
****************************************************************************/

extern void *__exidx_start;
extern void *__exidx_end;

/****************************************************************************
* Public Functions
****************************************************************************/

/****************************************************************************
* Name: __gnu_Unwind_Find_exidx
*
* Description:
* This function is called (if exists) by the gcc generated unwind
* run-time in order to retrieve an alternative .ARM.exidx Exception
* index section.
*
****************************************************************************/

volatile _Unwind_Ptr __gnu_Unwind_Find_exidx(_Unwind_Ptr return_address, int *nrecp)
{
*nrecp = &__exidx_end - &__exidx_start;
return (_Unwind_Ptr)&__exidx_start;
}
6 changes: 0 additions & 6 deletions build/configs/rtl8730e/Make.defs
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,9 @@ include ${TOPDIR}/arch/$(CONFIG_ARCH)/src/$(ARCH_FAMILY)/Toolchain.defs
LDSCRIPT = rlx8730e_img2.ld

ifeq ($(CONFIG_LIBCXX_HAVE_LIBSUPCXX),y)
ifeq ($(CONFIG_LIBCXX_EXCEPTION),y)
LIBSUPXX = ${shell $(CC) $(CXXFLAGS) --print-file-name=libsupc++.a}
EXTRA_LIBPATHS += -L "${shell dirname "$(LIBSUPXX)"}"
EXTRA_LIBS += -lsupc++
else
LIBSUPXX = ${shell $(CC) $(CXXFLAGS) --print-file-name=libsupc++_nano.a}
EXTRA_LIBPATHS += -L "${shell dirname "$(LIBSUPXX)"}"
EXTRA_LIBS += -lsupc++_nano
endif
endif

ifeq ($(WINTOOL),y)
Expand Down
30 changes: 8 additions & 22 deletions build/configs/rtl8730e/loadable_apps/defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ CONFIG_TOOLS_DIR="../tools"
CONFIG_APP_BINARY_SEPARATION=y
CONFIG_NUM_APPS=2
# CONFIG_APPS_RAM_REGION_SHAREABLE is not set
# CONFIG_SUPPORT_COMMON_BINARY is not set
CONFIG_SUPPORT_COMMON_BINARY=y
CONFIG_COMMON_BINARY_VERSION="200204"
CONFIG_COMMON_BINARY_NAME="common"
CONFIG_NUM_L2_PER_APP=4
CONFIG_BUILD_PROTECTED=y
CONFIG_BUILD_2PASS=y
Expand Down Expand Up @@ -304,9 +306,9 @@ CONFIG_ARCH_BOARD_HAVE_FLASH=y
#
CONFIG_FLASH_PARTITION=y
CONFIG_FLASH_MINOR=0
CONFIG_FLASH_PART_SIZE="60,40,12,400,1844,4808,384,1844,4808,384,512,1280,8,"
CONFIG_FLASH_PART_TYPE="none,none,none,none,kernel,bin,bin,kernel,bin,bin,smartfs,ftl,bootparam,"
CONFIG_FLASH_PART_NAME="bl1,reserved,ftl,ss,kernel,app1,app2,kernel,app1,app2,userfs,reserved,bootparam,"
CONFIG_FLASH_PART_SIZE="60,40,12,400,1844,2808,384,2000,1844,2808,384,2000,512,1280,8,"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need changes in the partition?

CONFIG_FLASH_PART_TYPE="none,none,none,none,kernel,bin,bin,bin,kernel,bin,bin,bin,smartfs,ftl,bootparam,"
CONFIG_FLASH_PART_NAME="bl1,reserved,ftl,ss,kernel,common,app1,app2,kernel,common,app1,app2,userfs,reserved,bootparam,"
# CONFIG_ARCH_BOARD_HAVE_SECOND_FLASH is not set
CONFIG_AUTOMOUNT=y
CONFIG_AUTOMOUNT_USERFS=y
Expand Down Expand Up @@ -1177,7 +1179,7 @@ CONFIG_LIBC_SCANSET=y
# CONFIG_NOPRINTF_LONGLONG_TO_ASCII is not set
CONFIG_LIBC_IOCTL_VARIADIC=y
CONFIG_LIBC_WCHAR=y
# CONFIG_LIBC_LOCALE is not set
CONFIG_LIBC_LOCALE=y
CONFIG_LIB_RAND_ORDER=1
# CONFIG_EOL_IS_CR is not set
# CONFIG_EOL_IS_LF is not set
Expand Down Expand Up @@ -1255,22 +1257,7 @@ CONFIG_LIBCXX_HAVE_LIBSUPCXX=y
# CONFIG_ENABLE_CURL is not set
# CONFIG_ERROR_REPORT is not set
# CONFIG_GMOCK is not set
CONFIG_ENABLE_IOTIVITY=y

#
# IOTIVITY Config Parameters
#
CONFIG_IOTIVITY_RELEASE_VERSION="1.2-rel"
CONFIG_IOTIVITY_ROUTING="EP"
CONFIG_IOTIVITY_PTHREAD_STACKSIZE=16384
CONFIG_IOTIVITY_QUEING_PTHREAD_STACKSIZE=5120
CONFIG_IOTIVITY_RETRANSMIT_PTHREAD_STACKSIZE=2048
CONFIG_IOTIVITY_TCPRECEIVE_PTHREAD_STACKSIZE=8192
CONFIG_IOTIVITY_RECEIVEHANDLER_PTHREAD_STACKSIZE=8192
CONFIG_ENABLE_IOTIVITY_SECURED=y
CONFIG_ENABLE_IOTIVITY_CLOUD=y
# CONFIG_IOTIVITY_DEBUG is not set
# CONFIG_IOTIVITY_NS_PROVIDER is not set
# CONFIG_ENABLE_IOTIVITY is not set
CONFIG_NETUTILS_JSON=y
# CONFIG_LIBTUV is not set
# CONFIG_PROTOBUF is not set
Expand Down Expand Up @@ -1361,7 +1348,6 @@ CONFIG_BUILTIN_APPS=y
CONFIG_EXAMPLES_HELLO=y
# CONFIG_EXAMPLES_HELLOXX is not set
# CONFIG_EXAMPLES_IOTBUS_TEST is not set
# CONFIG_EXAMPLES_IOTIVITY is not set
# CONFIG_EXAMPLES_IOTJS_STARTUP is not set
# CONFIG_EXAMPLES_KERNEL_SAMPLE is not set
# CONFIG_EXAMPLES_KERNEL_UPDATE is not set
Expand Down
2 changes: 0 additions & 2 deletions external/libcxx/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,7 @@ CXXSRCS += locale.cxx

# Exception handling logic

ifeq ($(CONFIG_LIBCXX_EXCEPTION),y)
CXXSRCS += exception.cxx stdexcept.cxx
endif

# libsupc++ replacement

Expand Down
2 changes: 2 additions & 0 deletions external/libcxx/new.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,7 @@ bad_array_length::~bad_array_length() _NOEXCEPT

#ifndef LIBSTDCXX

#if 0 // definition already present in libxx_stdthrow.cxx
void
__throw_bad_alloc()
{
Expand All @@ -376,6 +377,7 @@ __throw_bad_alloc()
_VSTD::abort();
#endif
}
#endif

#endif // !LIBSTDCXX

Expand Down
10 changes: 9 additions & 1 deletion lib/libc/machine/arm/armv7-a/arch_elf.c
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,15 @@ int up_relocate(const Elf32_Rel *rel, const Elf32_Sym *sym, uintptr_t addr)
binfo("insn [%04x %04x]\n",
(int)upper_insn, (int)lower_insn);
}
break;
break;
case R_ARM_TARGET2: /* TARGET2 is a platform-specific relocation: gcc-arm-none-eabi
* performs a self relocation */
{
binfo("Performing TARGET2 link at addr=%08lx [%08lx] to sym=%p st_value=%08lx\n", (long)addr, (long)(*(uint32_t *)addr), sym, (long)sym->st_value);

*(uint32_t *)addr += sym->st_value - addr;
}
break;

case R_ARM_THM_CALL:
case R_ARM_THM_JUMP24:
Expand Down
2 changes: 1 addition & 1 deletion os/Makefile.unix
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ pass1: pass1deps
ifeq ($(CONFIG_BUILD_2PASS),y)
$(Q) $(MAKE) -C $(LOADABLE_APPDIR) TOPDIR="$(TOPDIR)" LOADABLEDIR="${LOADABLE_APPDIR}" LIBRARIES_DIR="$(LIBRARIES_DIR)" USERLIBS="$(USERLIBS)" all KERNEL=n
ifeq ($(CONFIG_SUPPORT_COMMON_BINARY),y)
$(Q) $(LD) -r -o $(OUTBIN_DIR)/$(CONFIG_COMMON_BINARY_NAME) -T $(TOPDIR)/userspace/userspace_apps.ld -L $(LIBRARIES_DIR) --start-group $(USERLIBS) $(LIBGCC) $(LIBSUPXX) --end-group $$(cat $(OUTBIN_DIR)/lib_symbols.txt)
$(Q) $(LD) --force-group-allocation -r -o $(OUTBIN_DIR)/$(CONFIG_COMMON_BINARY_NAME) -T $(TOPDIR)/userspace/userspace_apps.ld -L $(LIBRARIES_DIR) --whole-archive $(USERLIBS) --no-whole-archive --start-group $(LIBGCC) $(LIBSUPXX) --end-group
endif
endif

Expand Down
2 changes: 1 addition & 1 deletion os/dbuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ BINDIR="${BUILDDIR}/output/bin"
CONFIGDIR="${BUILDDIR}/configs"
DOCKER_IMAGE=
DOCKER_PUBLIC_IMAGE="tizenrt/tizenrt"
DOCKER_VERSION="1.5.8"
DOCKER_VERSION="2.0.0"

STATUS_LIST="NOT_CONFIGURED BOARD_CONFIGURED CONFIGURED BUILT PREPARE_DL DOWNLOAD_READY"
BUILD_CMD=make
Expand Down
8 changes: 8 additions & 0 deletions os/include/wctype.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@ typedef int wctrans_t;
* Reference: Opengroup.org
*/

#if defined(__cplusplus)
extern "C" {
#endif

int iswalnum(wint_t);
int iswalpha(wint_t);
int iswblank(wint_t);
Expand All @@ -124,4 +128,8 @@ wint_t towupper(wint_t);
wctrans_t wctrans(FAR const char *);
wctype_t wctype(FAR const char *);

#if defined(__cplusplus)
} /* extern "C" */
#endif

#endif /* INCLUDE_WTYPE_H */
12 changes: 12 additions & 0 deletions os/userspace/userspace_apps.ld
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,18 @@ SECTIONS
_edtors = . ;
}

.ARM.extab :
{
*(.ARM.extab*)
}

.ARM.exidx :
{
__exidx_start = . ;
*(.ARM.exidx*)
__exidx_end = . ;
}

.bss :
{
_sbss = . ;
Expand Down