Browse Source

Add -EB or -EL paramter to xtensa assembler call (Warning: this requires a patched 2.40 release\!)

Pierre Muller 2 years ago
parent
commit
665670ae01
1 changed files with 6 additions and 1 deletions
  1. 6 1
      compiler/xtensa/agcpugas.pas

+ 6 - 1
compiler/xtensa/agcpugas.pas

@@ -66,6 +66,11 @@ unit agcpugas;
     function TXtensaGNUAssembler.MakeCmdLine: TCmdStr;
       begin
         result:=inherited MakeCmdLine;
+        if target_info.endian=endian_little then
+          Replace(result,'$SHORTENDIAN','-EL')
+        else
+          Replace(result,'$SHORTENDIAN','-EB');
+
       end;
 
 {****************************************************************************}
@@ -178,7 +183,7 @@ unit agcpugas;
 
             idtxt  : 'AS';
             asmbin : 'as';
-            asmcmd : '-o $OBJ $EXTRAOPT $ASM --longcalls';
+            asmcmd : '-o $OBJ $SHORTENDIAN $EXTRAOPT $ASM --longcalls';
             supported_targets : [system_xtensa_embedded,system_xtensa_linux,system_xtensa_freertos];
             flags : [af_needar,af_smartlink_sections,af_supports_dwarf,af_stabs_use_function_absolute_addresses];
             labelprefix : '.L';