Przeglądaj źródła

+ 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 lat temu
rodzic
commit
4ccc75e2e8
2 zmienionych plików z 10 dodań i 2 usunięć
  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,'$OBJ',maybequoted(ObjFileName));
          end;
+
          if (cs_create_pic in current_settings.moduleswitches) then
            Replace(result,'$PIC','-KPIC')
          else
            Replace(result,'$PIC','');
+
          if (cs_asm_source in current_settings.globalswitches) then
            Replace(result,'$NOWARN','')
          else
            Replace(result,'$NOWARN','-W');
+
+         if target_info.endian=endian_little then
+           Replace(result,'$ENDIAN','-mlittle')
+         else
+           Replace(result,'$ENDIAN','-mbig');
+
          Replace(result,'$EXTRAOPT',asmextraopt);
       end;
 

+ 2 - 2
compiler/ppcgen/agppcgas.pas

@@ -539,9 +539,9 @@ unit agppcgas;
          idtxt  : 'AS';
          asmbin : 'as';
 {$ifdef cpu64bitaddr}
-         asmcmd : '-a64 -o $OBJ $EXTRAOPT $ASM';
+         asmcmd : '-a64 $ENDIAN -o $OBJ $EXTRAOPT $ASM';
 {$else cpu64bitaddr}
-         asmcmd: '-o $OBJ $EXTRAOPT $ASM';
+         asmcmd: '$ENDIAN -o $OBJ $EXTRAOPT $ASM';
 {$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];
          flags : [af_needar,af_smartlink_sections];