Skip to content

Commit 9fc7d15

Browse files
czsgabajayrm
authored andcommitted
fbc: aarch64 target by default maps to '-march=armv8-a' when passing options to gcc/LLVM
- aarch64 is not a permissible value for -march passed to gcc/LLVM - fbc will accept aarch64, then map to '-march=armv8-a' when calling the backend - comments in fbc.bas:hCompileStage2Module() listing permissible values
1 parent 27832b2 commit 9fc7d15

File tree

3 files changed

+36
-2
lines changed

3 files changed

+36
-2
lines changed

changelog.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ Version 1.07.0
33
[changed]
44
- SADD/STRPTR(wstring) returns WSTRING PTR
55
- '-v' be verbose command line option affects '-help' output
6+
- fbc aarch64 target by default maps to '-march=armv8-a' when passing options to gcc/LLVM (czsgaba)
67

78
[added]
89
- CVA_LIST type, CVA_START(), CVA_COPY() CVA_END(), CVA_ARG() macros will map to gcc's __builtin_va_list and __builtin_va_* macros in gcc backend
@@ -46,6 +47,7 @@ Version 1.07.0
4647
- github #116: Fix optimizations in [L/R]TrimAny rtlib functions (SkyFish)
4748
- github #145: WSTRING concat and assign buffer (&=) overrun
4849
- sf.net #893: 'Suffixes are only valid in -lang' error message showing incorrect -lang options allowed
50+
- fbc uses '-march=armv8-a' instead of invalid option '-march=aarch64' when passing options to gcc/LLVM (czsgaba)
4951

5052

5153
Version 1.06.0

src/compiler/fb.bas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ dim shared as FBCPUTYPEINFO cputypeinfo(0 to FB_CPUTYPE__COUNT-1) = _
232232
( NULL , @"x86-64" , FB_CPUFAMILY_X86_64 , 64 ), _ '' FB_CPUTYPE_X86_64
233233
( NULL , @"armv6" , FB_CPUFAMILY_ARM , 32 ), _ '' FB_CPUTYPE_ARMV6
234234
( NULL , @"armv7-a" , FB_CPUFAMILY_ARM , 32 ), _ '' FB_CPUTYPE_ARMV7A
235-
( NULL , @"aarch64" , FB_CPUFAMILY_AARCH64, 64 ) _ '' FB_CPUTYPE_AARCH64
235+
( @"armv8-a" , @"aarch64" , FB_CPUFAMILY_AARCH64, 64 ) _ '' FB_CPUTYPE_AARCH64
236236
}
237237

238238
''::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

src/compiler/fbc.bas

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2961,7 +2961,39 @@ private function hCompileStage2Module( byval module as FBCIOFILE ptr ) as intege
29612961
case FB_CPUFAMILY_ARM
29622962
ln += "-march=arm "
29632963
case FB_CPUFAMILY_AARCH64
2964-
ln += "-march=aarch64 "
2964+
'' From the GCC manual:
2965+
'' -march=name
2966+
'' Specify the name of the target architecture and,
2967+
'' optionally, one or more feature modifiers. This option
2968+
'' has the form ‘-march=arch{+[no]feature}*’.
2969+
''
2970+
'' The permissible values for arch are
2971+
'' 'armv8-a'
2972+
'' 'armv8.1-a' = 'armv8-a' + ARMv8.1-A
2973+
'' 'armv8.2-a' = 'armv8.1-a' + ARMv8.2-A
2974+
'' 'armv8.3-a' = 'armv8.2-a' + ARMv8.3-A
2975+
'' 'armv8.4-a' = 'armv8.3-a' + ARMv8.4-A
2976+
'' 'armv8.5-a' = 'armv8.4-a' + ARMv8.5-A
2977+
'' 'native' = architecture of the host system
2978+
''
2979+
'' It enables the '+crc', '+lse', and '+rdma' features.
2980+
''
2981+
'' The value 'native' is available on native AArch64
2982+
'' GNU/Linux and causes the compiler to pick the
2983+
'' architecture of the host system. This option has no
2984+
'' effect if the compiler is unable to recognize the
2985+
'' architecture of the host system, The permissible
2986+
'' values for feature are listed in the sub-section on
2987+
'' ['-march' and '-mcpu' Feature Modifiers]. Where
2988+
'' conflicting feature modifiers are specified, the
2989+
'' right-most feature is used. GCC uses name to determine
2990+
'' what kind of instructions it can emit when generating
2991+
'' assembly code. If '-march' is specified without either
2992+
'' of '-mtune' or '-mcpu' also being specified, the code
2993+
'' is tuned to perform well across a range of target
2994+
'' processors implementing the target architecture.
2995+
2996+
ln += "-march=armv8-a "
29652997
end select
29662998

29672999
if( fbGetOption( FB_COMPOPT_PIC ) ) then

0 commit comments

Comments
 (0)