MudOSv22.2b14编译过程

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编译过程)