【已解决】cygwin中编译crosstool-ng出错:zconf.tab.o:zconf.tab.c:(.text+0x162a): undefined reference to ‘_libintl_gettext’

【问题】

折腾:

【记录】重试使用最新版本1.18.0的crosstool-ng去配置和编译xscale的交叉编译器

期间,在cygwin下编译crosstool-ng出错:

CLi@PC-CLI-1 ~/develop/crosstool-ng/crosstool-ng-1.18.0
$ make
  SED    'ct-ng'
  SED    'scripts/crosstool-NG.sh'
  SED    'scripts/saveSample.sh'
  SED    'scripts/showTuple.sh'
  GEN    'config/configure.in'
  GEN    'paths.mk'
  GEN    'paths.sh'
  DEP    'nconf.gui.dep'
  DEP    'nconf.dep'
  DEP    'lxdialog/checklist.dep'
  DEP    'lxdialog/inputbox.dep'
  DEP    'lxdialog/util.dep'
  DEP    'lxdialog/textbox.dep'
  DEP    'lxdialog/yesno.dep'
  DEP    'lxdialog/menubox.dep'
  DEP    'mconf.dep'
  DEP    'conf.dep'
  BISON  'zconf.tab.c'
  GPERF  'zconf.hash.c'
  LEX    'lex.zconf.c'
  DEP    'zconf.tab.dep'
  CC     'zconf.tab.o'
  CC     'conf.o'
  LD     'conf'
zconf.tab.o:zconf.tab.c:(.text+0x162a): undefined reference to `_libintl_gettext'
zconf.tab.o:zconf.tab.c:(.text+0x47fe): undefined reference to `_libintl_gettext'
zconf.tab.o:zconf.tab.c:(.text+0x56ec): undefined reference to `_libintl_gettext'
zconf.tab.o:zconf.tab.c:(.text+0x58be): undefined reference to `_libintl_gettext'
zconf.tab.o:zconf.tab.c:(.text+0xc70b): undefined reference to `_libintl_gettext'
zconf.tab.o:zconf.tab.c:(.text+0xc719): more undefined references to `_libintl_gettext' follow
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../i686-pc-cygwin/bin/ld: zconf.tab.o: bad reloc address 0x110 in section `.data'
/usr/lib/gcc/i686-pc-cygwin/4.5.3/../../../../i686-pc-cygwin/bin/ld: final link failed: Invalid operation
collect2: ld returned 1 exit status
Makefile:108: recipe for target `conf' failed
make[2]: *** [conf] Error 1
Makefile:160: recipe for target `build-lib-kconfig' failed
make[1]: *** [build-lib-kconfig] Error 2
Makefile:120: recipe for target `build' failed
make: *** [build] Error 2

 

【解决过程】

1.参考:

Re: crosstool-NG Cygwin Build Fails

去,找到:

D:\tmp\tmp_dev_root\cgwin\home\CLi\develop\crosstool-ng\crosstool-ng-1.18.0\kconfig\Makefile

相关改动为:

# What’s needed to build ‘conf’

conf_SRC = conf.c

conf_OBJ = $(patsubst %.c,%.o,$(conf_SRC))

conf_DEP = $(patsubst %.o,%.dep,$(conf_OBJ))

$(conf_OBJ) $(conf_DEP): CFLAGS += $(INTL_CFLAGS)

conf: LDFLAGS += -lintl

# What’s needed to build ‘mconf’

mconf_SRC = mconf.c

mconf_OBJ = $(patsubst %.c,%.o,$(mconf_SRC))

mconf_DEP = $(patsubst %.c,%.dep,$(mconf_SRC))

$(mconf_OBJ) $(mconf_DEP): CFLAGS += $(NCURSES_CFLAGS) $(INTL_CFLAGS)

#mconf: LDFLAGS += $(NCURSES_LDFLAGS)

mconf: LDFLAGS += -lintl $(NCURSES_LDFLAGS)

# What’s needed to build ‘nconf’

nconf_SRC = nconf.c nconf.gui.c

nconf_OBJ = $(patsubst %.c,%.o,$(nconf_SRC))

nconf_DEP = $(patsubst %.c,%.dep,$(nconf_SRC))

#$(nconf_OBJ) $(nconf_DEP): CFLAGS += $(INTL_CFLAGS) -I/usr/include/ncurses

#nconf: LDFLAGS += -lmenu -lpanel -lncurses

$(nconf_OBJ) $(nconf_DEP): CFLAGS += -I/usr/include/ncurses/ $(INTL_CFLAGS)

nconf: LDFLAGS += -lintl -lmenu -lpanel -lncurses

 

以及:

D:\tmp\tmp_dev_root\cgwin\home\CLi\develop\crosstool-ng\crosstool-ng-1.18.0\kconfig\nconf.c

中的改动:

	notimeout(stdscr, FALSE);
	//ESCDELAY = 1;
    set_escdelay(1);

2.再去make试试,然后就可以了:

CLi@PC-CLI-1 ~/develop/crosstool-ng/crosstool-ng-1.18.0
$ make
  GEN    'config/configure.in'
  GEN    'paths.mk'
  GEN    'paths.sh'
  DEP    'nconf.dep'
  LD     'conf'
  CC     'lxdialog/menubox.o'
  CC     'lxdialog/yesno.o'
  CC     'lxdialog/textbox.o'
  CC     'lxdialog/util.o'
  CC     'lxdialog/inputbox.o'
  CC     'lxdialog/checklist.o'
  CC     'mconf.o'
  LD     'mconf'
  CC     'nconf.o'
  CC     'nconf.gui.o'
  LD     'nconf'
  SED    'docs/ct-ng.1'
  GZIP   'docs/ct-ng.1.gz'

 

【总结】

哎,这个bug是人家1.15.0中发现的,到了现在的最新版的1.18.0,还是没合并此patch啊。。。



发表评论

电子邮件地址不会被公开。 必填项已用*标注

无觅相关文章插件,快速提升流量