linux-um archives
 help / color / mirror / Atom feed
From: BlaisorBlade <blaisorblade_spam@yahoo.it>
To: user-mode-linux-devel@lists.sourceforge.net
Subject: Re: [uml-devel] compile error ...(now tracked down)
Date: Wed, 17 Sep 2003 13:29:57 +0200	[thread overview]
Message-ID: <200309171329.57323.blaisorblade_spam@yahoo.it> (raw)
In-Reply-To: <200309161329.39725.user-mode-linux-devel@goldenspud.com>

Alle 20:29, martedì 16 settembre 2003, Matthew R. Scott ha scritto:

> With both of these patches I am getting the following error during compile:
I use the headers from glibc-devel-2.3.1-10mdk(from mandrake 9.1) and I get 
the same errors. Supposed that the patch compiles well somewhere else, it's 
something changed with glibc from the system of who released the patch. See 
below, especially where the code snippets speak about backward compatibility.

> In file included from umid.c:18:
> /home/gldnspud/uml/build/buildkernel-build/linux/arch/um/include/os.h:41:
> warning: no semicolon at end of struct or union
> /home/gldnspud/uml/build/buildkernel-build/linux/arch/um/include/os.h:41:
> parse error before `.'
> /home/gldnspud/uml/build/buildkernel-build/linux/arch/um/include/os.h:42:
> parse error before `.'
> /home/gldnspud/uml/build/buildkernel-build/linux/arch/um/include/os.h:43:
> parse error before `.'
>
> When I look at line 41, 42, and 43 in arch/um/include/os.h though, there
> doesn't seem to be any sort of problems.  Those lines are in the middle of
> a perfectly valid-looking struct.

I agree, but cd to that folder and rerun the exact gcc command, replacing -c 
-o umid.o with -E(to preprocess only the file), then use less(the 
preprocessed output is sent to stdout). On about line 5295(on me, look well), 
you can see that those line, because of a preprocessor #define, get turned 
into something else. The os.h file is good, but in umid.c it's included after 
sys/stat.h(which is the glibc one!). It then includes in turn bits/stat.h:

#ifdef __USE_MISC					
# define st_atime st_atim.tv_sec        /* Backward compatibility.  */
# define st_mtime st_mtim.tv_sec
# define st_ctime st_ctim.tv_sec
...
__USE_MISC comes from features.h; if you define __BSD_SOURCE(to choose this 
dialect of Unix) it gets defined; if you don't define anything, it comes up 
automatically. Anyway we need it in the code below.

I've given this command inside arch/um to find what includes both os.h and 
sys/stat.h
# grep 'os\.h\"' $(grep 'sys/stat\.h' `find . -name '*.[ch]'` -l)
./drivers/chan_user.c:#include "os.h"
./os-Linux/file.c:#include "os.h"
./kernel/umid.c:#include "os.h"
./kernel/initrd_user.c:#include "os.h"

I've tried #undefining them, but they are needed somewhere else(in file.c), so 
I've simply swapped the order of the two includes(so that os.h is included 
with those define's not in place). And yet, it doesn't compile. It stops on 
file.c.

This is the offending code(which was absent from the cleanup of -4um):
static void copy_stat(struct uml_stat* dst, struct stat64* src)
{
        *dst=((struct uml_stat) {
                .st_dev     = src->st_dev,     /* device */
                .st_ino     = src->st_ino,     /* inode */
                .st_mode    = src->st_mode,    /* protection */
                .st_nlink   = src->st_nlink,   /* number of hard links */
                .st_uid     = src->st_uid,     /* user ID of owner */
                .st_gid     = src->st_gid,     /* group ID of owner */
                .st_size    = src->st_size,    /* total size, in bytes */
                .st_blksize = src->st_blksize, /* blocksize for filesys I/O */
                .st_blocks  = src->st_blocks,  /* number of blocks allocated 
*/
                .st_atime   = src->st_atime,   /* time of last access */
                .st_mtime   = src->st_mtime,   /* time of last modification */
                .st_ctime   = src->st_ctime,   /* time of last change */
        });
}

As you can see, on the same line it needs that st_{a,m,c}time is its literal 
value on the right and the original vaue on the left. I am available to 
anyone who wants to fix the bug with help, actual hacking and whatever, but 
I'm not starting because I don't know how... if I #undef the things, then I 
need to patch the above function to use directly st_atim.tv_sec, and then 
maybe things won't work on systems where they worked before.
-- 
cat <<EOSIGN
Paolo Giarrusso, aka Blaisorblade
Linux Kernel 2.4.21/2.6.0-test on an i686; Linux registered user n. 292729
EOSIGN




-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

  reply	other threads:[~2003-09-17 18:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-16 18:29 [uml-devel] compile error with 2.4.22-uml4 and 2.4.23-pre4-djc2-4um Matthew R. Scott
2003-09-17 11:29 ` BlaisorBlade [this message]
2003-09-17 22:20   ` [uml-devel] compile error ...(now tracked down) Jeff Dike
2003-11-10  1:23 ` [uml-devel] compile error with 2.4.22-uml4 and 2.4.23-pre4-djc2-4um Jeff Dike
  -- strict thread matches above, loose matches on Subject: below --
2003-09-17 22:48 [uml-devel] compile error ...(now tracked down) Steve Schmidtke
2003-09-18  0:25 ` Jeff Dike

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200309171329.57323.blaisorblade_spam@yahoo.it \
    --to=blaisorblade_spam@yahoo.it \
    --cc=user-mode-linux-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox