2020-04-22 13:48:14
正规的龙芯系统需要以下依赖 做参考
1.从龙芯官网上下载源码 源码下载:git clone git://cgit.loongnix.org/browser/mozilla-esr52.git
2.安装以下编译依赖库 yum install zbar-gtk-devel dbus-devel dbug-glib-devel bzip zip hunspell alsa-lib-devel wireless-tools-devel libXt-devel mesa-libGL-devel startup-notification-devel openssl openssl-devel pulseaudio-libs pulseaudio-libs-devel pulseaudio-libs-glib2 pulseaudio libevent-devel libcurl-devel autoconf213 gstreamer-devel gstreamer gstreamer-plugins-base gstreamer-plugins-base-devel
3.编译 进入Firefox 目录:autoconf-2.13 ./mach configure; ./mach build
下面命令如果报错找不到手动打一边 有可能是编码的问题。
源码在uos下编译有错误建议使用好一点的文档编辑器查看
笔者使用的是qt creator在应用商店里可以安装 用命令行打开 创建新项目,导入现有项目 就可以当作编辑器查看文件了。
安装步骤如下:
下载火狐浏览器源码
wget https://ftp.mozilla.org/pub/firefox/releases/51.0/source/firefox-51.0.source.tar.xz
不要用归档管理器解压 uz -d firefox-51.0.source.tar.xz (为什么这个破系统太卡有时会直接卡死) 进入文件夹没有权限添加权限
chmod 755 ./
编译命令:
编译命令 编译时会有一堆错误大多是缺依赖包 make -f client.mk build
不同的系统版本需要的依赖不同,朋友们可以根据报错安装下面的依赖,
笔者需要的依赖如下:
apt-get install g++ g++是c++ 编译器也可以安装 build-essential (集合编译包) 下面安装alsa驱动的时候会提示安装
apt-get install libgtk-3-dev libgtk2.0-dev 请谨慎安装这个东西,有问题会导致没有界面要从新安装系统 pkg-config --modversion gtk+-3.0 查看是否安装成功 apt-get install libgconf2-dev apt-get install libdbus-glib-1-dev apt-get install libncurses-dev
autoconf编译:
wget http://ftp.gnu.org/gnu/autoconf/autoconf-2.13.tar.gz tar -xvzf autoconf-2.13.tar.gz cd autoconf-2.13/ ./configure --program-suffix=2.13 –program-suffix=SUFFIX 指定将被加到所安装程序的名字上的后缀. make make install
alsa 的编译笔者参考 https://zhidao.baidu.com/question/1988026317702934907.html
安装alsa驱动前必须要先安装编译内核必须的工具组件,如下:#/etc/init.d/alsa-utils stop 关闭声卡
建议先下载编译软件包,缺少依赖再安装下面包 #apt-get install build-essential ncurses-dev gettext xmlto #apt-get install linux-headers-`uname -r` libncursesw5-dev apt-get install libpulse-dev apt-get install libxt-dev wget ftp://ftp.alsa-project.org/pub/lib/alsa-lib-1.2.2.tar.bz2 #wget ftp://ftp.alsa-project.org/pub/utils/alsa-utils-1.2.2.tar.bz2 不用编译记录一下
#wget ftp://ftp.alsa-project.org/pub/driver/alsa-driver-1.0.25.tar.bz2 不用编译记录一下
tar xjf
alsa-lib-1.2.2.tar.bz2
进入各个文件夹编译三步曲 ./configure make make install
alsa-driver-1.0.25.tar.bz2 这个文件编译可能有问题。
alsa-driver-1.0.25.tar.bz2 笔者最后没有编译成功,报错有内置的驱动。笔者不愿意卸载原驱动,从新安装声卡可能会有问题。
笔者没有编译成功,也成功编译过了这一步
解决错误:
error: ‘CarrySet’ is not a member of ‘js::jit::Assembler’
masm.branchAdd32(Assembler::CarrySet, ......
CarrySet’是一个枚举 值为11 定义在js/src/jit/none/MacroAssembler-none.h 里 删除这个函数。 masm.branchAdd32(Assembler::CarrySet, ...... 我是没有办法解决了只能删除。有朋友解决了可以给我评论谢谢。
没有 MAsmJSLoadHeap、MAsmJSStoreHeap类 mir->barrierAfter() mir->barrierBefore() mir->isAtomicAccess() mir->needsBoundsCheck() 函数错误 js/src/jit/MIR.h 替换下面2个类 参考 MWasmMemoryAccess 类改写
class MAsmJSLoadHeap : public MUnaryInstruction, public MAsmJSMemoryAccess, public NoTypePolicy::Data { MAsmJSLoadHeap(MDefinition* base, Scalar::Type accessType, MemoryBarrierBits barrierBefore = MembarNobits, MemoryBarrierBits barrierAfter = MembarNobits) : MUnaryInstruction(base), MAsmJSMemoryAccess(accessType), barrierBefore_(barrierBefore), barrierAfter_(barrierAfter) //MAsmJSLoadHeap(MDefinition* base, Scalar::Type accessType) //todo yuanban //: MUnaryInstruction(base), //MAsmJSMemoryAccess(accessType) { setResultType(ScalarTypeToMIRType(accessType)); } public: INSTRUCTION_HEADER(AsmJSLoadHeap) TRIVIAL_NEW_WRAPPERS MDefinition* base() const { return getOperand(0); } void replaceBase(MDefinition* newBase) { replaceOperand(0, newBase); } bool congruentTo(const MDefinition* ins) const override; AliasSet getAliasSet() const override { return AliasSet::Load(AliasSet::AsmJSHeap); } AliasType mightAlias(const MDefinition* def) const override; // todo MemoryBarrierBits barrierBefore_; MemoryBarrierBits barrierAfter_; MemoryBarrierBits barrierBefore() const { return barrierBefore_; } MemoryBarrierBits barrierAfter() const { return barrierAfter_; } bool isAtomicAccess() const { return (barrierBefore_ | barrierAfter_) != MembarNobits; } }; class MAsmJSStoreHeap : public MBinaryInstruction, public MAsmJSMemoryAccess, public NoTypePolicy::Data { MAsmJSStoreHeap(MDefinition* base, Scalar::Type accessType, MDefinition* v, MemoryBarrierBits barrierBefore = MembarNobits, MemoryBarrierBits barrierAfter = MembarNobits) : MBinaryInstruction(base, v), MAsmJSMemoryAccess(accessType), barrierBefore_(barrierBefore), barrierAfter_(barrierAfter) {} public: INSTRUCTION_HEADER(AsmJSStoreHeap) TRIVIAL_NEW_WRAPPERS MDefinition* base() const { return getOperand(0); } void replaceBase(MDefinition* newBase) { replaceOperand(0, newBase); } MDefinition* value() const { return getOperand(1); } AliasSet getAliasSet() const override { return AliasSet::Store(AliasSet::AsmJSHeap); } // todo MemoryBarrierBits barrierBefore_; MemoryBarrierBits barrierAfter_; MemoryBarrierBits barrierBefore() const { return barrierBefore_; } MemoryBarrierBits barrierAfter() const { return barrierAfter_; } bool isAtomicAccess() const { return (barrierBefore_ | barrierAfter_) != MembarNobits; } };
错误 error: ‘class js::jit::MAsmJSAtomicBinopHeap’ has no member named ‘needsBoundsCheck’; did you mean ‘isBoundsCheck’?
if (mir->needsBoundsCheck()) {
isBoundsCheck
啥也不用说了 编译器让咋改就咋改。needsBoundsCheck()替换为isBoundsCheck()
大功告成 firefox在 obj-mips64el-unknown-linux-gnu/dist/bin里 。