unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] gnu: base: Add Glibc-Hurd Headers.
@ 2014-06-02 21:16 Manolis Ragkousis
  2014-08-29 13:48 ` Ludovic Courtès
  0 siblings, 1 reply; 7+ messages in thread
From: Manolis Ragkousis @ 2014-06-02 21:16 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: Guix-devel

[-- Attachment #1: Type: text/plain, Size: 1 bytes --]



[-- Attachment #2: 0001-gnu-base-Add-Glibc-Hurd-Headers.patch --]
[-- Type: text/x-patch, Size: 1934 bytes --]

From 1aa976c666db720008d3e77a7bccdfbae6b01962 Mon Sep 17 00:00:00 2001
From: Manolis Ragkousis <manolis837@gmail.com>
Date: Tue, 3 Jun 2014 00:11:47 +0000
Subject: [PATCH] gnu: base: Add Glibc-Hurd Headers.

* gnu/packages/base.scm (glibc/hurd-headers): New variable.
---
 gnu/packages/base.scm | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm
index 8faf797..ef4c4ae 100644
--- a/gnu/packages/base.scm
+++ b/gnu/packages/base.scm
@@ -646,6 +646,36 @@ with the Linux kernel.")
                       (zero? (system* "make" "localedata/install-locales")))
                     %standard-phases)))))))
 
+(define-public glibc/hurd-headers
+  (package (inherit glibc/hurd)
+    (name "glibc-hurd-headers")
+    (outputs `("out"))
+    (arguments
+     `(#:tests? #f
+       ,@(substitute-keyword-arguments (package-arguments glibc/hurd)
+           ((#:configure-flags _)
+            `(list "--enable-add-ons"
+                   "--host=i686-pc-gnu"
+                   ;; Installs NIS and RPC related headers that
+                   ;; are not installed by default
+                   "--enable-obsolete-rpc"))
+           ((#:phases _)
+            '(alist-replace
+              'install
+              (lambda* (#:key outputs #:allow-other-keys)
+                (let ((out (assoc-ref outputs "out")))
+                  (zero? (system* "make" "install-headers"))
+                  (close-port (open-output-file 
+                               (string-append out "/include/gnu/stubs.h")))))
+              (alist-delete
+               'build
+               (alist-cons-before
+                'configure 'pre-configure
+                (lambda _
+                  (substitute* "configure"
+                    (("/bin/pwd") "pwd")))
+                %standard-phases)))))))))
+
 (define-public tzdata
   (package
     (name "tzdata")
-- 
1.9.3


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

* Re: [PATCH] gnu: base: Add Glibc-Hurd Headers.
  2014-06-02 21:16 [PATCH] gnu: base: Add Glibc-Hurd Headers Manolis Ragkousis
@ 2014-08-29 13:48 ` Ludovic Courtès
  2014-09-24 13:01   ` Manolis Ragkousis
  0 siblings, 1 reply; 7+ messages in thread
From: Ludovic Courtès @ 2014-08-29 13:48 UTC (permalink / raw)
  To: Manolis Ragkousis; +Cc: Guix-devel

Hi, Manolis!

I have finally reviewed the 2 pending patches of yours that add
glibc-hurd and glibc-hurd-headers.  I’ve combined these 2 patches as
well as the hurd-minimal one into a single one to make a self-contained
patch.

I’ve then reviewed it, which led me to simplify a few things, and add a
bunch of FIXMEs, and pushed the result as the ‘wip-hurd’ branch.

Can you please check it out, look at all the FIXMEs, both in the .scm
and .patch files, address them, and post a patch here (no need for a
detailed commit log.)

The FIXMEs are about:

  • Things that are probably unneeded: if there are actually unneeded,
    please remove them, otherwise add a comment clearly stating why they
    are needed.

  • Workarounds that lack a justification, have an unclear
    justification, and/or lack a link to the relevant mailing list
    discussion.

If there is any FIXME that is unclear to you, please do let me know.

There are many workarounds being applied here, so it’s very important to
be rigorous in defining what they’re for so this can be maintained.

Also make sure that the result does not introduce any regressions with
the not-yet-reviewed cross-base.scm patch.

I think we’re on the right track now.  :-)

Thanks in advance, and again apologies for the looooong delay!

Ludo’.

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

* Re: [PATCH] gnu: base: Add Glibc-Hurd Headers.
  2014-08-29 13:48 ` Ludovic Courtès
@ 2014-09-24 13:01   ` Manolis Ragkousis
  2014-09-27  9:31     ` Ludovic Courtès
  0 siblings, 1 reply; 7+ messages in thread
From: Manolis Ragkousis @ 2014-09-24 13:01 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: Guix-devel

[-- Attachment #1: Type: text/plain, Size: 251 bytes --]

Taken care of the FIXME.

Just wanted to add that in base.scm, instead of gnu-gettext we needed
perl. Probably I changed it by mistake while rebasing some local
commits.

And thread_terminate does exist, that's why it's enough for our needs.

Manolis

[-- Attachment #2: 0001-Taken-care-of-FIXME.patch --]
[-- Type: text/x-patch, Size: 4393 bytes --]

From 0f169f370f4f3a6baf45b0020a461ae9844befb2 Mon Sep 17 00:00:00 2001
From: Manolis Ragkousis <manolis837@gmail.com>
Date: Thu, 18 Sep 2014 22:21:19 +0000
Subject: [PATCH] Taken care of FIXME.

---
 gnu/packages/base.scm                                   | 12 +++++-------
 gnu/packages/patches/hurd-minimal.patch                 |  4 +---
 gnu/packages/patches/libpthread-glibc-preparation.patch | 11 ++++-------
 3 files changed, 10 insertions(+), 17 deletions(-)

diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm
index 234194f..27c8fc1 100644
--- a/gnu/packages/base.scm
+++ b/gnu/packages/base.scm
@@ -533,7 +533,7 @@ with the Linux kernel.")
      `(,@(package-native-inputs glibc)
        ("patch/libpthread-patch" ,(search-patch "libpthread-glibc-preparation.patch"))
        ("mig" ,mig)
-       ("gettext" ,gnu-gettext)                   ;needed for FIXME
+       ("perl" ,perl)
        ("libpthread" ,(origin
                         (method git-fetch)
                         (uri (git-reference
@@ -548,12 +548,9 @@ with the Linux kernel.")
      (substitute-keyword-arguments (package-arguments glibc)
        ((#:configure-flags cf)
         `(append (list "--host=i686-pc-gnu"
-                       ;; Since Hurd supports only i686 disable everything
-                       ;; else.  FIXME: needed?
-                       ;"--disable-multi-arch"
 
                        ;; nscd fails to build for GNU/Hurd:
-                       ;; <http://lists.gnu.org/FIXME>.  Disable it.
+                       ;; <https://lists.gnu.org/archive/html/bug-hurd/2014-07/msg00006.html>.  Disable it.
                        "--disable-nscd")
                  ,cf))
        ((#:phases phases)
@@ -582,8 +579,9 @@ with the Linux kernel.")
           (lambda* (#:key outputs #:allow-other-keys)
             (and (zero? (system* "make" "install-headers"))
 
-                 ;; Make an empty stubs.h to work around FIXME.  See
-                 ;; <http://lists.gnu.org/FIXME>.
+                 ;; Make an empty stubs.h to work around not being able to
+                 ;; produce a valid stubs.h and causing the build to fail. See
+                 ;; <http://lists.gnu.org/archive/html/guix-devel/2014-04/msg00233.html>.
                  (let ((out (assoc-ref outputs "out")))
                    (close-port
                     (open-output-file
diff --git a/gnu/packages/patches/hurd-minimal.patch b/gnu/packages/patches/hurd-minimal.patch
index 60eb344..b551d5c 100644
--- a/gnu/packages/patches/hurd-minimal.patch
+++ b/gnu/packages/patches/hurd-minimal.patch
@@ -2,9 +2,7 @@ We want to build the Hurd's libihash very early so that we can then
 build libc.  Because of that, we cannot link against libc, and thus
 we miss 'clnt_create' and friends.
 
-See <http://lists.gnu.org/FIXME>.
-
-FIXME: Is this explanation correct?
+See <http://lists.gnu.org/archive/html/bug-hurd/2014-04/msg00116.html>.
 
 diff --git a/configure.ac b/configure.ac
 index f8856db..a381219 100644
diff --git a/gnu/packages/patches/libpthread-glibc-preparation.patch b/gnu/packages/patches/libpthread-glibc-preparation.patch
index 2862b76..fb13dd3 100644
--- a/gnu/packages/patches/libpthread-glibc-preparation.patch
+++ b/gnu/packages/patches/libpthread-glibc-preparation.patch
@@ -15,13 +15,10 @@ index 0000000..2cdbc71
 -- 
 1.9.0
 
-We are using a version of GNU Mach that lacks 'thread_terminate' (not
-introduced yet) and 'thread_terminate_release' (recently removed.)
-FIXME: really? Add URLs.
-
-The 'thread_terminate' RPC call will be enough for our needs.
+We are using a version of GNU Mach that lacks 'thread_terminate_release'
+(not introduced yet).The 'thread_terminate' RPC call will be enough for
+our needs.
 http://lists.gnu.org/archive/html/bug-hurd/2014-05/msg00127.html
-FIXME: then why not use it?
 
 diff --git a/libpthread/sysdeps/mach/pt-thread-terminate.c b/libpthread/sysdeps/mach/pt-thread-terminate.c
 index 6672065..129a611 100644
@@ -45,7 +42,7 @@ index 6672065..129a611 100644
 
 The __PTHREAD_SPIN_LOCK_INITIALIZER definition is missing, so we 
 define it to __SPIN_LOCK_INITIALIZER which already exists.
-See <http://lists.gnu.org/FIXME>.
+See http://lists.gnu.org/archive/html/commit-hurd/2009-04/msg00006.html
   
 diff --git a/libpthread/sysdeps/mach/bits/spin-lock.h b/libpthread/sysdeps/mach/bits/spin-lock.h
 index 537dac9..fca0e5a 100644
-- 
2.1.0


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

* Re: [PATCH] gnu: base: Add Glibc-Hurd Headers.
  2014-09-24 13:01   ` Manolis Ragkousis
@ 2014-09-27  9:31     ` Ludovic Courtès
  2014-09-27 13:50       ` Manolis Ragkousis
  0 siblings, 1 reply; 7+ messages in thread
From: Ludovic Courtès @ 2014-09-27  9:31 UTC (permalink / raw)
  To: Manolis Ragkousis; +Cc: Guix-devel

Manolis Ragkousis <manolis837@gmail.com> skribis:

> Taken care of the FIXME.

Thanks, I’ve merged it with the other commit on wip-hurd, and rebased it
on top of master.

> Just wanted to add that in base.scm, instead of gnu-gettext we needed
> perl. Probably I changed it by mistake while rebasing some local
> commits.

OK.

> And thread_terminate does exist, that's why it's enough for our needs.

You mean ‘thread_terminate_release’?  The comment in
libpthread-glibc-preparation.patch still reads:

--8<---------------cut here---------------start------------->8---
We are using a version of GNU Mach that lacks 'thread_terminate_release'
(not introduced yet).  The 'thread_terminate' RPC call will be enough for
our needs.
See <http://lists.gnu.org/archive/html/bug-hurd/2014-05/msg00127.html>.
--8<---------------cut here---------------end--------------->8---

Ludo’.

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

* Re: [PATCH] gnu: base: Add Glibc-Hurd Headers.
  2014-09-27  9:31     ` Ludovic Courtès
@ 2014-09-27 13:50       ` Manolis Ragkousis
  2014-09-27 17:30         ` Manolis Ragkousis
  0 siblings, 1 reply; 7+ messages in thread
From: Manolis Ragkousis @ 2014-09-27 13:50 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: Guix-devel

>> And thread_terminate does exist, that's why it's enough for our needs.
>
> You mean ‘thread_terminate_release’?

Okay, let me explain it a bit better

Here is the part we are interested in
"libpthread/sysdeps/mach/pt-thread-terminate.c"

  /* Terminate and release all that's left.  */
  err = __thread_terminate_release (kernel_thread, mach_task_self (),
                    kernel_thread, reply_port,
                    stackaddr, stacksize);

  /* The kernel does not support it yet.  Leak but at least terminate
     correctly.  */
  err = __thread_terminate (kernel_thread);

The comment  "The kernel does not support it yet." is misleading.
It wants to say that __thread_terminate_release is not yet supported
so __thread_terminate can be used instead, to at least terminate it
correctly, even though we will have leaks.

That's why Samuel told me here
http://lists.gnu.org/archive/html/bug-hurd/2014-05/msg00127.html

>  Manolis Ragkousis, le Thu 15 May 2014 21:08:41 +0000, a écrit :
>  > So I commented the part that calls this function out and glibc gets
>  > built succefully with libpthread.
>  > >  err = __thread_terminate_release (kernel_thread, mach_task_self (),
>
>  That should be fine, yes, IIRC I left a thread_terminate call just
>  below, which should work enough for your needs.

Manolis

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

* Re: [PATCH] gnu: base: Add Glibc-Hurd Headers.
  2014-09-27 13:50       ` Manolis Ragkousis
@ 2014-09-27 17:30         ` Manolis Ragkousis
  2014-09-28  9:51           ` Ludovic Courtès
  0 siblings, 1 reply; 7+ messages in thread
From: Manolis Ragkousis @ 2014-09-27 17:30 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: Guix-devel


[-- Attachment #1.1: Type: text/plain, Size: 1654 bytes --]

I am working on the cross-base patch so we can merge it with wip-hurd as
well, but some problems need to be discussed.

First, in glibc/hurd headers we need to redeclare #:configure-flags with
less flags.
We shouldn't but because we use the same configure flags as in glibc and
glibc/hurd, we get an error at (string-append "--localedir=" (assoc-ref
%outputs "locales") "/share/locale") when it tries to find the locales
output.
>In unknown file:
>   ?: 0 [string-append "--localedir=" #f "/share/locale"]

I attached the log.

Second, in glibc/hurd headers again, because we Don't use the same phases
as in glibc and glibc/hurd, and as a result we don't have the pre-configure
phase of glibc,  /bin/pwd is not substituted with pwd and we get a "no such
file" error.

>checking for i686-pc-gnu-readelf... i686-pc-gnu-readelf
>../glibc-hurd-2.18/configure: line 3312: /bin/pwd: No such file or
directory
>../glibc-hurd-2.18/configure: line 3312: /bin/pwd: No such file or
directory
>configure: error: you must configure in a separate build directory
>phase `configure' failed after 1 seconds

In order to solve this I just need to add a pre-configure phase with just
(lambda _
    (substitute* "configure"
        (("/bin/pwd") "pwd")))

attached log.

Third, in glibc/hurd the permissions in chmod "bits/pthreadtypes.h" should
be 666 not 555.

With this changes glibc/hurd can be built using the i686-pc-gnu cross
toolchain.

I attached the patch and I made sure that there will be no regressions with
the cross-base patch.

I wrote a simple commit message because it needs to be merged with the
current glibc/hurd patch in wip-hurd.

Thank you,
Manolis

[-- Attachment #1.2: Type: text/html, Size: 2103 bytes --]

[-- Attachment #2: 7rc2bifwca5rn62irz5q9hhhjwi30z-glibc-hurd-headers-cross-i686-pc-gnu-2.18.drv.bz2 --]
[-- Type: application/x-bzip2, Size: 535 bytes --]

[-- Attachment #3: k5ghfib3n6campjhi3y3ji634qv960-glibc-hurd-headers-cross-i686-pc-gnu-2.18.drv.bz2 --]
[-- Type: application/x-bzip2, Size: 56145 bytes --]

[-- Attachment #4: 0001-gnu-base-Edits-on-glibc-hurd-and-glibc-hurd-headers.patch --]
[-- Type: text/x-patch, Size: 2003 bytes --]

From 88f065c3818e2e6665ae490557415594528f2d6a Mon Sep 17 00:00:00 2001
From: Manolis Ragkousis <manolis837@gmail.com>
Date: Sat, 27 Sep 2014 20:07:19 +0300
Subject: [PATCH] gnu: base: Edits on glibc-hurd and glibc-hurd-headers.

* gnu/packages/base.scm (glibc/hurd): Fix file permissions in bits/pthreadtypes.h
			(glibc/hurd-headers): Add configure flags
					    : Add preconfigure phase
---
 gnu/packages/base.scm | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm
index 2acb51b..53858d4 100644
--- a/gnu/packages/base.scm
+++ b/gnu/packages/base.scm
@@ -561,7 +561,7 @@ with the Linux kernel.")
                      (assoc-ref %build-inputs "patch/libpthread-patch"))
 
             ;; Make the file writable.
-            (chmod "bits/pthreadtypes.h" #o555)
+            (chmod "bits/pthreadtypes.h" #o666)
             (copy-recursively "libpthread/sysdeps/generic/bits" "bits"))
           ,phases))))))
 
@@ -571,6 +571,11 @@ with the Linux kernel.")
     (outputs '("out"))
     (arguments
      (substitute-keyword-arguments (package-arguments glibc/hurd)
+       ;; We just pass the flags really needed to build the headers.
+       ((#:configure-flags _)
+        `(list "--enable-add-ons"
+               "--host=i686-pc-gnu"
+               "--enable-obsolete-rpc"))
        ((#:phases _)
         '(alist-replace
           'install
@@ -586,7 +591,16 @@ with the Linux kernel.")
                      (string-append out "/include/gnu/stubs.h"))))))
 
           ;; Nothing to build.
-          (alist-delete 'build %standard-phases)))))))
+          (alist-delete 
+           'build 
+
+           ;; We need this to use `pwd', not `/bin/pwd'.
+           (alist-cons-before
+            'configure 'pre-configure
+            (lambda _
+              (substitute* "configure"
+                (("/bin/pwd") "pwd")))
+            %standard-phases))))))))
 
 (define-public tzdata
   (package
-- 
2.1.1


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

* Re: [PATCH] gnu: base: Add Glibc-Hurd Headers.
  2014-09-27 17:30         ` Manolis Ragkousis
@ 2014-09-28  9:51           ` Ludovic Courtès
  0 siblings, 0 replies; 7+ messages in thread
From: Ludovic Courtès @ 2014-09-28  9:51 UTC (permalink / raw)
  To: Manolis Ragkousis; +Cc: Guix-devel

Manolis Ragkousis <manolis837@gmail.com> skribis:

>>In unknown file:
>>   ?: 0 [string-append "--localedir=" #f "/share/locale"]

This is because the ‘output’ field of ‘glibc/hurd’ doesn’t list
"locale".  It should, like ‘glibc’ does.  (In general it should diverge
as little as possible.)

> Second, in glibc/hurd headers again

[...]

> In order to solve this I just need to add a pre-configure phase with just
> (lambda _
>     (substitute* "configure"
>         (("/bin/pwd") "pwd")))

OK.

> Third, in glibc/hurd the permissions in chmod "bits/pthreadtypes.h" should
> be 666 not 555.

OK.

> With this changes glibc/hurd can be built using the i686-pc-gnu cross
> toolchain.

You mean the cross-glibc, right?  How did you test already?  (I think
there are missing bits in cross-base.scm to select the right libc.)

I’ve merged the patch and pushed the updated ‘wip-hurd’.

Thanks!

Ludo’.

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

end of thread, other threads:[~2014-09-28  9:51 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-02 21:16 [PATCH] gnu: base: Add Glibc-Hurd Headers Manolis Ragkousis
2014-08-29 13:48 ` Ludovic Courtès
2014-09-24 13:01   ` Manolis Ragkousis
2014-09-27  9:31     ` Ludovic Courtès
2014-09-27 13:50       ` Manolis Ragkousis
2014-09-27 17:30         ` Manolis Ragkousis
2014-09-28  9:51           ` Ludovic Courtès

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).