File tree Expand file tree Collapse file tree 6 files changed +65
-6
lines changed
patches/newlib/git-b06f1b57 Expand file tree Collapse file tree 6 files changed +65
-6
lines changed Original file line number Diff line number Diff line change 13
13
- TARGET=riscv32
14
14
- TARGET=mips
15
15
- TARGET=arc
16
+ - TARGET=xtensa
16
17
17
18
build :
18
19
cache : true
Original file line number Diff line number Diff line change @@ -8,8 +8,12 @@ CT_LOCAL_PATCH_DIR="${CT_TOP_DIR}/../../patches"
8
8
CT_ARCH_XTENSA=y
9
9
CT_XTENSA_CUSTOM=y
10
10
CT_ARCH_LE_BE=y
11
+ CT_OVERLAY_NAME="sample_controller"
12
+ CT_OVERLAY_LOCATION="./overlays"
11
13
CT_TARGET_VENDOR="zephyr"
12
- CT_NEWLIB_V_2_5_0=y
14
+ CT_NEWLIB_SRC_DEVEL=y
15
+ CT_NEWLIB_DEVEL_URL="https://github.com/jcmvbkbc/newlib-xtensa.git"
16
+ CT_NEWLIB_DEVEL_BRANCH="xtensa"
13
17
CT_LIBC_NEWLIB_IO_FLOAT=y
14
18
# CT_LIBC_NEWLIB_FSEEK_OPTIMIZATION is not set
15
19
CT_LIBC_NEWLIB_DISABLE_SUPPLIED_SYSCALLS=y
Original file line number Diff line number Diff line change @@ -74,12 +74,30 @@ for t in ${TARGETS}; do
74
74
mkdir -p build_${t}
75
75
pushd build_${t}
76
76
77
- ${CT_NG} clean
78
- ${CT_NG} defconfig DEFCONFIG=${GITDIR} /configs/${t} .config
79
- ${CT_NG} savedefconfig DEFCONFIG=${t} .config
80
- ${CT_NG} build -j ${JOBS}
81
- rm -rf build_${t}
77
+ build_toolchain=1
78
+ if [ -n " ${build_toolchain} " ]; then
79
+ cp -a ${SDK_NG_HOME} /overlays .
80
+
81
+ ${CT_NG} clean
82
+ ${CT_NG} defconfig DEFCONFIG=${GITDIR} /configs/${t} .config
83
+ ${CT_NG} savedefconfig DEFCONFIG=${t} .config
84
+ ${CT_NG} build -j ${JOBS}
85
+ fi
86
+
87
+ if [ " ${t} " = " xtensa" ]; then
88
+ wget https://github.com/foss-xtensa/xtensa-hal/archive/RF-2015.2.tar.gz
89
+ tar xf RF-2015.2.tar.gz
90
+ cd xtensa-hal-RF-2015.2
91
+ wget https://github.com/foss-xtensa/xtensa-config/releases/download/201702/sample_controller_linux.tgz
92
+ ./import-core.sh sample_controller_linux.tgz
93
+ export CC=${CT_PREFIX} /xtensa-zephyr-elf/bin/xtensa-zephyr-elf-gcc
94
+ ./configure --host xtensa-zephyr-elf --prefix ${CT_PREFIX} /xtensa-zephyr-elf
95
+ make
96
+ make install
97
+ unset CC
98
+ fi
82
99
83
100
popd
101
+ rm -rf build_${t}
84
102
85
103
done
Original file line number Diff line number Diff line change
1
+
2
+ xtensa_sample_controller.tar.gz
3
+ -------------------------------
4
+
5
+ Generated using the following sequence of commands:
6
+
7
+ $ git clone git://github.com/foss-xtensa/xtensa-config.git
8
+ $ cd xtensa-config
9
+ $ wget https://github.com/foss-xtensa/xtensa-config/releases/download/201702/sample_controller_linux.tgz
10
+ $ tar -xf sample_controller_linux.tgz `tar -tf sample_controller_linux.tgz | grep xtensa-config-overlay.tar.gz` -O > xtensa-config-overlay.tar.gz
11
+ $ ./make-overlay.sh sample_controller xtensa-config-overlay.tar.gz .
12
+
13
+
Original file line number Diff line number Diff line change
1
+
2
+ Fix unresolved external "fiprintf".
3
+ When newlib is configured with:
4
+
5
+ --enable-newlib-nano-formatted-io
6
+
7
+ "fiprintf" should be an alias of "fprintf". However the alias does
8
+ not seem to work properly, as we encounter unresolved external
9
+ error if we uses "assert" in code. So we patch the code directly.
10
+
11
+ Signed-off-by: Juro Bystricky <
[email protected] >
12
+
13
+ --- a/newlib/libc/stdlib/assert.c 2016-11-08 08:04:45.669248139 -0800
14
+ +++ b/newlib/libc/stdlib/assert.c 2016-11-08 08:05:47.357554034 -0800
15
+ @@ -56,7 +56,7 @@
16
+ const char *func _AND
17
+ const char *failedexpr)
18
+ {
19
+ - fiprintf(stderr,
20
+ + fprintf(stderr,
21
+ "assertion \"%s\" failed: file \"%s\", line %d%s%s\n",
22
+ failedexpr, file, line,
23
+ func ? ", function: " : "", func ? func : "");
You can’t perform that action at this time.
0 commit comments