iqiyi / dpvs

DPVS is a high performance Layer-4 load balancer based on DPDK.
Other
3.01k stars 724 forks source link

rockylinux 8 编译 1.9.6 失败了 #952

Closed selboo closed 5 months ago

selboo commented 5 months ago
# cat /etc/redhat-release
Rocky Linux release 8.8 (Green Obsidian)

# rpm -qa | grep kernel
kernel-modules-4.18.0-477.10.1.el8_8.x86_64
kernel-devel-4.18.0-477.10.1.el8_8.x86_64
kernel-tools-4.18.0-477.10.1.el8_8.x86_64
kernel-4.18.0-477.10.1.el8_8.x86_64
kernel-core-4.18.0-477.10.1.el8_8.x86_64
kernel-tools-libs-4.18.0-477.10.1.el8_8.x86_64
kernel-headers-4.18.0-513.24.1.el8_9.x86_64

# uname -a
Linux localhost 4.18.0-477.10.1.el8_8.x86_64 #1 SMP Tue May 16 11:38:37 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

# gcc --version
gcc (GCC) 8.5.0 20210514 (Red Hat 8.5.0-20)
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# make
for i in src tools; do make -C $i || exit 1; done
make[1]: Entering directory '/opt/dpvs/src'
pkg-config: --version specified with other options or module names, assuming --modversion.
pkg-config: --version specified with other options or module names, assuming --modversion.
/opt/dpvs/src//dpdk.mk:33: "The pkg-config version is 1.4.2 but 0.29.2 is recommended."
pkg-config: --version specified with other options or module names, assuming --modversion.
  ip_vs_proxy_proto.o
cc -c  -D DPVS_MAX_SOCKET=2 -D DPVS_MAX_LCORE=64 -D CONFIG_DPVS_FDIR -D CONFIG_DPVS_LOG -D CONFIG_DPVS_PDUMP -DALLOW_EXPERIMENTAL_API -I/opt/194/dpdk/dpdklib/include -include rte_config.h -march=native  -D __DPVS__ -DDPVS_VERSION=\"1.9-6\" -DDPVS_BUILD_DATE=\"2024.04.24.17:08:54\" -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -mcmodel=medium -Wno-format-truncation -Wno-stringop-truncation -Wno-address-of-packed-member -Wstringop-overflow=0 -O3 -I /opt/dpvs/src//../include /opt/dpvs/src/ipvs/ip_vs_proxy_proto.c -o /opt/dpvs/src/ipvs/ip_vs_proxy_proto.o
/opt/dpvs/src/ipvs/ip_vs_proxy_proto.c: In function ‘proxy_proto_insert’:
/opt/dpvs/src/ipvs/ip_vs_proxy_proto.c:497:49: error: ‘%s’ directive writing up to 63 bytes into a region of size between 33 and 96 [-Werror=format-overflow=]
                 sprintf(ppv1buf, "PROXY TCP6 %s %s %d %d\r\n", tbuf1, tbuf2,
                                                 ^~                    ~~~~~
/opt/dpvs/src/ipvs/ip_vs_proxy_proto.c:497:34: note: directive argument in the range [0, 65535]
                 sprintf(ppv1buf, "PROXY TCP6 %s %s %d %d\r\n", tbuf1, tbuf2,
                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/dpvs/src/ipvs/ip_vs_proxy_proto.c:497:34: note: directive argument in the range [0, 65535]
/opt/dpvs/src/ipvs/ip_vs_proxy_proto.c:497:17: note: ‘sprintf’ output between 19 and 153 bytes into a destination of size 108
                 sprintf(ppv1buf, "PROXY TCP6 %s %s %d %d\r\n", tbuf1, tbuf2,
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                         ntohs(ppinfo->addr.ip6.src_port), ntohs(ppinfo->addr.ip6.dst_port));
                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/dpvs/src/ipvs/ip_vs_proxy_proto.c:487:49: error: ‘%s’ directive writing up to 63 bytes into a region of size between 33 and 96 [-Werror=format-overflow=]
                 sprintf(ppv1buf, "PROXY TCP4 %s %s %d %d\r\n", tbuf1, tbuf2,
                                                 ^~                    ~~~~~
/opt/dpvs/src/ipvs/ip_vs_proxy_proto.c:487:34: note: directive argument in the range [0, 65535]
                 sprintf(ppv1buf, "PROXY TCP4 %s %s %d %d\r\n", tbuf1, tbuf2,
                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/dpvs/src/ipvs/ip_vs_proxy_proto.c:487:34: note: directive argument in the range [0, 65535]
/opt/dpvs/src/ipvs/ip_vs_proxy_proto.c:487:17: note: ‘sprintf’ output between 19 and 153 bytes into a destination of size 108
                 sprintf(ppv1buf, "PROXY TCP4 %s %s %d %d\r\n", tbuf1, tbuf2,
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                         ntohs(ppinfo->addr.ip4.src_port), ntohs(ppinfo->addr.ip4.dst_port));
                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/dpvs/src/ipvs/ip_vs_proxy_proto.c: At top level:
cc1: error: unrecognized command line option ‘-Wno-address-of-packed-member’ [-Werror]
cc1: all warnings being treated as errors
make[1]: *** [Makefile:81: /opt/dpvs/src/ipvs/ip_vs_proxy_proto.o] Error 1
make[1]: Leaving directory '/opt/dpvs/src'
make: *** [Makefile:36: all] Error 1
selboo commented 5 months ago

修改, src/Makefile 去掉 CFLAGS 里面 -Wall 通过了

ywc689 commented 5 months ago

It's a known issue, refer to #947.