Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MIPS platform #4086

Closed
jinyuttt opened this issue Jun 7, 2020 · 16 comments
Closed

MIPS platform #4086

jinyuttt opened this issue Jun 7, 2020 · 16 comments

Comments

@jinyuttt
Copy link

jinyuttt commented Jun 7, 2020

Does Avalonia need to adapt to MIPS architecture?

@hez2010
Copy link
Contributor

hez2010 commented Jun 7, 2020

It needs .NET Core Runtime support MIPS architecture first.

@jinyuttt
Copy link
Author

jinyuttt commented Jun 7, 2020

ok

@jinyuttt jinyuttt closed this as completed Jun 7, 2020
@kekekeks
Copy link
Member

kekekeks commented Jun 7, 2020

Should work with Mono runtime, but you'll also have to build libSkiaSharp.so

@xiangzhai
Copy link

:mips-interest

@xiangzhai
Copy link

Hi @kekekeks

libSkiaSharp.so is https://github.com/mono/SkiaSharp ?

Thanks,
Leslie Zhai

@jmacato
Copy link
Member

jmacato commented Aug 10, 2020

@xiangzhai yes, you'll need to make Skia/SkiaSharp to compile to MIPS platform.

@xiangzhai
Copy link

Hi @jmacato

Thanks for your response!

you'll need to make Skia/SkiaSharp to compile to MIPS platform.

I am on it.

Thanks,
Leslie Zhai

@xiangzhai
Copy link

xiangzhai commented Aug 10, 2020

Hi @jinyuttt

It is easy to cross compile libSkiaSharp and libHarfBuzzSharp v2.80.1 for MIPS64:

./bin/gn gen 'out/linux/x64' --args='
    cc="mips64el-linux-gnuabi64-gcc"
    cxx="mips64el-linux-gnuabi64-g++"
    is_official_build=true skia_enable_tools=false
    target_os="linux" target_cpu="mips64"
    visibility_hidden=false
    skia_use_icu=false skia_use_sfntly=false skia_use_piex=true
    skia_use_system_expat=false skia_use_system_freetype2=false skia_use_system_libjpeg_turbo=false skia_use_system_libpng=false skia_use_system_libwebp=false skia_use_system_zlib=false
    skia_enable_gpu=true
    extra_cflags=[ "-DSKIA_C_DLL", "-w", "-DXML_POOR_ENTROPY" ]
    extra_ldflags=[ "--sysroot=/chroots/mips64el_stretch" ]
    linux_soname_version="80.1.0"'


depot_tools/ninja 'SkiaSharp' -C 'out/linux/x64'
depot_tools/ninja 'HarfBuzzSharp' -C 'out/linux/x64'

Then there are libSkiaSharp and libHarfBuzzSharp:

$ file out/linux/x64/libSkiaSharp.so.80.1.0 
out/linux/x64/libSkiaSharp.so.80.1.0: ELF 64-bit LSB shared object, MIPS, MIPS64 rel2 version 1 (SYSV), dynamically linked, BuildID[sha1]=79cef834fd1a2da0230545626908bad3ab5f64d7, with debug_info, not stripped

$ file out/linux/x64/libHarfBuzzSharp.so.80.1.0 
out/linux/x64/libHarfBuzzSharp.so.80.1.0: ELF 64-bit LSB shared object, MIPS, MIPS64 rel2 version 1 (SYSV), dynamically linked, BuildID[sha1]=adf3edfa4745b6e60552f2607e03846ebdadcaa4, stripped

Please read the cross-building document about generating an mips64el rootfs.

Or just use docker image aoqi/dotnet-buildtools:x86_64-ubuntu-16.04-c103199-20180628134544-upstream-cross-mips64el there is /crossrootfs/mips64el in it by following linux-instructions document.

Thanks,
Leslie Zhai

@xiangzhai
Copy link

Hi @jmacato

What version of libHarfBuzzSharp do you suggest? skia-2.80.1 unable to find an entry point named hb_face_create_for_tables in shared library libHarfBuzzSharp:

Unhandled exception. System.EntryPointNotFoundException: Unable to find an entry point named 'hb_face_create_for_tables' in shared library 'libHarfBuzzSharp'.
   at HarfBuzzSharp.HarfBuzzApi.hb_face_create_for_tables(GetTableDelegateProxyDelegate reference_table_func, IntPtr user_data, ReleaseDelegateProxyDelegate destroy)
   at HarfBuzzSharp.Face..ctor(GetTableDelegate getTable, ReleaseDelegate destroy)
   at HarfBuzzSharp.Face..ctor(GetTableDelegate getTable)
   at Avalonia.Skia.GlyphTypefaceImpl..ctor(SKTypeface typeface) in /home/loongson/Avalonia/src/Skia/Avalonia.Skia/GlyphTypefaceImpl.cs:line 18
   at Avalonia.Skia.FontManagerImpl.CreateGlyphTypeface(Typeface typeface) in /home/loongson/Avalonia/src/Skia/Avalonia.Skia/FontManagerImpl.cs:line 141
   at Avalonia.Media.GlyphTypeface..ctor(Typeface typeface) in /home/loongson/Avalonia/src/Avalonia.Visuals/Media/GlyphTypeface.cs:line 9
   at Avalonia.Media.Typeface.get_GlyphTypeface() in /home/loongson/Avalonia/src/Avalonia.Visuals/Media/Typeface.cs:line 71
   at Avalonia.Media.TextFormatting.TextCharacters.TryGetRunProperties(ReadOnlySlice`1 text, Typeface typeface, Typeface defaultTypeface, Int32& count) in /home/loongson/Avalonia/src/Avalonia.Visuals/Media/TextFormatting/TextCharacters.cs:line 131
   at Avalonia.Media.TextFormatting.TextCharacters.CreateShapeableRun(ReadOnlySlice`1 text, TextRunProperties defaultProperties) in /home/loongson/Avalonia/src/Avalonia.Visuals/Media/TextFormatting/TextCharacters.cs:line 62
   at Avalonia.Media.TextFormatting.TextCharacters.GetShapeableCharacters() in /home/loongson/Avalonia/src/Avalonia.Visuals/Media/TextFormatting/TextCharacters.cs:line 40
   at Avalonia.Media.TextFormatting.TextFormatterImpl.FetchTextRuns(ITextSource textSource, Int32 firstTextSourceIndex, TextLineBreak previousLineBreak, TextLineBreak& nextLineBreak) in /home/loongson/Avalonia/src/Avalonia.Visuals/Media/TextFormatting/TextFormatterImpl.cs:line 260
   at Avalonia.Media.TextFormatting.TextFormatterImpl.FormatLine(ITextSource textSource, Int32 firstTextSourceIndex, Double paragraphWidth, TextParagraphProperties paragraphProperties, TextLineBreak previousLineBreak) in /home/loongson/Avalonia/src/Avalonia.Visuals/Media/TextFormatting/TextFormatterImpl.cs:line 15
   at Avalonia.Media.TextFormatting.TextLayout.UpdateLayout() in /home/loongson/Avalonia/src/Avalonia.Visuals/Media/TextFormatting/TextLayout.cs:line 223
   at Avalonia.Media.TextFormatting.TextLayout..ctor(String text, Typeface typeface, Double fontSize, IBrush foreground, TextAlignment textAlignment, TextWrapping textWrapping, TextTrimming textTrimming, TextDecorationCollection textDecorations, Double maxWidth, Double maxHeight, Double lineHeight, Int32 maxLines, IReadOnlyList`1 textStyleOverrides) in /home/loongson/Avalonia/src/Avalonia.Visuals/Media/TextFormatting/TextLayout.cs:line 71
   at Avalonia.Controls.TextBlock.CreateTextLayout(Size constraint, String text) in /home/loongson/Avalonia/src/Avalonia.Controls/TextBlock.cs:line 453
   at Avalonia.Controls.TextBlock.get_TextLayout() in /home/loongson/Avalonia/src/Avalonia.Controls/TextBlock.cs:line 165
   at Avalonia.Controls.TextBlock.MeasureOverride(Size availableSize) in /home/loongson/Avalonia/src/Avalonia.Controls/TextBlock.cs:line 499
   at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in /home/loongson/Avalonia/src/Avalonia.Layout/Layoutable.cs:line 559
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /home/loongson/Avalonia/src/Avalonia.Layout/Layoutable.cs:line 364
   at Avalonia.Layout.Layoutable.MeasureOverride(Size availableSize) in /home/loongson/Avalonia/src/Avalonia.Layout/Layoutable.cs:line 625
   at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in /home/loongson/Avalonia/src/Avalonia.Layout/Layoutable.cs:line 559
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /home/loongson/Avalonia/src/Avalonia.Layout/Layoutable.cs:line 364
   at Avalonia.Controls.ComboBox.UpdateSelectionBoxItem(Object item) in /home/loongson/Avalonia/src/Avalonia.Controls/ComboBox.cs:line 376
   at Avalonia.Controls.ComboBox.SelectedItemChanged(AvaloniaPropertyChangedEventArgs e) in /home/loongson/Avalonia/src/Avalonia.Controls/ComboBox.cs:line 337
   at Avalonia.Controls.ComboBox.<>c.<.cctor>b__13_0(ComboBox x, AvaloniaPropertyChangedEventArgs e) in /home/loongson/Avalonia/src/Avalonia.Controls/ComboBox.cs:line 91
   at Avalonia.AvaloniaObjectExtensions.<>c__DisplayClass23_0`1.<AddClassHandler>b__0(AvaloniaPropertyChangedEventArgs e) in /home/loongson/Avalonia/src/Avalonia.Base/AvaloniaObjectExtensions.cs:line 583
   at System.Reactive.AnonymousObserver`1.OnNextCore(T value) in /_/Rx.NET/Source/src/System.Reactive/AnonymousObserver.cs:line 67
   at System.Reactive.ObserverBase`1.OnNext(T value) in /_/Rx.NET/Source/src/System.Reactive/ObserverBase.cs:line 34
   at System.Reactive.Subjects.Subject`1.OnNext(T value) in /_/Rx.NET/Source/src/System.Reactive/Subjects/Subject.cs:line 146
   at Avalonia.AvaloniaProperty.NotifyChanged(AvaloniaPropertyChangedEventArgs e) in /home/loongson/Avalonia/src/Avalonia.Base/AvaloniaProperty.cs:line 483
   at Avalonia.AvaloniaObject.RaisePropertyChanged[T](AvaloniaPropertyChangedEventArgs`1 change) in /home/loongson/Avalonia/src/Avalonia.Base/AvaloniaObject.cs:line 727
   at Avalonia.AvaloniaObject.RaisePropertyChanged[T](AvaloniaProperty`1 property, Optional`1 oldValue, BindingValue`1 newValue, BindingPriority priority) in /home/loongson/Avalonia/src/Avalonia.Base/AvaloniaObject.cs:line 640
   at Avalonia.Controls.Primitives.SelectingItemsControl.OnSelectionModelSelectionChanged(Object sender, SelectionModelSelectionChangedEventArgs e) in /home/loongson/Avalonia/src/Avalonia.Controls/Primitives/SelectingItemsControl.cs:line 726
   at Avalonia.Controls.SelectionModel.OnSelectionChanged(SelectionModelSelectionChangedEventArgs e) in /home/loongson/Avalonia/src/Avalonia.Controls/SelectionModel.cs:line 654
   at Avalonia.Controls.SelectionModel.EndOperation() in /home/loongson/Avalonia/src/Avalonia.Controls/SelectionModel.cs:line 841
   at Avalonia.Controls.SelectionModel.Operation.Dispose() in /home/loongson/Avalonia/src/Avalonia.Controls/SelectionModel.cs:line 891
   at Avalonia.Controls.SelectionModel.set_SelectedIndex(IndexPath value) in /home/loongson/Avalonia/src/Avalonia.Controls/SelectionModel.cs:line 196
   at Avalonia.Controls.Primitives.SelectingItemsControl.set_SelectedIndex(Int32 value) in /home/loongson/Avalonia/src/Avalonia.Controls/Primitives/SelectingItemsControl.cs:line 166
   at Avalonia.Controls.Primitives.SelectingItemsControl.UpdateFinished() in /home/loongson/Avalonia/src/Avalonia.Controls/Primitives/SelectingItemsControl.cs:line 865
   at Avalonia.Controls.Primitives.SelectingItemsControl.InternalEndInit() in /home/loongson/Avalonia/src/Avalonia.Controls/Primitives/SelectingItemsControl.cs:line 892
   at Avalonia.Controls.Primitives.SelectingItemsControl.EndInit() in /home/loongson/Avalonia/src/Avalonia.Controls/Primitives/SelectingItemsControl.cs:line 334
   at ControlCatalog.Pages.ComboBoxPage.!XamlIlPopulate(IServiceProvider , ComboBoxPage ) in /home/loongson/Avalonia/samples/ControlCatalog/Pages/ComboBoxPage.xaml:line 27
   at ControlCatalog.Pages.ComboBoxPage.!XamlIlPopulateTrampoline(ComboBoxPage )
   at ControlCatalog.Pages.ComboBoxPage.InitializeComponent() in /home/loongson/Avalonia/samples/ControlCatalog/Pages/ComboBoxPage.xaml.cs:line 17
   at ControlCatalog.Pages.ComboBoxPage..ctor() in /home/loongson/Avalonia/samples/ControlCatalog/Pages/ComboBoxPage.xaml.cs:line 12
   at ControlCatalog.MainView.!XamlIlPopulate(IServiceProvider , MainView ) in /home/loongson/Avalonia/samples/ControlCatalog/MainView.xaml:line 23
   at ControlCatalog.MainView.!XamlIlPopulateTrampoline(MainView )
   at ControlCatalog.MainView..ctor() in /home/loongson/Avalonia/samples/ControlCatalog/MainView.xaml.cs:line 18
   at ControlCatalog.MainWindow.!XamlIlPopulate(IServiceProvider , MainWindow ) in /home/loongson/Avalonia/samples/ControlCatalog/MainWindow.xaml:line 80
   at ControlCatalog.MainWindow.!XamlIlPopulateTrampoline(MainWindow )
   at ControlCatalog.MainWindow.InitializeComponent() in /home/loongson/Avalonia/samples/ControlCatalog/MainWindow.xaml.cs:line 78
   at ControlCatalog.MainWindow..ctor() in /home/loongson/Avalonia/samples/ControlCatalog/MainWindow.xaml.cs:line 19
   at ControlCatalog.App.OnFrameworkInitializationCompleted() in /home/loongson/Avalonia/samples/ControlCatalog/App.xaml.cs:line 78
   at Avalonia.Controls.AppBuilderBase`1.Setup() in /home/loongson/Avalonia/src/Avalonia.Controls/AppBuilderBase.cs:line 295
   at Avalonia.Controls.AppBuilderBase`1.SetupWithLifetime(IApplicationLifetime lifetime) in /home/loongson/Avalonia/src/Avalonia.Controls/AppBuilderBase.cs:line 162
   at Avalonia.ClassicDesktopStyleApplicationLifetimeExtensions.StartWithClassicDesktopLifetime[T](T builder, String[] args, ShutdownMode shutdownMode) in /home/loongson/Avalonia/src/Avalonia.Controls/ApplicationLifetimes/ClassicDesktopStyleApplicationLifetime.cs:line 127
   at ControlCatalog.NetCore.Program.Main(String[] args) in /home/loongson/Avalonia/samples/ControlCatalog.NetCore/Program.cs:line 102

Thanks,
Leslie Zhai

@jmacato jmacato reopened this Aug 11, 2020
@kekekeks
Copy link
Member

@mattleibow
Copy link
Contributor

mattleibow commented Aug 11, 2020

I also have docker containers for cross compiling. Right now it is just for arm, but you might just be able to pass in the mips values to the docker build

https://github.com/mono/SkiaSharp/blob/master/scripts/Docker/ubuntu16/gcc-cross/Dockerfile

edit

I see I was downloading the gcc tool chain from arm, so that might need a new place.

Does clang support cross compiling to mips? I am doing this for arm

https://github.com/mono/SkiaSharp/blob/master/scripts/Docker/ubuntu16/clang-cross/Dockerfile

@xiangzhai
Copy link

Hi @mattleibow

Does clang support cross compiling to mips?

Yes! CoreCLR MIPS64 porting is using clang https://github.com/gsvm/coreclr/blob/mips64-port/Documentation/building/linux-instructions.md#docker-images

@kekekeks

You need harfbuzz 2.6.1. Build script is here https://github.com/mono/SkiaSharp/blob/be889396a5b8455cf52f0c00859c31c4bd5dac77/native/linux/build.cake#L94

Thanks for your advice! visibility_hidden=false is the root cause.

Cheers,
Leslie Zhai

@jmacato
Copy link
Member

jmacato commented Aug 11, 2020

@xiangzhai kind of a offtopic question: does your CoreCLR port of MIPS will support SGI Octane (it's MIPS IV iirc) or only the latest MIPS32/64 ones?

@xiangzhai
Copy link

Hi @jmacato

does your CoreCLR port of MIPS will support SGI Octane?

Nope!

But we open source MIPS64 (mips64r2) porting. It is easy to port to MIPS O32/N32 ABI.

Thanks,
Leslie Zhai

@jmacato
Copy link
Member

jmacato commented Aug 11, 2020

Haha thanks! was just really curious!

@kekekeks
Copy link
Member

kekekeks commented Jul 3, 2023

Closing due to inactivity

@kekekeks kekekeks closed this as not planned Won't fix, can't repro, duplicate, stale Jul 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants