Skip to content

Commit

Permalink
Added x86 and x86_64 support (issue #2)
Browse files Browse the repository at this point in the history
  • Loading branch information
buffer51 committed Jun 5, 2016
1 parent a15b588 commit 20cefa7
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 43 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,11 @@ prebuilt_ndk = 'ndk'
so that the building script can find the `ndk/platforms` folder
correctly.

**Note:** When building the x86 or x86_64 toolchains, additional changes are
required. There is an issue in libgfortran for the x86 and x86_64 targets
(see [this issue](https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71363)) causing
an error when building it. See the `x86.diff`.

**Note:** When building the toolchain for Windows,
you need to change `ndk/build/tools/prebuilt-common.sh` for the MinGW
wrapper to be found. Find the line that says:
Expand Down
43 changes: 0 additions & 43 deletions release.sh

This file was deleted.

30 changes: 30 additions & 0 deletions x86.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
diff --git a/gcc-4.9/libgfortran/mk-kinds-h.sh b/gcc-4.9/libgfortran/mk-kinds-h.sh
index 98a95ab..fdbccb0 100755
--- a/gcc-4.9/libgfortran/mk-kinds-h.sh
+++ b/gcc-4.9/libgfortran/mk-kinds-h.sh
@@ -51,7 +51,10 @@ echo "use iso_c_binding; print *, c_long_double ; end" > tmq$$.f90
long_double_kind=`$compile -S -fdump-parse-tree tmq$$.f90 | grep TRANSFER \
| sed 's/ *TRANSFER *//'`
rm -f tmq$$.*
-
+echo "use iso_c_binding; print *, c_double ; end" > tmq$$.f90
+double_kind=`$compile -S -fdump-parse-tree tmq$$.f90 | grep TRANSFER \
+ | sed 's/ *TRANSFER *//'`
+rm -f tmq$$.*

for k in $possible_real_kinds; do
echo " real (kind=$k) :: x" > tmp$$.f90
@@ -66,10 +69,12 @@ for k in $possible_real_kinds; do
ctype="__float128"
cplxtype="_Complex float __attribute__((mode(TC)))"
suffix="q"
- else
+ elif [ $long_double_kind -ne $double_kind ]; then
ctype="long double"
cplxtype="complex long double"
suffix="l"
+ else
+ break;
fi ;;
*) echo "$0: Unknown type" >&2 ; exit 1 ;;
esac

0 comments on commit 20cefa7

Please sign in to comment.