Skip to contentSkip to conversation

packages/glibc: Fix mcontext_t error that breaks RISC-V package builds

PATCH New Mark Corbin 2 participants 2 messages Feb 4, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 packages/glibc: Fix mcontext_t error that breaks RISC-V package builds

The riscv-glibc repository version of glibc 2.26 will build for RISC-V 32bit, but when many packages are built against the resulting library an 'unknown type name mcontext_t' error is reported. The definition of mcontext_h in the ucontext.h header file needs to be moved outside of the '#ifdef __USE_MISC' structure to fix this issue.

Fixes:
http://autobuild.buildroot.net/results/5aa9cb29c459f511dc9c4fcf218dc9a842505aa3

---
 ...rror-that-breaks-RISC-V-architecture.patch | 39 +++++++++++++++++++
 1 file changed, 39 insertions(+)
 create mode 100644 package/glibc/4e2943456e690d89f48e6e710757dd09404b0c9a/0002-Fix-mcontext_t-error-that-breaks-RISC-V-architecture.patch
package/glibc/4e2943456e690d89f48e6e710757dd09404b0c9a/0002-Fix-mcontext_t-error-that-breaks-RISC-V-architecture.patch new file +39 -0
new file mode 100644
index 0000000000..e0875a4590
@@ -0,0 +1,39 @@
+From 6b4520e13c2ed7fca725d5f5c879854cd7c96c19 Mon Sep 17 00:00:00 2001
+From: Mark Corbin <[email protected]>
+Date: Mon, 4 Feb 2019 10:35:27 +0000
+Subject: [PATCH 1/1] Fix mcontext_t error that breaks RISC-V architecture
+ package builds
+
+The riscv-glibc repository version of glibc 2.26 will build for
+RISC-V 32bit, but when many packages are built against the resulting
+library an 'unknown type name mcontext_t' error is reported. The
+definition of mcontext_h in the ucontext.h header file needs to be
+moved outside of the '#ifdef __USE_MISC' structure to fix this
+issue.
+
+Signed-off-by: Mark Corbin <[email protected]>
+---
+ sysdeps/unix/sysv/linux/riscv/sys/ucontext.h | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/sysdeps/unix/sysv/linux/riscv/sys/ucontext.h b/sysdeps/unix/sysv/linux/riscv/sys/ucontext.h
+index 8f02f09106..b9dd04564a 100644
+--- a/sysdeps/unix/sysv/linux/riscv/sys/ucontext.h
++++ b/sysdeps/unix/sysv/linux/riscv/sys/ucontext.h
+@@ -48,12 +48,11 @@ typedef greg_t gregset_t[NGREG];
+ 
+ /* Container for floating-point state.  */
+ typedef union __riscv_fp_state fpregset_t;
++#endif
+ 
+ /* Context to describe whole processor state.  */
+ typedef struct sigcontext mcontext_t;
+ 
+-#endif
+-
+ /* Userlevel context.  */
+ typedef struct ucontext
+   {
+-- 
+2.19.1
+
Signature · 1 line
2.19.1
#1 lore raw

PATCH 1/1 packages/glibc: Fix mcontext_t error that breaks RISC-V package builds

Quoted 24 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Mark" == Mark Corbin <[email protected]> writes:

The riscv-glibc repository version of glibc 2.26 will build for RISC-V 32bit, but when many packages are built against the resulting library an 'unknown type name mcontext_t' error is reported. The definition of mcontext_h in the ucontext.h header file needs to be moved outside of the '#ifdef __USE_MISC' structure to fix this issue.

Fixes:
http://autobuild.buildroot.net/results/5aa9cb29c459f511dc9c4fcf218dc9a842505aa3

---
 ...rror-that-breaks-RISC-V-architecture.patch | 39 +++++++++++++++++++
 1 file changed, 39 insertions(+)
 create mode 100644 package/glibc/4e2943456e690d89f48e6e710757dd09404b0c9a/0002-Fix-mcontext_t-error-that-breaks-RISC-V-architecture.patch
package/glibc/4e2943456e690d89f48e6e710757dd09404b0c9a/0002-Fix-mcontext_t-error-that-breaks-RISC-V-architecture.patch new file +0 -0
new file mode 100644
index 0000000000..e0875a4590

package/glibc/4e2943456e690d89f48e6e710757dd09404b0c9a/0002-Fix-mcontext_t-error-that-breaks-RISC-V-architecture.patch line 5

Quoted 5 lines
package/glibc/4e2943456e690d89f48e6e710757dd09404b0c9a/0002-Fix-mcontext_t-error-that-breaks-RISC-V-architecture.patch new file +5 -0
@@ -0,0 +1,39 @@
+From 6b4520e13c2ed7fca725d5f5c879854cd7c96c19 Mon Sep 17 00:00:00 2001
+From: Mark Corbin <[email protected]>
+Date: Mon, 4 Feb 2019 10:35:27 +0000
+Subject: [PATCH 1/1] Fix mcontext_t error that breaks RISC-V architecture
+ package builds

check-package warns about this:

Applying: packages/glibc: Fix mcontext_t error that breaks RISC-V package builds tpackage/glibc/4e2943456e690d89f48e6e710757dd09404b0c9a/0002-Fix-mcontext_t-error-that-breaks-RISC-V-architecture.patch:4: generate your patches with 'git format-patch -N'

Committed with that fixed, thanks. Do not forget to submit the patch upstream.

Signature · 1 line
Bye, Peter Korsgaard