Skip to content

Commit

Permalink
android: add back default for ARMv5te
Browse files Browse the repository at this point in the history
- '-target android` will again default to 'android-arm, armv5te, 32bit'
- this should be compatible with android ndk's up to version 16
- android ndk 17 removed support for this abi and armv7a must be used in later ndks'
- we don't know what ndk fbc is invoking, but the default can be overridden:
  '-target android -arch armv7a'  '
  '-target armv7a-android'
  • Loading branch information
jayrm committed Jan 6, 2024
1 parent a8c5ec6 commit 1fdf88a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
5 changes: 1 addition & 4 deletions src/compiler/fb.bas
Expand Up @@ -988,14 +988,11 @@ end function
function fbDefaultCpuTypeFromCpuFamilyId( byval os as integer, byref cpufamilyid as string ) as integer
var cpufamily = fbIdentifyCpuFamily( cpufamilyid )
if( cpufamily >= 0 ) then
'' !!!TODO!!! - remove this block
#if 0
if( (os = FB_COMPTARGET_ANDROID) and _
(cpufamily = FB_CPUFAMILY_ARM) ) then
'' Special case: our default arm cpu should be armv5te on android
return FB_CPUTYPE_ARMV5TE
end if
#endif
return cpufamilyinfo(cpufamily).defaultcputype
end if
function = -1
Expand Down Expand Up @@ -1070,7 +1067,7 @@ function fbIdentifyFbcArch( byref fbcarch as string ) as integer
function = FB_CPUTYPE_686
case "x86_64", "amd64"
function = FB_CPUTYPE_X86_64
case "armv5"
case "armv5", "armv5te"
function = FB_CPUTYPE_ARMV5TE
case "armeabi", "armv7a", "armv7"
function = FB_CPUTYPE_ARMV7A
Expand Down
7 changes: 2 additions & 5 deletions src/compiler/fbc.bas
Expand Up @@ -1643,13 +1643,10 @@ private sub hParseGnuTriplet _
next
end if

'' !!!TODO!!! - remove this block
#if 0
'' Special case: our default arm cpu should be armv5te on android
if( (os = FB_COMPTARGET_ANDROID) and (arch = "arm") ) then
cputype = FB_CPUTYPE_ARMV5TE
end if
#endif

end sub

Expand Down Expand Up @@ -1690,7 +1687,7 @@ dim shared as FBOSARCHINFO fbosarchmap(0 to ...) => _
(@"darwin" , FB_COMPTARGET_DARWIN , FB_DEFAULT_CPUTYPE ), _
(@"freebsd", FB_COMPTARGET_FREEBSD, FB_DEFAULT_CPUTYPE ), _
(@"linux" , FB_COMPTARGET_LINUX , FB_DEFAULT_CPUTYPE ), _
(@"android", FB_COMPTARGET_ANDROID, FB_CPUTYPE_ARMV7A ), _
(@"android", FB_COMPTARGET_ANDROID, FB_CPUTYPE_ARMV5TE ), _
(@"netbsd" , FB_COMPTARGET_NETBSD , FB_DEFAULT_CPUTYPE ), _
(@"openbsd", FB_COMPTARGET_OPENBSD, FB_DEFAULT_CPUTYPE ) _
}
Expand All @@ -1712,7 +1709,7 @@ dim shared as FBOSARCHINFO fbosarchmap(0 to ...) => _
'' (the rough format is <arch>-<vendor>-<os> but it can vary a lot)
'' -target i686-pc-linux-gnu -> Linux + i686
'' -target arm-linux-gnueabihf -> Linux + default ARM arch
'' -target arm-linux-androideabi -> Android + ARMv7-a/ARM eabi
'' -target arm-linux-androideabi -> Android + ARMv5te/ARM eabi
'' -target x86_64-w64-mingw32 -> Windows + x86_64
'' ...
''
Expand Down

0 comments on commit 1fdf88a

Please sign in to comment.