On Mon, 11 May 2015, Martin Pitt wrote:
>
> Control: tag -1 -patch moreinfo
>
> Hello Cristian,

Sorry, I should have been more explicit.

I noticed that when cross-building for mipsisa32r2el (GPLed tool
chain).

mipsisa32r2el-axis-linux-gnu-gcc (GCC 4.7.2 Axis release R25/1.25)
4.7.2 20120820 (prerelease) [gcc-4_7-branch revision 190527]
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

I can build fatrace all right, but when I run it on the
target system it fails with:

        Cannot initialize fanotify: Invalid argument

ltrace shows:

fanotify_init(0, 0x8000, 0x4019b4, 0x412368 <unfinished ...>
SYS_fanotify_init(0, 0x8000, 0x4019b4, 0x412368) = -1
<... fanotify_init resumed> )                    = -1
__errno_location(0, 0x8000, 0x4019b4, 1)         = 0x77e6d498
strerror(22, 0x8000, 0x4019b4, 1)                = 0x77e14ddc
__fprintf_chk(0x77e398f0, 1, 0x401ce8, 0x77e14ddc <unfinished ...>
SYS_write(2, 0x7fc3c998, 45, 0xfbad2887Cannot initialize fanotify:
Invalid argument
)         = 45

> Cristian Ionescu-Idbohrn [2015-05-11 14:20 +0200]:
> > Pick up O_LARGEFILE, if defined.
> >
> > diff --git a/fatrace/fatrace.c b/fatrace/fatrace.c
> > index ec925b7..cf99fa9 100644
> > --- a/fatrace/fatrace.c
> > +++ b/fatrace/fatrace.c
> > @@ -42,7 +42,11 @@
> >   * 
> > http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=1e2ee49f7
> >   * O_LARGEFILE is usually 0, so hardcode it here
>       ^^^^^^^^^
> See this comment.

Yes, I did.  I (mis)?read it too ;)

> >   */
> > +#ifdef O_LARGEFILE
> > +#define KERNEL_O_LARGEFILE O_LARGEFILE
> > +#else
> >  #define KERNEL_O_LARGEFILE 00100000
> > +#endif
>
> This doesn't work, I'm afraid, see above. O_LARGEFILE is 0 on at least
> x86_64, because it's the default there.

Hmm...  Maybe the test needs to be more convoluted?

> Can you please be more specific what the actual problem is, and why
> this is severity "important"?

It builds, but fails to run.  See the error above.

After compiling with 'CFLAGS += -save-temps' and looking at fatrace.i,
I see this:

        $ grep O_LARGEFILE fatrace.i
        #define O_LARGEFILE 0x2000
        #define KERNEL_O_LARGEFILE 00100000

O_LARGEFILE set to 0x2000 (in /usr/include/bits/fcntl.h), but replaced
with 00100000.  My patch makes it both build and run, and produce
reasonable results.

Does this make more sense?


Cheers,

-- 
Cristian


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to