0

I'm trying to cross compile libnuma for arm arch. In process of compiling i am facing below issue while generating libnuma.so file.

arm-linux-gnueabi-gcc -static -Wl,-soname=libnuma.so.1 -Wl,--version-script,versions.ldscript -Wl,-init,numa_init -o libnuma.so.1 libnuma.o syscall.o distance.o /usr/lib/gcc-cross/arm-linux-gnueabi/4.7/../../../../arm-linux-gnueabi/lib/../lib/crt1.o: In function _start': (.text+0x34): undefined reference tomain' collect2: error: ld returned 1 exit status make: *** [libnuma.so.1] Error 1

Can anyone please tell me how to overcome out of this issue inorder to generate static library?

msk
  • 135
  • 2
  • 13
  • First of all you have to use static libs ".a" instead of ".so" – Laser Mar 23 '16 at 07:47
  • what should i need to follow inorder to generate static libs? – msk Mar 24 '16 at 06:02
  • uh , sorry you must add `-c` option before `-static`, it will say to gcc to compiler library instead of executable. + common used and right one name for static libraries is `.a` instaead of `.so.1` – Laser Mar 24 '16 at 06:05
  • Doesn't help even after adding -c and rename the library to .a. Might be it require necessary Makefile change too. FYI you can refer http://numactl.sourcearchive.com/downloads/2.0.3/ – msk Mar 24 '16 at 10:53
  • could you please add make commandline : I've tried to use make `CC=$compiler` and everything passed without any errors – Laser Mar 25 '16 at 07:57
  • Have you tried compiling static library? Even i am able to compile successfully if it is a shared library. But I want to compile libnuma as a static library. – msk Mar 26 '16 at 06:54
  • Yes i was able to compile static library. libnumba.a was right in this folder – Laser Mar 26 '16 at 06:55
  • I've tried building static module.. But i am getting the same error. Is it possible to share your makefile? – msk Mar 26 '16 at 10:42
  • Check the .depend part of the makefile – Laser Mar 26 '16 at 10:44
  • make commandline gives below error `Makefile:193: .depend: No such file or directory cc -MM -DDEPS_RUN -I. bitops.c libnuma.c distance.c memhog.c numactl.c numademo.c numamon.c shm.c stream_lib.c stream_main.c syscall.c util.c mt.c clearcache.c test/*.c affinity.c sysfs.c rtnetlink.c > .depend.X && mv .depend.X .depend make: *** No rule to make target `commandline'. Stop.` – msk Mar 26 '16 at 12:57

0 Answers0