-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refer to chibicc. Include gcc headers. Currently, success on git and lua only, others are failed.
- Loading branch information
Showing
10 changed files
with
117 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,6 +32,8 @@ core | |
/dump_ir* | ||
/dump_type* | ||
|
||
/tests/thirdparty/.external/ | ||
|
||
### wasm | ||
|
||
libsrc/_wasm/crt0.c | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
repo='https://github.com/python/cpython.git' | ||
. tests/thirdparty/thirdpartycommon | ||
git reset --hard c75330605d4795850ec74fdc4d69aa5d92f76c00 | ||
|
||
# Python's './configure' command misidentifies chibicc as icc | ||
# (Intel C Compiler) because icc is a substring of chibicc. | ||
# Modify the configure file as a workaround. | ||
#sed -i -e 1996,2011d configure.ac | ||
autoreconf | ||
|
||
CC=$xcc ./configure | ||
$make clean | ||
$make | ||
$make test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
repo='https://github.com/git/git.git' | ||
. tests/thirdparty/thirdpartycommon | ||
git reset --hard 54e85e7af1ac9e9a92888060d6811ae767fea1bc | ||
|
||
# CFLAGS="-D__STDC_VERSION__=199901L -Drestrict=" | ||
|
||
$make clean | ||
$make V=1 CC="$xcc $CFLAGS" | ||
$make V=1 CC="$xcc $CFLAGS" test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
repo='https://github.com/rui314/libpng.git' | ||
. tests/thirdparty/thirdpartycommon | ||
git reset --hard dbe3e0c43e549a1602286144d94b0666549b18e6 | ||
|
||
CC="$xcc" ./configure | ||
sed -i 's/^wl=.*/wl=-Wl,/; s/^pic_flag=.*/pic_flag=-fPIC/' libtool | ||
$make clean | ||
$make -j1 | ||
$make test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
repo='https://github.com/lua/lua.git' | ||
. tests/thirdparty/thirdpartycommon | ||
git reset --hard 6443185167c77adcc8552a3fee7edab7895db1a9 # v5.4.6 | ||
|
||
$make clean | ||
$make -j1 CC="$xcc" | ||
|
||
# all.lua not work | ||
cd testes && ../lua locals.lua |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
repo='https://github.com/sqlite/sqlite.git' | ||
. tests/thirdparty/thirdpartycommon | ||
git reset --hard 86f477edaa17767b39c7bae5b67cac8580f7a8c1 | ||
|
||
CFLAGS="-D_GNU_SOURCE -D__STDC_VERSION__=199901L -Drestrict=" | ||
|
||
CC="$xcc" CFLAGS="$CFLAGS" ./configure | ||
sed -i 's/^wl=.*/wl=-Wl,/; s/^pic_flag=.*/pic_flag=-fPIC/' libtool | ||
$make clean | ||
$make -j1 | ||
$make test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
make="make -j$(nproc)" | ||
xcc=$(cd "$(dirname "$0")/../../tool";pwd)/xccsh | ||
|
||
dir=$(basename -s .git "$repo") | ||
|
||
set -e -x | ||
|
||
REPOROOT=$(cd "$(dirname "$0")";pwd)/.external | ||
mkdir -p "$REPOROOT" | ||
cd "$REPOROOT" | ||
[ -d "$dir" ] || git clone "$repo" | ||
cd "$dir" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
repo='https://github.com/TinyCC/tinycc.git' | ||
. tests/thirdparty/thirdpartycommon | ||
git reset --hard df67d8617b7d1d03a480a28f9f901848ffbfb7ec | ||
|
||
./configure --cc=$xcc | ||
$make clean | ||
$make | ||
$make CC=cc test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/bash | ||
|
||
xcc=$(cd "$(dirname "$0")/..";pwd)/xcc | ||
|
||
UNAME=$(uname) | ||
ARCH=$(arch) | ||
|
||
if [[ "$UNAME" = "Darwin" ]]; then | ||
SYS_INCLUDE_DIR="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include" | ||
else | ||
SYS_INCLUDE_DIR="/usr/include/$ARCH-linux-gnu" | ||
fi | ||
|
||
xcc_opt="\ | ||
-fuse-ld=cc -no-pie \ | ||
-isystem /usr/include \ | ||
-isystem /usr/local/include \ | ||
-isystem $SYS_INCLUDE_DIR \ | ||
-D__signed__=" | ||
|
||
CC="$xcc $xcc_opt -D_GNU_SOURCE" | ||
|
||
$CC "$@" |