OpenWrt Forum Archive

Topic: Compile error

The content of this topic has been archived on 27 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi,

I am trying to compile a package, I get the linker error for mcount. the package does not use mcount. I think it is the compiler that is causing the error (profiling enabled). Although i disabled the MCOUNT in the config file, I still get the error.

Can any one help me?
Here is the error

prj/views/rep1/chakrava/chakrava_openwrt/kamikaze/staging_dir/toolchain-i386_gcc-4.1.2_uClibc-0.9.29/usr/bin/i486-openwrt-linux-uclibc-gcc  -I../.. -I../../pal/api -I../../pal/linux -I../../lib -I../../platform/linux -I/prj/views/rep1/chakrava/chakrava_openwrt/kamikaze/staging_dir/target-i386_uClibc-0.9.29/usr/include -I/prj/views/rep1/chakrava/chakrava_openwrt/kamikaze/staging_dir/target-i386_uClibc-0.9.29/include -Wall -funsigned-char -fno-signed-char -Wlong-long -Wnested-externs -I../../lib/memmgr -I../../lib/diffserv -I../../lib/dste -I../../lib/mpls -I../../nsm/mpls -I../../hal/MPLS -I../../imi/util   -o ../../platform/linux/bin/nsm ../../platform/linux/nsm.c -Wl,-\( ../../platform/linux/obj/nsm.a  ../../platform/linux/obj/pal.a ../../platform/linux/obj/lib.a -Wl,-\) -L/prj/views/rep1/chakrava/chakrava_openwrt/kamikaze/staging_dir/toolchain-i386_gcc-4.1.2_uClibc-0.9.29/usr/lib -L/prj/views/rep1/chakrava/chakrava_openwrt/kamikaze/staging_dir/toolchain-i386_gcc-4.1.2_uClibc-0.9.29/lib -L/prj/views/rep1/chakrava/chakrava_openwrt/kamikaze/staging_dir/target-i386_uClibc-0.9.29/usr/lib -L/prj/views/rep1/chakrava/chakrava_openwrt/kamikaze/staging_dir/target-i386_uClibc-0.9.29/lib -L/prj/views/rep1/chakrava/chakrava_openwrt/kamikaze/build_dir/target-i386_uClibc-0.9.29/ncurses-5.6/ncurses -lm -lcrypt -lcrypto
<built-in>:0: note: someone does not honour COPTS correctly, passed 0 times
../../platform/linux/obj/pal.a(pal_if_stats.o): In function `pal_if_get_stats':
pal_if_stats.c:(.text+0x4): undefined reference to `mcount'
../../platform/linux/obj/pal.a(pal_if_stats.o): In function `pal_if_stats_get_input_stats':
pal_if_stats.c:(.text+0x94): undefined reference to `mcount'
../../platform/linux/obj/pal.a(pal_if_stats.o): In function `pal_if_stats_get_input_errors':
pal_if_stats.c:(.text+0xdb): undefined reference to `mcount'
../../platform/linux/obj/pal.a(pal_if_stats.o): In function `pal_if_stats_get_output':
pal_if_stats.c:(.text+0x141): undefined reference to `mcount'
../../platform/linux/obj/pal.a(pal_if_stats.o): In function `pal_if_stats_get_output_errors':
pal_if_stats.c:(.text+0x180): undefined reference to `mcount'
../../platform/linux/obj/pal.a(pal_if_stats.o):pal_if_stats.c:(.text+0x1d9): more undefined references to `mcount' follow
collect2: ld returned 1 exit status
make[4]: *** [../../platform/linux/bin/nsm] Error 1
make[4]: Leaving directory `/prj/views/rep1/chakrava/chakrava_openwrt/kamikaze/build_dir/target-i386_uClibc-0.9.29/zebos/platform/linux'
make[3]: *** [nsm] Error 2
make[3]: Leaving directory `/prj/views/rep1/chakrava/chakrava_openwrt/kamikaze/build_dir/target-i386_uClibc-0.9.29/zebos/platform/linux'                                                                                                             


Thanks,
Dan

Looks like no one responded

OK, the problem solved (profiling is enabled) in the package makefile MAKE_CFLAGS.

Is there a termcap package in openwrt. if so, how do i enable it

The discussion might have continued from here.