Skip to content

Commit df84499

Browse files
committed
newlib: Fix 32-bit build of newlib for setjmp
The 32-bit build of newlib didn't include setjmp/longjmp due to us not configuring it correctly. In configure.host we needed to set mach_add_setjmp=true for 'm32'. Also mimic i.86 in setting libm_machine_dir=i386. Fixes #179 Signed-off-by: Kumar Gala <[email protected]>
1 parent 951ca98 commit df84499

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

patches/newlib/3.1.0.20181231/0003-Support-building-for-32-bit-under-x86_64.patch

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
From 7dd18c12276cd4cb784dbebd9eb22eed45a49db6 Mon Sep 17 00:00:00 2001
1+
From dc48595340a292f044a0fddcab2d67a81650010f Mon Sep 17 00:00:00 2001
22
From: Daniel Leung <[email protected]>
33
Date: Wed, 8 May 2019 09:17:10 -0700
44
Subject: [PATCH 3/3] Support building for 32-bit under x86_64
@@ -8,22 +8,25 @@ This is for multilib support under x86_64. When compiling for
88
x86_64.
99

1010
Signed-off-by: Daniel Leung <[email protected]>
11+
Signed-off-by: Kumar Gala <[email protected]>
1112
---
12-
newlib/configure.host | 12 +++++++++++-
13-
1 file changed, 11 insertions(+), 1 deletion(-)
13+
newlib/configure.host | 14 +++++++++++++-
14+
1 file changed, 13 insertions(+), 1 deletion(-)
1415

1516
diff --git a/newlib/configure.host b/newlib/configure.host
16-
index 6c49cb7..0a40b1a 100644
17+
index 6c49cb750..37d2b9b2e 100644
1718
--- a/newlib/configure.host
1819
+++ b/newlib/configure.host
19-
@@ -333,7 +333,17 @@ case "${host_cpu}" in
20+
@@ -333,7 +333,19 @@ case "${host_cpu}" in
2021
machine_dir=w65
2122
;;
2223
x86_64)
2324
- machine_dir=x86_64
2425
+ case "${CC}" in
2526
+ *-m32*)
27+
+ libm_machine_dir=i386
2628
+ machine_dir=i386
29+
+ mach_add_setjmp=true
2730
+ ;;
2831
+ *-mx32)
2932
+ machine_dir=x86_64
@@ -36,5 +39,5 @@ index 6c49cb7..0a40b1a 100644
3639
xc16x*)
3740
machine_dir=xc16x
3841
--
39-
2.23.0
42+
2.24.1
4043

0 commit comments

Comments
 (0)