Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 204457

Summary: dev-util/strace-4.5.16-r1: file.c:678: error: incompatible type for argument 1 of `sprinttime' on sparc when using -O3
Product: Gentoo Linux Reporter: Michał Mirosław <mirq-genboogs>
Component: [OLD] DevelopmentAssignee: Gentoo's Team for Core System packages <base-system>
Status: RESOLVED FIXED    
Severity: normal CC: sparc
Priority: High    
Version: unspecified   
Hardware: Sparc64   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: Quick fix
emerge --info
files/strace-4.5.16-sparc-fix-O3.patch
emerge-sparc64

Description Michał Mirosław 2008-01-05 18:20:40 UTC
strace-4.5.16 fails to build on sparc

Reproducible: Always

Steps to Reproduce:
emerge strace
Actual Results:  
sparc-unknown-linux-gnu-gcc -DHAVE_CONFIG_H -I. -Ilinux/sparc -I./linux/sparc -Ilinux -I./linux   -Wall -O3 -mcpu=ultrasparc -MT file.o -MD -MP -MF .deps/file.Tpo -c -o file.o file.c
file.c: In function `realprintstat':
file.c:922: warning: long unsigned int format, unsigned int arg (arg 2)
In file included from file.c:769:
file.c: In function `printstatsol':
file.c:678: error: incompatible type for argument 1 of `sprinttime'
In file included from file.c:770:
file.c:678: error: incompatible type for argument 1 of `sprinttime'
In file included from file.c:771:
file.c:678: error: incompatible type for argument 1 of `sprinttime'
make[1]: *** [file.o] Error 1
make[1]: Leaving directory `/home/tmp/portage/dev-util/strace-4.5.16-r1/work/strace-4.5.16'
make: *** [all] Error 2



looks like upstream bug - the function sprinttime(time_t) is called with timestruct_t param.
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2008-01-05 18:23:57 UTC
emerge --info please.
Comment 2 Michał Mirosław 2008-01-05 18:27:25 UTC
Created attachment 140213 [details, diff]
Quick fix
Comment 3 Michał Mirosław 2008-01-05 18:30:21 UTC
Created attachment 140214 [details]
emerge --info
Comment 4 Raúl Porcel (RETIRED) gentoo-dev 2008-01-06 14:47:34 UTC
Base-system: ?
Comment 5 SpanKY gentoo-dev 2008-01-06 18:08:07 UTC
i dont have any way of actually run time testing this, but the fix is probably:
-        tprintf("st_atime=%s, ", sprinttime(statbuf.st_atime));
-        tprintf("st_mtime=%s, ", sprinttime(statbuf.st_mtime));
-        tprintf("st_ctime=%s}", sprinttime(statbuf.st_ctime));
+        tprintf("st_atime=%s, ", sprinttime(statbuf.st_atime.tv_sec));
+        tprintf("st_mtime=%s, ", sprinttime(statbuf.st_mtime.tv_sec));
+        tprintf("st_ctime=%s}", sprinttime(statbuf.st_ctime.tv_sec));

sprinttime() takes a time_t which represents the time (in seconds).  the time members of the solstatbuf are the time (in seconds) as well as nanosecond granularity.  since sprinttime() doesnt include nanosecond granularity, we dont care about that part of the time.

someone needs to find a sparc system running with the personality required and exercise this difference
Comment 6 Jorge Manuel B. S. Vicetto (RETIRED) Gentoo Infrastructure gentoo-dev 2008-02-02 16:50:31 UTC
Applying vapier's patch here I can build dev-util/strace-4.5.16-r1 with -O3.
Comment 7 Jorge Manuel B. S. Vicetto (RETIRED) Gentoo Infrastructure gentoo-dev 2008-02-02 16:52:30 UTC
Created attachment 142508 [details]
files/strace-4.5.16-sparc-fix-O3.patch

Patch to fix bug 204457 when building with -O3.
Comment 8 Jorge Manuel B. S. Vicetto (RETIRED) Gentoo Infrastructure gentoo-dev 2008-02-02 16:54:31 UTC
Created attachment 142510 [details]
emerge-sparc64

emerge --info for the sparc64
Comment 9 Jorge Manuel B. S. Vicetto (RETIRED) Gentoo Infrastructure gentoo-dev 2008-02-11 19:37:35 UTC
Reassigning to base-system as this is a gcc (-O3) issue and there's a patch that seems to work.
base-system: it's your call.
Comment 10 SpanKY gentoo-dev 2008-02-11 21:52:13 UTC
it was assigned to sparc because it's up to the sparc team to validate things work
Comment 11 Jorge Manuel B. S. Vicetto (RETIRED) Gentoo Infrastructure gentoo-dev 2008-02-12 14:32:54 UTC
vapier,

I've tried the patch locally and it worked. What else do you need from us?