@@ -3082,6 +3082,11 @@ private function hCompileXpm( ) as integer
3082
3082
function = TRUE
3083
3083
end function
3084
3084
3085
+ # if defined( __FB_WIN32__ )
3086
+ '' LLVM official Windows binary distributions lack llc.exe, use clang instead
3087
+ #define NO_LLC
3088
+ # endif
3089
+
3085
3090
private function hCompileStage2Module( byval module as FBCIOFILE ptr ) as integer
3086
3091
dim as string ln, asmfile
3087
3092
@@ -3190,13 +3195,34 @@ private function hCompileStage2Module( byval module as FBCIOFILE ptr ) as intege
3190
3195
end select
3191
3196
3192
3197
case FB_BACKEND_LLVM
3198
+ #ifdef NO_LLC
3199
+ ln += "-S "
3200
+ '' Silence "overriding the module target triple" warning. Maybe warning
3201
+ '' that the target should be declared in the .ll instead.
3202
+ ln += "-Wno-override-module "
3203
+ '' Tell clang we're using system as, so don't use extensions in the asm
3204
+ ln += "-no-integrated-as "
3205
+ # endif
3206
+
3193
3207
select case ( fbGetCpuFamily( ) )
3194
3208
case FB_CPUFAMILY_X86
3195
- ln += "-march=x86 "
3209
+ #ifdef NO_LLC
3210
+ ln += "--target=i686 "
3211
+ # else
3212
+ ln += "-march=x86 "
3213
+ # endif
3196
3214
case FB_CPUFAMILY_X86_64
3197
- ln += "-march=x86-64 "
3215
+ #ifdef NO_LLC
3216
+ ln += "--target=x86_64 "
3217
+ # else
3218
+ ln += "-march=x86-64 "
3219
+ # endif
3198
3220
case FB_CPUFAMILY_ARM
3199
- ln += "-march=arm "
3221
+ #ifdef NO_LLC
3222
+ ln += "--target=armv7a "
3223
+ # else
3224
+ ln += "-march=arm "
3225
+ # endif
3200
3226
case FB_CPUFAMILY_AARCH64
3201
3227
'' From the GCC manual:
3202
3228
'' -march=name
@@ -3230,7 +3256,11 @@ private function hCompileStage2Module( byval module as FBCIOFILE ptr ) as intege
3230
3256
'' is tuned to perform well across a range of target
3231
3257
'' processors implementing the target architecture.
3232
3258
3233
- ln += "-march=armv8-a "
3259
+ #ifdef NO_LLC
3260
+ ln += "--target=armv8a "
3261
+ # else
3262
+ ln += "-march=armv8-a "
3263
+ # endif
3234
3264
end select
3235
3265
3236
3266
if ( fbGetOption( FB_COMPOPT_PIC ) ) then
@@ -3242,7 +3272,11 @@ private function hCompileStage2Module( byval module as FBCIOFILE ptr ) as intege
3242
3272
select case ( fbGetCpuFamily( ) )
3243
3273
case FB_CPUFAMILY_X86, FB_CPUFAMILY_X86_64
3244
3274
if ( fbGetOption( FB_COMPOPT_ASMSYNTAX ) = FB_ASMSYNTAX_INTEL ) then
3245
- ln += "--x86-asm-syntax=intel "
3275
+ #ifdef NO_LLC
3276
+ ln += "-masm=intel "
3277
+ # else
3278
+ ln += "--x86-asm-syntax=intel "
3279
+ # endif
3246
3280
end if
3247
3281
end select
3248
3282
@@ -3260,7 +3294,12 @@ private function hCompileStage2Module( byval module as FBCIOFILE ptr ) as intege
3260
3294
end if
3261
3295
function = fbcRunBin( "compiling C" , gcc, ln )
3262
3296
case FB_BACKEND_LLVM
3263
- function = fbcRunBin( "compiling LLVM IR" , FBCTOOL_LLC, ln )
3297
+ #ifdef NO_LLC
3298
+ const compiler = FBCTOOL_CLANG
3299
+ # else
3300
+ const compiler = FBCTOOL_LLC
3301
+ # endif
3302
+ function = fbcRunBin( "compiling LLVM IR" , compiler, ln )
3264
3303
end select
3265
3304
end function
3266
3305
0 commit comments