Skip to content

Commit f73e8b5

Browse files
dcpleunggalak
authored andcommitted
x86_64: newlib: use march=pentium for 32-bit
The 32-bit build on Zephyr main tree is targeting Pentium-based devices. However, given the target tuple, newlib is being built targeting i686 by default. This emits instructions that cannot run on Pentium-based devices. So add a march=pentium when newlib is being built for x86_64 32-bit. Signed-off-by: Daniel Leung <[email protected]>
1 parent 51a085c commit f73e8b5

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
From dc48595340a292f044a0fddcab2d67a81650010f Mon Sep 17 00:00:00 2001
1+
From 7fa9f8eb8aff8bd73d04dd04f72eeac4682e38dc 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
@@ -10,14 +10,14 @@ x86_64.
1010
Signed-off-by: Daniel Leung <[email protected]>
1111
Signed-off-by: Kumar Gala <[email protected]>
1212
---
13-
newlib/configure.host | 14 +++++++++++++-
14-
1 file changed, 13 insertions(+), 1 deletion(-)
13+
newlib/configure.host | 15 ++++++++++++++-
14+
1 file changed, 14 insertions(+), 1 deletion(-)
1515

1616
diff --git a/newlib/configure.host b/newlib/configure.host
17-
index 6c49cb750..37d2b9b2e 100644
17+
index 6c49cb7..d739dda 100644
1818
--- a/newlib/configure.host
1919
+++ b/newlib/configure.host
20-
@@ -333,7 +333,19 @@ case "${host_cpu}" in
20+
@@ -333,7 +333,20 @@ case "${host_cpu}" in
2121
machine_dir=w65
2222
;;
2323
x86_64)
@@ -27,6 +27,7 @@ index 6c49cb750..37d2b9b2e 100644
2727
+ libm_machine_dir=i386
2828
+ machine_dir=i386
2929
+ mach_add_setjmp=true
30+
+ newlib_cflags="${newlib_cflags} -march=pentium"
3031
+ ;;
3132
+ *-mx32)
3233
+ machine_dir=x86_64
@@ -39,5 +40,5 @@ index 6c49cb750..37d2b9b2e 100644
3940
xc16x*)
4041
machine_dir=xc16x
4142
--
42-
2.24.1
43+
2.27.0
4344

0 commit comments

Comments
 (0)