[CRIU] [PATCH] zdtm: fix building uptime_grow.c on s390

Adrian Reber areber at redhat.com
Thu Jul 20 19:42:33 MSK 2017


On Thu, Jul 20, 2017 at 06:13:02PM +0200, Michael Holzheu wrote:
> Am Wed, 19 Jul 2017 21:08:02 +0200
> schrieb Adrian Reber <areber at redhat.com>:
> 
> > On Wed, Jul 19, 2017 at 07:04:16PM +0200, Michael Holzheu wrote:
> > > Am Wed, 19 Jul 2017 13:40:36 +0000
> > > schrieb Adrian Reber <adrian at lisas.de>:
> > > 
> > > > From: Adrian Reber <areber at redhat.com>
> > > > 
> > > > Building the uptime_grow test case fails on s390 with:
> > > > 
> > > > uptime_grow.o: In function `main':
> > > > /tmp/2/criu/test/zdtm/static/uptime_grow.c:36: undefined reference to `__floatdidf'
> > > > /tmp/2/criu/test/zdtm/static/uptime_grow.c:36: undefined reference to `__muldf3'
> > > > /tmp/2/criu/test/zdtm/static/uptime_grow.c:36: undefined reference to `__floatdidf'
> > > > /tmp/2/criu/test/zdtm/static/uptime_grow.c:36: undefined reference to `__adddf3'
> > > 
> > > These look like soft-float symbols. Normally you should not need to
> > > include <math.h> in this case.
> > > 
> > > Could you please send the V=1 compile output?
> > 
> > gcc -O2 -g  -Wall -Wformat-security -Werror -DCONFIG_S390 -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -DCONFIG_HAS_SELINUX -iquote include/ -DCONFIG_HAS_SELINUX -msoft-float -fno-optimize-sibling-calls -g -O2 -Wall -Werror -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0  -D_GNU_SOURCE -I../lib -iquote ../lib/arch/s390/include  -c -MM -MP -o uptime_grow.d uptime_grow.c
> > gcc -O2 -g  -Wall -Wformat-security -Werror -DCONFIG_S390 -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -DCONFIG_HAS_SELINUX -iquote include/ -DCONFIG_HAS_SELINUX -msoft-float -fno-optimize-sibling-calls -g -O2 -Wall -Werror -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0  -D_GNU_SOURCE -I../lib -iquote ../lib/arch/s390/include  -c -o uptime_grow.o uptime_grow.c
> 
> The testsuite should *not* be compiled with the "-msoft-float" option.
> 
> When I do "make V=1 -C test/zdtm" on the current "criu-dev" branch I get the following:
> 
> # gcc -g -O2 -Wall -Werror -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0  -D_GNU_SOURCE -I../lib -iquote ../lib/arch/s390/include  -c -o uptime_grow.o uptime_grow.c
> 
> So no "-msoft-float" ...
> 
> The question is: What is different on your system?

So, this one is a bit strange. If I checkout criu-dev and run make and
make zdtm (to just build all test cases) I get the error above.

If I do make; cd test; ./zdtm.py run -t zdtm/static/uptime_grow
I see

 CC        uptime_grow.o
 LINK      uptime_grow

No errors, it just builds and works. So building test cases from the top
level directory is different than build test cases from the test
directory:

# make -C zdtm/static/ uptime_grow V=1
make: Entering directory `/tmp/2/criu/test/zdtm/static'
make -C ../lib
make[1]: Entering directory `/tmp/2/criu/test/zdtm/lib'
make[1]: Leaving directory `/tmp/2/criu/test/zdtm/lib'
gcc -g -O2 -Wall -Werror -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0  -D_GNU_SOURCE -I../lib -iquote ../lib/arch/s390/include  -c -o uptime_grow.o uptime_grow.c
gcc  uptime_grow.o ../lib/libzdtmtst.a ../lib/libzdtmtst.a -lrt -pthread -o uptime_grow
make: Leaving directory `/tmp/2/criu/test/zdtm/static'


And my patch does not actually work. To test it I just rebuild the test
case from the test directory and that works with and without the <math.h>
include.

So the patch is wrong and unnecessary and the buildsystem needs a fix.

		Adrian


More information about the CRIU mailing list