-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathnewlib
More file actions
36 lines (30 loc) · 2.67 KB
/
newlib
File metadata and controls
36 lines (30 loc) · 2.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
git clone git://sourceware.org/git/newlib-cygwin.git
// porting
FAQ: What is needed to port newlib to a new platform? in https://sourceware.org/newlib/
https://www.embecosm.com/appnotes/ean9/ean9-howto-newlib-1.0.pdf
// build:
~/git/newlib-cygwin/build$ ../newlib/configure or CC=gcc ../newlib/configure "make pass"
~/git/newlib-cygwin/build$ CC_FOR_TARGET=/home/cschen/llvm/release/build/bin/clang ../newlib/configure "make pass"
cschen@cschendeiMac build % CC=/usr/local/bin/gcc-11 ../newlib/configure // my mac pc
/local/git/newlib-cygwin/build$ make
// ref. search "build newlib with clang" https://ecos.sourceware.org/ml/newlib/current/018127.html
// build with clang on my iMac pc:
sed -i -e 's/\*__block/\*__libc_block/g' /Users/cschen/git/newlib-cygwin/newlib/libc/include/sys/unistd.h ref. https://bugzilla.redhat.com/show_bug.cgi?id=1009623
cschen@cschendeiMac build % CC=clang CFLAGS="-Wno-error=implicit-function-declaration" ../newlib/configure
cschen@cschendeiMac build % make // pass
cschen@cschendeiMac build % CC=clang CFLAGS="-Wno-error=implicit-function-declaration" AS="clang -target x86_64-apple-darwin21.2.0 -static -fintegrated-as -c" ../newlib/configure // make pass (with or without -static in clang
...
checking for as... clang -target x86_64-apple-darwin21.2.0 -fintegrated-as -c
cschen@cschendeiMac build % CC=/Users/cschen/llvm/release/build/bin/clang CFLAGS="-Wno-error=implicit-function-declaration" AS="/Users/cschen/llvm/release/build/bin/clang -target x86_64-apple-darwin21.2.0 -static -fintegrated-as -c" ../newlib/configure // pass except doc/ fail
cschen@cschendeiMac build % CC=/Users/cschen/llvm/release/build/bin/clang CFLAGS="-Wno-error=implicit-function-declaration" AS="/Users/cschen/llvm/release/build/bin/clang -target x86_64-unknown-linux-gnu -static -fintegrated-as -c" ../newlib/configure // pass except doc/ fail
/Users/cschen/llvm/release/build/bin/clang -g -o doc/makedoc.o -c ../newlib/doc/makedoc.c
../newlib/doc/makedoc.c:38:10: fatal error: 'stdio.h' file not found
#include <stdio.h>
^~~~~~~~~
// build with Cpu0/clang: pass on my mac pc
cschen@cschendeiMac newlib-cygwin % git log
commit dcb25665be227fb5a05497b7178a3d5df88050ec (HEAD -> master, origin/master, origin/HEAD)
https://github.com/Jonathan2251/note/newlib.patch
https://github.com/Jonathan2251/note/newlib-cygwin
CC=/Users/cschen/llvm/test/build/bin/clang CFLAGS="-static -fintegrated-as -Wno-error=implicit-function-declaration" AS="/Users/cschen/llvm/test/build/bin/clang -static -fintegrated-as -c" AR="/Users/cschen/llvm/test/build/bin/llvm-ar" RANLIB="/Users/cschen/llvm/test/build/bin/llvm-ranlib" READELF="/Users/cschen/llvm/test/build/bin/llvm-readelf" ../newlib/configure --host=cpu0
make