mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-11 13:09:43 +02:00
* merged the fixes_3_0-relevant parts of r31808, r31830, r31879: add support
for clang as an assembler on Darwin and use it by default for i386 and x86_64 (ARM will be in fixes_3_0_ios) git-svn-id: branches/fixes_3_0@31907 -
This commit is contained in:
parent
24747a2e4f
commit
decff7ad16
@ -368,7 +368,7 @@ unit agarmgas;
|
|||||||
as_arm_gas_darwin_info : tasminfo =
|
as_arm_gas_darwin_info : tasminfo =
|
||||||
(
|
(
|
||||||
id : as_darwin;
|
id : as_darwin;
|
||||||
idtxt : 'AS-Darwin';
|
idtxt : 'AS-DARWIN';
|
||||||
asmbin : 'as';
|
asmbin : 'as';
|
||||||
asmcmd : '-o $OBJ $EXTRAOPT $ASM -arch $ARCH';
|
asmcmd : '-o $OBJ $EXTRAOPT $ASM -arch $ARCH';
|
||||||
supported_targets : [system_arm_darwin];
|
supported_targets : [system_arm_darwin];
|
||||||
@ -379,7 +379,22 @@ unit agarmgas;
|
|||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
as_arm_clang_darwin_info : tasminfo =
|
||||||
|
(
|
||||||
|
id : as_clang;
|
||||||
|
idtxt : 'CLANG';
|
||||||
|
asmbin : 'clang';
|
||||||
|
asmcmd : '-c -o $OBJ $EXTRAOPT -arch $ARCH $DARWINVERSION -x assembler $ASM';
|
||||||
|
supported_targets : [system_arm_darwin];
|
||||||
|
flags : [af_needar,af_smartlink_sections,af_supports_dwarf];
|
||||||
|
labelprefix : 'L';
|
||||||
|
comment : '# ';
|
||||||
|
dollarsign: '$';
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
begin
|
begin
|
||||||
RegisterAssembler(as_arm_gas_info,TARMGNUAssembler);
|
RegisterAssembler(as_arm_gas_info,TARMGNUAssembler);
|
||||||
RegisterAssembler(as_arm_gas_darwin_info,TArmAppleGNUAssembler);
|
RegisterAssembler(as_arm_gas_darwin_info,TArmAppleGNUAssembler);
|
||||||
|
RegisterAssembler(as_arm_clang_darwin_info,TArmAppleGNUAssembler);
|
||||||
end.
|
end.
|
||||||
|
@ -275,7 +275,7 @@ Implementation
|
|||||||
begin
|
begin
|
||||||
DoPipe:=(cs_asm_pipe in current_settings.globalswitches) and
|
DoPipe:=(cs_asm_pipe in current_settings.globalswitches) and
|
||||||
(([cs_asm_extern,cs_asm_leave,cs_link_on_target] * current_settings.globalswitches) = []) and
|
(([cs_asm_extern,cs_asm_leave,cs_link_on_target] * current_settings.globalswitches) = []) and
|
||||||
((target_asm.id in [as_gas,as_ggas,as_darwin,as_powerpc_xcoff]));
|
((target_asm.id in [as_gas,as_ggas,as_darwin,as_powerpc_xcoff,as_clang]));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -582,6 +582,13 @@ Implementation
|
|||||||
function TExternalAssembler.MakeCmdLine: TCmdStr;
|
function TExternalAssembler.MakeCmdLine: TCmdStr;
|
||||||
begin
|
begin
|
||||||
result:=target_asm.asmcmd;
|
result:=target_asm.asmcmd;
|
||||||
|
{ for Xcode 7.x and later }
|
||||||
|
if MacOSXVersionMin<>'' then
|
||||||
|
Replace(result,'$DARWINVERSION','-mmacosx-version-min='+MacOSXVersionMin)
|
||||||
|
else if iPhoneOSVersionMin<>'' then
|
||||||
|
Replace(result,'$DARWINVERSION','-miphoneos-version-min='+iPhoneOSVersionMin)
|
||||||
|
else
|
||||||
|
Replace(result,'$DARWINVERSION','');
|
||||||
{$ifdef arm}
|
{$ifdef arm}
|
||||||
if (target_info.system=system_arm_darwin) then
|
if (target_info.system=system_arm_darwin) then
|
||||||
Replace(result,'$ARCH',lower(cputypestr[current_settings.cputype]));
|
Replace(result,'$ARCH',lower(cputypestr[current_settings.cputype]));
|
||||||
@ -595,7 +602,10 @@ Implementation
|
|||||||
begin
|
begin
|
||||||
{$ifdef hasunix}
|
{$ifdef hasunix}
|
||||||
if DoPipe then
|
if DoPipe then
|
||||||
Replace(result,'$ASM','')
|
if target_asm.id<>as_clang then
|
||||||
|
Replace(result,'$ASM','')
|
||||||
|
else
|
||||||
|
Replace(result,'$ASM','-')
|
||||||
else
|
else
|
||||||
{$endif}
|
{$endif}
|
||||||
Replace(result,'$ASM',maybequoted(AsmFileName));
|
Replace(result,'$ASM',maybequoted(AsmFileName));
|
||||||
|
@ -556,7 +556,7 @@ unit agppcgas;
|
|||||||
(
|
(
|
||||||
id : as_darwin;
|
id : as_darwin;
|
||||||
|
|
||||||
idtxt : 'AS-Darwin';
|
idtxt : 'AS-DARWIN';
|
||||||
asmbin : 'as';
|
asmbin : 'as';
|
||||||
asmcmd : '-o $OBJ $EXTRAOPT $ASM -arch $ARCH';
|
asmcmd : '-o $OBJ $EXTRAOPT $ASM -arch $ARCH';
|
||||||
supported_targets : [system_powerpc_darwin,system_powerpc64_darwin];
|
supported_targets : [system_powerpc_darwin,system_powerpc64_darwin];
|
||||||
|
@ -211,6 +211,7 @@
|
|||||||
,as_i8086_nasm
|
,as_i8086_nasm
|
||||||
,as_i8086_nasmobj
|
,as_i8086_nasmobj
|
||||||
,as_gas_powerpc_xcoff
|
,as_gas_powerpc_xcoff
|
||||||
|
,as_clang
|
||||||
);
|
);
|
||||||
|
|
||||||
tlink = (ld_none,
|
tlink = (ld_none,
|
||||||
|
@ -70,7 +70,7 @@ interface
|
|||||||
id : tasm;
|
id : tasm;
|
||||||
idtxt : string[12];
|
idtxt : string[12];
|
||||||
asmbin : string[8];
|
asmbin : string[8];
|
||||||
asmcmd : string[50];
|
asmcmd : string[70];
|
||||||
supported_targets : set of tsystem;
|
supported_targets : set of tsystem;
|
||||||
flags : set of tasmflags;
|
flags : set of tasmflags;
|
||||||
labelprefix : string[3];
|
labelprefix : string[3];
|
||||||
|
@ -729,8 +729,8 @@ unit i_bsd;
|
|||||||
Cprefix : '_';
|
Cprefix : '_';
|
||||||
newline : #10;
|
newline : #10;
|
||||||
dirsep : '/';
|
dirsep : '/';
|
||||||
assem : as_darwin;
|
assem : as_clang;
|
||||||
assemextern : as_darwin;
|
assemextern : as_clang;
|
||||||
link : ld_none;
|
link : ld_none;
|
||||||
linkextern : ld_bsd;
|
linkextern : ld_bsd;
|
||||||
ar : ar_gnu_ar;
|
ar : ar_gnu_ar;
|
||||||
@ -793,8 +793,8 @@ unit i_bsd;
|
|||||||
Cprefix : '_';
|
Cprefix : '_';
|
||||||
newline : #10;
|
newline : #10;
|
||||||
dirsep : '/';
|
dirsep : '/';
|
||||||
assem : as_darwin;
|
assem : as_clang;
|
||||||
assemextern : as_darwin;
|
assemextern : as_clang;
|
||||||
link : ld_none;
|
link : ld_none;
|
||||||
linkextern : ld_bsd;
|
linkextern : ld_bsd;
|
||||||
ar : ar_gnu_ar;
|
ar : ar_gnu_ar;
|
||||||
@ -921,8 +921,8 @@ unit i_bsd;
|
|||||||
Cprefix : '_';
|
Cprefix : '_';
|
||||||
newline : #10;
|
newline : #10;
|
||||||
dirsep : '/';
|
dirsep : '/';
|
||||||
assem : as_darwin;
|
assem : as_clang;
|
||||||
assemextern : as_darwin;
|
assemextern : as_clang;
|
||||||
link : ld_none;
|
link : ld_none;
|
||||||
linkextern : ld_bsd;
|
linkextern : ld_bsd;
|
||||||
ar : ar_gnu_ar;
|
ar : ar_gnu_ar;
|
||||||
|
@ -508,7 +508,7 @@ interface
|
|||||||
as_x86_64_gas_darwin_info : tasminfo =
|
as_x86_64_gas_darwin_info : tasminfo =
|
||||||
(
|
(
|
||||||
id : as_darwin;
|
id : as_darwin;
|
||||||
idtxt : 'AS-Darwin';
|
idtxt : 'AS-DARWIN';
|
||||||
asmbin : 'as';
|
asmbin : 'as';
|
||||||
asmcmd : '-o $OBJ $EXTRAOPT $ASM -arch x86_64';
|
asmcmd : '-o $OBJ $EXTRAOPT $ASM -arch x86_64';
|
||||||
supported_targets : [system_x86_64_darwin];
|
supported_targets : [system_x86_64_darwin];
|
||||||
@ -518,6 +518,19 @@ interface
|
|||||||
dollarsign: '$';
|
dollarsign: '$';
|
||||||
);
|
);
|
||||||
|
|
||||||
|
as_x86_64_clang_darwin_info : tasminfo =
|
||||||
|
(
|
||||||
|
id : as_clang;
|
||||||
|
idtxt : 'CLANG';
|
||||||
|
asmbin : 'clang';
|
||||||
|
asmcmd : '-c -o $OBJ $EXTRAOPT -arch x86_64 $DARWINVERSION -x assembler $ASM';
|
||||||
|
supported_targets : [system_x86_64_darwin];
|
||||||
|
flags : [af_needar,af_smartlink_sections,af_supports_dwarf];
|
||||||
|
labelprefix : 'L';
|
||||||
|
comment : '# ';
|
||||||
|
dollarsign: '$';
|
||||||
|
);
|
||||||
|
|
||||||
{$else x86_64}
|
{$else x86_64}
|
||||||
as_i386_as_info : tasminfo =
|
as_i386_as_info : tasminfo =
|
||||||
(
|
(
|
||||||
@ -569,7 +582,7 @@ interface
|
|||||||
as_i386_gas_darwin_info : tasminfo =
|
as_i386_gas_darwin_info : tasminfo =
|
||||||
(
|
(
|
||||||
id : as_darwin;
|
id : as_darwin;
|
||||||
idtxt : 'AS-Darwin';
|
idtxt : 'AS-DARWIN';
|
||||||
asmbin : 'as';
|
asmbin : 'as';
|
||||||
asmcmd : '-o $OBJ $EXTRAOPT $ASM -arch i386';
|
asmcmd : '-o $OBJ $EXTRAOPT $ASM -arch i386';
|
||||||
supported_targets : [system_i386_darwin,system_i386_iphonesim];
|
supported_targets : [system_i386_darwin,system_i386_iphonesim];
|
||||||
@ -579,6 +592,19 @@ interface
|
|||||||
dollarsign: '$';
|
dollarsign: '$';
|
||||||
);
|
);
|
||||||
|
|
||||||
|
as_i386_clang_darwin_info : tasminfo =
|
||||||
|
(
|
||||||
|
id : as_clang;
|
||||||
|
idtxt : 'CLANG';
|
||||||
|
asmbin : 'clang';
|
||||||
|
asmcmd : '-c -o $OBJ $EXTRAOPT -arch i386 $DARWINVERSION -x assembler $ASM';
|
||||||
|
supported_targets : [system_i386_darwin,system_i386_iphonesim];
|
||||||
|
flags : [af_needar,af_smartlink_sections,af_supports_dwarf];
|
||||||
|
labelprefix : 'L';
|
||||||
|
comment : '# ';
|
||||||
|
dollarsign: '$';
|
||||||
|
);
|
||||||
|
|
||||||
as_i386_gas_info : tasminfo =
|
as_i386_gas_info : tasminfo =
|
||||||
(
|
(
|
||||||
id : as_ggas;
|
id : as_ggas;
|
||||||
@ -602,11 +628,13 @@ initialization
|
|||||||
RegisterAssembler(as_x86_64_yasm_info,Tx86ATTAssembler);
|
RegisterAssembler(as_x86_64_yasm_info,Tx86ATTAssembler);
|
||||||
RegisterAssembler(as_x86_64_gas_info,Tx86ATTAssembler);
|
RegisterAssembler(as_x86_64_gas_info,Tx86ATTAssembler);
|
||||||
RegisterAssembler(as_x86_64_gas_darwin_info,Tx86AppleGNUAssembler);
|
RegisterAssembler(as_x86_64_gas_darwin_info,Tx86AppleGNUAssembler);
|
||||||
|
RegisterAssembler(as_x86_64_clang_darwin_info,Tx86AppleGNUAssembler);
|
||||||
{$else x86_64}
|
{$else x86_64}
|
||||||
RegisterAssembler(as_i386_as_info,Tx86ATTAssembler);
|
RegisterAssembler(as_i386_as_info,Tx86ATTAssembler);
|
||||||
RegisterAssembler(as_i386_gas_info,Tx86ATTAssembler);
|
RegisterAssembler(as_i386_gas_info,Tx86ATTAssembler);
|
||||||
RegisterAssembler(as_i386_yasm_info,Tx86ATTAssembler);
|
RegisterAssembler(as_i386_yasm_info,Tx86ATTAssembler);
|
||||||
RegisterAssembler(as_i386_gas_darwin_info,Tx86AppleGNUAssembler);
|
RegisterAssembler(as_i386_gas_darwin_info,Tx86AppleGNUAssembler);
|
||||||
|
RegisterAssembler(as_i386_clang_darwin_info,Tx86AppleGNUAssembler);
|
||||||
RegisterAssembler(as_i386_as_aout_info,Tx86AoutGNUAssembler);
|
RegisterAssembler(as_i386_as_aout_info,Tx86AoutGNUAssembler);
|
||||||
{$endif x86_64}
|
{$endif x86_64}
|
||||||
end.
|
end.
|
||||||
|
Loading…
Reference in New Issue
Block a user