[squid-users] Error on RPM build of squid 3.2.1 on Fedora 17

From: Eliezer Croitoru <eliezer_at_ngtech.co.il>
Date: Tue, 21 Aug 2012 12:59:16 +0300

I am trying to build an RPM for fedora 17.
I took the squid.spec and other files from:
squid-3.2.0.16-1.fc17.src.rpm
at
http://koji.fedoraproject.org/koji/buildinfo?buildID=305827

the basic cxx and cflags are:
RPM_OPT_FLAGS="-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions
-fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic"

and the compilation will fail in the middle.(regular compilation works)
at:
##start
g++ -DHAVE_CONFIG_H -DDEFAULT_CONFIG_FILE=\"/etc/squid/squid.conf\"
-DDEFAULT_SQUID_DATA_DIR=\"/usr/share/squid\" -DDEFAULT_SQUID_CONFIG_DIR
           =\"/etc/squid\" -I.. -I../include -I../lib -I../src
-I../include -I../src -I/usr/include/libxml2
-I/usr/include/libxml2 -Wall -Wpo inter-arith -Wwrite-strings
-Wcomments -Werror -pipe -D_REENTRANT -O2 -g -pipe -Wall
-Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector
--param=ssp-buffer-size=4 -m64 -mtune=generic -fpie -c -o tools.o tools.cc
g++ -DHAVE_CONFIG_H -DDEFAULT_CONFIG_FILE=\"/etc/squid/squid.conf\"
-DDEFAULT_SQUID_DATA_DIR=\"/usr/share/squid\" -DDEFAULT_SQUID_CONFIG_DIR
           =\"/etc/squid\" -I.. -I../include -I../lib -I../src
-I../include -I../src -I/usr/include/libxml2
-I/usr/include/libxml2 -Wall -Wpo inter-arith -Wwrite-strings
-Wcomments -Werror -pipe -D_REENTRANT -O2 -g -pipe -Wall
-Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector
--param=ssp-buffer-size=4 -m64 -mtune=generic -fpie -c -o tunnel.o
tunnel.cc
tools.cc: In function 'void no_suid()':
tools.cc:785:14: error: ignoring return value of 'int setuid(__uid_t)',
declared with attribute warn_unused_result [-Werror=unused-result]
tools.cc: In function 'void enter_suid()':
tools.cc:760:39: error: ignoring return value of 'int setresuid(__uid_t,
__uid_t, __uid_t)', declared with attribute warn_unused_result [-We
       rror=unused-result]
cc1plus: all warnings being treated as errors
make[3]: *** [tools.o] Error 1
##end

I changed the flags to:
CFLAGS="-O2 -pipe -m64 -mtune=generic"
CXXFLAGS="${CFLAGS}"
LDFLAGS="-pie"

and it seems to work fine.

the question is:
what is causing the problem?
is it squid code or unneeded flags?

Thanks,
Eliezer

-- 
Eliezer Croitoru
https://www1.ngtech.co.il
IT consulting for Nonprofit organizations
eliezer <at> ngtech.co.il
Received on Tue Aug 21 2012 - 09:59:28 MDT

This archive was generated by hypermail 2.2.0 : Tue Aug 21 2012 - 12:00:03 MDT