linux-um archives
 help / color / mirror / Atom feed
* [uml-devel] compile error with 2.4.22-uml4 and 2.4.23-pre4-djc2-4um
@ 2003-09-16 18:29 Matthew R. Scott
  2003-09-17 11:29 ` [uml-devel] compile error ...(now tracked down) BlaisorBlade
  2003-11-10  1:23 ` [uml-devel] compile error with 2.4.22-uml4 and 2.4.23-pre4-djc2-4um Jeff Dike
  0 siblings, 2 replies; 4+ messages in thread
From: Matthew R. Scott @ 2003-09-16 18:29 UTC (permalink / raw)
  To: user-mode-linux-devel


With both of these patches I am getting the following error during compile:

gcc-2.95   -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing 
-fno-common -march=pentium -O3 -pipe -fomit-frame-pointer -U__i386__ -Ui386 
-DUM_FASTCALL -g -D__arch_um__ -DSUBARCH=\"i386\" -D_LARGEFILE64_SOURCE  -I/
home/gldnspud/uml/build/buildkernel-build/linux/arch/um/include -I/home/
gldnspud/uml/build/buildkernel-build/linux/arch/um/kernel/tt/include -I/home/
gldnspud/uml/build/buildkernel-build/linux/arch/um/kernel/skas/include 
-D_GNU_SOURCE -c -o umid.o umid.c
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 `.'
make[4]: *** [umid.o] Error 1
make[4]: Leaving directory `/home/gldnspud/uml/build/buildkernel-build/linux/
arch/um/kernel'
make[3]: *** [first_rule] Error 2
make[3]: Leaving directory `/home/gldnspud/uml/build/buildkernel-build/linux/
arch/um/kernel'
make[2]: *** [_dir_arch/um/kernel] Error 2
make[2]: Leaving directory `/home/gldnspud/uml/build/buildkernel-build/linux'
make[1]: *** [buildkernel-build-stamp] Error 2
make[1]: Leaving directory `/home/gldnspud/uml/build'
make: *** [build-stamp] Error 2

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.


-- 
Matthew R. Scott
OMAjA / http://www.omaja.com/



-------------------------------------------------------
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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [uml-devel] compile error ...(now tracked down)
  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
  2003-09-17 22:20   ` 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
  1 sibling, 1 reply; 4+ messages in thread
From: BlaisorBlade @ 2003-09-17 11:29 UTC (permalink / raw)
  To: user-mode-linux-devel

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [uml-devel] compile error ...(now tracked down)
  2003-09-17 11:29 ` [uml-devel] compile error ...(now tracked down) BlaisorBlade
@ 2003-09-17 22:20   ` Jeff Dike
  0 siblings, 0 replies; 4+ messages in thread
From: Jeff Dike @ 2003-09-17 22:20 UTC (permalink / raw)
  To: BlaisorBlade, Steve Schmidtke; +Cc: user-mode-linux-devel

blaisorblade_spam@yahoo.it said:
> # define st_atime st_atim.tv_sec        /* Backward compatibility.  */
	...
>                 .st_atime   = src->st_atime,   /* time of last access */ 

This is just because of the names of the struct uml_stat.  Changing those
field names should fix the compile problem.

				Jeff



-------------------------------------------------------
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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [uml-devel] compile error with 2.4.22-uml4 and 2.4.23-pre4-djc2-4um
  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 ` [uml-devel] compile error ...(now tracked down) BlaisorBlade
@ 2003-11-10  1:23 ` Jeff Dike
  1 sibling, 0 replies; 4+ messages in thread
From: Jeff Dike @ 2003-11-10  1:23 UTC (permalink / raw)
  To: Matthew R. Scott; +Cc: user-mode-linux-devel

user-mode-linux-devel@goldenspud.com said:
> 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. 

This should be fixed now.  The problem was that those field names were
#defined in a header to be something else.

				Jeff



-------------------------------------------------------
This SF.Net email sponsored by: ApacheCon 2003,
16-19 November in Las Vegas. Learn firsthand the latest
developments in Apache, PHP, Perl, XML, Java, MySQL,
WebDAV, and more! http://www.apachecon.com/
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-11-10  1:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [uml-devel] compile error ...(now tracked down) BlaisorBlade
2003-09-17 22:20   ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox