[squid-users] using clang to compile squid 4-5
graf huy
grafhuy at yahoo.fr
Wed Jan 30 08:38:23 UTC 2019
Hi,
Using update-alternatives to set clang++ was a success, and export CC=/usr/bin/clang does the job (trying two differents methods). Debian project recommended to use export (CC,CCX) for versioning and only update-alternatives for alternative as it says.Anyway compilation with clang was as quick as gcc can do.
/usr/local/squid/sbin# ./squid -v
Squid Cache: Version 4.5
Service Name: squid
This binary uses OpenSSL 1.1.1a 20 Nov 2018. For legal restrictions on distribution see https://www.openssl.org/source/license.html
configure options: '--enable-ssl' '--enable-ssl-crtd' '--localstatedir=/var' '--datadir=/usr/share/squid' '--sysconfdir=/etc/squid' '--libexecdir=/usr/lib/squid' '--mandir=/usr/share/man' '--enable-inline' '--disable-arch-native' '--enable-async-io=8' '--enable-storeio=ufs,aufs,diskd,rock' '--enable-removal-policies=lru,heap' '--enable-delay-pools' '--enable-cache-digests' '--enable-icap-client' '--enable-follow-x-forwarded-for' '--enable-auth-basic=DB,fake,getpwnam,LDAP,NCSA,NIS,PAM,POP3,RADIUS,SASL,SMB' '--enable-auth-digest=file,LDAP' '--enable-auth-negotiate=kerberos,wrapper' '--enable-auth-ntlm=fake,SMB_LM' '--enable-external-acl-helpers=file_userip,kerberos_ldap_group,LDAP_group,session,SQL_session,time_quota,unix_group,wbinfo_group' '--enable-security-cert-validators=fake' '--enable-storeid-rewrite-helpers=file' '--enable-url-rewrite-helpers=fake' '--enable-eui' '--enable-esi' '--enable-icmp' '--enable-zph-qos' '--enable-ecap' '--disable-translation' '--with-swapdir=/var/spool/squid' '--with-logdir=/var/log/squid' '--with-pidfile=/var/run/squid.pid' '--with-filedescriptors=65536' '--with-large-files' '--with-default-user=proxy' '--with-gnutls' '--with-openssl' 'CC=/usr/bin/clang'
>Seconded. With both my Squid Project and Debian pkg-squid Team hat's on
>I'd like to know why you feel any need to force the compiler?
There were errors to patch with memcpy because of the gcc version 8.2.0-14 Debian wich considers some warnings as errors, besides some targets are BSD's.
smblib-util.c: In function ‘SMB_Negotiate’:
smblib-util.c:404:9: error: ‘strncpy’ output may be truncated copying 79 bytes from a string of length 79 [-Werror=stringop-truncation]
strncpy(p, Con_Handle -> Svr_PDom, sizeof(Con_Handle -> Svr_PDom) - 1);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
smblib-util.c:427:9: error: ‘strncpy’ output may be truncated copying 79 bytes from a string of length 79 [-Werror=stringop-truncation]
strncpy(p, Con_Handle -> Svr_PDom, sizeof(Con_Handle -> Svr_PDom) - 1);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
smblib-util.c: In function ‘SMB_TreeConnect’:
smblib-util.c:541:5: error: ‘strncpy’ specified bound 129 equals destination size [-Werror=stringop-truncation]
strncpy(tree -> path, path, sizeof(tree -> path));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
smblib-util.c:542:5: error: ‘strncpy’ specified bound 20 equals destination size [-Werror=stringop-truncation]
strncpy(tree -> device_type, device, sizeof(tree -> device_type));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Although my heart bleeds to use a compiler not compliant with GPL on Debian.
Great to known you are on this package, I thought there was only Luigi Gangitano (luigi at debian.org) for ages...
Best regards.
Le mercredi 23 janvier 2019 à 05:25:04 UTC+1, Amos Jeffries <squid3 at treenet.co.nz> a écrit :
On 23/01/19 5:17 am, Alex Rousskov wrote:
> On 1/22/19 6:21 AM, graf huy wrote:
>
>> The Makefile is modified so each line with gcc is replaced with clang
>> and each line of g++ replaced with clang++. But gcc is still used.
>
> I am not sure you are doing that,
Seconded. With both my Squid Project and Debian pkg-squid Team hat's on
I'd like to know why you feel any need to force the compiler?
Amos
_______________________________________________
squid-users mailing list
squid-users at lists.squid-cache.org
http://lists.squid-cache.org/listinfo/squid-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squid-cache.org/pipermail/squid-users/attachments/20190130/832d0ef8/attachment.html>
More information about the squid-users
mailing list