Skip to content

Commit 14e3b4b

Browse files
stephanosiogalak
authored andcommitted
Support newlib retargetable locking configuration
This commit adds a patch for supporting the newlib retargetable locking configuration in the crosstool-ng. The patch is derived from the upstream pull request for the retargetable locking configuration (crosstool-ng/crosstool-ng#1284) cherry-picked on top of the newlib nano variant pull request (crosstool-ng/crosstool-ng#1279). The work branch for this patch is available at the following location: stephanosio/crosstool-ng/newlib_nano_variant_with_retargetable_locking Signed-off-by: Stephanos Ioannidis <[email protected]>
1 parent ea81840 commit 14e3b4b

6 files changed

+66
-5
lines changed

patches/0001-Add-newlib-nano-variant-configurations.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
From 62f28beb597e8299a79add217281143fc6cb5ac2 Mon Sep 17 00:00:00 2001
22
From: Stephanos Ioannidis <[email protected]>
33
Date: Thu, 28 Nov 2019 23:32:10 +0900
4-
Subject: [PATCH 1/5] Add newlib nano variant configurations
4+
Subject: [PATCH 1/6] Add newlib nano variant configurations
55

66
This commit adds the new configuration option 'LIBC_NANO_NEWLIB' for
77
specifying the additional 'nano' variant of newlib to be built.

patches/0002-Support-building-newlib-nano-variant.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
From c7e4eafab9bd940058ce38ca0484dd897c6202c1 Mon Sep 17 00:00:00 2001
22
From: Stephanos Ioannidis <[email protected]>
33
Date: Fri, 29 Nov 2019 01:35:57 +0900
4-
Subject: [PATCH 2/5] Support building newlib nano variant
4+
Subject: [PATCH 2/6] Support building newlib nano variant
55

66
This commit updates the newlib build script to build the additional
77
newlib nano variant using the nano variant-specific build options.

patches/0003-Support-building-libstdc-nano-variant.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
From 3fe25cedd9b6db08dcf1d990784dc3ab89c10e86 Mon Sep 17 00:00:00 2001
22
From: Stephanos Ioannidis <[email protected]>
33
Date: Fri, 29 Nov 2019 20:44:21 +0900
4-
Subject: [PATCH 3/5] Support building libstdc++ nano variant
4+
Subject: [PATCH 3/6] Support building libstdc++ nano variant
55

66
This commit adds the new configuration option 'CC_GCC_LIBSTDCXX_NANO'
77
for specifying the additional 'nano' variant of libstdc++ to be built

patches/0004-Assume-O2-by-default-for-building-gcc-target-librari.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
From 6a20aad951cd79b4141842f261b68614b10088d1 Mon Sep 17 00:00:00 2001
22
From: Stephanos Ioannidis <[email protected]>
33
Date: Sat, 30 Nov 2019 01:42:18 +0900
4-
Subject: [PATCH 4/5] Assume '-O2' by default for building gcc target libraries
4+
Subject: [PATCH 4/6] Assume '-O2' by default for building gcc target libraries
55

66
The gcc target libraries (e.g. libstdc++) are currently built without
77
any optimisation flag when 'CT_CC_GCC_ENABLE_TARGET_OPTSPACE' is not

patches/0005-Allow-stripping-target-toolchain-libraries.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
From 6fca4742a80e26ae00c1ca947e93ed20f8845714 Mon Sep 17 00:00:00 2001
22
From: Stephanos Ioannidis <[email protected]>
33
Date: Fri, 29 Nov 2019 22:25:17 +0900
4-
Subject: [PATCH 5/5] Allow stripping target toolchain libraries
4+
Subject: [PATCH 5/6] Allow stripping target toolchain libraries
55

66
This commit adds an option to strip the target toolchain libraries
77
(e.g. libc, libstdc++) of any unneeded or debugging information.
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
From 968bf7d65812bba490c4222b3d05fa94cf856472 Mon Sep 17 00:00:00 2001
2+
From: Stephanos Ioannidis <[email protected]>
3+
Date: Fri, 20 Dec 2019 11:18:46 +0900
4+
Subject: [PATCH 6/6] Add newlib retargetable locking configuration
5+
6+
This commit adds support for the newlib configuration option
7+
'--enable-newlib-retargetable-locking'.
8+
9+
Signed-off-by: Stephanos Ioannidis <[email protected]>
10+
---
11+
config/libc/newlib.in | 14 ++++++++++++++
12+
scripts/build/libc/newlib.sh | 1 +
13+
2 files changed, 15 insertions(+)
14+
15+
diff --git a/config/libc/newlib.in b/config/libc/newlib.in
16+
index bd193cd8..d84db70b 100644
17+
--- a/config/libc/newlib.in
18+
+++ b/config/libc/newlib.in
19+
@@ -152,6 +152,13 @@ config LIBC_NEWLIB_MULTITHREAD
20+
help
21+
Enable support for multiple threads.
22+
23+
+config LIBC_NEWLIB_RETARGETABLE_LOCKING
24+
+ bool
25+
+ prompt "Enable retargetable locking"
26+
+ help
27+
+ Enable retargetable locking to allow the operating system to override
28+
+ the dummy lock functions defined within the newlib.
29+
+
30+
config LIBC_NEWLIB_EXTRA_SECTIONS
31+
bool
32+
prompt "Place each function & data element in their own section"
33+
@@ -355,6 +362,13 @@ config LIBC_NANO_NEWLIB_MULTITHREAD
34+
help
35+
Enable support for multiple threads.
36+
37+
+config LIBC_NANO_NEWLIB_RETARGETABLE_LOCKING
38+
+ bool
39+
+ prompt "Enable retargetable locking"
40+
+ help
41+
+ Enable retargetable locking to allow the operating system to override
42+
+ the dummy lock functions defined within the newlib.
43+
+
44+
config LIBC_NANO_NEWLIB_EXTRA_SECTIONS
45+
bool
46+
prompt "Place each function & data element in their own section"
47+
diff --git a/scripts/build/libc/newlib.sh b/scripts/build/libc/newlib.sh
48+
index ca53c7f8..299698ac 100644
49+
--- a/scripts/build/libc/newlib.sh
50+
+++ b/scripts/build/libc/newlib.sh
51+
@@ -220,6 +220,7 @@ GLOBAL_ATEXIT:newlib-global-atexit
52+
LITE_EXIT:lite-exit
53+
REENT_SMALL:newlib-reent-small
54+
MULTITHREAD:newlib-multithread
55+
+RETARGETABLE_LOCKING:newlib-retargetable-locking
56+
WIDE_ORIENT:newlib-wide-orient
57+
UNBUF_STREAM_OPT:newlib-unbuf-stream-opt
58+
ENABLE_TARGET_OPTSPACE:target-optspace
59+
--
60+
2.17.1
61+

0 commit comments

Comments
 (0)