numam-dpdk/lib/librte_eal/common/include
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 eal/armv8: use high-resolution cycle counter 2016-10-04 10:43:44 +02:00
generic eal: fix C++ link of delay function pointer 2016-10-05 11:16:28 +02:00
rte_alarm.h alarm: make cancellation thread-safe 2014-11-24 13:17:49 +01:00
rte_branch_prediction.h remove trailing whitespaces 2014-06-11 00:29:34 +02:00
rte_common.h lib: remove named variadic macros in exported headers 2016-09-13 15:35:28 +02:00
rte_debug.h eal: add missing include to debug header 2016-05-05 22:47:42 +02:00
rte_dev.h eal: introduce generalized device 2016-10-03 16:34:02 +02:00
rte_devargs.h lib: work around unnamed structs/unions 2016-09-13 15:35:28 +02:00
rte_eal_memconfig.h mem: introduce memzone freeing 2015-07-16 14:01:04 +02:00
rte_eal.h eal: introduce driver init macros 2016-10-03 16:33:12 +02:00
rte_errno.h eal: remove useless errno 2015-03-10 12:17:31 +01:00
rte_hexdump.h eal: fix whitespace 2015-06-12 11:10:10 +02:00
rte_interrupts.h lib: work around unnamed structs/unions 2016-09-13 15:35:28 +02:00
rte_keepalive.h keepalive: add liveness callback 2016-06-16 18:25:48 +02:00
rte_launch.h remove trailing whitespaces 2014-06-11 00:29:34 +02:00
rte_lcore.h eal: fix thread naming on FreeBSD 2016-06-17 18:04:22 +02:00
rte_log.h log: remove deprecated history dump 2016-08-03 18:48:54 +02:00
rte_malloc_heap.h mem: rework memzone to be allocated by malloc 2015-07-16 13:59:24 +02:00
rte_malloc.h mem: move librte_malloc to eal/common 2015-07-16 13:44:48 +02:00
rte_memory.h lib: add missing include dependencies 2016-09-13 15:35:28 +02:00
rte_memzone.h lib: work around unnamed structs/unions 2016-09-13 15:35:28 +02:00
rte_pci_dev_feature_defs.h pci: fix licenses 2015-06-23 23:31:15 +02:00
rte_pci_dev_features.h pci: fix licenses 2015-06-23 23:31:15 +02:00
rte_pci.h pci: create device list and fallback on its members 2016-10-03 16:34:03 +02:00
rte_per_lcore.h eal: factorize common headers 2014-11-25 13:16:24 +01:00
rte_random.h remove trailing whitespaces 2014-06-11 00:29:34 +02:00
rte_string_fns.h eal: remove rte_snprintf 2014-09-29 15:04:55 +02:00
rte_tailq.h eal: introduce driver init macros 2016-10-03 16:33:12 +02:00
rte_time.h lib: add missing include dependencies 2016-09-13 15:35:28 +02:00
rte_vdev.h drivers: use vdev registration 2016-10-03 16:33:48 +02:00
rte_version.h lib: add missing include dependencies 2016-09-13 15:35:28 +02:00
rte_warnings.h config: remove EAL flags for OS environment 2016-03-05 11:09:31 +01:00