numam-dpdk/lib/librte_eal/common
Konstantin Ananyev fd4015e98e eal: fix C++ link of delay function pointer
When compiling with C++, it treats
void (*rte_delay_us)(unsigned int us);
as definition of the global variable.
So further linking with librte_eal fails.

Fixes: b4d63fb622 ("eal: customize delay function")

Steps to reproduce:

$ cat rttm1.cpp

using namespace std;

int main(int argc, char *argv[])
{
        int ret = rte_eal_init(argc, argv);
        rte_delay_us(1);
        cout << "return code ";
        cout << ret;
        return ret;
}

$ g++ -m64 -I/${RTE_SDK}/${RTE_TARGET}/include -c  -o rttm1.o rttm1.cpp
$ gcc -m64 -pthread -o rttm1 rttm1.o -ldl -Wl,-lstdc++ \
  -L/${RTE_SDK}/${RTE_TARGET}/lib -Wl,-lrte_eal
.../librte_eal.a(eal_common_timer.o):
(.bss+0x0): multiple definition of `rte_delay_us'
rttm1.o:(.bss+0x0): first defined here
collect2: error: ld returned 1 exit status

$ nm rttm1.o | grep rte_delay_us
0000000000000092 t _GLOBAL__sub_I_rte_delay_us
0000000000000000 B rte_delay_us

Signed-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
2016-10-05 11:16:28 +02:00
..
arch spinlock: move constructor out of x86 header file 2016-07-15 17:26:52 +02:00
include eal: fix C++ link of delay function pointer 2016-10-05 11:16:28 +02:00
eal_common_cpuflags.c eal: move CPU flags check from constructor to init 2016-10-03 16:13:36 +02:00
eal_common_dev.c eal: introduce generalized device 2016-10-03 16:34:02 +02:00
eal_common_devargs.c eal: fix argument parsing check 2016-06-20 10:44:43 +02:00
eal_common_errno.c
eal_common_hexdump.c eal: fix whitespace 2015-06-12 11:10:10 +02:00
eal_common_launch.c eal: fix whitespace 2015-06-12 11:10:10 +02:00
eal_common_lcore.c eal: increase log level of some messages 2016-05-02 15:31:17 +02:00
eal_common_log.c log: remove deprecated history dump 2016-08-03 18:48:54 +02:00
eal_common_memory.c eal: decrease log level of some debug messages 2016-03-13 23:44:35 +01:00
eal_common_memzone.c ivshmem: remove library and its EAL integration 2016-08-23 12:23:58 +02:00
eal_common_options.c eal: fix tail blank check in --lcores argument 2016-07-28 18:11:30 +02:00
eal_common_pci_uio.c pci: fix resource release when unmapping 2016-06-20 10:46:04 +02:00
eal_common_pci.c pci: fix memory leak when detaching device 2016-10-04 10:05:51 +02:00
eal_common_proc.c eal: check if primary process is alive 2016-03-09 16:13:09 +01:00
eal_common_string_fns.c
eal_common_tailqs.c log: use simple macro 2015-07-30 20:16:04 +02:00
eal_common_thread.c
eal_common_timer.c eal: customize delay function 2016-09-26 14:48:42 +02:00
eal_common_vdev.c eal: register drivers explicitly 2016-10-03 16:33:59 +02:00
eal_filesystem.h mem: remove single file segments 2016-10-03 15:20:51 +02:00
eal_hugepages.h mem: remove single file segments 2016-10-03 15:20:51 +02:00
eal_internal_cfg.h doc: fix doxygen syntax of some comments 2015-11-04 11:56:37 +01:00
eal_options.h eal: move plugin loading from linuxapp to common 2015-11-12 16:53:22 +01:00
eal_private.h pci: introduce helpers for device name parsing/update 2016-10-03 16:33:26 +02:00
eal_thread.h
Makefile eal: extract vdev infra 2016-10-03 16:33:42 +02:00
malloc_elem.c mem: zero out memory on free 2016-07-10 15:38:40 +02:00
malloc_elem.h remove extra parentheses in return statement 2016-02-10 15:47:50 +01:00
malloc_heap.c ivshmem: remove library and its EAL integration 2016-08-23 12:23:58 +02:00
malloc_heap.h mem: rework memzone to be allocated by malloc 2015-07-16 13:59:24 +02:00
rte_keepalive.c keepalive: add liveness callback 2016-06-16 18:25:48 +02:00
rte_malloc.c mem: do not zero out memory on zmalloc 2016-07-10 15:40:04 +02:00