-
Notifications
You must be signed in to change notification settings - Fork 506
[arm32 unix building] Passing target platform and os to IlcCompiler for cross compiling #2793
Conversation
|
Hi @sergign60, I'm your friendly neighborhood .NET Foundation Pull Request Bot (You can call me DNFBOT). Thanks for your contribution! The agreement was validated by .NET Foundation and real humans are currently evaluating your PR. TTYL, DNFBOT; |
| switch (os) | ||
| { | ||
| case TargetOS.Windows: | ||
| case TargetOS.Linux: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ARM calling convention is same on all OSes. It would be better to delete this switch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jkotas changed
tests/src/Simple/SimpleTest.targets
Outdated
| </ItemGroup> | ||
|
|
||
| <ItemGroup> | ||
| <IlsArg Include="--targetarch=$(Platform)" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IlsArg ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jkotas
of course it's misprinting. I've tested 'IlcArg'
| if (g_cbLargestOnDieCache == 0) | ||
| { | ||
| if ((strncmp(cpuEntry->d_name, "cpu", 3) == 0) && isdigit(cpuEntry->d_name[3])) | ||
| DIR* cpuDir = opendir("/sys/devices/system/cpu"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@janvorli I do not see a similar logic in CoreCLR. Is there a good reason for having it in CoreRT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This additional logic theoretically enables getting cache size on non-intel processors (intel ones should be handled by the sysconf stuff).
But I am not sure if the /sys/devices/system/cpu contains cache details on other architectures at all. On my Raspberry Pi 3, both with aarch64 and arm32 Linux distros, the cache details are not in there and I remember that @sdmaclea said that on his aarch64 Linux device, there were no cache details either.
@sergign60 are these present on your arm32 Linux distro / device?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@janvorli I've written about it above - two arm-based systems
Linux raspberrypi 4.1.19-v7+ #858 SMP armv7l GNU/Linux and
Linux odroid 4.9.6 #3 SMP PREEMPT armv7l armv7l armv7l GNU/Linux
that I've checked out doesn't have this information. I guess that one of the possible and simplest way is to include into corert the table with info about arm processors and get out it from this table.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@janvorli Should we delete this parsing of sys/devices/system/cpu then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would recommend deleting it. We can introduce it in the future if we support targets that provide this information.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sergign60 Could you please do it as part of this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| _targetArchitecture = TargetArchitecture.ARMEL; | ||
| else if (_targetArchitectureStr.Equals("arm64")) | ||
| _targetArchitecture = TargetArchitecture.ARM64; | ||
| else |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be command line exception with message
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jkotas changed
| // Set target Architecture and OS | ||
| // | ||
| if (_targetArchitectureStr != null) | ||
| { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It maybe nice to do the comparisons case-insensitive for convenience. _targetArchitectureStr.Equals("x86", StringComparison.OrdinalIgnoreCase)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jkotas added
Are you hitting this method with CppCodeGen? This method should not be called with CppCodeGen at all. |
|
@jkotas |
|
@MichalStrehovsky We end up creating AssembyStubNodes during CppCodeGen. Where would be the best place to cut it off? |
This is two things (both of the brought in from EETypeNode):
I could try to come up with a way to avoid this (it would be a general improvement), but it might be easier to just not throw from the stubs and have them generate machine code that crashes at runtime. |
|
LGTM. Thank! |
This pull request contains some fixes for test cross building on arm32 systems.
There are several problems:
Linux raspberrypi 4.1.19-v7+ Remove Encoding workaround #858 SMP armv7l GNU/Linux and
Linux odroid 4.9.6 Add .gitattributes and .gitignore files #3 SMP PREEMPT armv7l armv7l armv7l GNU/Linux