瀏覽代碼

+ be able to specify endianess in the assembler command line
+ pass endianess to the powerpc assembler (GNU only), so an unified be/le GNU assembler can used to build powerpc64le

git-svn-id: trunk@32894 -

florian 9 年之前
父節點
當前提交
4ccc75e2e8
共有 2 個文件被更改,包括 10 次插入2 次删除
  1. 8 0
      compiler/assemble.pas
  2. 2 2
      compiler/ppcgen/agppcgas.pas

+ 8 - 0
compiler/assemble.pas

@@ -927,14 +927,22 @@ Implementation
              Replace(result,'$ASM',maybequoted(AsmFileName));
              Replace(result,'$ASM',maybequoted(AsmFileName));
            Replace(result,'$OBJ',maybequoted(ObjFileName));
            Replace(result,'$OBJ',maybequoted(ObjFileName));
          end;
          end;
+
          if (cs_create_pic in current_settings.moduleswitches) then
          if (cs_create_pic in current_settings.moduleswitches) then
            Replace(result,'$PIC','-KPIC')
            Replace(result,'$PIC','-KPIC')
          else
          else
            Replace(result,'$PIC','');
            Replace(result,'$PIC','');
+
          if (cs_asm_source in current_settings.globalswitches) then
          if (cs_asm_source in current_settings.globalswitches) then
            Replace(result,'$NOWARN','')
            Replace(result,'$NOWARN','')
          else
          else
            Replace(result,'$NOWARN','-W');
            Replace(result,'$NOWARN','-W');
+
+         if target_info.endian=endian_little then
+           Replace(result,'$ENDIAN','-mlittle')
+         else
+           Replace(result,'$ENDIAN','-mbig');
+
          Replace(result,'$EXTRAOPT',asmextraopt);
          Replace(result,'$EXTRAOPT',asmextraopt);
       end;
       end;
 
 

+ 2 - 2
compiler/ppcgen/agppcgas.pas

@@ -539,9 +539,9 @@ unit agppcgas;
          idtxt  : 'AS';
          idtxt  : 'AS';
          asmbin : 'as';
          asmbin : 'as';
 {$ifdef cpu64bitaddr}
 {$ifdef cpu64bitaddr}
-         asmcmd : '-a64 -o $OBJ $EXTRAOPT $ASM';
+         asmcmd : '-a64 $ENDIAN -o $OBJ $EXTRAOPT $ASM';
 {$else cpu64bitaddr}
 {$else cpu64bitaddr}
-         asmcmd: '-o $OBJ $EXTRAOPT $ASM';
+         asmcmd: '$ENDIAN -o $OBJ $EXTRAOPT $ASM';
 {$endif cpu64bitaddr}
 {$endif cpu64bitaddr}
          supported_targets : [system_powerpc_linux,system_powerpc_netbsd,system_powerpc_openbsd,system_powerpc_MorphOS,system_powerpc_Amiga,system_powerpc64_linux,system_powerpc_embedded,system_powerpc64_embedded];
          supported_targets : [system_powerpc_linux,system_powerpc_netbsd,system_powerpc_openbsd,system_powerpc_MorphOS,system_powerpc_Amiga,system_powerpc64_linux,system_powerpc_embedded,system_powerpc64_embedded];
          flags : [af_needar,af_smartlink_sections];
          flags : [af_needar,af_smartlink_sections];