SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -DUNIQUE_DEFAULT_BASE_ADDR_SUPPORT")
ENDIF(DEFINED UNIQUE_DEFAULT_BASE_ADDR_SUPPORT)
+IF(DEFINED SYSTEM_BASE_FILE)
+ SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -DSYSTEM_BASE_FILE=${SYSTEM_BASE_FILE}")
+ENDIF(DEFINED SYSTEM_BASE_FILE)
+
+IF(DEFINED DEFAULT_BASE_ADDR_START)
+ SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -DDEFAULT_BASE_ADDR_START=${DEFAULT_BASE_ADDR_START}")
+ENDIF(DEFINED DEFAULT_BASE_ADDR_START)
+
OPTION(NOT_USE_FUNCTION "Remove build warning" OFF)
IF(NOT_USE_FUNCTION)
ADD_DEFINITIONS("-DNOT_USE_FUNCTION")
#error "CROSSGEN_PATH is missed"
#endif
-#ifdef UNIQUE_DEFAULT_BASE_ADDR_SUPPORT
-#define SYSTEM_BASE_FILE "/usr/share/dotnet.tizen/system.base.addr.txt"
-#define DEFAULT_BASE_ADDR_START 0x3000000
-#endif
-
#define __XSTR(x) #x
#define __STR(x) __XSTR(x)
static const char* __CROSSGEN_PATH = __STR(CROSSGEN_PATH);
+
+#ifdef UNIQUE_DEFAULT_BASE_ADDR_SUPPORT
+static const char* __SYSTEM_BASE_FILE = __STR(SYSTEM_BASE_FILE);
+#endif
+
#undef __STR
#undef __XSTR
#ifdef UNIQUE_DEFAULT_BASE_ADDR_SUPPORT
// Get next base address to be used for system ni image from file
-// SYSTEM_BASE_FILE should be checked for existance before calling this function
+// __SYSTEM_BASE_FILE should be checked for existance before calling this function
static uintptr_t getNextBaseAddrFromFile()
{
- FILE *pFile = fopen(SYSTEM_BASE_FILE, "r");
+ FILE *pFile = fopen(__SYSTEM_BASE_FILE, "r");
if (pFile == NULL) {
- fprintf(stderr, "Failed to open " SYSTEM_BASE_FILE "\n");
+ fprintf(stderr, "Failed to open %s\n", __SYSTEM_BASE_FILE);
return 0;
}
{
uintptr_t baseAddr = 0;
- if (!isFileExist(SYSTEM_BASE_FILE)) {
+ if (!isFileExist(__SYSTEM_BASE_FILE)) {
// This is the starting address for all default base addresses
baseAddr = DEFAULT_BASE_ADDR_START;
} else {
}
// Write new entry to the file
- FILE *pFile = fopen(SYSTEM_BASE_FILE, "a");
+ FILE *pFile = fopen(__SYSTEM_BASE_FILE, "a");
if (pFile == NULL) {
- fprintf(stderr, "Failed to open " SYSTEM_BASE_FILE "\n");
+ fprintf(stderr, "Failed to open %s\n", __SYSTEM_BASE_FILE);
return;
}
}
#ifdef UNIQUE_DEFAULT_BASE_ADDR_SUPPORT
- if (isFileExist(SYSTEM_BASE_FILE)) {
- if (remove(SYSTEM_BASE_FILE)) {
- fprintf(stderr, "Failed to remove " SYSTEM_BASE_FILE " file\n");
+ if (isFileExist(__SYSTEM_BASE_FILE)) {
+ if (remove(__SYSTEM_BASE_FILE)) {
+ fprintf(stderr, "Failed to remove %s\n", __SYSTEM_BASE_FILE);
}
}
#endif
%define _install_mdplugin_dir /etc/package-manager/parserlib/metadata
%define _native_lib_dir /usr/share/dotnet.tizen/lib
%define _tac_dir /opt/usr/dotnet
+%define _system_base_addr_file /usr/share/dotnet.tizen/system.base.addr
+
+%define _default_base_addr_start 0x3000000
ExcludeArch: aarch64
-DUSE_DEFAULT_BASE_ADDR="" \
%endif
-DUNIQUE_DEFAULT_BASE_ADDR_SUPPORT="" \
+ -DSYSTEM_BASE_FILE=%{_system_base_addr_file} \
+ -DDEFAULT_BASE_ADDR_START=%{_default_base_addr_start} \
NativeLauncher
make %{?jobs:-j%jobs} VERBOSE=1
mkdir -p /opt/etc/skel/.dotnet
chsmack -t -a User::App::Shared /opt/etc/skel/.dotnet
%{_bindir}/nitool --dll %{_runtime_dir}/System.Private.CoreLib.dll
+chsmack -a _ %{_system_base_addr_file}
%files
%manifest dotnet-launcher.manifest