Mozilla explains 'the hardships of making Firefox natively compatible with Apple Silicon'

The first Apple Silicon that appeared in November 2020, the
Porting Firefox to Apple Silicon --Mozilla Hacks --the Web developer blog
https://hacks.mozilla.org/2021/01/porting-firefox-to-apple-silicon/
The introduction of the MacBook Air , Mac mini , and MacBook Pro with the first Apple Silicon 'M1' was a reminder of Apple's development capabilities. Many tech media have praised Apple Silicon and even slammed the words 'computing revolution' and 'incredible feat.'
Apple's 'M1' equipped Mac review summary, 'computing revolution' and 'unbelievable feat' storm of acclaim & expectations for Apple Silicon in the future-GIGAZINE

According to Paskut, Mozilla has long expected Apple to equip Macs with Arm-based SoCs. The ' Apple A7 ' installed in the iPhone 5s released in 2013 made its debut with the touch of '64-bit desktop-class architecture (architecture comparable to 64-bit desktop PC)', and from that time already 'for Mac' The existence of 'Arm-based SoC' has been rumored in the industry for a long time.
This rumor came to fruition in 2018, when Apple installed its own designed Arm-based SoC ' Apple A12 ' on the iPhone XS, XS Max, and XR. The A12 is the world's first chip commercialized using the 7nm process, and technology media AnandTech reports that it 'has specifications comparable to desktop PCs and is significantly superior in power efficiency.' With the advent of the Apple A12, Mozilla considered that 'Apple will move to the Arm architecture in the near future.'
What was important to Firefox was the 'macOS API' issue. If the macOS API is updated with the advent of new SoCs, the Mac version of Firefox that operates using the macOS API may also be significantly affected. Based on two sources, the aforementioned AnandTech report and Apple's past release schedule, Mozilla's platform team said, ''macOS 10.16' will be available in September or October,' as of March 2020. It was predicted by.
On June 22, 2020, at the developer conference WWDC 2020 , Apple officially revealed the existence of Apple Silicon and officially confirmed that it will install its own designed Arm-based SoC on the Mac. However, Apple only said that Apple Silicon-powered Macs will be available at the end of 2020.
Apple announces 'Apple Silicon' to move to proprietary processor on Mac, iPhone & iPad application available on Mac-GIGAZINE

With the statement 'end of 2020' and the announcement that Mozilla will deliver a Mac mini with a developer migration kit to ARM architecture, the actual release date of the Apple Silicon-equipped Mac is predicted to be slightly before Christmas holidays. Since Apple tends to start selling at the same time as the device is announced, it predicted that the shipping date will be 'November 10' one month before the release date. And the Mac with Apple Silicon was released on 'November 17th', and it was confirmed that the prediction was almost correct.
Regarding the work of actually porting Firefox to the 64-bit Arm architecture, since Android and Linux have already supported the 64-bit Arm architecture for many years, 'it was almost unnecessary'. Therefore, the first step in building a natively compatible Firefox for Apple Silicon is to investigate Firefox code, dependencies, and various third-party build systems to see if it works properly on a Mac with Apple Silicon. It seems to be. The problem with this process was that Apple Silicon's support for the Mozilla programming language Rust was just beginning at the time, and the compiler was limited.
After that, Mozilla decided to adopt ' Universal Binary ' which can run software with two incompatible CPUs but increases the software capacity, and by using this Universal Binary, it will be installed in Firefox for Windows of Arm architecture. Succeeded in diverting the existing DRM video decoder. Native support for video streaming services such as Netflix, Disney +, and Amazon Prime.
As it continues to do this, Apple has begun distributing the beta version of macOS Big Sur. We also found multiple issues with this macOS Big Sur beta. One of them is the specification that 'when an application that is not running natively starts another application, that application is forced to behave non-natively'. When Firefox is updated, it performs the process of 'starting the updated version of Firefox after updating the file on the storage', and the updated Firefox started by this process has the above specifications. Caused a problem that forced non-native operation. In addition, some antivirus software misidentified the Universal Binary as malware, and received a user report that Firefox was corrupted the moment the update was installed.
Mozilla has chosen to create a dedicated page to inform users of the proper installation method for non-native behavior issues due to updates. Regarding the problem of antivirus software, I could not contact the company side through the usual support channel, so I took measures by the force of 'find and contact the engineer with LinkedIn'.

After all these difficulties, Mozilla released the official version of Firefox 84, which is natively compatible with Apple Silicon-powered Macs, on December 6, 2020. We have added a break to the Apple Silicon compatibility issue.
Official release of 'Firefox 84', more than double the operating speed on Apple Silicon-equipped devices --GIGAZINE

Paskut said that 'Firefox 85' scheduled to be released on January 26, 2021 will improve the bugs of the graphic driver in the future, 'Taking the experience of Firefox for macOS to the next level in the next year. I'm looking forward to pushing it up. '
Related Posts: