diff --git a/compiler/aasmdata.pas b/compiler/aasmdata.pas index 0710b7a60f..a2441796ef 100644 --- a/compiler/aasmdata.pas +++ b/compiler/aasmdata.pas @@ -482,7 +482,7 @@ implementation procedure TAsmData.getlabel(out l : TAsmLabel;alt:TAsmLabeltype); begin - if (target_info.system in (systems_linux + systems_bsd)) and + if (target_info.system in (systems_linux + systems_bsd + systems_android)) and { the next condition was (cs_create_smart in current_settings.moduleswitches) and but if we create_smartlink_sections, this is useless } diff --git a/compiler/aggas.pas b/compiler/aggas.pas index 61bb952d8b..f9d728029c 100644 --- a/compiler/aggas.pas +++ b/compiler/aggas.pas @@ -1693,7 +1693,7 @@ implementation AsmWriteLn(#9'.subsections_via_symbols'); { "no executable stack" marker for Linux } - if (target_info.system in systems_linux) and + if (target_info.system in (systems_linux + systems_android)) and not(cs_executable_stack in current_settings.moduleswitches) then begin AsmWriteLn('.section .note.GNU-stack,"",%progbits'); diff --git a/compiler/expunix.pas b/compiler/expunix.pas index 4e7bc80ff5..06e95c7b7d 100644 --- a/compiler/expunix.pas +++ b/compiler/expunix.pas @@ -154,7 +154,7 @@ begin current_asmdata.asmlists[al_procedures].concat(Tai_symbol.Createname_global(hp2.name^,AT_FUNCTION,0)); if (cs_create_pic in current_settings.moduleswitches) and { other targets need to be checked how it works } - (target_info.system in [system_i386_freebsd,system_x86_64_freebsd,system_x86_64_linux,system_i386_linux,system_x86_64_solaris,system_i386_solaris]) then + (target_info.system in [system_i386_freebsd,system_x86_64_freebsd,system_x86_64_linux,system_i386_linux,system_x86_64_solaris,system_i386_solaris,system_i386_android]) then begin {$ifdef x86} sym:=current_asmdata.RefAsmSymbol(pd.mangledname); diff --git a/compiler/ncgld.pas b/compiler/ncgld.pas index be3bb37e15..41ff1451eb 100644 --- a/compiler/ncgld.pas +++ b/compiler/ncgld.pas @@ -360,7 +360,7 @@ implementation location:=gvs.localloc; {$ifdef i386} case target_info.system of - system_i386_linux: + system_i386_linux,system_i386_android: location.reference.segment:=NR_GS; end; {$endif i386} diff --git a/compiler/ogelf.pas b/compiler/ogelf.pas index f0c7bda20b..3e7831137c 100644 --- a/compiler/ogelf.pas +++ b/compiler/ogelf.pas @@ -1192,7 +1192,7 @@ implementation symtabsect:=TElfSymtab.create(data,esk_obj); shstrtabsect:=TElfObjSection.create_ext(data,'.shstrtab',SHT_STRTAB,0,1,0); { "no executable stack" marker for Linux } - if (target_info.system in systems_linux) and + if (target_info.system in (systems_linux + systems_android)) and not(cs_executable_stack in current_settings.moduleswitches) then TElfObjSection.create_ext(data,'.note.GNU-stack',SHT_PROGBITS,0,1,0); { symbol for filename } diff --git a/compiler/systems.pas b/compiler/systems.pas index ffacdea537..705f601dac 100644 --- a/compiler/systems.pas +++ b/compiler/systems.pas @@ -297,7 +297,7 @@ interface system_i386_netwlibc, system_arm_wince, system_x86_64_win64, - system_ia64_win64]+systems_linux; + system_ia64_win64]+systems_linux+systems_android; { all systems for which weak linking has been tested/is supported } systems_weak_linking = systems_darwin + systems_solaris + systems_linux + systems_android; diff --git a/compiler/x86/agx86att.pas b/compiler/x86/agx86att.pas index 617d123b58..252aec6f39 100644 --- a/compiler/x86/agx86att.pas +++ b/compiler/x86/agx86att.pas @@ -488,7 +488,8 @@ interface asmcmd : '--32 -o $OBJ $ASM'; supported_targets : [system_i386_GO32V2,system_i386_linux,system_i386_Win32,system_i386_freebsd,system_i386_solaris,system_i386_beos, system_i386_netbsd,system_i386_Netware,system_i386_qnx,system_i386_wdosx,system_i386_openbsd, - system_i386_netwlibc,system_i386_wince,system_i386_embedded,system_i386_symbian,system_i386_haiku,system_x86_6432_linux]; + system_i386_netwlibc,system_i386_wince,system_i386_embedded,system_i386_symbian,system_i386_haiku, + system_x86_6432_linux,system_i386_android]; flags : [af_needar,af_smartlink_sections,af_supports_dwarf]; labelprefix : '.L'; comment : '# '; diff --git a/compiler/x86/cgx86.pas b/compiler/x86/cgx86.pas index 152fd783d4..8d1a2d5ac8 100644 --- a/compiler/x86/cgx86.pas +++ b/compiler/x86/cgx86.pas @@ -1003,7 +1003,7 @@ unit cgx86; { Convert thread local address to a process global addres as we cannot handle far pointers.} case target_info.system of - system_i386_linux: + system_i386_linux,system_i386_android: if segment=NR_GS then begin reference_reset_symbol(tmpref,current_asmdata.RefAsmSymbol('___fpc_threadvar_offset'),0,ref.alignment); diff --git a/compiler/x86/rax86.pas b/compiler/x86/rax86.pas index 66cf6ed496..c903f9166a 100644 --- a/compiler/x86/rax86.pas +++ b/compiler/x86/rax86.pas @@ -1107,7 +1107,7 @@ begin if someone uses this in assembler code FPC itself does not use it at all PM } if (opcode=A_ENTER) and - (target_info.system in [system_i386_linux,system_i386_FreeBSD]) then + (target_info.system in [system_i386_linux,system_i386_FreeBSD,system_i386_android]) then Message(asmr_w_enter_not_supported_by_linux);