From d275e74c75b7044ba699fff70936bdd97ca579d9 Mon Sep 17 00:00:00 2001 From: "yasuo@babs" Date: Thu, 17 Jan 2019 21:36:12 +0100 Subject: [PATCH 1/4] Added explicit -nopie to default linker options for Linux platforms where PIE is used by default --- src/BuildIntegration/Microsoft.NETCore.Native.Unix.props | 1 + tests/src/Simple/StaticLibrary/StaticLibrary.csproj | 1 + 2 files changed, 2 insertions(+) diff --git a/src/BuildIntegration/Microsoft.NETCore.Native.Unix.props b/src/BuildIntegration/Microsoft.NETCore.Native.Unix.props index e0b5d6e309c..832beb687c0 100644 --- a/src/BuildIntegration/Microsoft.NETCore.Native.Unix.props +++ b/src/BuildIntegration/Microsoft.NETCore.Native.Unix.props @@ -88,6 +88,7 @@ See the LICENSE file in the project root for more information. + diff --git a/tests/src/Simple/StaticLibrary/StaticLibrary.csproj b/tests/src/Simple/StaticLibrary/StaticLibrary.csproj index b3477312a6e..cc150721f51 100644 --- a/tests/src/Simple/StaticLibrary/StaticLibrary.csproj +++ b/tests/src/Simple/StaticLibrary/StaticLibrary.csproj @@ -39,6 +39,7 @@ + From 82a757ce80de1830e26bcfd8ba6e2b97bf092e34 Mon Sep 17 00:00:00 2001 From: "yasuo@babs" Date: Thu, 17 Jan 2019 21:39:24 +0100 Subject: [PATCH 2/4] Updated documentation with Linux issues --- Documentation/prerequisites-for-building.md | 44 +++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/Documentation/prerequisites-for-building.md b/Documentation/prerequisites-for-building.md index f58a46143c7..e9b39191303 100644 --- a/Documentation/prerequisites-for-building.md +++ b/Documentation/prerequisites-for-building.md @@ -50,3 +50,47 @@ sudo zypper install cmake libuuid-devel icu libcurl-devel zlib-devel Make sure you run with Ubuntu 16.04 Xenial userland (this is the default after Windows 10 Creators Update, but if you enabled the "Bash on Ubuntu on Windows" feature before the Creators Update, you need to [upgrade manually](https://blogs.msdn.microsoft.com/commandline/2017/04/11/windows-10-creators-update-whats-new-in-bashwsl-windows-console/)). Running `lsb_release -a` will give you the version. Then follow the Ubuntu 16.04 instructions above. + +# clang 3.9 not found on Linux + +If you encounter this error, CoreRT could not find the clang executable +``` +error : Platform linker ('clang-3.9') not found. Try installing clang-3.9 or the appropriate package for your platform to resolve the problem. +``` + +CoreRT expect by default clang-3.9 installed (see above). You can override this by setting an environment variable. + +``` +export CppCompilerAndLinker=clang +``` + +This works for building CoreCR itself as well as building with CoreRT. +When filing bugs, please make sure to mention the clang version you are using, if you override this. + +# libObjWriter.so not found on Linux + +``` +EXEC : error : Unable to load shared library 'objwriter' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libobjwriter: cannot open shared object file: No such file or directory +``` + +This is the default error message when a [DLLImport] could not be loaded. CoreRT nuget packages distribute this file, but it might be failing to load depencies. +Make sure to install all dependencies. If the error persists, use ldd to find out if you lack any dependencies. + +``` +ldd /home//.nuget/packages/runtime.linux-x64.microsoft.dotnet.ilcompiler//tools/libobjwriter.so + linux-vdso.so.1 (0x00007ffe9bbea000) + librt.so.1 => /usr/lib/librt.so.1 (0x00007f8f52142000) + libdl.so.2 => /usr/lib/libdl.so.2 (0x00007f8f5213d000) + libtinfo.so.5 => not found + libpthread.so.0 => /usr/lib/libpthread.so.0 (0x00007f8f5211c000) + libz.so.1 => /usr/lib/libz.so.1 (0x00007f8f51f05000) + libm.so.6 => /usr/lib/libm.so.6 (0x00007f8f51d80000) + libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007f8f51bef000) + libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x00007f8f51bd5000) + libc.so.6 => /usr/lib/libc.so.6 (0x00007f8f51a11000) + /usr/lib64/ld-linux-x86-64.so.2 (0x00007f8f53358000) +``` + +In this Arch Linux example, libtinfo.so.5 is missing. Its part of ncurses5 but aur has a compatibility package here: +https://aur.archlinux.org/packages/ncurses5-compat-libs/ +After installing it should work fine \ No newline at end of file From 56306cab1710c72929ae13dbd4f6733e51935a78 Mon Sep 17 00:00:00 2001 From: "yasuo@babs" Date: Thu, 17 Jan 2019 23:15:29 +0100 Subject: [PATCH 3/4] Fixed Documentation typo's. --- Documentation/prerequisites-for-building.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/prerequisites-for-building.md b/Documentation/prerequisites-for-building.md index e9b39191303..1f56f4331c1 100644 --- a/Documentation/prerequisites-for-building.md +++ b/Documentation/prerequisites-for-building.md @@ -73,7 +73,7 @@ When filing bugs, please make sure to mention the clang version you are using, i EXEC : error : Unable to load shared library 'objwriter' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libobjwriter: cannot open shared object file: No such file or directory ``` -This is the default error message when a [DLLImport] could not be loaded. CoreRT nuget packages distribute this file, but it might be failing to load depencies. +This is the default error message when a `[DllImport]` could not be loaded. CoreRT nuget packages distribute this file, but it might be failing to load dependencies. Make sure to install all dependencies. If the error persists, use ldd to find out if you lack any dependencies. ``` @@ -91,6 +91,6 @@ ldd /home//.nuget/packages/runtime.linux-x64.microsoft.dotnet.ilcompil /usr/lib64/ld-linux-x86-64.so.2 (0x00007f8f53358000) ``` -In this Arch Linux example, libtinfo.so.5 is missing. Its part of ncurses5 but aur has a compatibility package here: +In this Arch Linux example, libtinfo.so.5 is missing. Its part of ncurses5 but AUR has a compatibility package here: https://aur.archlinux.org/packages/ncurses5-compat-libs/ After installing it should work fine \ No newline at end of file From 01863ad701d8349327ffcae9b05ec6cb5f5a1795 Mon Sep 17 00:00:00 2001 From: yasuo Date: Sat, 19 Jan 2019 12:48:52 +0000 Subject: [PATCH 4/4] Revert "Added explicit -nopie to default linker options for Linux platforms where PIE is used by default" This reverts commit d275e74c75b7044ba699fff70936bdd97ca579d9. --- src/BuildIntegration/Microsoft.NETCore.Native.Unix.props | 1 - tests/src/Simple/StaticLibrary/StaticLibrary.csproj | 1 - 2 files changed, 2 deletions(-) diff --git a/src/BuildIntegration/Microsoft.NETCore.Native.Unix.props b/src/BuildIntegration/Microsoft.NETCore.Native.Unix.props index 832beb687c0..e0b5d6e309c 100644 --- a/src/BuildIntegration/Microsoft.NETCore.Native.Unix.props +++ b/src/BuildIntegration/Microsoft.NETCore.Native.Unix.props @@ -88,7 +88,6 @@ See the LICENSE file in the project root for more information. - diff --git a/tests/src/Simple/StaticLibrary/StaticLibrary.csproj b/tests/src/Simple/StaticLibrary/StaticLibrary.csproj index cc150721f51..b3477312a6e 100644 --- a/tests/src/Simple/StaticLibrary/StaticLibrary.csproj +++ b/tests/src/Simple/StaticLibrary/StaticLibrary.csproj @@ -39,7 +39,6 @@ -