[CRIU] [PATCH 3/4] make: Use generic build engine for libcriu.so

Cyrill Gorcunov gorcunov at gmail.com
Thu Aug 29 05:15:54 EDT 2013


On Thu, Aug 29, 2013 at 01:11:13PM +0400, Pavel Emelyanov wrote:
> >  
> > -criu.o:
> > -	$(Q) $(CC) $(CFLAGS) -fPIC -c criu.c -I ../include/
> > +#
> > +# We need util-fd.c to be re-compiled with
> > +# own flags, but our build engine can't
> > +# do such tricks yet, so write a rule
> > +# manually for a while.
> > +$(obj)/util-fd.o: $(obj)/../pie/util-fd.c
> > +	$(E) "  CC      " $@
> > +	$(Q) $(CC) -c $(cflags-y) $(CFLAGS) $(includes) $< -o $@
> 
> How about syscalls? Which rule makes them get linked into .so?

.so compiled without syscalls

cflags-y		+= -shared -fPIC -Wa,--noexecstack -fno-stack-protector

so in until-fd.c

#ifdef CR_NOGLIBC
# include "syscall.h"
# define __sys(foo)	sys_##foo
#else
# define __sys(foo)	foo
#endif

	flags = __sys(fcntl)(fd, F_GETFD, 0);

transforms to

	flags = fcntl(fd, F_GETFD, 0);


More information about the CRIU mailing list