Re: Problem with GNU Mach compilation

2018-06-27 Thread Almudena Garcia
Finally, I got to solve the problem, adding a few flags to Makefile.am

http://dpaste.com/2NRGESV

I attach the patch file

2018-06-25 18:13 GMT+02:00 Almudena Garcia :

> HHi all:
>
> I'm trying to compile GNU Mach from GNU Hurd, using the sources from git
> repository.
>
> I based on this guide: https://www.gnu.org/software/
> hurd/microkernel/mach/gnumach/building.html
> But, during the latest step (make gnumach.gz), It returns a linker error
> (I attach the log file)
>
> My steps were these:
>
> -
>
> git clone git://git.savannah.gnu.org/hurd/gnumach.git
> cd gnumach/
>
> apt-get build-dep gnumach
>
> autoreconf --install
>
> mkdir build
> cd build/
>
> ./configure --prefix=
> make DESTDIR=~/gnu install-data
>
> git clone git://git.savannah.gnu.org/hurd/mig.git
> cd mig
>
> autoreconf --install
>
> mkdir build
> cd build
>
> GNU=~/gnu
>
> TARGET_CPPFLAGS=-I"$GNU"/include ../configure --prefix="$GNU"
>
> PATH=~/gnu/bin:$PATH
> export PATH
>
> cd ../.. #Return to gnumach/build
>
> mig
> make gnumach.gz
>
>
> How can I solve this?
>
>
55c55
< 	-fno-builtin-log
---
> 	-fno-builtin-log --no-pie --no-pic

Re: Problem with GNU Mach compilation

2018-06-27 Thread Samuel Thibault
Almudena Garcia, le mer. 27 juin 2018 18:12:53 +0200, a ecrit:
> I attach the patch file

Please use diff -u, not just diff.

Samuel



Re: Problem with GNU Mach compilation

2018-06-27 Thread Almudena Garcia
The last patch file was wrong to generate. I attach a better patch file

2018-06-27 18:12 GMT+02:00 Almudena Garcia :

> Finally, I got to solve the problem, adding a few flags to Makefile.am
>
> http://dpaste.com/2NRGESV
>
> I attach the patch file
>
> 2018-06-25 18:13 GMT+02:00 Almudena Garcia :
>
>> HHi all:
>>
>> I'm trying to compile GNU Mach from GNU Hurd, using the sources from git
>> repository.
>>
>> I based on this guide: https://www.gnu.org/software/h
>> urd/microkernel/mach/gnumach/building.html
>> But, during the latest step (make gnumach.gz), It returns a linker error
>> (I attach the log file)
>>
>> My steps were these:
>>
>> -
>>
>> git clone git://git.savannah.gnu.org/hurd/gnumach.git
>> cd gnumach/
>>
>> apt-get build-dep gnumach
>>
>> autoreconf --install
>>
>> mkdir build
>> cd build/
>>
>> ./configure --prefix=
>> make DESTDIR=~/gnu install-data
>>
>> git clone git://git.savannah.gnu.org/hurd/mig.git
>> cd mig
>>
>> autoreconf --install
>>
>> mkdir build
>> cd build
>>
>> GNU=~/gnu
>>
>> TARGET_CPPFLAGS=-I"$GNU"/include ../configure --prefix="$GNU"
>>
>> PATH=~/gnu/bin:$PATH
>> export PATH
>>
>> cd ../.. #Return to gnumach/build
>>
>> mig
>> make gnumach.gz
>>
>>
>> How can I solve this?
>>
>>
>
--- ../gnumach2/Makefile.am	2018-06-19 18:30:40.0 +0200
+++ ./Makefile.am	2018-06-27 17:52:01.0 +0200
@@ -52,7 +52,7 @@
 	-I$(top_srcdir)/include
 
 AM_CFLAGS += \
-	-fno-builtin-log
+	-fno-builtin-log --no-pie --no-pic
 
 # Yes, this makes the eyes hurt.  But perhaps someone will finally take care of
 # all that scruffy Mach code...  Also see .

Re: Problem with GNU Mach compilation

2018-06-27 Thread Almudena Garcia
Yes, I just send a fixed patch file, with diff -u

2018-06-27 18:17 GMT+02:00 Samuel Thibault :

> Almudena Garcia, le mer. 27 juin 2018 18:12:53 +0200, a ecrit:
> > I attach the patch file
>
> Please use diff -u, not just diff.
>
> Samuel
>


Re: Problem with GNU Mach compilation

2018-06-27 Thread Almudena Garcia
Have you received my latest patch?

2018-06-27 18:18 GMT+02:00 Almudena Garcia :

> Yes, I just send a fixed patch file, with diff -u
>
> 2018-06-27 18:17 GMT+02:00 Samuel Thibault :
>
>> Almudena Garcia, le mer. 27 juin 2018 18:12:53 +0200, a ecrit:
>> > I attach the patch file
>>
>> Please use diff -u, not just diff.
>>
>> Samuel
>>
>
>


Re: Problem with GNU Mach compilation

2018-06-27 Thread Samuel Thibault
Almudena Garcia, le mer. 27 juin 2018 18:16:21 +0200, a ecrit:
> - -fno-builtin-log
> + -fno-builtin-log --no-pie --no-pic

I'm surprised by the form of the option.  I would have thought rather

-no-pie -fno-pic

which are documented, while the options above are not. Could you try
them instead?

Samuel



Re: Problem with GNU Mach compilation

2018-06-27 Thread Almudena Garcia
I don't be sure. I asked in #hurd Freenode channel, and one person
suggested me to add this flags

2018-06-27 21:45 GMT+02:00 Samuel Thibault :

> Almudena Garcia, le mer. 27 juin 2018 18:16:21 +0200, a ecrit:
> > - -fno-builtin-log
> > + -fno-builtin-log --no-pie --no-pic
>
> I'm surprised by the form of the option.  I would have thought rather
>
> -no-pie -fno-pic
>
> which are documented, while the options above are not. Could you try
> them instead?
>
> Samuel
>


Re: Problem with GNU Mach compilation

2018-06-27 Thread Almudena Garcia
This is the conversation

2018-06-27 22:06 GMT+02:00 Almudena Garcia :

> I don't be sure. I asked in #hurd Freenode channel, and one person
> suggested me to add this flags
>
> 2018-06-27 21:45 GMT+02:00 Samuel Thibault :
>
>> Almudena Garcia, le mer. 27 juin 2018 18:16:21 +0200, a ecrit:
>> > - -fno-builtin-log
>> > + -fno-builtin-log --no-pie --no-pic
>>
>> I'm surprised by the form of the option.  I would have thought rather
>>
>> -no-pie -fno-pic
>>
>> which are documented, while the options above are not. Could you try
>> them instead?
>>
>> Samuel
>>
>
>


IRC.text
Description: application/extension-text


Re: Problem with GNU Mach compilation

2018-06-27 Thread Samuel Thibault
Almudena Garcia, le mer. 27 juin 2018 22:06:32 +0200, a ecrit:
> I don't be sure. I asked in #hurd Freenode channel, and one person suggested 
> me
> to add this flags

Ok, but could you test these instead?

-no-pie -fno-pic

Samuel



Re: Problem with GNU Mach compilation

2018-06-27 Thread Almudena Garcia
Ok, I'll try it

2018-06-27 22:14 GMT+02:00 Samuel Thibault :

> Almudena Garcia, le mer. 27 juin 2018 22:06:32 +0200, a ecrit:
> > I don't be sure. I asked in #hurd Freenode channel, and one person
> suggested me
> > to add this flags
>
> Ok, but could you test these instead?
>
> -no-pie -fno-pic
>
> Samuel
>


Re: Problem with GNU Mach compilation

2018-06-27 Thread Almudena Garcia
I've just to try the flags what you suggested, and this also runs correctly

2018-06-27 22:15 GMT+02:00 Almudena Garcia :

> Ok, I'll try it
>
> 2018-06-27 22:14 GMT+02:00 Samuel Thibault :
>
>> Almudena Garcia, le mer. 27 juin 2018 22:06:32 +0200, a ecrit:
>> > I don't be sure. I asked in #hurd Freenode channel, and one person
>> suggested me
>> > to add this flags
>>
>> Ok, but could you test these instead?
>>
>> -no-pie -fno-pic
>>
>> Samuel
>>
>
>


Re: Enable SMP support

2018-06-27 Thread Almudena Garcia
After to solve the compilation problems, We continue with our SMP work.

We have fixed many little errors and now have just found another big
problem, this time with pmap.c

This feels a problem about page tables and MMU, which feels aren't
implemented for many CPUs

I attach a patch will all changes that we have applied, and the log of the
latest compilation.


Can you help me?

2018-06-19 17:22 GMT+02:00 Joshua Branson :

> Almudena Garcia  writes:
>
> > Here attach the patch files.
> >
> > About the sources, the gnumach apt sources are dated in 2018/02/18, so
> It don't includes your latest fixes.
> >
> > How can I download sources from git repository?
>
> I believe the gnumach repo is located here:
>
> git clone git://git.sv.gnu.org/hurd/gnumach.git
>
> You can find more info underneath the heading, "Instant Development
> Environment".
>
> https://www.gnu.org/software/hurd/contributing.html
> >
> > 2018-06-19 2:26 GMT+02:00 Samuel Thibault :
> >
> >  Hello,
> >
> >  Almudena Garcia, le lun. 18 juin 2018 21:16:28 +0200, a ecrit:
> >  > [1]http://dpaste.com/32VFE37
> >  >
> >  > [2]http://dpaste.com/1F3YETN
> >
> >  Please post them as attached text files to your mail, so review can take
> >  place.
> >
> >  > But my sources were downloaded from apt, so these are outdated.
> >
> >  gnumach doesn't change that fast :)
> >
> >  Samuel
>
>
make  all-recursive
make[1]: Entering directory '/home/diwou/gnumach/build'
make[2]: Entering directory '/home/diwou/gnumach/build'
depbase=`echo i386/intel/pmap.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
gcc -DHAVE_CONFIG_H -I. -I..  -ffreestanding -nostdinc -imacros config.h -Ii386 -I. -I../i386 -I../i386/include/mach/sa -I../include  -fno-builtin-log --no-pie --no-pic -Wall -fgnu89-inline -fno-strict-aliasing -fno-stack-protector  -mno-3dnow -mno-mmx -mno-sse -mno-sse2 -g -O2 -MT i386/intel/pmap.o -MD -MP -MF $depbase.Tpo -c -o i386/intel/pmap.o ../i386/intel/pmap.c &&\
mv -f $depbase.Tpo $depbase.Po
In file included from ../kern/thread.h:50:0,
 from ../i386/intel/pmap.c:65:
../kern/sched_prim.h:188:1: warning: parameter names (without types) in function declaration
 extern void cause_ast_check(processor); /*new*/
 ^~
In file included from ../i386/intel/pmap.c:65:0:
../kern/thread.h:348:1: warning: parameter names (without types) in function declaration
 extern void cause_ast_check(processor); /*new*/
 ^~
../i386/intel/pmap.c: In function ‘pmap_map_bd’:
../i386/intel/pmap.c:238:8: warning: implicit declaration of function ‘splvm’ [-Wimplicit-function-declaration]
  spl = splvm(); \
^
../i386/intel/pmap.c:253:2: note: in expansion of macro ‘SPLVM’
  SPLVM(spl); \
  ^
../i386/intel/pmap.c:546:2: note: in expansion of macro ‘PMAP_READ_LOCK’
  PMAP_READ_LOCK(pmap, spl);
  ^~
In file included from ../kern/lock.h:41:0,
 from ../kern/queue.h:38,
 from ../kern/mach_clock.h:31,
 from ../kern/thread.h:46,
 from ../i386/intel/pmap.c:65:
../i386/intel/pmap.c:546:17: error: ‘pmap’ undeclared (first use in this function)
  PMAP_READ_LOCK(pmap, spl);
 ^
./machine/lock.h:50:31: note: in definition of macro ‘_simple_lock_xchg_’
   : "0" (new_val), "m" (*(lock)) : "memory" \
   ^~~~
../i386/intel/pmap.c:255:2: note: in expansion of macro ‘simple_lock’
  simple_lock(&(pmap)->lock); \
  ^~~
../i386/intel/pmap.c:546:2: note: in expansion of macro ‘PMAP_READ_LOCK’
  PMAP_READ_LOCK(pmap, spl);
  ^~
../i386/intel/pmap.c:546:17: note: each undeclared identifier is reported only once for each function it appears in
  PMAP_READ_LOCK(pmap, spl);
 ^
./machine/lock.h:50:31: note: in definition of macro ‘_simple_lock_xchg_’
   : "0" (new_val), "m" (*(lock)) : "memory" \
   ^~~~
../i386/intel/pmap.c:255:2: note: in expansion of macro ‘simple_lock’
  simple_lock(&(pmap)->lock); \
  ^~~
../i386/intel/pmap.c:546:2: note: in expansion of macro ‘PMAP_READ_LOCK’
  PMAP_READ_LOCK(pmap, spl);
  ^~
../i386/intel/pmap.c:244:2: warning: implicit declaration of function ‘splx’ [-Wimplicit-function-declaration]
  splx(spl); \
  ^
../i386/intel/pmap.c:266:2: note: in expansion of macro ‘SPLX’
  SPLX(spl); \
  ^~~~
../i386/intel/pmap.c:575:2: note: in expansion of macro ‘PMAP_READ_UNLOCK’
  PMAP_READ_UNLOCK(pmap, spl);
  ^~~~
In file included from ../i386/intel/pmap.c:63:0:
../i386/intel/pmap.c: In function ‘pmap_enter’:
../i386/intel/pmap.c:1866:13: warning: format ‘%p’ expects argument of type ‘void *’, but argument 5 has type ‘vm_offset_t {aka long unsigned int}’ [-Wformat=]
   panic("pmap_enter(%p, %p) falls in physical memory area!\n", v, pa);
 ^
../kern/debug.h:67:43: note: in definition of macro ‘panic’
  Panic (__FILE__, __LINE__, __FUNCTION__, s, ##__VA_ARGS__)
   ^
../i386/intel/pmap.c:1866:13: war

Re: Problem with GNU Mach compilation

2018-06-27 Thread Samuel Thibault
Almudena Garcia, le mer. 27 juin 2018 22:27:48 +0200, a ecrit:
> I've just to try the flags what you suggested, and this also runs correctly

Cool, thanks for the test!

Samuel



Re: Enable SMP support

2018-06-27 Thread Samuel Thibault
Hello,

Almudena Garcia, le mer. 27 juin 2018 22:37:55 +0200, a ecrit:
> ../kern/sched_prim.h:188:1: warning: parameter names (without types) in 
> function declaration
>  extern void cause_ast_check(processor); /*new*/

Yes, the type for processor is needed, see the patch I have now commited.

>  /* More-specific code must define cpu_number() and CPU_NUMBER.  */
>  #define  CX(addr, reg)   addr(,reg,4)
> +#define CPU_NUMBER(reg) /*XXX: we think this is not right, but we wanted to 
> bypass the compiling error. Please review. */

It will have to contain the assembler code to get the CPU number indeed.

> diff -Naur '--exclude=.git' gnumach/kern/sched_prim.h 
> gnumach-dev/kern/sched_prim.h
> --- gnumach/kern/sched_prim.h 2018-06-27 16:52:47.0 -0400
> +++ gnumach-dev/kern/sched_prim.h 2018-06-27 15:36:46.0 -0400
> +extern void cause_ast_check(processor); /*new*/

> diff -Naur '--exclude=.git' gnumach/kern/thread.h gnumach-dev/kern/thread.h
> --- gnumach/kern/thread.h 2018-06-27 16:52:47.0 -0400
> +++ gnumach-dev/kern/thread.h 2018-06-27 15:36:46.0 -0400
> +extern void cause_ast_check(processor); /*new*/

There is no need to declare it twice.  I have just declared it in a
proper place instead.

Samuel



Re: Enable SMP support

2018-06-27 Thread Almudena Garcia
>
> *Yes, the type for processor is needed, see the patch I have now commited.*
>

Ok. I've just to apply your patches and copy my cpu_number() function in
kern/cpu_number.h.
The latest compilation problems have disappeared, but there are any errors
yet.


>
>
> *>  /* More-specific code must define cpu_number() and CPU_NUMBER.  */>
> #define  CX(addr, reg)   addr(,reg,4) > +#define CPU_NUMBER(reg) /*XXX:
> we think this is not right, but we wanted to bypass the compiling error.
> Please review. */*
>
> *It will have to contain the assembler code to get the CPU number indeed.*
>

Now we have to add the cpu_number() function in this file.


2018-06-27 23:42 GMT+02:00 Samuel Thibault :

> Hello,
>
> Almudena Garcia, le mer. 27 juin 2018 22:37:55 +0200, a ecrit:
> > ../kern/sched_prim.h:188:1: warning: parameter names (without types) in
> function declaration
> >  extern void cause_ast_check(processor); /*new*/
>
> Yes, the type for processor is needed, see the patch I have now commited.
>
> >  /* More-specific code must define cpu_number() and CPU_NUMBER.  */
> >  #define  CX(addr, reg)   addr(,reg,4)
> > +#define CPU_NUMBER(reg) /*XXX: we think this is not right, but we
> wanted to bypass the compiling error. Please review. */
>
> It will have to contain the assembler code to get the CPU number indeed.
>
> > diff -Naur '--exclude=.git' gnumach/kern/sched_prim.h
> gnumach-dev/kern/sched_prim.h
> > --- gnumach/kern/sched_prim.h 2018-06-27 16:52:47.0 -0400
> > +++ gnumach-dev/kern/sched_prim.h 2018-06-27 15:36:46.0 -0400
> > +extern void cause_ast_check(processor); /*new*/
>
> > diff -Naur '--exclude=.git' gnumach/kern/thread.h
> gnumach-dev/kern/thread.h
> > --- gnumach/kern/thread.h 2018-06-27 16:52:47.0 -0400
> > +++ gnumach-dev/kern/thread.h 2018-06-27 15:36:46.0 -0400
> > +extern void cause_ast_check(processor); /*new*/
>
> There is no need to declare it twice.  I have just declared it in a
> proper place instead.
>
> Samuel
>