美文网首页
MudOSv22.2b14编译过程

MudOSv22.2b14编译过程

作者: 1angxi | 来源:发表于2015-07-27 18:59 被阅读421次

1、gmake报错:

在包含自 ../comm.h:10 的文件中,
                 从 contrib.c:16:
../network_incl.h:17:24: 错误:sys/sema.h:没有那个文件或目录
在包含自 contrib.c:17 的文件中:
../file_incl.h:21:25: 错误:sys/filio.h:没有那个文件或目录
../file_incl.h:24:26: 错误:sys/sockio.h:没有那个文件或目录

修改configure.h文件,注释下面三行:

#define INCL_SYS_SEMA_H
#define INCL_SYS_FILIO_H
#define INCL_SYS_SOCKIO_H

原因分析:sys保存的是硬件设备的驱动程序信息。没有的话注释掉#define语句就好。

2、修改cc.h文件

#define CFLAGS   "-D__USE_FIXED_PROTOTYPES__ -export-dynamic -O2 -fstrength-reduce"

改为

#define CFLAGS   "-D__USE_FIXED_PROTOTYPES__ -rdynamic -O2 -fstrength-reduce"  

原因分析:选项 -rdynamic 用来通知链接器将所有符号添加到动态符号表中。目的是能够通过使用 dlopen 来实现向后跟踪。

官方解释:

  -rdynamic
           Pass the flag -export-dynamic to the ELF linker, on targets that
           support it. This instructs the linker to add all symbols, not only
           used ones, to the dynamic symbol table. This option is needed for
           some uses of "dlopen" or to allow obtaining backtraces from within
           a program.

  --export-dynamic
  --no-export-dynamic
           When creating a dynamically linked executable, using the -E option
           or the --export-dynamic option causes the linker to add all symbols
           to the dynamic symbol table. The dynamic symbol table is the set
           of symbols which are visible from dynamic objects at run time.

           If you do not use either of these options (or use the
           --no-export-dynamic option to restore the default behavior), the
           dynamic symbol table will normally contain only those symbols which
           are referenced by some dynamic object mentioned in the link.

           If you use "dlopen" to load a dynamic object which needs to refer
           back to the symbols defined by the program, rather than some other
           dynamic object, then you will probably need to use this option when
           linking the program itself.

           You can also use the dynamic list to control what symbols should be
           added to the dynamic symbol table if the output format supports it.
           See the description of --dynamic-list.

           Note that this option is specific to ELF targeted ports. PE
           targets support a similar function to export all symbols from a DLL
           or EXE; see the description of --export-all-symbols below.

3、修改GNUmakefile文件

CFLAGS=-D__USE_FIXED_PROTOTYPES__ -export-dynamic

改为

CFLAGS=-D__USE_FIXED_PROTOTYPES__ -rdynamic

同上。

4、安装bison和bison-devel

yum install bison bison-devel

5、gmake clean all 成功

./driver即驱动文件。

相关文章

  • MudOSv22.2b14编译过程

    1、gmake报错: 修改configure.h文件,注释下面三行: 原因分析:sys保存的是硬件设备的驱动程序信...

  • 浅谈编译过程

    浅谈编译过程浅谈编译过程

  • 编译过程

    前言 计算机应用都依赖于计算机程序;除此之外,计算机应用还需要基础硬件去执行计算机程序,而基础硬件又是不能识别我们...

  • 编译过程

    1、预编译(1)宏定义指令,如 #define a b(2)条件编译指令,如#ifdef,#ifndef,#el...

  • 编译过程

    https://blog.csdn.net/haibosdu/article/details/77094833

  • 编译过程

    C源代码 编译---->形成目标代码,目标代码是在目标机器上运行的代码。 连接---->将目标代码与C函数库相连接...

  • 编译过程

    编译过程 参考: https://objccn.io/issue-6-1/ https://objccn.io/i...

  • 编译原理 -- 编译以及编译过程

    前言 为了了解编译器是什么? 为什么需要编译器? 编译器、高级语言、源代码、机器语言 编译器:首先也是一种电脑程序...

  • 编译链接过程

    编译链接过程 一个完整的编译链接过程包含了以下步骤: 预编译 编译 汇编 链接 预编译 预编译的处理规则如下 删除...

  • Android源码编译--编译过程

    6.0源码下载 下载方式有很多,出的去可以直接去Google Source下载,或者别人共享资源(有些会出现解压报...

网友评论

      本文标题:MudOSv22.2b14编译过程

      本文链接:https://www.haomeiwen.com/subject/vrumqttx.html