I am trying to install Mono on RedHat 5.11. Here are some details of the mono that we are trying to install.
Downloaded from: http://download.mono-project.com/sources/mono/mono-3.12.0.tar.bz2
Mono version: 3.12
Steps to install it:
./configure --prefix=/opt/mono
make && make install
We could install it on CentOS but installing it on RedHat is creating the following issue:
/usr/bin/ld: ./.libs/libmini.a(libmini_la-mini.o): relocation R_X86_64_PC32 against `mono_cross_helpers_run' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
collect2: ld returned 1 exit status
I searched around and found the following link: how to recompile with -fPIC
To solve this issue I tried running it with -fPIC option, but then I realized that the -fPIC option does not work with RedHat so I used the -pie option. I then performed the following steps:
./configure --enable-shared --prefix=/opt/mono
make -pie
make install
But I still have the same issue:
/usr/bin/ld: ./.libs/libmini.a(libmini_la-mini.o): relocation R_X86_64_PC32 against `mono_cross_helpers_run' can not be used when making a shared object; recompile with -fPIC
I also see below error on the console
make[7]: [cs-errors.tree] Error 1 (ignored)
make[7]: [ecma334.tree] Error 1 (ignored)
make[7]: [Mono.tree] Error 1 (ignored)
make[7]: [netdocs.tree] Error 1 (ignored)
make[7]: [Novell.tree] Error 1 (ignored)
make[8]: *** No rule to make target `../../class/lib/build/sn.exe', needed by `../../class/lib/xbuild_12/Microsoft.Build.Framework.dll'. Stop.
make[7]: [do-all] Error 2 (ignored)
make[8]: *** No rule to make target `../../class/lib/build/sn.exe', needed by `../../class/lib/xbuild_12/Microsoft.Build.Utilities.v12.0.dll'. Stop.
make[7]: [do-all] Error 2 (ignored)
make[8]: *** No rule to make target `../../class/lib/build/sn.exe', needed by `../../class/lib/xbuild_12/Microsoft.Build.Engine.dll'. Stop.
make[7]: [do-all] Error 2 (ignored)
make[8]: *** No rule to make target `../../class/lib/build/sn.exe', needed by `../../class/lib/xbuild_12/Mono.XBuild.Tasks.dll'. Stop.
make[7]: [do-all] Error 2 (ignored)
make[8]: *** No rule to make target `../../class/lib/build/sn.exe', needed by `../../class/lib/xbuild_12/Microsoft.Build.Tasks.v12.0.dll'. Stop.
make[7]: [do-all] Error 2 (ignored)
make[8]: *** No rule to make target `../../class/lib/build/sn.exe', needed by `../../class/lib/xbuild_12/Microsoft.Build.dll'. Stop.
make[7]: [do-all] Error 2 (ignored)
/bin/sh: .//mkinstalldirs: No such file or directory
make[7]: [../../class/lib/xbuild_12//.stamp] Error 127 (ignored)
touch: cannot touch `../../class/lib/xbuild_12//.stamp': No such file or directory
make[7]: [../../class/lib/xbuild_12//.stamp] Error 1 (ignored)
make[7]: [../../class/lib/xbuild_12/xbuild.exe] Error 1 (ignored)
Makefile:821: warning: overriding commands for target `mod'
Makefile:801: warning: ignoring old commands for target `mod'
make[3]: [AgilityPack.dll] Error 1 (ignored)
make[3]: [AgilityPack.dll] Error 1 (ignored)
make[3]: [convert.exe] Error 1 (ignored)
make[3]: [mono-file-formats.tree] Error 1 (ignored)
make[3]: [mono-tools.tree] Error 1 (ignored)
make[3]: [monoapi.tree] Error 1 (ignored)
Related
Unable to build valgrind in yocto
I have highleted the problem i am facing
arm-poky-linux-gnueabi-gcc: error: unrecognized argument in option '-march=armv7ve'
arm-poky-linux-gnueabi-gcc: note: valid arguments to '-march=' are: armv2 armv2a armv3 armv3m armv4 armv4t armv5 armv5e armv5t armv5te armv6 armv6-m armv6j armv6k armv6s-m armv6t2 armv6z armv6zk armv7 armv7-a armv7-m armv7-r armv7e-m armv8-a armv8-a+crc iwmmxt iwmmxt2 native
make[5]: *** [intdiv-intdiv.o] Error 1
make[5]: Leaving directory `/home/sarjoodeen/Project/2018/Nippon/YOCTO/iwG22M-release-bsp/build/tmp/work/cortexa7hf-vfp-neon-poky-linux-gnueabi/valgrind/3.15.0-r0/build/none/tests/arm'
make[4]: *** [check-am] Error 2
make[4]: Leaving directory `/home/sarjoodeen/Project/2018/Nippon/YOCTO/iwG22M-release-bsp/build/tmp/work/cortexa7hf-vfp-neon-poky-linux-gnueabi/valgrind/3.15.0-r0/build/none/tests/arm'
make[3]: *** [check-recursive] Error 1
make[3]: Leaving directory `/home/sarjoodeen/Project/2018/Nippon/YOCTO/iwG22M-release-bsp/build/tmp/work/cortexa7hf-vfp-neon-poky-linux-gnueabi/valgrind/3.15.0-r0/build/none/tests'
make[2]: *** [check-recursive] Error 1
make[2]: Leaving directory `/home/sarjoodeen/Project/2018/Nippon/YOCTO/iwG22M-release-bsp/build/tmp/work/cortexa7hf-vfp-neon-poky-linux-gnueabi/valgrind/3.15.0-r0/build/none'
make[1]: *** [check-recursive] Error 1
make[1]: Leaving directory `/home/sarjoodeen/Project/2018/Nippon/YOCTO/iwG22M-release-bsp/build/tmp/work/cortexa7hf-vfp-neon-poky-linux-gnueabi/valgrind/3.15.0-r0/build'
make: *** [check] Error 2
make: Leaving directory `/home/sarjoodeen/Project/2018/Nippon/YOCTO/iwG22M-release-bsp/build/tmp/work/cortexa7hf-vfp-neon-poky-linux-gnueabi/valgrind/3.15.0-r0/build'
ERROR: oe_runmake failed
WARNING: exit code 1 from a shell command.
ERROR: Function failed: do_compile_ptest_base (log file is located at /home/sarjoodeen/Project/2018/Nippon/YOCTO/iwG22M-release-bsp/build/tmp/work/cortexa7hf-vfp-neon-poky-linux-gnueabi/valgrind/3.15.0-r0/temp/log.do_compile_ptest_base.29480)
The error means that the cross gcc doesn't contain the support for armv7ve architecture. The support for armv7ve has been added in gcc-4.9 as evident from the gcc Changelog https://gcc.gnu.org/gcc-4.9/changes.html. Please check your gcc recipe in yocto sources and make sure the gcc version is 4.9 or greater.
I built mono 5.20.1.19 from tarball successfully. But the build of master from github was failed. Instead of using a existing mono installation for the build, I run make get-monolite-latest for the mcs. On RedHat 6.9 (gcc6.3, cmake3.7.2) the build was crashed(segment fault). On SUSE 12.4(gcc6.3, cmake 3.5.2), the build ended with errors. I thought I might need to checkout the branch 5.20.1.19, but I couldn't find any branch newer then 4.8. Why there doesn't exist such a branch? Thanks in advance. Below are my build errors:
RedHat 6.9
make -C build-shared
make[4]: Entering directory mono-src/mono/btls/build-shared'
make[5]: Entering directorymono-src/mono/btls/build-shared'
make[6]: Entering directory mono-src/mono/btls/build-shared'
Scanning dependencies of target pqueue
make[6]: Leaving directorymono-src/mono/btls/build-shared'
make[6]: Entering directory mono-src/mono/btls/build-shared'
[ 1%] Building C object boringssl/ssl/pqueue/CMakeFiles/pqueue.dir/pqueue.c.o
^[l/bin/sh: line 1: 42877 Segmentation fault (core dumped) /opt/anss/bin/ccache /opt/anss/bin/gcc -DBORINGSSL_IMPLEMENTATION -Imono-src/external/boringssl/ssl/../include -Imono-src/external/boringssl/ssl/pqueue/../../include -Wall -Wsign-compare -Wmissing-field-initializers -fPIC -ggdb -fvisibility=hidden -Wall -Wformat=2 -Wsign-compare -Wmissing-field-initializers -ggdb -fvisibility=hidden -Wshadow -std=c11 -D_XOPEN_SOURCE=700 -o CMakeFiles/pqueue.dir/pqueue.c.o -c mono-src/external/boringssl/ssl/pqueue/pqueue.c
make[6]: *** [boringssl/ssl/pqueue/CMakeFiles/pqueue.dir/pqueue.c.o] Error 139
make[6]: Leaving directorymono-src/mono/btls/build-shared'
make[5]: * [boringssl/ssl/pqueue/CMakeFiles/pqueue.dir/all] Error 2
make[5]: Leaving directory mono-src/mono/btls/build-shared'
make[4]: *** [all] Error 2
make[4]: Leaving directorymono-src/mono/btls/build-shared'
make[3]: [build-shared/libmono-btls-shared.so] Error 2
make[3]: Leaving directory mono-src/mono/btls'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directorymono-src/mono'
make[1]: [all-recursive] Error 1
make[1]: Leaving directory `mono-src'
make: * [all] Error 2
SUSE12.4
Directory does not exist: 'mono-src/external/nuget-buildtasks/src/Microsoft.NuGet.Build.Tasks'
Directory does not exist: 'mono-src/external/nuget-buildtasks/src/Microsoft.NuGet.Build.Tasks'
Directory does not exist: 'mono-src/external/nuget-buildtasks/src/Microsoft.NuGet.Build.Tasks'
Directory does not exist: 'mono-src/external/nuget-buildtasks/src/Microsoft.NuGet.Build.Tasks'
Directory does not exist: 'mono-src/external/nuget-buildtasks/src/Microsoft.NuGet.Build.Tasks'
Directory does not exist: 'mono-src/external/nuget-buildtasks/src/Microsoft.NuGet.Build.Tasks'
Directory does not exist: 'mono-src/external/nuget-buildtasks/src/Microsoft.NuGet.Build.Tasks'
Directory does not exist: 'mono-src/external/nuget-buildtasks/src/Microsoft.NuGet.Build.Tasks'
// gensources produced 8 error(s) and a set of 155 filename(s)
// Invoked with 'mono-src/mcs/class/lib/build/gensources.exe --strict --platformsdir:./../../build ../../build/deps/_xbuild_14__Microsoft.NuGet.Build.Tasks.dll.sources Microsoft.NuGet.Build.Tasks.dll xbuild_14'
// Working directory was 'mono-src/mcs/class/Microsoft.NuGet.Build.Tasks'
make[8]: * No rule to make target '../../build/deps/_xbuild_14__Microsoft.NuGet.Build.Tasks.dll.sources', needed by '../../build/deps/_xbuild_14__Microsoft.NuGet.Build.Tasks.dll.response'. Stop.
../../build/rules.make:226: recipe for target 'do-all' failed
make[7]: * [do-all] Error 2
I am installing a newer version of cmake which is cmake 3.10.1 and the make command is giving me error while building CXX object source.
I have installed the ninja 1.5.1 but still getting the same error.
used this to install the cmake:
wget <link of the cmake3.10.1>
./configure
make # (at this stage getting error)
The error is:
[ 83%] Building CXX object Source/CMakeFiles/CMakeLib.dir/cmGlobalNinjaGenerator.cxx.o
/media/nadia/967E9B477E9B1F55/data/cmake-3.10.1/Source/cmGlobalNinjaGenerator.cxx: In member function ‘void cmGlobalNinjaGenerator::AppendTargetDependsClosure(const cmGeneratorTarget*, cmNinjaOuts&, bool)’:
/media/nadia/967E9B477E9B1F55/data/cmake-3.10.1/Source/cmGlobalNinjaGenerator.cxx:1077:40: error: ‘class std::map<const cmGeneratorTarget*, std::set<std::basic_string<char> > >’ has no member named ‘emplace_hint’
Source/CMakeFiles/CMakeLib.dir/build.make:5942: recipe for target 'Source/CMakeFiles/CMakeLib.dir/cmGlobalNinjaGenerator.cxx.o' failed
make[2]: *** [Source/CMakeFiles/CMakeLib.dir/cmGlobalNinjaGenerator.cxx.o] Error 1
CMakeFiles/Makefile2:2355: recipe for target 'Source/CMakeFiles/CMakeLib.dir/all' failed
make[1]: *** [Source/CMakeFiles/CMakeLib.dir/all] Error 2
Makefile:162: recipe for target 'all' failed
make: *** [all] Error 2
When running make in CMake, I only get an error that says /usr/bin/ld unrecognised emulation mode aarch64linux.
Im trying to build DualBootPatcher app for Android, this is the error:
/usr/bin/ld: unrecognised emulation mode: aarch64linux
Supported emulations: elf_x86_64 elf32_x86_64 elf_i386 elf_iamcu elf_l1om elf_k1om i386pep i386pe
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[5]: *** [misc/CMakeFiles/fsck-wrapper.dir/build.make:76: misc/fsck-wrapper] Error 1
make[4]: *** [CMakeFiles/Makefile2:1786: misc/CMakeFiles/fsck-wrapper.dir/all] Error 2
make[3]: *** [Makefile:163: all] Error 2
make[2]: *** [android/CMakeFiles/android-system_arm64-v8a.dir/build.make:111: android/android-system_arm64-v8a-prefix/src/android-system_arm64-v8a-stamp/android-system_arm64-v8a-build] Error 2
make[1]: *** [CMakeFiles/Makefile2:1868: android/CMakeFiles/android-system_arm64-v8a.dir/all] Error 2
make: *** [Makefile:163: all] Error 2>
Im running latest Cmake and binutils. Also tried reinstalling binutils.
Im NOT a developers, so it would be nice if you could explain it^^
Does anyone has a solution?
The issue is clear from the fact that the output is coming from /usr/bin/ld. This is the system ld, rather than the ld included with the NDK. You should investigate why this ld is being executed instead, for example via strace.
For me it turned out to be a file permissions issue - the NDK zip file had extracted without execute permissions, so the toolchain binaries were silently ignored. A few chmod +x later and all was well.
I tried
cd /usr/local/src
wget http://download.mono-project.com/sources/libgdiplus/libgdiplus-4.2.tar.gz
tar -xvf libgdiplus-4.2.tar.gz
cd libgdiplus-4.2
mkdir /opt/m511
./configure --prefix=/opt/m511
make
make install
cd /usr/local/src
wget http://download.mono-project.com/sources/mono/mono-5.11.0.89.tar.bz2
tar jxf mono-5.11.0.89.tar.bz2
cd /usr/local/src/mono-5.11.0.89
./autogen.sh --prefix=/opt/m511
make
but got error
...
make[3]: Entering directory `/usr/local/src/mono-5.11.0.89/mono/utils'
make all-am
make[4]: Entering directory `/usr/local/src/mono-5.11.0.89/mono/utils'
CC os-event-unix.lo
os-event-unix.c: In function ‘mono_os_event_wait_multiple’:
os-event-unix.c:121: warning: ‘data’ may be used uninitialized in this function
os-event-unix.c:123: warning: ‘start’ may be used uninitialized in this function
CC mono-md5.lo
CC mono-sha1.lo
CC mono-logger.lo
CC mono-codeman.lo
In file included from ../../mono/metadata/metadata-internals.h:12,
from ../../mono/metadata/class-internals.h:12,
from ../../mono/metadata/profiler-private.h:10,
from mono-codeman.c:22:
../../mono/metadata/domain-internals.h:10:42: error: mono/metadata/object-forward.h: No such file or directory
In file included from ../../mono/metadata/metadata-internals.h:12,
from ../../mono/metadata/class-internals.h:12,
from ../../mono/metadata/profiler-private.h:10,
from mono-codeman.c:22:
../../mono/metadata/domain-internals.h:615: error: expected declaration specifiers or ‘...’ before ‘MonoReflectionTypeBuilder’
make[4]: *** [mono-codeman.lo] Error 1
make[4]: Leaving directory `/usr/local/src/mono-5.11.0.89/mono/utils'
make[3]: *** [all] Error 2
make[3]: Leaving directory `/usr/local/src/mono-5.11.0.89/mono/utils'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/usr/local/src/mono-5.11.0.89/mono'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/local/src/mono-5.11.0.89'
make: *** [all] Error 2
How to compile it ? Mono 4.4.2 compiled OK with those commands.