Skip to content
This repository was archived by the owner on Nov 1, 2020. It is now read-only.

[Arm Unix build] Fixes for cross building corert tests for arm architectures on Linux#2682

Merged
jkotas merged 1 commit into
dotnet:masterfrom
sergign60:arm_build
Feb 14, 2017
Merged

[Arm Unix build] Fixes for cross building corert tests for arm architectures on Linux#2682
jkotas merged 1 commit into
dotnet:masterfrom
sergign60:arm_build

Conversation

@sergign60
Copy link
Copy Markdown
Contributor

@sergign60 sergign60 commented Feb 8, 2017

This pull request contains fixes for the cross building corert tests for arm architectures (arm&armel) on Ubuntu 16.04 x64.

Unfortunately, there are two problems just now:

  1. The following error arises during building jit-variants of tests
       IlcCompile:
         Creating directory ".../corert/tests/src/Simple/Delegates/obj/Debug/armel/native/".
         ".../corert/tests/../bin/Product/Linux.armel.Debug/packaging/publish1/corerun" ".../corert/tests/../bin/Product/Linux.armel.Debug/packaging/publish1/ilc.dll" @".../corert/tests/src/Simple/Delegates/obj/Debug/armel/native/Delegates.ilc.rsp"
         
         Unhandled Exception: System.DllNotFoundException: Unable to load DLL 'jitinterface': The specified module could not be found.
          (Exception from HRESULT: 0x8007007E)
            at Internal.JitInterface.CorInfoImpl.GetJitHost(IntPtr configProvider)
            at Internal.JitInterface.CorInfoImpl..ctor(Compilation compilation, JitConfigProvider jitConfig)
            at ILCompiler.RyuJitCompilation.CompileInternal(String outputFile)
            at ILCompiler.Compilation.ILCompiler.ICompilation.Compile(String outputFile)
            at ILCompiler.Program.Run(String[] args)
            at ILCompiler.Program.Main(String[] args)
         Aborted (core dumped)

x64 native variant doesn't create this fail.

  1. I don't know yet how to pass archtecture-specific c++ compiler options for building cpp-variant of tests

any help will be accepted with gratitude

@dnfclas
Copy link
Copy Markdown

dnfclas commented Feb 8, 2017

Hi @sergign60, I'm your friendly neighborhood .NET Foundation Pull Request Bot (You can call me DNFBOT). Thanks for your contribution!
You've already signed the contribution license agreement. Thanks!

The agreement was validated by .NET Foundation and real humans are currently evaluating your PR.

TTYL, DNFBOT;

@sergign60
Copy link
Copy Markdown
Contributor Author

CC: @Dmitri-Botcharnikov

Comment thread tests/src/Simple/SimpleTest.targets Outdated
<OutputType Condition="'$(OutputType)' == ''">Exe</OutputType>
<OutputPath>$(MSBuildProjectDirectory)\bin\$(Configuration)\</OutputPath>
<IntermediateOutputPath>$(MSBuildProjectDirectory)\obj\$(Configuration)\</IntermediateOutputPath>
<OutputPath>$(MSBuildProjectDirectory)\bin\$(Configuration)\$(Variant)\</OutputPath>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is common to call this Platform. Do we have some prior art somewhere where it is called Variant?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jkotas Changed

@jkotas
Copy link
Copy Markdown
Member

jkotas commented Feb 8, 2017

I don't know yet how to pass archtecture-specific c++ compiler options for building cpp-variant of tests

It is done here: https://github.com/dotnet/corert/blob/master/src/BuildIntegration/Microsoft.NETCore.Native.Unix.props#L29

@jkotas
Copy link
Copy Markdown
Member

jkotas commented Feb 8, 2017

The following error arises during building jit-variants of tests

libjitinterface.so is part of the compiler, so it needs to be built on the host architecture.

It is easier to make a simple hello world running first using the cppcodegen option. You may do that first and then work on the RyuJIT one. The RyuJIT one is more involved.

@sergign60
Copy link
Copy Markdown
Contributor Author

@jkotas many thanks!

Comment thread tests/runtest.cmd
)
)

echo msbuild /m /ConsoleLoggerParameters:ForceNoAlign "/p:IlcPath=%CoreRT_ToolchainDir%" "/p:Configuration=%CoreRT_BuildType%" "/p:RepoLocalBuild=true" "/p:FrameworkLibPath=%~dp0\..\bin\Product\%CoreRT_BuildOS%.%CoreRT_BuildArch%.%CoreRT_BuildType%\lib" "/p:FrameworkObjPath=%~dp0\..\bin\obj\Product\%CoreRT_BuildOS%.%CoreRT_BuildArch%.%CoreRT_BuildType%\Framework" !extraArgs! !__SourceFile!.csproj
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Indentation

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jkotas fixed

@sergign60
Copy link
Copy Markdown
Contributor Author

sergign60 commented Feb 13, 2017

@jkotas

Now I get the following error:

         clang-3.9 -target arm-linux-gnueabi --sysroot=/home/signatov/CORERT/corert/tests/../cross/rootfs/armel -B/home/signatov/CORERT/corert/tests/../cross/rootfs/armel/usr/lib/gcc/armv7l-tizen-linux-gnueabi/4.9.2 -L/home/signatov/CORERT/corert/tests/../cross/rootfs/armel/usr/lib/gcc/armv7l-tizen-linux-gnueabi/4.9.2 /home/signatov/CORERT/corert/tests/src/Simple/Hello/obj/Debug/armel/native/Hello.o -o /home/signatov/CORERT/corert/tests/src/Simple/Hello/bin/Debug/armel/native/Hello /home/signatov/CORERT/corert/tests/../bin/Product/Linux.armel.Debug/packaging/publish1/sdk/libbootstrappercpp.a /home/signatov/CORERT/corert/tests/../bin/Product/Linux.armel.Debug/packaging/publish1/sdk/libPortableRuntime.a /home/signatov/CORERT/corert/tests/../bin/Product/Linux.armel.Debug/packaging/publish1/sdk/libSystem.Private.CoreLib.Native.a /home/signatov/CORERT/corert/tests/../bin/Product/Linux.armel.Debug/packaging/publish1/framework/System.Native.a /home/signatov/CORERT/corert/tests/../bin/Product/Linux.armel.Debug/packaging/publish1/framework/libSystem.Globalization.Native.a -g -pthread -lstdc++ -ldl -lm -lrt
         /home/signatov/CORERT/corert/tests/../bin/Product/Linux.armel.Debug/packaging/publish1/framework/System.Native.a: error adding symbols: File format not recognized

As I understand I need the arm versions of System.Native.a (and libSystem.Globalization.Native.a) Which way can I get them?

@sergign60
Copy link
Copy Markdown
Contributor Author

@jkotas I've created the issue #2739

@sergign60
Copy link
Copy Markdown
Contributor Author

@jkotas I take armel versions of System.Native.a from CoreFX and libSystem.Globalizaiton.Native.a from CoreCLR and get the following list of unresolved variables

/home/signatov/CORERT/corert/tests/src/Simple/Hello/obj/Debug/armel/native/Hello.o: In function `System_Private_CoreLib::System::Runtime::InternalCalls::RhpNewFastMisalign(System_Private_CoreLib::Internal::Runtime::EEType*)':
/home/signatov/CORERT/corert/tests/src/Simple/Hello/obj/Debug/armel/native/Hello.cpp:(.text+0x1fe50a): undefined reference to `RhpNewFastMisalign'
/home/signatov/CORERT/corert/tests/src/Simple/Hello/obj/Debug/armel/native/Hello.o: In function `System_Private_CoreLib::System::Runtime::InternalCalls::RhpNewFinalizableAlign8(System_Private_CoreLib::Internal::Runtime::EEType*)':
/home/signatov/CORERT/corert/tests/src/Simple/Hello/obj/Debug/armel/native/Hello.cpp:(.text+0x1fe556): undefined reference to `RhpNewFinalizableAlign8'
/home/signatov/CORERT/corert/tests/src/Simple/Hello/obj/Debug/armel/native/Hello.o: In function `System_Private_CoreLib::System::Runtime::InternalCalls::RhpNewFastAlign8(System_Private_CoreLib::Internal::Runtime::EEType*)':
/home/signatov/CORERT/corert/tests/src/Simple/Hello/obj/Debug/armel/native/Hello.cpp:(.text+0x1fe56a): undefined reference to `RhpNewFastAlign8'
/home/signatov/CORERT/corert/tests/src/Simple/Hello/obj/Debug/armel/native/Hello.o: In function `System_Private_CoreLib::System::Runtime::InternalCalls::RhpNewArrayAlign8(System_Private_CoreLib::Internal::Runtime::EEType*, int)':
/home/signatov/CORERT/corert/tests/src/Simple/Hello/obj/Debug/armel/native/Hello.cpp:(.text+0x1fe646): undefined reference to `RhpNewArrayAlign8'
/home/signatov/CORERT/corert/tests/../bin/Product/Linux.armel.Debug/packaging/publish1/sdk/libPortableRuntime.a(RuntimeInstance.cpp.o):(.data.rel.ro+0x0): undefined reference to `RhpNewFinalizableAlign8'
/home/signatov/CORERT/corert/tests/../bin/Product/Linux.armel.Debug/packaging/publish1/sdk/libPortableRuntime.a(RuntimeInstance.cpp.o):(.data.rel.ro+0x4): undefined reference to `RhpNewFastMisalign'
/home/signatov/CORERT/corert/tests/../bin/Product/Linux.armel.Debug/packaging/publish1/sdk/libPortableRuntime.a(RuntimeInstance.cpp.o):(.data.rel.ro+0x8): undefined reference to `RhpNewFastAlign8'
/home/signatov/CORERT/corert/tests/../bin/Product/Linux.armel.Debug/packaging/publish1/sdk/libPortableRuntime.a(RuntimeInstance.cpp.o):(.data.rel.ro+0x2c): undefined reference to `RhpNewArrayAlign8'


// Allocate non-array object with finalizer.
// r0 == EEType
LEAF_ENTRY RhpNewFinalizable, _TEXT
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to make the implementation breakpoint to get nice crash for unimplemented parts once you start running the programs.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jkotas Added breakpoints

@jkotas jkotas merged commit df1b120 into dotnet:master Feb 14, 2017
@jkotas
Copy link
Copy Markdown
Member

jkotas commented Feb 14, 2017

Thank you! I guess that the next one will have hello world working?

@sergign60
Copy link
Copy Markdown
Contributor Author

@jkotas
I hope so.

@sergign60 sergign60 deleted the arm_build branch February 14, 2017 15:17
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants