Re: NULL struct to futimes does not return current date/time on GNU/Hurd

2006-10-10 Thread Roland McGrath
> Roland, what do you prefer?  Based on that I will then send in patches
> also for the other *utimes.c files, which have similar problems, as the
> code looks like.

I haven't figured out what you think this is fixing.


___
Bug-hurd mailing list
Bug-hurd@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-hurd


Re: NULL struct to futimes does not return current date/time on GNU/Hurd

2006-10-10 Thread Samuel Thibault
Roland McGrath, le Tue 10 Oct 2006 00:16:25 -0700, a écrit :
> > Roland, what do you prefer?  Based on that I will then send in patches
> > also for the other *utimes.c files, which have similar problems, as the
> > code looks like.
> 
> I haven't figured out what you think this is fixing.

Glibc is compiled with -fstrict-aliasing, and hence casts like
*(time_value_t*)&tvp[0]
don't propagate the "value is used" property, according to
strict C aliasing rules.  As a result, the

timevals[1].tv_usec = timevals[0].tv_usec = (time_t)-1;

statement is just optimized out!  See attached program that reproduces
the behavior of futimes.  Before 4.0, gcc was not able to optimize such
cases, but now it is.

Another solution would of course be to compile glibc with
-fno-strict-aliasing, but that will probably prevent a bunch of
optimizations.

Samuel
#include "test2.h"

struct a {
int a;
int b;
};

void f(const struct a a[2]) {
struct a _a[2];
if (!go) {
_a[0].a = 5;
_a[0].b = 6;
_a[1].a = 7;
_a[1].b = 8;
a = _a;
}
print(*(struct foo*)&a[0]);
print(*(struct foo*)&a[1]);
}

int main(void) {
struct a a[2] = { { 1, 2 }, { 3, 4 } };
f(a);
return 0;
}
#include 
#include "test2.h"
int go;
void print(struct foo foo) {
printf("%d %d\n",foo.a1,foo.a2);
}
struct foo {
int a1;
int a2;
};
extern int go;
void print(struct foo foo);
___
Bug-hurd mailing list
Bug-hurd@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-hurd


Re: mach4 & gnumach/oskit...

2006-10-10 Thread Thomas Schwinge
Hello!

On Sun, Oct 08, 2006 at 02:20:06AM -0400, Mach wrote:
> Hi, I was interested in jumping back into playing around with lites/mach..
> Anyway I'm having a really hard time building any mach system.
> 
> I've tried the mach4 source under Slakware 7.1, it builds, but is unable to
> boot.  I've also tried to build mach4 under NetBSD1.1 & Lites 1.1, again it
> builds but fails to boot.

One issue might be that compilers (GCC) are much smarter and aggressive
(w.r.t. optimizations) now than they were fifteen years ago and thus
simply mis-compile code as it was written at that time.  See
 for one example.  You might succeed
when using GCC 2.95.3 and similar stuff...


> I've tried to build gnumach, but I need libc & other stuff from hurd,

That's not true in this form.  To build the GNU Mach from
gnumach-1-branch (which is the only one that is supported at the moment)
nothing special is needed, apart from the usual tools and a C library for
the system you intend to run the kernel on.  But that certainly doesn't
need to be a Hurd one.  Can you show how it fails to build?  What system
are you building on and what system is the kernel supposed to run on?
(GNU Mach is i386-only so far.)


> So finally Id like to try oskit mach.

OSKit Mach is unfinished and completely unmaintained and will most
probably not be revived, as OSKit is dead and there is no replacement for
OSKit.


> Also what system can successfully build a mach4/oskit-gnumach kernel?  I'm
> really confused with the kernels that compile but silently fail.

Use the gnumach-1-branch; see
.


Please continue to report how this works out!


Regards,
 Thomas


signature.asc
Description: Digital signature
___
Bug-hurd mailing list
Bug-hurd@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-hurd


Re: mach 4

2006-10-10 Thread Thomas Schwinge
Hello!

On Fri, Oct 06, 2006 at 11:56:30PM +0900, girish wrote:
> >>my plan is to port mach kernel to MIPS Malta evaluation board.  i   
> >>have done some experience on porting NetBSD & Linux kernels for  
> >>MIPS  Malta board. idea is to experiment with mach threads vis-a- 
> >>vis NPTL/ TLS of MIPS.
> >>
> >>where should i start - with mach4?
> 
> i am more keen on Mach4!
> because i couldn't find much of Mach4 info i started off with reading  
> GNUMACH.

GNU Mach is basically a somewhat maintained fork on Mach 4.  I would
suggest to use the gnumach-1-branch; see
.


Regards,
 Thomas


signature.asc
Description: Digital signature
___
Bug-hurd mailing list
Bug-hurd@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-hurd


Re: NULL struct to futimes does not return current date/time on GNU/Hurd

2006-10-10 Thread Roland McGrath
Thanks for the clarification.  I committed a libc change that should work.


___
Bug-hurd mailing list
Bug-hurd@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-hurd


Re: NULL struct to futimes does not return current date/time on GNU/Hurd

2006-10-10 Thread Samuel Thibault
Roland McGrath, le Tue 10 Oct 2006 02:29:12 -0700, a écrit :
> Thanks for the clarification.  I committed a libc change that should work.

Thanks.  Unions make the "may alias" link, indeed.

Samuel


___
Bug-hurd mailing list
Bug-hurd@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-hurd


Re: mach4 & gnumach/oskit...

2006-10-10 Thread Thomas Schwinge
Hello again!

On Tue, Oct 10, 2006 at 11:16:26AM +0200, I wrote:
> On Sun, Oct 08, 2006 at 02:20:06AM -0400, Mach wrote:
> > I've tried to build gnumach, but I need libc & other stuff from hurd,
> 
> That's not true in this form.  To build the GNU Mach from
> gnumach-1-branch (which is the only one that is supported at the moment)
> nothing special is needed, apart from the usual tools and a C library for
> the system you intend to run the kernel on.

I forgot: you also need to have GNU MIG installed.  On
 I once put some
notes about how to build all that.  They should still be accurate, I
think.


Regards,
 Thomas


signature.asc
Description: Digital signature
___
Bug-hurd mailing list
Bug-hurd@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-hurd


Re: NULL struct to futimes does not return current date/time on GNU/Hurd

2006-10-10 Thread Samuel Thibault
Roland McGrath, le Tue 10 Oct 2006 02:29:12 -0700, a écrit :
> Thanks for the clarification.  I committed a libc change that should work.

sysdeps/mach/hurd/adjtime.c
sysdeps/mach/hurd/fstatvfs.c
sysdeps/mach/hurd/fstatvfs64.c
sysdeps/mach/hurd/readdir.c
sysdeps/mach/hurd/readdir_r.c
sysdeps/mach/hurd/settimeofday.c
sysdeps/mach/hurd/statvfs.c
sysdeps/mach/hurd/statvfs64.c
sysdeps/mach/hurd/xstatconv.c

probably need correcting too.

Samuel


___
Bug-hurd mailing list
Bug-hurd@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-hurd


Re: mach 4

2006-10-10 Thread girish


Thanks.

Currently I am trying that branch on a MIPS port. There are some  
headers missing included from locore.S file. I am working on it.


On Oct 10, 2006, at 6:20 PM, Thomas Schwinge wrote:


Hello!

On Fri, Oct 06, 2006 at 11:56:30PM +0900, girish wrote:

my plan is to port mach kernel to MIPS Malta evaluation board.  i
have done some experience on porting NetBSD & Linux kernels for
MIPS  Malta board. idea is to experiment with mach threads vis-a-
vis NPTL/ TLS of MIPS.

where should i start - with mach4?


i am more keen on Mach4!
because i couldn't find much of Mach4 info i started off with reading
GNUMACH.


GNU Mach is basically a somewhat maintained fork on Mach 4.  I would
suggest to use the gnumach-1-branch; see
.


Regards,
 Thomas




___
Bug-hurd mailing list
Bug-hurd@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-hurd


Re: NULL struct to futimes does not return current date/time on GNU/Hurd

2006-10-10 Thread Samuel Thibault
Samuel Thibault, le Tue 10 Oct 2006 11:35:12 +0200, a écrit :
> Roland McGrath, le Tue 10 Oct 2006 02:29:12 -0700, a écrit :
> > Thanks for the clarification.  I committed a libc change that should work.
> 
> Thanks.  Unions make the "may alias" link, indeed.

Oops, union fields indeed alias between each other (that's a gcc
extension of the C standard), but the remaining cast is still doubtful:

  const union tv *u = (const union tv *) tvp;

gcc won't consider that u and tvp may alias.  Now, it happens that this
works, since glibc is currently not compiled with optimization across
modules, hence tvp is always correctly filled by the caller.

Samuel


___
Bug-hurd mailing list
Bug-hurd@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-hurd


Re: NULL struct to futimes does not return current date/time on GNU/Hurd

2006-10-10 Thread Samuel Thibault
And BTW, although char * aliases with any other pointer type, int*
doesn't. IIRC, I saw some casts involving int*.

Samuel


___
Bug-hurd mailing list
Bug-hurd@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-hurd


Re: NULL struct to futimes does not return current date/time on GNU/Hurd

2006-10-10 Thread Thomas Schwinge
Hey Roland!  Aren't you supposed to cure your wrist?

On Tue, Oct 10, 2006 at 02:29:12AM -0700, Roland McGrath wrote:
> Thanks for the clarification.  I committed a libc change that should work.

Confirmed that it works.


But may I ask why you didn't like the function to be the way Samuel and I
proposed:

#v+
int
__futimes (int fd, const struct timeval tvp[2])
{
  error_t err;
  time_value_t new_atime, new_mtime;

  if (tvp == NULL)
  /* Setting the number of microseconds to `-1' tells the
 underlying filesystems to use the current time.  */
new_atime.microseconds = new_mtime.microseconds = -1;
  else
{
  new_atime.seconds = tvp[0].tv_sec;
  new_atime.microseconds = tvp[0].tv_usec;
  new_mtime.seconds = tvp[1].tv_sec;
  new_mtime.microseconds = tvp[1].tv_usec;
}

  err = HURD_DPORT_USE (fd, __file_utimes (port, new_atime, new_mtime));
  return err ? __hurd_dfail (fd, err) : 0;
}
#v-

Compared to yours:

#v+
int
__futimes (int fd, const struct timeval tvp[2])
{
  union tv
  {
struct timeval tv;
time_value_t tvt;
  };
  const union tv *u = (const union tv *) tvp;
  union tv nulltv[2];
  error_t err;

  if (tvp == NULL)
{
  /* Setting the number of microseconds to `-1' tells the
 underlying filesystems to use the current time.  */
  nulltv[0].tvt.microseconds = nulltv[1].tvt.microseconds = -1;
  u = nulltv;
}

  err = HURD_DPORT_USE (fd, __file_utimes (port, u[0].tvt, u[1].tvt));
  return err ? __hurd_dfail (fd, err) : 0;
#v-

... ours needs to copy the four values for `tvp != NULL', but avoids the
union and the cast you need in yours.


And by the way: why do we need both `struct timeval' and `struct
time_value'?  Given that we nevertheless assume them to be equal in the
code, isn't there a way to get rid of Mach's `struct time_value'?


Regards,
 Thomas


signature.asc
Description: Digital signature
___
Bug-hurd mailing list
Bug-hurd@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-hurd


Re: NULL struct to futimes does not return current date/time on GNU/Hurd

2006-10-10 Thread Roland McGrath
> But may I ask why you didn't like the function to be the way Samuel and I
> proposed:

Did you look at the code generated and verify that it is no less efficient?


___
Bug-hurd mailing list
Bug-hurd@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-hurd


Re: NULL struct to futimes does not return current date/time on GNU/Hurd

2006-10-10 Thread Roland McGrath
> sysdeps/mach/hurd/adjtime.c

In this example there is no actual aliasing going on, the cast is the only
use of the pointer.  If any other cases really do have aliasing, then send
patches for those.

If the compiler is shown to deal optimally with passing args as
((time_value_t) { tv->tv_sec, tv->tv_usec })
or suchlike (or copying to named temporaries if you prefer), then changing
all the instances (utimes included) to be like that is fine with me too.


___
Bug-hurd mailing list
Bug-hurd@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-hurd


Re: NULL struct to futimes does not return current date/time on GNU/Hurd

2006-10-10 Thread Samuel Thibault
Roland McGrath, le Tue 10 Oct 2006 11:34:10 -0700, a écrit :
> > sysdeps/mach/hurd/adjtime.c
> 
> In this example there is no actual aliasing going on, the cast is the only
> use of the pointer.

Indeed.  And since glibc is not compiled with inter-module optimizations
it does work, but with it and inlining, we might get surprises.

Samuel


___
Bug-hurd mailing list
Bug-hurd@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-hurd


[task #5975] TEST

2006-10-10 Thread Thomas Schwinge

URL:
  

 Summary: TEST
 Project: The GNU Hurd
Submitted by: tschwinge
Submitted on: Wednesday 10/11/06 at 01:33
Category: None
 Should Start On: Wednesday 10/11/06 at 00:00
   Should be Finished on: Wednesday 10/11/06 at 00:00
Priority: 1 - Later
  Status: None
 Privacy: Public
 Assigned to: None
Percent Complete: 0%
 Open/Closed: Open
 Planned Release: None
  Effort: 0.00
   To be done before: 

___

Details:

This task is only for testing Savannah stuff.







___

Reply to this item at:

  

___
  Message sent via/by Savannah
  http://savannah.gnu.org/



___
Bug-hurd mailing list
Bug-hurd@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-hurd


[task #5975] TEST

2006-10-10 Thread Thomas Schwinge

Update of task #5975 (project hurd):

 Assigned to:None => tschwinge  
   To be done before: => Hm.
  


___

Reply to this item at:

  

___
  Message sent via/by Savannah
  http://savannah.gnu.org/



___
Bug-hurd mailing list
Bug-hurd@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-hurd


[task #5975] TEST

2006-10-10 Thread Thomas Schwinge

Update of task #5975 (project hurd):

   To be done before:   Hm.
 => Hm.  Hm.
 


___

Reply to this item at:

  

___
  Message sent via/by Savannah
  http://savannah.gnu.org/



___
Bug-hurd mailing list
Bug-hurd@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-hurd


[task #5975] TEST

2006-10-10 Thread Thomas Schwinge

Update of task #5975 (project hurd):

  Status:None => Cancelled  
 Open/Closed:Open => Closed 


___

Reply to this item at:

  

___
  Message sent via/by Savannah
  http://savannah.gnu.org/



___
Bug-hurd mailing list
Bug-hurd@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-hurd


[task #5956] Automake'ify GNU Mach's code base

2006-10-10 Thread Thomas Schwinge

Update of task #5956 (project hurd):

   To be done before: http://savannah.gnu.org/task/?5958 --- ``GNU MIG:
dependency information output''
Also: how to get these dependency files considered by the build system.

http://sourceware.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=automake&pr=492
--- ``Compilation of assembler files with subdir-objects''
Is being worked around.

http://lists.gnu.org/archive/html/autoconf/2006-10/msg5.html ---
``Inconsistency w.r.t. defining the same symbol more than once''
Could be worked around.

http://lists.gnu.org/archive/html/automake/2006-05/msg00038.html --- ``A
quick idea about dependencies w.r.t. files depending on `nodist_...'
files'''
Is being worked around.

TODO --- ``Dependency tracking of pre processed Assembler files''
Quite involved, but could be worked around.
 => http://savannah.gnu.org/task/?5958 --- ``GNU MIG: dependency information
output''
Also: how to get these dependency files considered by the build system.

http://sourceware.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=automake&pr=492
--- ``Compilation of assembler files with subdir-objects''
Is locally being worked around.

http://lists.gnu.org/archive/html/autoconf/2006-10/msg5.html ---
``Inconsistency w.r.t. defining the same symbol more than once''
Could locally be worked around.

http://lists.gnu.org/archive/html/automake/2006-05/msg00038.html --- ``A
quick idea about dependencies w.r.t. files depending on `nodist_...'
files'''
Is locally being worked around.

http://lists.gnu.org/archive/html/automake/2006-10/msg00023.html ---
``Dependency tracking of pre processed Assembler files''
Quite involved, but could locally be worked around.



___

Reply to this item at:

  

___
  Message sent via/by Savannah
  http://savannah.gnu.org/



___
Bug-hurd mailing list
Bug-hurd@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-hurd


[task #5491] Automake'ify the Hurd's code base

2006-10-10 Thread Thomas Schwinge

Update of task #5491 (project hurd):

   To be done before: http://savannah.gnu.org/task/?5956 ---
``Automake'ify GNU Mach's code base'' --- we need everything that has to be
done there, so do that first.

Think about how to marry libtool and the Hurd libraries.
 => http://savannah.gnu.org/task/?5956 --- ``Automake'ify GNU Mach's code
base''
We need everything that has to be done there, so do that first.

Think about how to marry libtool and the Hurd libraries (with respect to file
names, for example).



___

Reply to this item at:

  

___
  Message sent via/by Savannah
  http://savannah.gnu.org/



___
Bug-hurd mailing list
Bug-hurd@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-hurd


RE: mach4 & gnumach/oskit...

2006-10-10 Thread Mach
Ok I downloaded the gnumach & mig from the CVS and much to my amazement I
got mig to build.
(I did the "make no_deps=t install-headers" in gnumach 1st, and tweaked the
makefile to find the /include/mach direcotry.) 
Now going for gnumach it currently fails to build on gnumach/device/net_io.c
line 1182 in funciton net_set_filter parse error before 'void'

At first I thought the procedure above was missing a } but then I get errors
that most if not all the vars in the check_filter_list are invalid... So Im
not sure.

Im using Slakware 7.1 so my gcc is version egcs-2.91.66 19990314/Linux
(egcs-1.1.2 release).  I did have to install autoconf-2.54 if it matters to
anyone.

Im using this old version of Linux since I was able to build some mach/lites
stuff back around 2001.

Ill update my gcc later to say a 2.95.3 level and give it another shot.

Jason


___
Bug-hurd mailing list
Bug-hurd@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-hurd