Koji cannot build openldap

Jakub Jelinek jakub at redhat.com
Thu Aug 2 11:55:09 UTC 2007


On Thu, Aug 02, 2007 at 12:35:55PM +0200, Jan Safranek wrote:
> Two days ago I have successfully compiled openldap-2.3.37-1.fc8, see 
> http://koji.fedoraproject.org/koji/taskinfo?taskID=83328
> 
> Today I cannot compile any openldap package, even the .src.rpm, which 
> was compilable two days ago - I downloaded it from koji and executed 
> "koji build --scratch dist-f8 openldap-2.3.37-1.fc8.src.rpm" with 
> following result (see 
> http://koji.fedoraproject.org/koji/taskinfo?taskID=85652 ):
>  cc -c -I. -I../dist/.. -D_GNU_SOURCE -D_REENTRANT -O2 -g -pipe -Wall 
> -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector 
> --param=ssp-buffer-size=4 -m64 -mtune=generic -D_REENTRANT -fPIC 
> ../dist/../dbm/dbm.c  -fPIC -DPIC -o .libs/dbm.o
> ../dist/../dbm/dbm.c: In function '__db_ndbm_open_openldap_slapd_rhl_42':
> ../dist/../dbm/dbm.c:241: error: expected identifier before '(' token
> 
> There is nothing suspicious in the dbm.c, it was compilable for several 
> years without any problem. My (virtualized) rawhide updated today is 
> able to compile the .src.rpm without any problem.
> 
> Something has changed in the buildroot so koji cannot compile my package 
>  anymore. Was here any change I should be aware of? Or how can I make 
> my openldap to compile again?

dbm.c is buggy.  It includes <fcntl.h>, which provides open, and POSIX
allows functions to be defined as function-like macros.
Until recently glibc didn't define open as a function like macro, but
in glibc 2.6.90 and later it does when -D_FORTIFY_SOURCE=2, to enforce
correct use of open/open64/openat/openat64.
But dbm.c uses dbm->open (x, y, z, a);, which works when open is
not defined as a function-like macro, but of course can break badly
if it is defined as a function-like macro.
The fix is use () to avoid it being expanded as function-like macro:
(dbm->open) (x, y, z, a);

	Jakub




More information about the Fedora-maintainers mailing list