graygnuorg / pound

Light-weight reverse proxy, load balancer and HTTPS front-end for Web servers.
GNU General Public License v3.0
48 stars 13 forks source link

GCC flag -fcommon required with GCC v. 10.2.0 #4

Closed abaldoni closed 1 year ago

abaldoni commented 1 year ago

Hello, I'm currently building pound to run on Photon OS (VMware Linux container). Photon OS ships with GCC 10.2.0: the assembly steps (ld) with the following error:

gcc -pthread -g -O2   -o poundctl poundctl.o ./libpound.a -lpthread -lssl -lcrypto -lresolv -ldl -lrt
/usr/bin/ld: ./libpound.a(json.o):/root/pound-4.4/src/pound.h:792: multiple definition of `progname'; poundctl.o:/root/pound-4.4/src/pound.h:792: first defined here
/usr/bin/ld: ./libpound.a(mem.o):/root/pound-4.4/src/pound.h:792: multiple definition of `progname'; poundctl.o:/root/pound-4.4/src/pound.h:792: first defined here
/usr/bin/ld: ./libpound.a(progname.o):/root/pound-4.4/src/./pound.h:792: multiple definition of `progname'; poundctl.o:/root/pound-4.4/src/pound.h:792: first defined here
/usr/bin/ld: ./libpound.a(tmpl.o):/root/pound-4.4/src/pound.h:792: multiple definition of `progname'; poundctl.o:/root/pound-4.4/src/pound.h:792: first defined here

Setting CFLAGS=-fcommon before running configure solves the problem. The flags is reported on multiple source to be a change in the default behaviour of GCC v. 10 and above.

graygnuorg commented 1 year ago

Fixed in commit b12a4cb91f519dc43fa7a3b6655472197e2dd5be. No special flags needed. Thanks for reporting.