Skip to content

Commit 20cefa7

Browse files
committed
Added x86 and x86_64 support (issue #2)
1 parent a15b588 commit 20cefa7

File tree

3 files changed

+35
-43
lines changed

3 files changed

+35
-43
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,11 @@ prebuilt_ndk = 'ndk'
116116
so that the building script can find the `ndk/platforms` folder
117117
correctly.
118118

119+
**Note:** When building the x86 or x86_64 toolchains, additional changes are
120+
required. There is an issue in libgfortran for the x86 and x86_64 targets
121+
(see [this issue](https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71363)) causing
122+
an error when building it. See the `x86.diff`.
123+
119124
**Note:** When building the toolchain for Windows,
120125
you need to change `ndk/build/tools/prebuilt-common.sh` for the MinGW
121126
wrapper to be found. Find the line that says:

release.sh

Lines changed: 0 additions & 43 deletions
This file was deleted.

x86.diff

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
diff --git a/gcc-4.9/libgfortran/mk-kinds-h.sh b/gcc-4.9/libgfortran/mk-kinds-h.sh
2+
index 98a95ab..fdbccb0 100755
3+
--- a/gcc-4.9/libgfortran/mk-kinds-h.sh
4+
+++ b/gcc-4.9/libgfortran/mk-kinds-h.sh
5+
@@ -51,7 +51,10 @@ echo "use iso_c_binding; print *, c_long_double ; end" > tmq$$.f90
6+
long_double_kind=`$compile -S -fdump-parse-tree tmq$$.f90 | grep TRANSFER \
7+
| sed 's/ *TRANSFER *//'`
8+
rm -f tmq$$.*
9+
-
10+
+echo "use iso_c_binding; print *, c_double ; end" > tmq$$.f90
11+
+double_kind=`$compile -S -fdump-parse-tree tmq$$.f90 | grep TRANSFER \
12+
+ | sed 's/ *TRANSFER *//'`
13+
+rm -f tmq$$.*
14+
15+
for k in $possible_real_kinds; do
16+
echo " real (kind=$k) :: x" > tmp$$.f90
17+
@@ -66,10 +69,12 @@ for k in $possible_real_kinds; do
18+
ctype="__float128"
19+
cplxtype="_Complex float __attribute__((mode(TC)))"
20+
suffix="q"
21+
- else
22+
+ elif [ $long_double_kind -ne $double_kind ]; then
23+
ctype="long double"
24+
cplxtype="complex long double"
25+
suffix="l"
26+
+ else
27+
+ break;
28+
fi ;;
29+
*) echo "$0: Unknown type" >&2 ; exit 1 ;;
30+
esac

0 commit comments

Comments
 (0)