Add setup of COMPlus_UseDefaultBaseAddr environment variable
authorGleb Balykov <g.balykov@samsung.com>
Tue, 25 Jun 2019 17:21:22 +0000 (20:21 +0300)
committer조웅석/Common Platform Lab(SR)/Principal Engineer/삼성전자 <ws77.cho@samsung.com>
Tue, 16 Jul 2019 05:05:17 +0000 (14:05 +0900)
NativeLauncher/CMakeLists.txt
NativeLauncher/launcher/dotnet/dotnet_launcher.cc
packaging/dotnet-launcher.spec

index 90bedcf..cc70ba6 100644 (file)
@@ -38,6 +38,10 @@ IF(DEFINED TAC_DIR)
     SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -DTAC_DIR=${TAC_DIR}")
 ENDIF(DEFINED TAC_DIR)
 
+IF(DEFINED USE_DEFAULT_BASE_ADDR)
+    SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -DUSE_DEFAULT_BASE_ADDR")
+ENDIF(DEFINED USE_DEFAULT_BASE_ADDR)
+
 OPTION(NOT_USE_FUNCTION "Remove build warning" OFF)
 IF(NOT_USE_FUNCTION)
     ADD_DEFINITIONS("-DNOT_USE_FUNCTION")
index c1fd01c..57b6005 100644 (file)
@@ -320,6 +320,10 @@ int CoreRuntime::initialize(bool standalone)
        // Write Debug.WriteLine to stderr
        putenv(const_cast<char *>("COMPlus_DebugWriteToStdErr=1"));
 
+#ifdef USE_DEFAULT_BASE_ADDR
+       putenv(const_cast<char *>("COMPlus_UseDefaultBaseAddr=1"));
+#endif // USE_DEFAULT_BASE_ADDR
+
        // read string from external file and set them to environment value.
        setEnvFromFile();
 
index b956bc0..cb67185 100644 (file)
@@ -110,6 +110,9 @@ cmake \
        -DTAC_DIR=%{_tac_dir} \
        -DVERSION=%{version} \
        -DNATIVE_LIB_DIR=%{_native_lib_dir} \
+%if 0%{?use_default_base_addr}
+       -DUSE_DEFAULT_BASE_ADDR="" \
+%endif
        NativeLauncher
 
 make %{?jobs:-j%jobs} VERBOSE=1