Trying this out on FreeBSD 11.1
The proper build instructions for coreclr are here:
https://github.com/dotnet/coreclr/blob/master/Documentation/building/freebsd-instructions.md
Results from the documented instructions:
# git clone https://github.com/dotnet/coreclr.git
# cd coreclr
# ./build.sh clang50 release
I get errors the build script can't find llvm-ar, llvm-link, and llvm-nm. My dirty fix for this error is symbolic links in /usr/local/bin eg, 'ln -s llvm50-ar llvm-ar' etc. Preferably done inside a jail. That gets me farther along but no joy.
The above looks like the typical goof of using angle brackets instead of quotes. I set this aside (may come back later) to try another approach.
The convention for most cmake builds is (a) mkdir build (b) cd build (c) cmake .. and (d) make. That almost works.
Missing a version.cpp and compiler looks for etmdummy.h in the wrong place. Two features "perftracing" and "even_trace" seem to be not implemented for this platform. Adding placebos allows cmake to progress. Also - these steps do not require the symbolic link hack above.
# git clone https://github.com/dotnet/coreclr.git
# cd coreclr
# mkdir build
# cd build
# touch version.cpp
# vi ../src/inc/etdummy.h
# (insert one line -> #include "../gc/env/etmdummy.h" )
# cmake .. -DCMAKE_BUILD_TYPE=RELEASE -DFEATURE_PERFTRACING=0 -DFEATURE_EVENT_TRACE=0
This gets me further along than running "build.sh" above. cmake creates the Makefile(s). However, actual compile fails.
# make
I do not see this symbol anywhere within coreclr. After commenting out that one line, the build progresses ...
Still not there.
The proper build instructions for coreclr are here:
https://github.com/dotnet/coreclr/blob/master/Documentation/building/freebsd-instructions.md
Results from the documented instructions:
# git clone https://github.com/dotnet/coreclr.git
# cd coreclr
# ./build.sh clang50 release
I get errors the build script can't find llvm-ar, llvm-link, and llvm-nm. My dirty fix for this error is symbolic links in /usr/local/bin eg, 'ln -s llvm50-ar llvm-ar' etc. Preferably done inside a jail. That gets me farther along but no joy.
Code:
-- Configuring done
-- Generating done
-- Build files have been written to: ./coreclr/bin/obj/FreeBSD.x64.Release
~/coreclr
~/coreclr/bin/obj/FreeBSD.x64.Release ~/coreclr
Executing make install -j 5
[ 0%] Building CXX object src/pal/src/eventprovider/CMakeFiles/eventprovider.dir/lttng/eventprovdotnetruntime.cpp.o
[ 0%] Building CXX object src/corefx/System.Globalization.Native/CMakeFiles/System.Globalization.Native.dir/casing.cpp.o
[ 0%] Building CXX object src/corefx/System.Globalization.Native/CMakeFiles/System.Globalization.Native_Static.dir/casing.cpp.o
In file included from ./coreclr/bin/obj/FreeBSD.x64.Release/eventing/eventprovider/lttng/eventprovdotnetruntime.cpp:24:
./coreclr/bin/obj/FreeBSD.x64.Release/eventing/eventprovider/lttng/tpdotnetruntime.h:29:10: fatal error: 'lttng/tracepoint.h' file not found
#include <lttng/tracepoint.h>
^~~~~~~~~~~~~~~~~~~~
[ 0%] Building CXX object src/pal/src/CMakeFiles/coreclrpal.dir/cruntime/file.cpp.o
1 error generated.
The above looks like the typical goof of using angle brackets instead of quotes. I set this aside (may come back later) to try another approach.
The convention for most cmake builds is (a) mkdir build (b) cd build (c) cmake .. and (d) make. That almost works.
Missing a version.cpp and compiler looks for etmdummy.h in the wrong place. Two features "perftracing" and "even_trace" seem to be not implemented for this platform. Adding placebos allows cmake to progress. Also - these steps do not require the symbolic link hack above.
# git clone https://github.com/dotnet/coreclr.git
# cd coreclr
# mkdir build
# cd build
# touch version.cpp
# vi ../src/inc/etdummy.h
# (insert one line -> #include "../gc/env/etmdummy.h" )
# cmake .. -DCMAKE_BUILD_TYPE=RELEASE -DFEATURE_PERFTRACING=0 -DFEATURE_EVENT_TRACE=0
This gets me further along than running "build.sh" above. cmake creates the Makefile(s). However, actual compile fails.
# make
Code:
[ 14%] Built target utilcode_dac
[ 14%] Building CXX object src/vm/dac/CMakeFiles/cee_dac.dir/__/gctoclreventsink.cpp.o
./coreclr/src/vm/gctoclreventsink.cpp:23:5: error: use of undeclared identifier 'FireEtwGCDynamicEvent'
FireEtwGCDynamicEvent(wideEventName, payloadSize, (const BYTE*)payload, GetClrInstanceId());
^
1 error generated.
*** Error code 1
I do not see this symbol anywhere within coreclr. After commenting out that one line, the build progresses ...
Code:
[ 27%] Built target utilcode
[ 27%] Built target gcinfo
[ 27%] Building CXX object src/vm/wks/CMakeFiles/cee_wks.dir/__/prestub.cpp.o
./coreclr/src/vm/prestub.cpp:730:17: error: too many arguments to function call, expected at most 6, have 8
pConfig->ProfilerRejectedPrecompiledCode(),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./coreclr/src/inc/eventtracebase.h:614:9: note: 'MethodJitted' declared here
static VOID MethodJitted(MethodDesc *pMethodDesc, SString *namespaceOrClassName=NULL, SString *methodName=NULL, SString *methodSignature=NULL, SIZE_T pCode = 0, ReJITID rejitID = 0) {};
^
1 error generated.
Still not there.