【原创】HP-UX下解决QT内存映射的错误

QT版本:qt-x11-free-3.3.8
操作系统:HP-UX at-vl02 B.11.31 U ia64 3890095976 unlimited-user license
编译器:aCC
现象:QT程序调用mmap函数时,会提示空间不够错误!!
解决方法:
1、在aCC编译时,CXXFLAGS和LFLAGS 加-N选项。

      -N             Cause the output file from the linker to be marked as
                     unshareable.  For details and system defaults, see
                     ld(1).

2、在aCC编译时,LFLAGS 加+s, +b选项(chatr所必须)

      -s             Cause the output of the linker to be stripped of symbol
                     table information.  See strip(1) for more details.  The
                     use of this option prevents the use of a symbolic
                     debugger on the resulting program.  Also see ld(1) for
                     additional details.
      -b             Causes the linker ld(1) to create a shared library
                     rather than a normal executable file.  Object files
                     processed with this option must contain position
                     independent code (PIC).  For details see ld(1), HP-UX
                     Linker and Libraries Online User's Guide and the
                     Programming on HP-UX manual.

3、执行"chatr +as mpas 生成的可执行文件名"

      chatr_ia: chatr - change program's internal attributes on Integrity systems

4、正确执行后,可看到的结果有一行为:

address space model: MAPS


而不是

address space model: default
posted @ 2016-04-12 20:55  xiaoleisme  阅读(611)  评论(0编辑  收藏  举报