09年智手各组组长,组员重新招募中 发贴得礼品有实物,有金币和道具 重新招募09年各版版主 每月获奖名单
新人报到加分贴 对我们的意见告诉这里 新增奖品及奖励办法 广告招商
 
发新话题
打印

Linux手机DIY.库文件专题.兼容性问题

Linux手机DIY.库文件专题.兼容性问题

夏新E600和飞利浦968手机系统是十分相近的,内核版本信息也是一致的,
不过即便这样,在模拟器移植过程中,E600使用968的QT库,都会有按键问题。
显然这是硬件有所不同的原因。
  Qnes模拟器能不能在E680上用呢,事实是不太可能的,因两者硬件差异太
大。以下描述我在E680上运行Qnes的提示信息。  我将一些夏新E600本身特有lib文件加上后,仍然使用E680本地的QT库,设
置好环境变量,运行会出现:
  # ./r qnes
  ./qnes: relocation error: /mmc/mmca1/qnes/libcec.so.0: undefined
symbol: _ZThn184_N10QPopupMenu10updateItemEi
  说明自带的QT库缺少函数。我把E600的libqte-mt.so.2,和fonts复制过去,
运行倒是可以,只不过是不正常的运行,提示如下:
  ======== 240 x 320 x 16
  Default2: Cannot open /dev/ts (No such file or directory)
   ==========================================================
  theme config file [../Settings/theme/010Gray.conf] doesn't exist!
  JPEG parameter struct mismatch: library thinks size is 376, caller expects 372
   QImage::measure fail to guess image format
   csmCheckLimited : csm size 0/655360
   csmConstruct : csm info
   start 0x40551000
   size  655360
  could not open for writing `/Settings/cec.conf.new'
  QCopChannel: no client registered for channel CEC/Desktop, not sending stopStartupAnimation()
  ...
  QCopChannel: no client registered for channel CEC/IdleManager, not sending hideInputMethod()
  ...
  在E680手机上倒是显示了个新界面,并有英文的Load和Back。通过提示可以
清楚看出因两者硬件的差异生成兼容性的问题。不过也证实了上篇文章的推论,
浮点格式不同,最多是浮点运算有误,但是程序还是可以链结运行的。造成什么
Segmentation Fault的错误,还是直接来源于硬件。
  如我把E600的sysinfo放在E680运行会有如下提示:
  
  ======== 240 x 320 x 16
  Default2: Cannot open /dev/ts (No such file or directory)
   ==========================================================
  theme config file [../Settings/theme/010Gray.conf] doesn't exist!
   QImage::measure fail to guess image format
   csmCheckLimited : csm size 0/655360
   create csm : exist
   csmConstruct : csm info
   start 0x40871000
   size  655360
  could not open for writing `/Settings/cec.conf.new'
  Can't make QGfx for null pixmap
  
  QPainter::begin: Unable to get graphics context
  Segmentation fault
  
  这个Segmentation fault可能来自于显示设备的,具体原因不详,如做
反汇编处理,会了解更多的信息。
四、测试简单的浮点运算
  编译环境:
  VFP gcc-3.3.2 glibc-2.3.2 binutils-2.15 kernel 2.4.20
  FPA gcc-3.4.0 glibc-2.2.5 binutils-2.15 kernel 2.4.19
  先简单写个命令行程序如下:
  int main()
  {
  float fValueA=1.9;
  float fValueB=2.8;
  int iValueC=8;
  int iValueD=9999;
  printf("Hello!My E680G!\n");
  printf("TestValue(4.7):%f\n",fValueA+fValueB);
  printf("TestValue(9.9):%f\n",fValueA+iValueC);
  printf("TestValue(10007):%d\n",iValueC+iValueD);
  return 0;
  }
  1.vfp soft fp gcc-3.3.2 glibc-2.3.2 编译
  arm-linux-gcc -o hellocmdvfp hello.c
  
  2.fpa soft fp gcc-3.4.0 glibc-2.2.5 编译
  (加参数 -msoft-float 也是完全一样的)
  arm-linux-gcc -o hellocmdfpa hello.c
  
  ------------------------------------------------
  E680运行结果:
  
  # ./hellocmdvfp
  Hello!My E680G!
  TestValue(4.7):4.700000
  TestValue(9.9):9.900000
  TestValue(10007):10007
  
  # ./hellocmdfpa
  Hello!My E680G!
  TestValue(4.7):-2.000000
  TestValue(9.9):-2.000000
  TestValue(10007):10007
  
  FPA虽然有软浮点,但浮点运算依然出错。
  
  ------------------------------------------------
  E600和968的运行结果:
  
  #./hellocmdvfp
  Hello!My E680G!
  TestValue(4.7):-2.000000
  TestValue(9.9):-2.000000
  TestValue(10007):10007
  
  #./hellocmdfpa
  Hello!My E680G!
  TestValue(4.7):-2.000000
  TestValue(9.9):-2.000000
  TestValue(10007):10007
  
  -------------------------------------------------
  
  出乎我的意料,在E600上,浮点运算居然全出错,后来偶然间用VFP格式
的arm-linux-g++编译:
  arm-linux-g++ -o hellocmdvfp+ hello.c
  
  #./hellocmdvfp+
  Hello!My E680G!
  TestValue(4.7):4.700000
  TestValue(9.9):9.900000
  TestValue(10007):10007
  
  在E600上居然又运行正确,这令人十分奇怪。于是我再用FPA格式这样编
译:
  arm-linux-g++ -o hellocmdfpa+ hello.c
  
  因为是gcc.3.4.0版本,会提示libstdc++6.so.0和libgcc_s.so.1缺少。
加上库文件后运行结果如下(E680,E600,968结果完全一样):
  
  #.hellocmdfpa+
  Hello!My E680G!
  TestValue(4.7):-2.000000
  TestValue(9.9):-2.000000
  TestValue(10007):10007  
  显然都是错误的。

五、总结

  VFP格式在E600,968上运行,可以说是没有浮点BUG的。不过FPA却总
有问题。VFP编译环境在编译过程中不能兼容E600,968本身的库文件,所
以才要用FPA的编译环境。

TOP

好东东,这个要顶呀!

TOP

帮顶一下~~~~~~让需要的人看到

TOP

沙漠比赛小游戏

提示: 作者被禁止或删除 内容自动屏蔽

TOP

免费外挂网,各种外挂请登陆 www.cq521.com,外挂我爱 ,速度超快!

免费外挂网,各种外挂请登陆 www.cq521.com,外挂我爱 ,速度超快!

TOP

发新话题
版块跳转 
   京ICP备06029169号

本社区言论纯属发表者个人意见  与 智手移动中文网论坛 立场无关