Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 162789 - strace-4.5.15 fails to build on sparc
Summary: strace-4.5.15 fails to build on sparc
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Sparc Porters
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 197398
  Show dependency tree
 
Reported: 2007-01-19 12:58 UTC by Andrew Gaffney (RETIRED)
Modified: 2007-12-15 16:42 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
strace-4.5.15 build log (strace.log,31.43 KB, text/plain)
2007-01-19 12:58 UTC, Andrew Gaffney (RETIRED)
Details
strace-sparc-missingsyscalls.patch (strace-sparc-missingsyscalls.patch,1.82 KB, patch)
2007-08-30 12:27 UTC, Jose Luis Rivero (yoswink) (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Gaffney (RETIRED) gentoo-dev 2007-01-19 12:58:18 UTC
strace-4.5.15 fails to build with a header that has errors out the wazoo. I've got linux-headers-2.6.11-r6, so it's unlikely to be a system headers problem. The build log is attached.
Comment 1 Andrew Gaffney (RETIRED) gentoo-dev 2007-01-19 12:58:52 UTC
Created attachment 107430 [details]
strace-4.5.15 build log
Comment 2 Andrew Gaffney (RETIRED) gentoo-dev 2007-02-05 05:08:32 UTC
I took another look at this, and I think I know what's going wrong. The command that fails is:

sparc-unknown-linux-gnu-gcc -DHAVE_CONFIG_H -I. -Ilinux/sparc -I./linux/sparc -Ilinux -I./linux   -Wall -mcpu=ultrasparc -mtune=ultrasparc -O2 -pipe -fomit-frame-pointer -MT syscall.o -MD -MP -MF .deps/syscall.Tpo -c -o syscall.o syscall.c

The include order has linux/sparc/ coming before linux/ and both of them have a file called syscall.h. The syscall.h in linux/ is the one that is needed (it has the sys_io_setup() and friends definitions), but the one in linux/sparc/ is getting pulled in first.
Comment 3 Goran Mekić 2007-08-14 21:45:30 UTC
The weird thing is grep can not find -Ilinux. For example:
# grep -r -- Ilinux .
#

Anyone knows how to figure out this?
Comment 4 Jose Luis Rivero (yoswink) (RETIRED) gentoo-dev 2007-08-30 12:17:10 UTC
(In reply to comment #2)
> I took another look at this, and I think I know what's going wrong. The command
> that fails is:
> 
> sparc-unknown-linux-gnu-gcc -DHAVE_CONFIG_H -I. -Ilinux/sparc -I./linux/sparc
> -Ilinux -I./linux   -Wall -mcpu=ultrasparc -mtune=ultrasparc -O2 -pipe
> -fomit-frame-pointer -MT syscall.o -MD -MP -MF .deps/syscall.Tpo -c -o
> syscall.o syscall.c
> 
> The include order has linux/sparc/ coming before linux/ and both of them have a
> file called syscall.h. The syscall.h in linux/ is the one that is needed (it
> has the sys_io_setup() and friends definitions), but the one in linux/sparc/ is
> getting pulled in first.
> 

Yup, problem was because strace uses for sparc its own syscall.h inside $strace_dir/linux/sparc (which don't happend to any other arch where the syscall.h used is in $strace_dir/linux/).

As far as I can see, what happened is that new syscall entries where added to strace and syscallent.h files where properly updated as well as linux/syscall.h. But not linux/sparc/syscall.h.

I will attach a patch that makes strace-4.5.16 to compile. The details will appear in the comment of the attachment. 



Comment 5 Jose Luis Rivero (yoswink) (RETIRED) gentoo-dev 2007-08-30 12:27:06 UTC
Created attachment 129620 [details, diff]
strace-sparc-missingsyscalls.patch

The patch adds to linux/sparc/syscalls.h the missing syscalls entries.

The patch also remove the syscall getpagesize() which AFAIK was removed in the last kernel headers clean up and it's not present anymore to be used in userspace.

First problem is that linux/sparc/syscalls.h follow a categorized order and I just add the missing entries under the label "Missing entries" (original eeh?).

Second problem is that I realized that the new strace version dies with a: "uname( <unfinished ... exit status 0>" while previous versions finish with the usual "Process XXY detached" or the same 4.5.16 works fine in other arches (i.e. alpha). Dunno if I've broken something with this patch :/

Please use it with caution.
Comment 6 Jose Luis Rivero (yoswink) (RETIRED) gentoo-dev 2007-08-30 12:34:20 UTC
We will need the help of vapier (or any other strace ninja) to review (and probably fix my patch).

The testing ebuild can be found in:
http://dev.gentoo.org/~yoswink/tmp/strace-4.5.16-r1.ebuild

And the proper patch to be included in /files is the one attached to this bug.

Sorry for the bug spam.