报错:
CCLD libzebra.la
/usr/bin/ld: .libs/sockunion.o (symbol from plugin): in function `inet_sutop':
(.text+0x0): multiple definition of `__packed'; .libs/vty.o (symbol from plugin):(.text+0x0): first defined here
/usr/bin/ld: .libs/prefix.o (symbol from plugin): in function `prefix_bit':
(.text+0x0): multiple definition of `__packed'; .libs/vty.o (symbol from plugin):(.text+0x0): first defined here
/usr/bin/ld: .libs/if.o (symbol from plugin): in function `if_cmp_func':
(.text+0x0): multiple definition of `__packed'; .libs/vty.o (symbol from plugin):(.text+0x0): first defined here
/usr/bin/ld: .libs/table.o (symbol from plugin): in function `route_table_init_with_delegate':
(.text+0x0): multiple definition of `__packed'; .libs/vty.o (symbol from plugin):(.text+0x0): first defined here
/usr/bin/ld: .libs/filter.o (symbol from plugin): in function `show_ip_access_list_cmd':
(.text+0x0): multiple definition of `__packed'; .libs/vty.o (symbol from plugin):(.text+0x0): first defined here
/usr/bin/ld: .libs/routemap.o (symbol from plugin): in function `route_map_lookup_by_name':
(.text+0x0): multiple definition of `__packed'; .libs/vty.o (symbol from plugin):(.text+0x0): first defined here
/usr/bin/ld: .libs/stream.o (symbol from plugin): in function `stream_new':
(.text+0x0): multiple definition of `__packed'; .libs/vty.o (symbol from plugin):(.text+0x0): first defined here
/usr/bin/ld: .libs/plist.o (symbol from plugin): in function `ip_prefix_list_cmd':
(.text+0x0): multiple definition of `__packed'; .libs/vty.o (symbol from plugin):(.text+0x0): first defined here
/usr/bin/ld: .libs/zclient.o (symbol from plugin): in function `zclient_debug':
(.text+0x0): multiple definition of `__packed'; .libs/vty.o (symbol from plugin):(.text+0x0): first defined here
/usr/bin/ld: .libs/vrf.o (symbol from plugin): in function `vrf_table':
(.text+0x0): multiple definition of `__packed'; .libs/vty.o (symbol from plugin):(.text+0x0): first defined here
/usr/bin/ld: .libs/nexthop.o (symbol from plugin): in function `nexthop_same_no_recurse':
(.text+0x0): multiple definition of `__packed'; .libs/vty.o (symbol from plugin):(.text+0x0): first defined here
collect2: error: ld returned 1 exit status
make[3]: *** [Makefile:502: libzebra.la] Error 1
make[3]: Leaving directory '/root/rpmbuild/BUILD/quagga-1.2.4/lib'
make[2]: *** [Makefile:430: all] Error 2
make[2]: Leaving directory '/root/rpmbuild/BUILD/quagga-1.2.4/lib'
make[1]: *** [Makefile:467: all-recursive] Error 1
make[1]: Leaving directory '/root/rpmbuild/BUILD/quagga-1.2.4'
make: *** [Makefile:399: all] Error 2
error: Bad exit status from /var/tmp/rpm-tmp.0KSRYb (%build)
效果:
Quagga configuration
--------------------
quagga version : 1.2.4
host operating system : linux-gnu
source code location : .
compiler : gcc
compiler flags : -fcommon -I/usr/include -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64-v2 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection
make : make
linker flags : -Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -rdynamic -lcrypt -Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -lm -L/usr/lib64 -lnetsnmpmibs -lsensors -lm -lrpm -lrpmio -lnetsnmpagent -Wl,--enable-new-dtags -Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -lnetsnmp -lm -lssl -lssl -lcrypto -lrt -lcap -lreadline -ltermcap -lm
state file directory : /var/run/quagga
config file directory : /etc/quagga
example directory : /etc/quagga
user to run as : quagga
group to run as : quagga
group for vty sockets : quaggavt
config file mask : 0600
log file mask : 0600
zebra protobuf enabled : no
解决方式:
在configure入参中加入
--with-cflags=-fcommon 会有性能方面弊端