0x0
在ubuntu20上编译dpdk 18.11报错,gcc 版本为9.3.0,报错如下:
error: converting a packed ‘const struct ether_addr’ pointer (alignment 1) to a ‘unaligned_uint16_t’ {aka ‘const short unsigned int’} pointer (alignment 2) may result in an unaligned pointer value [-Werror=address-of-packed-member]149 | const unaligned_uint16_t *ea_words = (const unaligned_uint16_t *)ea;
这是因为编译器检测到dpdk代码这样可能导致地址的非对齐,我们取消掉这个检查就行
解决方案
编译时添加EXTRA_CFLAGS=’-w -Wno-address-of-packed-member’ 参数
make install T=x86_64-native-linuxapp-gcc -j6 EXTRA_CFLAGS='-w -Wno-address-of-packed-member'