[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Minios-devel] [Unikraft] Static Libraries not being linked properly



Earnest request for some help, please ..

On Sun, Apr 15, 2018 at 7:05 PM, Ajay Garg <ajaygargnsit@xxxxxxxxx> wrote:
Ideas please?
Any pointers to any existing example usage of linking static-libraries would be useful.

On Sat, Apr 14, 2018 at 6:15 PM, Ajay Garg <ajaygargnsit@xxxxxxxxx> wrote:
Very surprisingly, the missing functions (start_time, end_time) are actually present in https://github.com/tonyho/CoreMark/blob/master/core_main.c.
But in the make-output, fdt_wip.c is being listed.


On Sat, Apr 14, 2018 at 9:22 AM, Ajay Garg <ajaygargnsit@xxxxxxxxx> wrote:
Hi All.

I am trying to integrate coremark-app in unikraft for x86_64.
It requires static linking to librt.a and libpthread.a; however seems  they are not being picked up.


Following is the Makefile.uk :

####################################################################
$(eval $(call addlib,appcoremark))

APPCOREMARK_SRCS-y              += $(APPCOREMARK_BASE)/core_main.c                                  \
                                                          $(APPCOREMARK_BASE)/core_list_join.c                              \
                                                          $(APPCOREMARK_BASE)/core_util.c                                     \
                                                          $(APPCOREMARK_BASE)/core_state.c                                  \
                                                          $(APPCOREMARK_BASE)/core_matrix.c                                \
                                                                                                                                                       \
                                                          $(APPCOREMARK_BASE)/linux64/core_portme.c

APPCOREMARK_OBJS-y               += /usr/lib/x86_64-linux-gnu/librt.a                                                \
                                                           /usr/lib/x86_64-linux-gnu/libpthread.a

APPCOREMARK_CINCLUDES-y     +=-I$(APPCOREMARK_BASE)                                                    \
                                                          -I$(APPCOREMARK_BASE)/linux64                                        \
                                                          -I$(APPCOREMARK_BASE)/../../unikraft/lib/nolibc/include/sys   \
                                                          -I/usr/include
####################################################################


Following is the compilation-run :

####################################################################
aajay@latitude-3480:~/unikraft/apps/coremark$ make
make[1]: Entering directory '/home/ajay/unikraft/unikraft'
  CP      config
  CC      libxenplat: hypervisor.o
  CC      libxenplat: memory.o
  CC      libxenplat: setup.o
  CC      libxenplat: traps.o
  AS      libxenplat: entry64.o
  CC      libxenplat: mm.o
  CC      libxenplat: arch_events.o
  CC      libxenplat: arch_time.o
  CC      libxenplat: lcpu.o
  CC      libxenplat: console.o
  CC      libxenplat: shutdown.o
  CC      libxenplat: events.o
  LD      libxenplat.ld.o
  OBJCOPY libxenplat.o
  CC      appcoremark: core_main.o
/home/ajay/unikraft/apps/coremark/core_main.c: In function ‘main’:
/home/ajay/unikraft/apps/coremark/core_main.c:292:12: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘unsigned int’ [-Wformat=]
  ee_printf("CoreMark Size    : %lu\n",(ee_u32)results[0].size);
            ^
/home/ajay/unikraft/apps/coremark/core_main.c:293:12: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘unsigned int’ [-Wformat=]
  ee_printf("Total ticks      : %lu\n",(ee_u32)total_time);
            ^
/home/ajay/unikraft/apps/coremark/core_main.c:308:12: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘unsigned int’ [-Wformat=]
  ee_printf("Iterations       : %lu\n",(ee_u32)default_num_contexts*results[0].iterations);
            ^
  CC      appcoremark: core_list_join.o
  CC      appcoremark: core_util.o
  CC      appcoremark: core_state.o
  CC      appcoremark: core_matrix.o
  CC      appcoremark: core_portme.o
In file included from /usr/include/features.h:367:0,
                 from /usr/include/malloc.h:22,
                 from /home/ajay/unikraft/apps/coremark/linux64/core_portme.c:18:
/usr/include/sys/cdefs.h:285:0: warning: "__nonnull" redefined
 # define __nonnull(params) __attribute__ ((__nonnull__ params))
 ^
In file included from /home/ajay/unikraft/unikraft/lib/nolibc/include/stdio.h:41:0,
                 from /home/ajay/unikraft/apps/coremark/linux64/core_portme.c:9:
/home/ajay/unikraft/unikraft/include/uk/essentials.h:59:0: note: this is the location of the previous definition
 #define __nonnull              __attribute__((nonnull))
 ^
/home/ajay/unikraft/apps/coremark/linux64/core_portme.c: In function ‘start_time’:
/home/ajay/unikraft/apps/coremark/linux64/core_portme.c:93:24: warning: implicit declaration of function ‘clock_gettime’ [-Wimplicit-function-declaration]
  #define GETMYTIME(_t) clock_gettime(0,_t)
                        ^
/home/ajay/unikraft/apps/coremark/linux64/core_portme.c:116:2: note: in expansion of macro ‘GETMYTIME’
  GETMYTIME(&start_time_val );      
  ^
/home/ajay/unikraft/apps/coremark/linux64/core_portme.c: In function ‘portable_init’:
/home/ajay/unikraft/apps/coremark/linux64/core_portme.c:172:43: warning: unused parameter ‘argc’ [-Wunused-parameter]
 void portable_init(core_portable *p, int *argc, char *argv[])
                                           ^
/home/ajay/unikraft/apps/coremark/linux64/core_portme.c:172:55: warning: unused parameter ‘argv’ [-Wunused-parameter]
 void portable_init(core_portable *p, int *argc, char *argv[])
                                                       ^
  LD      appcoremark.ld.o
  OBJCOPY appcoremark.o
  CC      libukboot: boot.o
  LD      libukboot.ld.o
  OBJCOPY libukboot.o
  CC      libukdebug: print.o
  CC      libukdebug: hexdump.o
  LD      libukdebug.ld.o
  OBJCOPY libukdebug.o
  CC      libukargparse: argparse.o
  LD      libukargparse.ld.o
  OBJCOPY libukargparse.o
  CC      libnolibc: errno.o
  CC      libnolibc: stdio.o
  CC      libnolibc: ctype.o
  CC      libnolibc: stdlib.o
  CC      libnolibc: string.o
  CC      libnolibc: getopt.o
  CC      libnolibc: malloc.o
  LD      libnolibc.ld.o
  OBJCOPY libnolibc.o
  CC      libukalloc: alloc.o
  LD      libukalloc.ld.o
  OBJCOPY libukalloc.o
  CC      libukallocbbuddy: bbuddy.o
  LD      libukallocbbuddy.ld.o
  OBJCOPY libukallocbbuddy.o
  CC      libfdt: fdt.o
  CC      libfdt: fdt_addresses.o
  CC      libfdt: fdt_empty_tree.o
  CC      libfdt: fdt_overlay.o
  CC      libfdt: fdt_ro.o
  CC      libfdt: fdt_rw.o
  CC      libfdt: fdt_strerror.o
  CC      libfdt: fdt_sw.o
  CC      libfdt: fdt_wip.o
  LD      libfdt.ld.o
  OBJCOPY libfdt.o
  LD      coremark_xen-x86_64.ld.o
  OBJCOPY coremark_xen-x86_64.o
  LD      coremark_xen-x86_64
/home/ajay/unikraft/apps/coremark/build/coremark_xen-x86_64.o: In function `iterate':
fdt_wip.c:(.text+0x5719): undefined reference to `sched_yield'
/home/ajay/unikraft/apps/coremark/build/coremark_xen-x86_64.o: In function `start_time':
fdt_wip.c:(.text+0x6e2f): undefined reference to `clock_gettime'
/home/ajay/unikraft/apps/coremark/build/coremark_xen-x86_64.o: In function `stop_time':
fdt_wip.c:(.text+0x6e4f): undefined reference to `clock_gettime'
/home/ajay/unikraft/unikraft/plat/xen/Linker.uk:22: recipe for target '/home/ajay/unikraft/apps/coremark/build/coremark_xen-x86_64' failed
make[2]: *** [/home/ajay/unikraft/apps/coremark/build/coremark_xen-x86_64] Error 1
Makefile:32: recipe for target '_all' failed
make[1]: *** [_all] Error 2
make[1]: Leaving directory '/home/ajay/unikraft/unikraft'
Makefile:6: recipe for target 'all' failed
make: *** [all] Error 2
ajay@latitude-3480:~/unikraft/apps/coremark$
####################################################################


I tried looking for any examples of linkage of OBJS files, but no example (for OBJS) is present in any of plat/app folder.

Kindly help me in fixing this.



Thanks and Regards,
Ajay



--
Regards,
Ajay



--
Regards,
Ajay



--
Regards,
Ajay
_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.