浏览代码

* synchronised with trunk up to r21067

git-svn-id: branches/jvmbackend@21068 -
Jonas Maebe 13 年之前
父节点
当前提交
834026bfb5
共有 100 个文件被更改,包括 1843 次插入969 次删除
  1. 23 1
      .gitattributes
  2. 13 2
      Makefile
  3. 26 2
      compiler/Makefile
  4. 16 2
      compiler/aasmdata.pas
  5. 11 4
      compiler/aggas.pas
  6. 4 1
      compiler/aoptbase.pas
  7. 160 48
      compiler/aoptobj.pas
  8. 150 42
      compiler/arm/aoptcpu.pas
  9. 4 0
      compiler/arm/cpubase.pas
  10. 16 4
      compiler/arm/cpupara.pas
  11. 1 1
      compiler/assemble.pas
  12. 3 3
      compiler/avr/agavrgas.pas
  13. 16 5
      compiler/cgobj.pas
  14. 17 6
      compiler/dbgstabs.pas
  15. 48 59
      compiler/defcmp.pas
  16. 3 3
      compiler/fmodule.pas
  17. 2 2
      compiler/globals.pas
  18. 4 1
      compiler/globtype.pas
  19. 78 59
      compiler/htypechk.pas
  20. 1 1
      compiler/i386/cpupi.pas
  21. 1 1
      compiler/jvm/njvmcon.pas
  22. 1 1
      compiler/jvm/njvmtcon.pas
  23. 1 0
      compiler/mips/cpugas.pas
  24. 5 1
      compiler/msg/errore.msg
  25. 1 1
      compiler/msgidx.inc
  26. 91 84
      compiler/msgtxt.inc
  27. 4 4
      compiler/nadd.pas
  28. 8 14
      compiler/ncal.pas
  29. 11 14
      compiler/ncgcal.pas
  30. 6 0
      compiler/ncgutil.pas
  31. 7 6
      compiler/ncnv.pas
  32. 5 5
      compiler/ncon.pas
  33. 3 2
      compiler/ngenutil.pas
  34. 3 3
      compiler/ngtcon.pas
  35. 1 1
      compiler/ninl.pas
  36. 1 1
      compiler/nobj.pas
  37. 5 0
      compiler/optdead.pas
  38. 1 1
      compiler/pexpr.pas
  39. 0 186
      compiler/powerpc/nppcadd.pas
  40. 1 2
      compiler/powerpc/rappcgas.pas
  41. 38 141
      compiler/powerpc64/cgcpu.pas
  42. 23 9
      compiler/powerpc64/cpupara.pas
  43. 9 3
      compiler/powerpc64/rappcgas.pas
  44. 10 14
      compiler/ppcgen/agppcgas.pas
  45. 139 27
      compiler/ppcgen/cgppc.pas
  46. 3 4
      compiler/ppcmips.lpi
  47. 10 8
      compiler/ppcmipsel.lpi
  48. 4 3
      compiler/ptconst.pas
  49. 6 5
      compiler/symconst.pas
  50. 7 7
      compiler/systems/i_aix.pas
  51. 12 12
      compiler/systems/i_bsd.pas
  52. 17 2
      compiler/utils/Makefile
  53. 167 31
      compiler/x86_64/aoptcpu.pas
  54. 30 2
      ide/Makefile
  55. 3 0
      ide/Makefile.fpc
  56. 17 2
      ide/compiler/Makefile
  57. 8 2
      ide/fakegdb/Makefile
  58. 17 2
      installer/Makefile
  59. 5 2
      packages/Makefile
  60. 9 2
      packages/a52/Makefile
  61. 9 2
      packages/amunits/Makefile
  62. 17 2
      packages/amunits/src/utilunits/Makefile
  63. 9 2
      packages/aspell/Makefile
  64. 9 2
      packages/bfd/Makefile
  65. 9 2
      packages/bzip2/Makefile
  66. 1 1
      packages/bzip2/src/bzip2.pas
  67. 3 3
      packages/bzip2/src/bzip2i386.inc
  68. 3 3
      packages/bzip2/src/bzip2si386.inc
  69. 1 1
      packages/bzip2/src/bzip2stream.pp
  70. 9 2
      packages/cairo/Makefile
  71. 9 2
      packages/cdrom/Makefile
  72. 13 2
      packages/cdrom/examples/Makefile
  73. 9 2
      packages/chm/Makefile
  74. 9 2
      packages/cocoaint/Makefile
  75. 9 2
      packages/dblib/Makefile
  76. 9 2
      packages/dbus/Makefile
  77. 13 2
      packages/dbus/examples/Makefile
  78. 9 2
      packages/dts/Makefile
  79. 9 2
      packages/fastcgi/Makefile
  80. 9 2
      packages/fcl-async/Makefile
  81. 9 2
      packages/fcl-base/Makefile
  82. 21 2
      packages/fcl-base/examples/Makefile
  83. 9 2
      packages/fcl-db/Makefile
  84. 23 2
      packages/fcl-db/src/base/Makefile
  85. 65 41
      packages/fcl-db/src/base/bufdataset.pas
  86. 14 4
      packages/fcl-db/src/base/dataset.inc
  87. 7 2
      packages/fcl-db/src/base/db.pas
  88. 2 0
      packages/fcl-db/src/base/dbconst.pas
  89. 6 1
      packages/fcl-db/src/base/fields.inc
  90. 19 2
      packages/fcl-db/src/codegen/Makefile
  91. 26 2
      packages/fcl-db/src/datadict/Makefile
  92. 25 2
      packages/fcl-db/src/dbase/Makefile
  93. 20 2
      packages/fcl-db/src/export/Makefile
  94. 14 2
      packages/fcl-db/src/json/Makefile
  95. 19 2
      packages/fcl-db/src/memds/Makefile
  96. 17 2
      packages/fcl-db/src/paradox/Makefile
  97. 16 2
      packages/fcl-db/src/sdf/Makefile
  98. 22 2
      packages/fcl-db/src/sql/Makefile
  99. 38 2
      packages/fcl-db/src/sqldb/Makefile
  100. 17 2
      packages/fcl-db/src/sqldb/interbase/Makefile

+ 23 - 1
.gitattributes

@@ -2096,6 +2096,7 @@ packages/fcl-db/tests/testdbbasics.pas svneol=native#text/plain
 packages/fcl-db/tests/testdddiff.pp svneol=native#text/plain
 packages/fcl-db/tests/testdddiff.pp svneol=native#text/plain
 packages/fcl-db/tests/testfieldtypes.pas svneol=native#text/plain
 packages/fcl-db/tests/testfieldtypes.pas svneol=native#text/plain
 packages/fcl-db/tests/testjsondataset.pp svneol=native#text/plain
 packages/fcl-db/tests/testjsondataset.pp svneol=native#text/plain
+packages/fcl-db/tests/testspecifictbufdataset.pas svneol=native#text/plain
 packages/fcl-db/tests/testsqlfiles.lpi svneol=native#text/plain
 packages/fcl-db/tests/testsqlfiles.lpi svneol=native#text/plain
 packages/fcl-db/tests/testsqlfiles.lpr svneol=native#text/plain
 packages/fcl-db/tests/testsqlfiles.lpr svneol=native#text/plain
 packages/fcl-db/tests/testsqlscanner.lpi svneol=native#text/plain
 packages/fcl-db/tests/testsqlscanner.lpi svneol=native#text/plain
@@ -7674,6 +7675,7 @@ rtl/linux/arm/ucprt0.as svneol=native#text/plain
 rtl/linux/buildrtl.lpi svneol=native#text/plain
 rtl/linux/buildrtl.lpi svneol=native#text/plain
 rtl/linux/buildrtl.pp svneol=native#text/plain
 rtl/linux/buildrtl.pp svneol=native#text/plain
 rtl/linux/bunxsysc.inc svneol=native#text/plain
 rtl/linux/bunxsysc.inc svneol=native#text/plain
+rtl/linux/errno-sparc.inc svneol=native#text/plain
 rtl/linux/errno.inc svneol=native#text/plain
 rtl/linux/errno.inc svneol=native#text/plain
 rtl/linux/errnostr.inc svneol=native#text/plain
 rtl/linux/errnostr.inc svneol=native#text/plain
 rtl/linux/fpcylix.pp svneol=native#text/plain
 rtl/linux/fpcylix.pp svneol=native#text/plain
@@ -7728,6 +7730,7 @@ rtl/linux/mips/stat.inc svneol=native#text/plain
 rtl/linux/mips/syscall.inc svneol=native#text/plain
 rtl/linux/mips/syscall.inc svneol=native#text/plain
 rtl/linux/mips/syscallh.inc svneol=native#text/plain
 rtl/linux/mips/syscallh.inc svneol=native#text/plain
 rtl/linux/mips/sysnr.inc svneol=native#text/plain
 rtl/linux/mips/sysnr.inc svneol=native#text/plain
+rtl/linux/mipsel/bsyscall.inc svneol=native#text/plain
 rtl/linux/mipsel/cprt0.as svneol=native#text/plain
 rtl/linux/mipsel/cprt0.as svneol=native#text/plain
 rtl/linux/mipsel/dllprt0.as svneol=native#text/plain
 rtl/linux/mipsel/dllprt0.as svneol=native#text/plain
 rtl/linux/mipsel/gprt0.as svneol=native#text/plain
 rtl/linux/mipsel/gprt0.as svneol=native#text/plain
@@ -7854,11 +7857,17 @@ rtl/mips/setjump.inc svneol=native#text/plain
 rtl/mips/setjumph.inc svneol=native#text/plain
 rtl/mips/setjumph.inc svneol=native#text/plain
 rtl/mips/strings.inc svneol=native#text/plain
 rtl/mips/strings.inc svneol=native#text/plain
 rtl/mips/stringss.inc svneol=native#text/plain
 rtl/mips/stringss.inc svneol=native#text/plain
+rtl/mipsel/int64p.inc svneol=native#text/plain
 rtl/mipsel/makefile.cpu svneol=native#text/plain
 rtl/mipsel/makefile.cpu svneol=native#text/plain
 rtl/mipsel/math.inc svneol=native#text/plain
 rtl/mipsel/math.inc svneol=native#text/plain
+rtl/mipsel/mathu.inc svneol=native#text/plain
+rtl/mipsel/mathuh.inc svneol=native#text/plain
 rtl/mipsel/mips.inc svneol=native#text/plain
 rtl/mipsel/mips.inc svneol=native#text/plain
 rtl/mipsel/set.inc svneol=native#text/plain
 rtl/mipsel/set.inc svneol=native#text/plain
+rtl/mipsel/setjump.inc svneol=native#text/plain
 rtl/mipsel/setjumph.inc svneol=native#text/plain
 rtl/mipsel/setjumph.inc svneol=native#text/plain
+rtl/mipsel/strings.inc svneol=native#text/plain
+rtl/mipsel/stringss.inc svneol=native#text/plain
 rtl/morphos/Makefile svneol=native#text/plain
 rtl/morphos/Makefile svneol=native#text/plain
 rtl/morphos/Makefile.fpc svneol=native#text/plain
 rtl/morphos/Makefile.fpc svneol=native#text/plain
 rtl/morphos/aboxlib.pas -text svneol=unset#text/plain
 rtl/morphos/aboxlib.pas -text svneol=unset#text/plain
@@ -8192,7 +8201,6 @@ rtl/objpas/varutilh.inc svneol=native#text/plain
 rtl/objpas/varutils.inc svneol=native#text/plain
 rtl/objpas/varutils.inc svneol=native#text/plain
 rtl/openbsd/Makefile svneol=native#text/plain
 rtl/openbsd/Makefile svneol=native#text/plain
 rtl/openbsd/Makefile.fpc svneol=native#text/plain
 rtl/openbsd/Makefile.fpc svneol=native#text/plain
-rtl/openbsd/check_sys.sh svneol=native#text/plain
 rtl/openbsd/classes.pp svneol=native#text/plain
 rtl/openbsd/classes.pp svneol=native#text/plain
 rtl/openbsd/errno.inc svneol=native#text/plain
 rtl/openbsd/errno.inc svneol=native#text/plain
 rtl/openbsd/errnostr.inc svneol=native#text/plain
 rtl/openbsd/errnostr.inc svneol=native#text/plain
@@ -8484,6 +8492,11 @@ rtl/unix/oscdecl.inc svneol=native#text/plain
 rtl/unix/oscdeclh.inc svneol=native#text/plain
 rtl/unix/oscdeclh.inc svneol=native#text/plain
 rtl/unix/ports.pp svneol=native#text/plain
 rtl/unix/ports.pp svneol=native#text/plain
 rtl/unix/printer.pp svneol=native#text/plain
 rtl/unix/printer.pp svneol=native#text/plain
+rtl/unix/scripts/README svneol=native#text/plain
+rtl/unix/scripts/check_consts.sh svneol=native#text/plain
+rtl/unix/scripts/check_errno.sh svneol=native#text/plain
+rtl/unix/scripts/check_errnostr.sh svneol=native#text/plain
+rtl/unix/scripts/check_sys.sh svneol=native#text/plain
 rtl/unix/serial.pp svneol=native#text/plain
 rtl/unix/serial.pp svneol=native#text/plain
 rtl/unix/settimeo.inc svneol=native#text/plain
 rtl/unix/settimeo.inc svneol=native#text/plain
 rtl/unix/sockets.pp svneol=native#text/plain
 rtl/unix/sockets.pp svneol=native#text/plain
@@ -9606,6 +9619,13 @@ tests/test/cg/cdecl/taoc3.pp svneol=native#text/plain
 tests/test/cg/cdecl/taoc4.pp svneol=native#text/plain
 tests/test/cg/cdecl/taoc4.pp svneol=native#text/plain
 tests/test/cg/cdecl/taoc5.pp svneol=native#text/plain
 tests/test/cg/cdecl/taoc5.pp svneol=native#text/plain
 tests/test/cg/cdecl/taoc6.pp svneol=native#text/plain
 tests/test/cg/cdecl/taoc6.pp svneol=native#text/plain
+tests/test/cg/obj/aix/powerpc/cpptcl1.o -text
+tests/test/cg/obj/aix/powerpc/cpptcl2.o -text
+tests/test/cg/obj/aix/powerpc/ctest.o -text
+tests/test/cg/obj/aix/powerpc/tcext3.o -text
+tests/test/cg/obj/aix/powerpc/tcext4.o -text
+tests/test/cg/obj/aix/powerpc/tcext5.o -text
+tests/test/cg/obj/aix/powerpc/tcext6.o -text
 tests/test/cg/obj/amiga/m68k/ctest.o -text
 tests/test/cg/obj/amiga/m68k/ctest.o -text
 tests/test/cg/obj/beos/i386/ctest.o -text
 tests/test/cg/obj/beos/i386/ctest.o -text
 tests/test/cg/obj/beos/i386/tcext3.o -text
 tests/test/cg/obj/beos/i386/tcext3.o -text
@@ -10214,6 +10234,8 @@ tests/test/opt/twpo5.pp svneol=native#text/plain
 tests/test/opt/twpo6.pp svneol=native#text/plain
 tests/test/opt/twpo6.pp svneol=native#text/plain
 tests/test/opt/twpo7.pp svneol=native#text/plain
 tests/test/opt/twpo7.pp svneol=native#text/plain
 tests/test/opt/uwpo2.pp svneol=native#text/plain
 tests/test/opt/uwpo2.pp svneol=native#text/plain
+tests/test/packages/bzip2/tbzip2streamtest.pp svneol=native#text/plain
+tests/test/packages/bzip2/testbzip2.res -text
 tests/test/packages/cocoaint/tobjc33.pp svneol=native#text/plain
 tests/test/packages/cocoaint/tobjc33.pp svneol=native#text/plain
 tests/test/packages/cocoaint/tobjc33a.pp svneol=native#text/plain
 tests/test/packages/cocoaint/tobjc33a.pp svneol=native#text/plain
 tests/test/packages/cocoaint/tobjcnh1.pp svneol=native#text/plain
 tests/test/packages/cocoaint/tobjcnh1.pp svneol=native#text/plain

+ 13 - 2
Makefile

@@ -1,8 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2012/04/13]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2012/04/25]
 #
 #
 default: help
 default: help
-MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux jvm-java jvm-android
+MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-netbsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux jvm-java jvm-android
 BSDs = freebsd netbsd openbsd darwin
 BSDs = freebsd netbsd openbsd darwin
 UNIXs = linux $(BSDs) solaris qnx haiku aix
 UNIXs = linux $(BSDs) solaris qnx haiku aix
 LIMIT83fs = go32v2 os2 emx watcom
 LIMIT83fs = go32v2 os2 emx watcom
@@ -550,6 +550,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 override TARGET_DIRS+=compiler rtl utils packages ide installer
 override TARGET_DIRS+=compiler rtl utils packages ide installer
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+override TARGET_DIRS+=compiler rtl utils packages ide installer
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 override TARGET_DIRS+=compiler rtl utils packages ide installer
 override TARGET_DIRS+=compiler rtl utils packages ide installer
 endif
 endif
@@ -2093,6 +2096,14 @@ TARGET_DIRS_PACKAGES=1
 TARGET_DIRS_IDE=1
 TARGET_DIRS_IDE=1
 TARGET_DIRS_INSTALLER=1
 TARGET_DIRS_INSTALLER=1
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+TARGET_DIRS_COMPILER=1
+TARGET_DIRS_RTL=1
+TARGET_DIRS_UTILS=1
+TARGET_DIRS_PACKAGES=1
+TARGET_DIRS_IDE=1
+TARGET_DIRS_INSTALLER=1
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 TARGET_DIRS_COMPILER=1
 TARGET_DIRS_COMPILER=1
 TARGET_DIRS_RTL=1
 TARGET_DIRS_RTL=1

+ 26 - 2
compiler/Makefile

@@ -1,8 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2012/04/13]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2012/04/25]
 #
 #
 default: all
 default: all
-MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux jvm-java jvm-android
+MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-netbsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux jvm-java jvm-android
 BSDs = freebsd netbsd openbsd darwin
 BSDs = freebsd netbsd openbsd darwin
 UNIXs = linux $(BSDs) solaris qnx haiku aix
 UNIXs = linux $(BSDs) solaris qnx haiku aix
 LIMIT83fs = go32v2 os2 emx watcom
 LIMIT83fs = go32v2 os2 emx watcom
@@ -605,6 +605,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 override TARGET_DIRS+=utils
 override TARGET_DIRS+=utils
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+override TARGET_DIRS+=utils
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 override TARGET_DIRS+=utils
 override TARGET_DIRS+=utils
 endif
 endif
@@ -812,6 +815,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 override TARGET_PROGRAMS+=pp
 override TARGET_PROGRAMS+=pp
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+override TARGET_PROGRAMS+=pp
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 override TARGET_PROGRAMS+=pp
 override TARGET_PROGRAMS+=pp
 endif
 endif
@@ -1020,6 +1026,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 override COMPILER_INCLUDEDIR+=$(CPC_TARGET)
 override COMPILER_INCLUDEDIR+=$(CPC_TARGET)
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+override COMPILER_INCLUDEDIR+=$(CPC_TARGET)
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 override COMPILER_INCLUDEDIR+=$(CPC_TARGET)
 override COMPILER_INCLUDEDIR+=$(CPC_TARGET)
 endif
 endif
@@ -1227,6 +1236,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
 override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
 override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
 endif
 endif
@@ -1434,6 +1446,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 override COMPILER_TARGETDIR+=.
 override COMPILER_TARGETDIR+=.
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+override COMPILER_TARGETDIR+=.
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 override COMPILER_TARGETDIR+=.
 override COMPILER_TARGETDIR+=.
 endif
 endif
@@ -1641,6 +1656,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
 override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
 override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
 endif
 endif
@@ -2459,6 +2477,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+REQUIRE_PACKAGES_RTL=1
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 endif
 endif
@@ -3297,6 +3318,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 TARGET_DIRS_UTILS=1
 TARGET_DIRS_UTILS=1
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+TARGET_DIRS_UTILS=1
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 TARGET_DIRS_UTILS=1
 TARGET_DIRS_UTILS=1
 endif
 endif

+ 16 - 2
compiler/aasmdata.pas

@@ -62,6 +62,7 @@ interface
         al_dwarf_abbrev,
         al_dwarf_abbrev,
         al_dwarf_line,
         al_dwarf_line,
         al_picdata,
         al_picdata,
+        al_indirectpicdata,
         al_resourcestrings,
         al_resourcestrings,
         { Objective-C related sections }
         { Objective-C related sections }
         al_objc_data,
         al_objc_data,
@@ -111,6 +112,7 @@ interface
         'al_dwarf_abbrev',
         'al_dwarf_abbrev',
         'al_dwarf_line',
         'al_dwarf_line',
         'al_picdata',
         'al_picdata',
+        'al_indirectpicdata',
         'al_resourcestrings',
         'al_resourcestrings',
         'al_objc_data',
         'al_objc_data',
         'al_objc_pools',
         'al_objc_pools',
@@ -163,6 +165,7 @@ interface
         constructor create(const n:string);
         constructor create(const n:string);
         destructor  destroy;override;
         destructor  destroy;override;
         { asmsymbol }
         { asmsymbol }
+        function  DefineAsmSymbolByClass(symclass: TAsmSymbolClass; const s : TSymStr;_bind:TAsmSymBind;_typ:Tasmsymtype) : TAsmSymbol;
         function  DefineAsmSymbol(const s : TSymStr;_bind:TAsmSymBind;_typ:Tasmsymtype) : TAsmSymbol;
         function  DefineAsmSymbol(const s : TSymStr;_bind:TAsmSymBind;_typ:Tasmsymtype) : TAsmSymbol;
         function  WeakRefAsmSymbol(const s : TSymStr) : TAsmSymbol;
         function  WeakRefAsmSymbol(const s : TSymStr) : TAsmSymbol;
         function  RefAsmSymbol(const s : TSymStr) : TAsmSymbol;
         function  RefAsmSymbol(const s : TSymStr) : TAsmSymbol;
@@ -181,6 +184,7 @@ interface
         { hash tables for reusing constant storage }
         { hash tables for reusing constant storage }
         property ConstPools[APoolType:TConstPoolType]: THashSet read GetConstPools;
         property ConstPools[APoolType:TConstPoolType]: THashSet read GetConstPools;
       end;
       end;
+      TAsmDataClass = class of TAsmData;
 
 
       TTCInitItem = class(TLinkedListItem)
       TTCInitItem = class(TLinkedListItem)
         sym: tsym;
         sym: tsym;
@@ -189,6 +193,10 @@ interface
         constructor Create(asym: tsym; aoffset: aint; alabel: TAsmSymbol);
         constructor Create(asym: tsym; aoffset: aint; alabel: TAsmSymbol);
       end;
       end;
 
 
+    const
+      casmdata: TAsmDataClass = TAsmData;
+
+
     var
     var
       CAsmCFI : TAsmCFIClass;
       CAsmCFI : TAsmCFIClass;
       current_asmdata : TAsmData;
       current_asmdata : TAsmData;
@@ -395,7 +403,7 @@ implementation
       end;
       end;
 
 
 
 
-    function TAsmData.DefineAsmSymbol(const s : TSymStr;_bind:TAsmSymBind;_typ:Tasmsymtype) : TAsmSymbol;
+    function TAsmData.DefineAsmSymbolByClass(symclass: TAsmSymbolClass; const s : TSymStr;_bind:TAsmSymBind;_typ:Tasmsymtype) : TAsmSymbol;
       var
       var
         hp : TAsmSymbol;
         hp : TAsmSymbol;
       begin
       begin
@@ -416,12 +424,18 @@ implementation
         else
         else
          begin
          begin
            { Not found, insert it. }
            { Not found, insert it. }
-           hp:=TAsmSymbol.create(AsmSymbolDict,s,_bind,_typ);
+           hp:=symclass.create(AsmSymbolDict,s,_bind,_typ);
          end;
          end;
         result:=hp;
         result:=hp;
       end;
       end;
 
 
 
 
+    function TAsmData.DefineAsmSymbol(const s : TSymStr;_bind:TAsmSymBind;_typ:Tasmsymtype) : TAsmSymbol;
+      begin
+        result:=DefineAsmSymbolByClass(TAsmSymbol,s,_bind,_typ);
+      end;
+
+
     function TAsmData.RefAsmSymbol(const s : TSymStr) : TAsmSymbol;
     function TAsmData.RefAsmSymbol(const s : TSymStr) : TAsmSymbol;
       begin
       begin
         result:=TAsmSymbol(FAsmSymbolDict.Find(s));
         result:=TAsmSymbol(FAsmSymbolDict.Find(s));

+ 11 - 4
compiler/aggas.pas

@@ -470,7 +470,7 @@ implementation
         l: longint;
         l: longint;
       begin
       begin
         if (secalign=0) or
         if (secalign=0) or
-           not(atype in [sec_code,sec_bss,sec_rodata_norel]) then
+           not(atype in [sec_code,sec_bss,sec_rodata_norel,sec_rodata,sec_data]) then
           begin
           begin
             result:='';
             result:='';
             exit;
             exit;
@@ -753,7 +753,7 @@ implementation
                        asmwrite(tai_datablock(hp).sym.name);
                        asmwrite(tai_datablock(hp).sym.name);
                        asmwriteln(', '+tostr(tai_datablock(hp).size)+','+tostr(last_align));
                        asmwriteln(', '+tostr(tai_datablock(hp).size)+','+tostr(last_align));
                        if not(LastSecType in [sec_data,sec_none]) then
                        if not(LastSecType in [sec_data,sec_none]) then
-                         writesection(LastSecType,'',secorder_default,last_align);
+                         writesection(LastSecType,'',secorder_default,1 shl last_align);
                      end
                      end
                    else
                    else
                      begin
                      begin
@@ -775,7 +775,7 @@ implementation
                        asmwrite(#9'.space ');
                        asmwrite(#9'.space ');
                        asmwriteln(tostr(tai_datablock(hp).size));
                        asmwriteln(tostr(tai_datablock(hp).size));
                        if not(LastSecType in [sec_data,sec_none]) then
                        if not(LastSecType in [sec_data,sec_none]) then
-                         writesection(LastSecType,'',secorder_default,last_align);
+                         writesection(LastSecType,'',secorder_default,1 shl last_align);
                      end
                      end
                    else
                    else
                      begin
                      begin
@@ -930,7 +930,14 @@ implementation
                        end
                        end
                      else
                      else
                        begin
                        begin
-                         AsmWrite(ait_const2str[constdef]);
+                         if not(target_info.system in systems_aix) or
+                            (constdef<>aitconst_64bit) then
+                           AsmWrite(ait_const2str[constdef])
+                         else
+                           { can't use .llong, because that forces 8 byte
+                             alignnment and we sometimes store addresses on
+                             4-byte aligned addresses (e.g. in the RTTI) }
+                           AsmWrite('.vbyte'#9'8,');
                          l:=0;
                          l:=0;
                          t := '';
                          t := '';
                          repeat
                          repeat

+ 4 - 1
compiler/aoptbase.pas

@@ -91,11 +91,12 @@ unit aoptbase;
 
 
     end;
     end;
 
 
+    function labelCanBeSkipped(p: tai_label): boolean;
 
 
   implementation
   implementation
 
 
     uses
     uses
-      globtype,globals, aoptcpub;
+      globtype,globals,aoptcpub;
 
 
   constructor taoptbase.create;
   constructor taoptbase.create;
     begin
     begin
@@ -148,11 +149,13 @@ unit aoptbase;
     Result:=true;
     Result:=true;
   End;
   End;
 
 
+
   function labelCanBeSkipped(p: tai_label): boolean;
   function labelCanBeSkipped(p: tai_label): boolean;
   begin
   begin
     labelCanBeSkipped := not(p.labsym.is_used) or (p.labsym.labeltype<>alt_jump);
     labelCanBeSkipped := not(p.labsym.is_used) or (p.labsym.labeltype<>alt_jump);
   end;
   end;
 
 
+
   Function TAOptBase.GetNextInstruction(Current: tai; Var Next: tai): Boolean;
   Function TAOptBase.GetNextInstruction(Current: tai; Var Next: tai): Boolean;
   Begin
   Begin
     Repeat
     Repeat

+ 160 - 48
compiler/aoptobj.pas

@@ -59,28 +59,34 @@ Unit AoptObj;
       TRefCompare = Function(const r1, r2: TReference): Boolean;
       TRefCompare = Function(const r1, r2: TReference): Boolean;
       //!!! FIXME
       //!!! FIXME
       TRegArray = Array[byte] of tsuperregister;
       TRegArray = Array[byte] of tsuperregister;
+
+
       TRegSet = Set of byte;
       TRegSet = Set of byte;
-    { possible actions on an operand: read, write or modify (= read & write) }
+      { possible actions on an operand: read, write or modify (= read & write) }
       TOpAction = (OpAct_Read, OpAct_Write, OpAct_Modify, OpAct_Unknown);
       TOpAction = (OpAct_Read, OpAct_Write, OpAct_Modify, OpAct_Unknown);
 
 
     { ************************************************************************* }
     { ************************************************************************* }
     { * Object to hold information on which regiters are in use and which not * }
     { * Object to hold information on which regiters are in use and which not * }
     { ************************************************************************* }
     { ************************************************************************* }
+
+      { TUsedRegs }
+
       TUsedRegs = class
       TUsedRegs = class
-        Constructor create;
-        Constructor create_regset(Const _RegSet: TRegSet);
+        Constructor create(aTyp : TRegisterType);
+        Constructor create_regset(aTyp : TRegisterType;Const _RegSet: TRegSet);
 
 
         Destructor Destroy;override;
         Destructor Destroy;override;
-        { update the info with the pairegalloc objects coming after }
-        { p                                                         }
+
+        Procedure Clear;
+        { update the info with the pairegalloc objects coming after
+          p                                                         }
         Procedure Update(p: Tai);
         Procedure Update(p: Tai);
         { is Reg currently in use }
         { is Reg currently in use }
         Function IsUsed(Reg: TRegister): Boolean;
         Function IsUsed(Reg: TRegister): Boolean;
         { get all the currently used registers }
         { get all the currently used registers }
         Function GetUsedRegs: TRegSet;
         Function GetUsedRegs: TRegSet;
-
       Private
       Private
-
+        Typ : TRegisterType;
         UsedRegs: TRegSet;
         UsedRegs: TRegSet;
       End;
       End;
 
 
@@ -120,10 +126,10 @@ Unit AoptObj;
     { gets one of these assigned: a pointer to it is stored in the OptInfo field }
     { gets one of these assigned: a pointer to it is stored in the OptInfo field }
     { ************************************************************************** }
     { ************************************************************************** }
 
 
+      { TPaiProp }
+
       TPaiProp = class(TAoptBaseCpu)
       TPaiProp = class(TAoptBaseCpu)
         Regs: TRegContent;
         Regs: TRegContent;
-        { info about allocation of general purpose integer registers }
-        UsedRegs: TUsedRegs;
         { can this instruction be removed? }
         { can this instruction be removed? }
         CanBeRemoved: Boolean;
         CanBeRemoved: Boolean;
 
 
@@ -227,6 +233,9 @@ Unit AoptObj;
     { ********** General optimizer object, used to derive others from ********* }
     { ********** General optimizer object, used to derive others from ********* }
     { ************************************************************************* }
     { ************************************************************************* }
 
 
+      TAllUsedRegs = array[TRegisterType] of TUsedRegs;
+      { TAOptObj }
+
       TAOptObj = class(TAoptBaseCpu)
       TAOptObj = class(TAoptBaseCpu)
         { the PAasmOutput list this optimizer instance works on }
         { the PAasmOutput list this optimizer instance works on }
         AsmL: TAsmList;
         AsmL: TAsmList;
@@ -240,15 +249,25 @@ Unit AoptObj;
         BlockStart, BlockEnd: Tai;
         BlockStart, BlockEnd: Tai;
 
 
         DFA: TAOptDFA;
         DFA: TAOptDFA;
+
+        UsedRegs: TAllUsedRegs;
+
         { _AsmL is the PAasmOutpout list that has to be optimized,     }
         { _AsmL is the PAasmOutpout list that has to be optimized,     }
         { _BlockStart and _BlockEnd the start and the end of the block }
         { _BlockStart and _BlockEnd the start and the end of the block }
         { that has to be optimized and _LabelInfo a pointer to a       }
         { that has to be optimized and _LabelInfo a pointer to a       }
         { TLabelInfo record                                            }
         { TLabelInfo record                                            }
         Constructor create(_AsmL: TAsmList; _BlockStart, _BlockEnd: Tai;
         Constructor create(_AsmL: TAsmList; _BlockStart, _BlockEnd: Tai;
                            _LabelInfo: PLabelInfo); virtual; reintroduce;
                            _LabelInfo: PLabelInfo); virtual; reintroduce;
+        Destructor Destroy;override;
 
 
         { processor independent methods }
         { processor independent methods }
 
 
+        Procedure ClearUsedRegs;
+        Procedure UpdateUsedRegs(p : Tai);
+        procedure UpdateUsedRegs(var Regs: TAllUsedRegs; p: Tai);
+        Function CopyUsedRegs(var dest : TAllUsedRegs) : boolean;
+        Procedure ReleaseUsedRegs(const regs : TAllUsedRegs);
+
         { returns true if the label L is found between hp and the next }
         { returns true if the label L is found between hp and the next }
         { instruction                                                  }
         { instruction                                                  }
         Function FindLabel(L: TasmLabel; Var hp: Tai): Boolean;
         Function FindLabel(L: TasmLabel; Var hp: Tai): Boolean;
@@ -256,7 +275,6 @@ Unit AoptObj;
         { inserts new_one between prev and foll in AsmL }
         { inserts new_one between prev and foll in AsmL }
         Procedure InsertLLItem(prev, foll, new_one: TLinkedListItem);
         Procedure InsertLLItem(prev, foll, new_one: TLinkedListItem);
 
 
-
         { If P is a Tai object releveant to the optimizer, P is returned
         { If P is a Tai object releveant to the optimizer, P is returned
           If it is not relevant tot he optimizer, the first object after P
           If it is not relevant tot he optimizer, the first object after P
           that is relevant is returned                                     }
           that is relevant is returned                                     }
@@ -270,6 +288,9 @@ Unit AoptObj;
           instruction                                                      }
           instruction                                                      }
         Function FindRegAlloc(Reg: TRegister; StartPai: Tai): Boolean;
         Function FindRegAlloc(Reg: TRegister; StartPai: Tai): Boolean;
 
 
+        { reg used after p? }
+        function RegUsedAfterInstruction(reg: Tregister; p: tai; var AllUsedRegs: TAllUsedRegs): Boolean;
+
        { traces sucessive jumps to their final destination and sets it, e.g.
        { traces sucessive jumps to their final destination and sets it, e.g.
          je l1                je l3
          je l1                je l3
          <code>               <code>
          <code>               <code>
@@ -312,57 +333,76 @@ Unit AoptObj;
       { ******************************** TUsedRegs ****************************** }
       { ******************************** TUsedRegs ****************************** }
       { ************************************************************************* }
       { ************************************************************************* }
 
 
-      Constructor TUsedRegs.create;
+    Constructor TUsedRegs.create(aTyp : TRegisterType);
       Begin
       Begin
+        Typ:=aTyp;
         UsedRegs := [];
         UsedRegs := [];
       End;
       End;
 
 
-      Constructor TUsedRegs.create_regset(Const _RegSet: TRegSet);
+
+    Constructor TUsedRegs.create_regset(aTyp : TRegisterType;Const _RegSet: TRegSet);
       Begin
       Begin
+        Typ:=aTyp;
         UsedRegs := _RegSet;
         UsedRegs := _RegSet;
       End;
       End;
 
 
-      Procedure TUsedRegs.Update(p: Tai);
-      {updates UsedRegs with the RegAlloc Information coming after P}
+
+    {
+      updates UsedRegs with the RegAlloc Information coming after P
+    }
+    Procedure TUsedRegs.Update(p: Tai);
       Begin
       Begin
-        Repeat
-          While Assigned(p) And
+        repeat
+          while assigned(p) and
                 ((p.typ in (SkipInstr - [ait_RegAlloc])) or
                 ((p.typ in (SkipInstr - [ait_RegAlloc])) or
-                 ((p.typ = ait_label) And
-                  Not(Tai_Label(p).labsym.is_used))) Do
-               p := Tai(p.next);
-          While Assigned(p) And
+                 ((p.typ = ait_label) and
+                  labelCanBeSkipped(tai_label(p))) or
+                 ((p.typ = ait_marker) and
+                  (tai_Marker(p).Kind in [mark_AsmBlockEnd,mark_NoLineInfoStart,mark_NoLineInfoEnd]))) do
+               p := tai(p.next);
+          while assigned(p) and
                 (p.typ=ait_RegAlloc) Do
                 (p.typ=ait_RegAlloc) Do
-            Begin
-          {!!!!!!!! FIXME
-              if tai_regalloc(p).ratype=ra_alloc then
-                UsedRegs := UsedRegs + [tai_regalloc(p).Reg]
-              else
-                UsedRegs := UsedRegs - [tai_regalloc(p).Reg];
-              p := Tai(p.next);
-          }
-            End;
-        Until Not(Assigned(p)) Or
-              (Not(p.typ in SkipInstr) And
-               Not((p.typ = ait_label) And
-                  Not(Tai_Label(p).labsym.is_used)));
+            begin
+              if (getregtype(tai_regalloc(p).reg) = typ) then
+                begin
+                  case tai_regalloc(p).ratype of
+                    ra_alloc :
+                      Include(UsedRegs, getsupreg(tai_regalloc(p).reg));
+                    ra_dealloc :
+                      Exclude(UsedRegs, getsupreg(tai_regalloc(p).reg));
+                  end;
+                end;
+              p := tai(p.next);
+            end;
+        until not(assigned(p)) or
+              (not(p.typ in SkipInstr) and
+               not((p.typ = ait_label) and
+                   labelCanBeSkipped(tai_label(p))));
       End;
       End;
 
 
-      Function TUsedRegs.IsUsed(Reg: TRegister): Boolean;
+
+    Function TUsedRegs.IsUsed(Reg: TRegister): Boolean;
       Begin
       Begin
-        //!!!!!!!!!!! IsUsed := Reg in UsedRegs
-        Result:=False; { unimplemented }
+        IsUsed := (getregtype(Reg)=Typ) and (getsupreg(Reg) in UsedRegs);
       End;
       End;
 
 
-      Function TUsedRegs.GetUsedRegs: TRegSet;
+
+    Function TUsedRegs.GetUsedRegs: TRegSet;
       Begin
       Begin
         GetUsedRegs := UsedRegs;
         GetUsedRegs := UsedRegs;
       End;
       End;
 
 
-      Destructor TUsedRegs.Destroy;
-        Begin
-          inherited destroy;
-        end;
+
+    Destructor TUsedRegs.Destroy;
+      Begin
+        inherited destroy;
+      end;
+
+
+    procedure TUsedRegs.Clear;
+      begin
+        UsedRegs := [];
+      end;
 
 
       { ************************************************************************* }
       { ************************************************************************* }
       { **************************** TPaiProp *********************************** }
       { **************************** TPaiProp *********************************** }
@@ -377,6 +417,7 @@ Unit AoptObj;
         {  DirFlag: TFlagContents; I386 specific}
         {  DirFlag: TFlagContents; I386 specific}
         End;
         End;
 
 
+
       Function TPaiProp.RegInSequence(Reg, which: TRegister): Boolean;
       Function TPaiProp.RegInSequence(Reg, which: TRegister): Boolean;
       {
       {
       Var p: Tai;
       Var p: Tai;
@@ -555,6 +596,7 @@ Unit AoptObj;
       *)
       *)
       End;
       End;
 
 
+
       Procedure TPaiProp.DestroyAllRegs(var InstrSinceLastMod: TInstrSinceLastMod);
       Procedure TPaiProp.DestroyAllRegs(var InstrSinceLastMod: TInstrSinceLastMod);
       {Var Counter: TRegister;}
       {Var Counter: TRegister;}
       Begin {initializes/desrtoys all registers}
       Begin {initializes/desrtoys all registers}
@@ -736,13 +778,72 @@ Unit AoptObj;
 
 
       Constructor TAoptObj.create(_AsmL: TAsmList; _BlockStart, _BlockEnd: Tai;
       Constructor TAoptObj.create(_AsmL: TAsmList; _BlockStart, _BlockEnd: Tai;
                                   _LabelInfo: PLabelInfo);
                                   _LabelInfo: PLabelInfo);
+      var
+        i : TRegisterType;
       Begin
       Begin
         AsmL := _AsmL;
         AsmL := _AsmL;
         BlockStart := _BlockStart;
         BlockStart := _BlockStart;
         BlockEnd := _BlockEnd;
         BlockEnd := _BlockEnd;
-        LabelInfo := _LabelInfo
+        LabelInfo := _LabelInfo;
+        for i:=low(TRegisterType) to high(TRegisterType) do
+          UsedRegs[i]:=TUsedRegs.Create(i);
       End;
       End;
 
 
+      destructor TAOptObj.Destroy;
+        var
+          i : TRegisterType;
+        begin
+          for i:=low(TRegisterType) to high(TRegisterType) do
+            UsedRegs[i].Destroy;
+          inherited Destroy;
+        end;
+
+
+      procedure TAOptObj.ClearUsedRegs;
+        var
+          i : TRegisterType;
+        begin
+          for i:=low(TRegisterType) to high(TRegisterType) do
+            UsedRegs[i].Clear;
+        end;
+
+
+      procedure TAOptObj.UpdateUsedRegs(p : Tai);
+        var
+          i : TRegisterType;
+        begin
+          for i:=low(TRegisterType) to high(TRegisterType) do
+            UsedRegs[i].Update(p);
+        end;
+
+
+      procedure TAOptObj.UpdateUsedRegs(var Regs : TAllUsedRegs;p : Tai);
+        var
+          i : TRegisterType;
+        begin
+          for i:=low(TRegisterType) to high(TRegisterType) do
+            Regs[i].Update(p);
+        end;
+
+
+      function TAOptObj.CopyUsedRegs(var dest: TAllUsedRegs): boolean;
+      var
+        i : TRegisterType;
+      begin
+        Result:=true;
+        for i:=low(TRegisterType) to high(TRegisterType) do
+          dest[i]:=TUsedRegs.Create_Regset(i,UsedRegs[i].GetUsedRegs);
+      end;
+
+      procedure TAOptObj.ReleaseUsedRegs(const regs: TAllUsedRegs);
+        var
+          i : TRegisterType;
+      begin
+        for i:=low(TRegisterType) to high(TRegisterType) do
+          regs[i].Free;
+      end;
+
+
       Function TAOptObj.FindLabel(L: TasmLabel; Var hp: Tai): Boolean;
       Function TAOptObj.FindLabel(L: TasmLabel; Var hp: Tai): Boolean;
       Var TempP: Tai;
       Var TempP: Tai;
       Begin
       Begin
@@ -852,6 +953,17 @@ Unit AoptObj;
       End;
       End;
 
 
 
 
+      function TAOptObj.RegUsedAfterInstruction(reg: Tregister; p: tai;
+       var AllUsedRegs: TAllUsedRegs): Boolean;
+       begin
+         AllUsedRegs[getregtype(reg)].Update(tai(p.Next));
+         RegUsedAfterInstruction :=
+           (AllUsedRegs[getregtype(reg)].IsUsed(reg)); { optimization and
+              (not(getNextInstruction(p,p)) or
+               not(regLoadedWithNewValue(supreg,false,p))); }
+       end;
+
+
     function SkipLabels(hp: tai; var hp2: tai): boolean;
     function SkipLabels(hp: tai; var hp2: tai): boolean;
       {skips all labels and returns the next "real" instruction}
       {skips all labels and returns the next "real" instruction}
       begin
       begin
@@ -1008,10 +1120,10 @@ Unit AoptObj;
         p,hp1,hp2 : tai;
         p,hp1,hp2 : tai;
       begin
       begin
         p := BlockStart;
         p := BlockStart;
-        //!!!! UsedRegs := [];
+        ClearUsedRegs;
         while (p <> BlockEnd) Do
         while (p <> BlockEnd) Do
           begin
           begin
-            //!!!! UpDateUsedRegs(UsedRegs, tai(p.next));
+            UpdateUsedRegs(tai(p.next));
             if PeepHoleOptPass1Cpu(p) then
             if PeepHoleOptPass1Cpu(p) then
               continue;
               continue;
             case p.Typ Of
             case p.Typ Of
@@ -1116,7 +1228,7 @@ Unit AoptObj;
                     end; { if is_jmp }
                     end; { if is_jmp }
                 end;
                 end;
             end;
             end;
-            //!!!!!!!! updateUsedRegs(UsedRegs,p);
+            UpdateUsedRegs(p);
             p:=tai(p.next);
             p:=tai(p.next);
           end;
           end;
       end;
       end;
@@ -1132,13 +1244,13 @@ Unit AoptObj;
         p: tai;
         p: tai;
       begin
       begin
         p := BlockStart;
         p := BlockStart;
-        //!!!! UsedRegs := [];
+        ClearUsedRegs;
         while (p <> BlockEnd) Do
         while (p <> BlockEnd) Do
           begin
           begin
-            //!!!! UpDateUsedRegs(UsedRegs, tai(p.next));
+            UpdateUsedRegs(tai(p.next));
             if PostPeepHoleOptsCpu(p) then
             if PostPeepHoleOptsCpu(p) then
               continue;
               continue;
-            //!!!!!!!! updateUsedRegs(UsedRegs,p);
+            UpdateUsedRegs(p);
             p:=tai(p.next);
             p:=tai(p.next);
           end;
           end;
       end;
       end;

+ 150 - 42
compiler/arm/aoptcpu.pas

@@ -78,11 +78,46 @@ Implementation
         (r1.shiftmode = r2.shiftmode);
         (r1.shiftmode = r2.shiftmode);
     end;
     end;
 
 
+  function MatchInstruction(const instr: tai; const op: TAsmOp; const cond: TAsmConds; const postfix: TOpPostfixes): boolean;
+  begin
+    result :=
+      (instr.typ = ait_instruction) and
+      (taicpu(instr).opcode = op) and
+      ((cond = []) or (taicpu(instr).condition in cond)) and
+      ((postfix = []) or (taicpu(instr).oppostfix in postfix));
+  end;
+
+  function MatchOperand(const oper1: TOper; const oper2: TOper): boolean; inline;
+    begin
+      result := (oper1.typ = oper2.typ) and
+                (
+                  ((oper1.typ = top_const) and (oper1.val = oper2.val)) or
+                  ((oper1.typ = top_reg) and (oper1.reg = oper2.reg)) or
+                  ((oper1.typ = top_conditioncode) and (oper1.cc = oper2.cc))
+                );
+    end;
+
+  function MatchOperand(const oper: TOper; const reg: TRegister): boolean; inline;
+    begin
+      result := (oper.typ = top_reg) and (oper.reg = reg);
+    end;
+
+  procedure RemoveRedundantMove(const cmpp: tai; movp: tai; asml: TAsmList) ;
+    begin
+      if (taicpu(movp).condition = C_EQ) and
+         (taicpu(cmpp).oper[0]^.reg = taicpu(movp).oper[0]^.reg) and
+         (taicpu(cmpp).oper[1]^.val = taicpu(movp).oper[1]^.val) then
+      begin
+        asml.insertafter(tai_comment.Create(strpnew('Peephole CmpMovMov - Removed redundant moveq')), movp);
+        asml.remove(movp);
+        movp.free;
+      end;
+    end;
 
 
   function TCpuAsmOptimizer.PeepHoleOptPass1Cpu(var p: tai): boolean;
   function TCpuAsmOptimizer.PeepHoleOptPass1Cpu(var p: tai): boolean;
     var
     var
-      next1: tai;
       hp1,hp2: tai;
       hp1,hp2: tai;
+      i: longint;
     begin
     begin
       result := false;
       result := false;
       case p.typ of
       case p.typ of
@@ -99,15 +134,10 @@ Implementation
             { this optimization can applied only to the currently enabled operations because
             { this optimization can applied only to the currently enabled operations because
               the other operations do not update all flags and FPC does not track flag usage }
               the other operations do not update all flags and FPC does not track flag usage }
             if (taicpu(p).opcode in [A_ADC,A_ADD,A_SUB {A_UDIV,A_SDIV,A_MUL,A_MVN,A_MOV,A_ORR,A_EOR,A_AND}]) and
             if (taicpu(p).opcode in [A_ADC,A_ADD,A_SUB {A_UDIV,A_SDIV,A_MUL,A_MVN,A_MOV,A_ORR,A_EOR,A_AND}]) and
-              (taicpu(p).oper[0]^.typ = top_reg) and
               (taicpu(p).oppostfix = PF_None) and
               (taicpu(p).oppostfix = PF_None) and
               (taicpu(p).condition = C_None) and
               (taicpu(p).condition = C_None) and
               GetNextInstruction(p, hp1) and
               GetNextInstruction(p, hp1) and
-              (tai(hp1).typ = ait_instruction) and
-              (taicpu(hp1).opcode = A_CMP) and
-              (taicpu(hp1).oppostfix = PF_None) and
-              (taicpu(hp1).condition = C_None) and
-              (taicpu(hp1).oper[0]^.typ = top_reg) and
+              MatchInstruction(hp1, A_CMP, [C_None], [PF_None]) and
               (taicpu(hp1).oper[1]^.typ = top_const) and
               (taicpu(hp1).oper[1]^.typ = top_const) and
               (taicpu(p).oper[0]^.reg = taicpu(hp1).oper[0]^.reg) and
               (taicpu(p).oper[0]^.reg = taicpu(hp1).oper[0]^.reg) and
               (taicpu(hp1).oper[1]^.val = 0) { and
               (taicpu(hp1).oper[1]^.val = 0) { and
@@ -136,11 +166,8 @@ Implementation
                     }
                     }
                     if (taicpu(p).oper[1]^.ref^.addressmode=AM_OFFSET) and
                     if (taicpu(p).oper[1]^.ref^.addressmode=AM_OFFSET) and
                        GetNextInstruction(p,hp1) and
                        GetNextInstruction(p,hp1) and
-                       (hp1.typ = ait_instruction) and
-                       (taicpu(hp1).opcode = A_LDR) and
+                       MatchInstruction(hp1, A_LDR, [taicpu(p).condition, C_None], [PF_None]) and
                        RefsEqual(taicpu(p).oper[1]^.ref^,taicpu(hp1).oper[1]^.ref^) and
                        RefsEqual(taicpu(p).oper[1]^.ref^,taicpu(hp1).oper[1]^.ref^) and
-                       ((taicpu(p).condition = taicpu(hp1).condition) or
-                        (taicpu(p).condition = C_None)) and
                        (taicpu(hp1).oper[1]^.ref^.addressmode=AM_OFFSET) then
                        (taicpu(hp1).oper[1]^.ref^.addressmode=AM_OFFSET) then
                       begin
                       begin
                         if taicpu(hp1).oper[0]^.reg=taicpu(p).oper[0]^.reg then
                         if taicpu(hp1).oper[0]^.reg=taicpu(p).oper[0]^.reg then
@@ -150,6 +177,7 @@ Implementation
                           end
                           end
                         else
                         else
                           begin
                           begin
+                            asml.insertbefore(tai_comment.Create(strpnew('Peephole StrLdr2StrMov done')), hp1);
                             taicpu(hp1).opcode:=A_MOV;
                             taicpu(hp1).opcode:=A_MOV;
                             taicpu(hp1).oppostfix:=PF_None;
                             taicpu(hp1).oppostfix:=PF_None;
                             taicpu(hp1).loadreg(1,taicpu(p).oper[0]^.reg);
                             taicpu(hp1).loadreg(1,taicpu(p).oper[0]^.reg);
@@ -168,22 +196,21 @@ Implementation
                     }
                     }
                     if (taicpu(p).oper[1]^.ref^.addressmode=AM_OFFSET) and
                     if (taicpu(p).oper[1]^.ref^.addressmode=AM_OFFSET) and
                        GetNextInstruction(p,hp1) and
                        GetNextInstruction(p,hp1) and
-                       (hp1.typ = ait_instruction) and
-                       (taicpu(hp1).opcode = A_LDR) and
+                       MatchInstruction(hp1, A_LDR, [taicpu(p).condition, C_None], [PF_None]) and
                        RefsEqual(taicpu(p).oper[1]^.ref^,taicpu(hp1).oper[1]^.ref^) and
                        RefsEqual(taicpu(p).oper[1]^.ref^,taicpu(hp1).oper[1]^.ref^) and
-                       ((taicpu(p).condition = taicpu(hp1).condition) or
-                        (taicpu(p).condition = C_None)) and
                        (taicpu(p).oper[0]^.reg<>taicpu(hp1).oper[1]^.ref^.index) and
                        (taicpu(p).oper[0]^.reg<>taicpu(hp1).oper[1]^.ref^.index) and
                        (taicpu(p).oper[0]^.reg<>taicpu(hp1).oper[1]^.ref^.base) and
                        (taicpu(p).oper[0]^.reg<>taicpu(hp1).oper[1]^.ref^.base) and
                        (taicpu(hp1).oper[1]^.ref^.addressmode=AM_OFFSET) then
                        (taicpu(hp1).oper[1]^.ref^.addressmode=AM_OFFSET) then
                       begin
                       begin
                         if taicpu(hp1).oper[0]^.reg=taicpu(p).oper[0]^.reg then
                         if taicpu(hp1).oper[0]^.reg=taicpu(p).oper[0]^.reg then
                           begin
                           begin
+                            asml.insertbefore(tai_comment.Create(strpnew('Peephole LdrLdr2Ldr done')), hp1);
                             asml.remove(hp1);
                             asml.remove(hp1);
                             hp1.free;
                             hp1.free;
                           end
                           end
                         else
                         else
                           begin
                           begin
+                            asml.insertbefore(tai_comment.Create(strpnew('Peephole LdrLdr2LdrMov done')), hp1);
                             taicpu(hp1).opcode:=A_MOV;
                             taicpu(hp1).opcode:=A_MOV;
                             taicpu(hp1).oppostfix:=PF_None;
                             taicpu(hp1).oppostfix:=PF_None;
                             taicpu(hp1).loadreg(1,taicpu(p).oper[0]^.reg);
                             taicpu(hp1).loadreg(1,taicpu(p).oper[0]^.reg);
@@ -200,23 +227,18 @@ Implementation
                       mov reg1,reg0, shift imm1+imm2
                       mov reg1,reg0, shift imm1+imm2
                     }
                     }
                     if (taicpu(p).ops=3) and
                     if (taicpu(p).ops=3) and
-                       (taicpu(p).oper[0]^.typ = top_reg) and
                        (taicpu(p).oper[2]^.typ = top_shifterop) and
                        (taicpu(p).oper[2]^.typ = top_shifterop) and
                        (taicpu(p).oper[2]^.shifterop^.rs = NR_NO) and
                        (taicpu(p).oper[2]^.shifterop^.rs = NR_NO) and
-                       getnextinstruction(p,next1) and
-                       (next1.typ = ait_instruction) and
-                       (taicpu(next1).opcode = A_MOV) and
-                       (taicpu(p).condition=taicpu(next1).condition) and
-                       (taicpu(next1).ops=3) and
-                       (taicpu(next1).oper[0]^.typ = top_reg) and
-                       (taicpu(p).oper[0]^.reg=taicpu(next1).oper[0]^.reg) and
-                       (taicpu(next1).oper[1]^.typ = top_reg) and
-                       (taicpu(p).oper[0]^.reg=taicpu(next1).oper[1]^.reg) and
-                       (taicpu(next1).oper[2]^.typ = top_shifterop) and
-                       (taicpu(next1).oper[2]^.shifterop^.rs = NR_NO) and
-                       (taicpu(p).oper[2]^.shifterop^.shiftmode=taicpu(next1).oper[2]^.shifterop^.shiftmode) then
+                       getnextinstruction(p,hp1) and
+                       MatchInstruction(hp1, A_MOV, [taicpu(p).condition], [PF_None]) and
+                       (taicpu(hp1).ops=3) and
+                       MatchOperand(taicpu(hp1).oper[0]^, taicpu(p).oper[0]^.reg) and
+                       MatchOperand(taicpu(hp1).oper[1]^, taicpu(p).oper[0]^.reg) and
+                       (taicpu(hp1).oper[2]^.typ = top_shifterop) and
+                       (taicpu(hp1).oper[2]^.shifterop^.rs = NR_NO) and
+                       (taicpu(p).oper[2]^.shifterop^.shiftmode=taicpu(hp1).oper[2]^.shifterop^.shiftmode) then
                       begin
                       begin
-                        inc(taicpu(p).oper[2]^.shifterop^.shiftimm,taicpu(next1).oper[2]^.shifterop^.shiftimm);
+                        inc(taicpu(p).oper[2]^.shifterop^.shiftimm,taicpu(hp1).oper[2]^.shifterop^.shiftimm);
                         { avoid overflows }
                         { avoid overflows }
                         if taicpu(p).oper[2]^.shifterop^.shiftimm>31 then
                         if taicpu(p).oper[2]^.shifterop^.shiftimm>31 then
                           case taicpu(p).oper[2]^.shifterop^.shiftmode of
                           case taicpu(p).oper[2]^.shifterop^.shiftmode of
@@ -235,10 +257,78 @@ Implementation
                             else
                             else
                               internalerror(2008072803);
                               internalerror(2008072803);
                           end;
                           end;
-                        asml.remove(next1);
-                        next1.free;
+                        asml.insertbefore(tai_comment.Create(strpnew('Peephole ShiftShift2Shift done')), p);
+                        asml.remove(hp1);
+                        hp1.free;
                         result := true;
                         result := true;
                       end;
                       end;
+
+                    { 
+                      This changes the very common 
+                      mov r0, #0
+                      str r0, [...]
+                      mov r0, #0
+                      str r0, [...]
+
+                      and removes all superfluous mov instructions
+                    }
+                    if (taicpu(p).ops = 2) and
+                       (taicpu(p).oper[1]^.typ = top_const) and
+                       GetNextInstruction(p,hp1) then
+                      begin
+                        while MatchInstruction(hp1, A_STR, [], []) and
+                              MatchOperand(taicpu(hp1).oper[0]^, taicpu(p).oper[0]^) and
+                              GetNextInstruction(hp1, hp2) and
+                              MatchInstruction(hp2, A_MOV, [taicpu(p).condition], [taicpu(p).oppostfix]) and
+                              (taicpu(hp2).ops = 2) and
+                              MatchOperand(taicpu(hp2).oper[0]^, taicpu(p).oper[0]^) and
+                              MatchOperand(taicpu(hp2).oper[1]^, taicpu(p).oper[1]^) do
+                          begin
+                            asml.insertbefore(tai_comment.Create(strpnew('Peephole MovStrMov done')), hp2);
+                            GetNextInstruction(hp2,hp1);
+                            asml.remove(hp2);
+                            hp2.free;
+                            if not assigned(hp1) then break;
+                          end;
+                      end;
+                    {
+                      change
+                      mov r1, r0
+                      add r1, r1, #1
+                      to
+                      add r1, r0, #1
+                    }
+                    if (taicpu(p).ops = 2) and
+                       (taicpu(p).oper[1]^.typ = top_reg) and
+                       (taicpu(p).oppostfix = PF_NONE) and
+                       GetNextInstruction(p, hp1) and
+                       (tai(hp1).typ = ait_instruction) and
+                       (taicpu(hp1).opcode in [A_ADD, A_ADC, A_RSB, A_RSC, A_SUB, A_SBC,
+                                               A_AND, A_BIC, A_EOR, A_ORR]) and
+                       (taicpu(hp1).condition in [C_NONE, taicpu(hp1).condition]) and
+                       MatchOperand(taicpu(p).oper[0]^, taicpu(hp1).oper[0]^.reg) and
+                       (taicpu(hp1).oper[1]^.typ = top_reg) and
+                       (taicpu(hp1).oper[2]^.typ in [top_reg, top_const]) then
+                      begin
+                      { When we get here we still don't know if the registers match}
+                        for I:=1 to 2 do
+                          {
+                            If the first loop was successful p will be replaced with hp1.
+                            The checks will still be ok, because all required information
+                            will also be in hp1 then.
+                          }
+                          if MatchOperand(taicpu(p).oper[0]^, taicpu(hp1).oper[I]^.reg) then
+                            begin
+                              asml.insertbefore(tai_comment.Create(strpnew('Peephole RedundantMovProcess done ')), hp1);
+                              taicpu(hp1).oper[I]^.reg := taicpu(p).oper[1]^.reg;
+                              if p<>hp1 then
+                              begin
+                                asml.remove(p);
+                                p.free;
+                                p:=hp1;
+                              end;
+                            end;
+                      end;
                   end;
                   end;
                 A_AND:
                 A_AND:
                   begin
                   begin
@@ -249,26 +339,44 @@ Implementation
                       to
                       to
                       and reg2,reg1,(const1 and const2)
                       and reg2,reg1,(const1 and const2)
                     }
                     }
-                    if (taicpu(p).oper[0]^.typ = top_reg) and
-                       (taicpu(p).oper[1]^.typ = top_reg) and
+                    if (taicpu(p).oper[1]^.typ = top_reg) and
                        (taicpu(p).oper[2]^.typ = top_const) and
                        (taicpu(p).oper[2]^.typ = top_const) and
                        GetNextInstruction(p, hp1) and
                        GetNextInstruction(p, hp1) and
-                       (tai(hp1).typ = ait_instruction) and
-                       (taicpu(hp1).opcode = A_AND) and
-                       (taicpu(p).condition=taicpu(hp1).condition) and
-                       (taicpu(p).oppostfix=PF_None) and
-                       (taicpu(hp1).oper[0]^.typ = top_reg) and
-                       (taicpu(hp1).oper[1]^.typ = top_reg) and
-                       (taicpu(hp1).oper[2]^.typ = top_const) and
-                       (taicpu(p).oper[0]^.reg = taicpu(hp1).oper[0]^.reg) and
-                       (taicpu(hp1).oper[0]^.reg = taicpu(hp1).oper[1]^.reg) then
+                       MatchInstruction(hp1, A_AND, [taicpu(p).condition], [PF_None]) and
+                       MatchOperand(taicpu(hp1).oper[0]^, taicpu(p).oper[0]^.reg) and
+                       MatchOperand(taicpu(hp1).oper[1]^, taicpu(p).oper[0]^.reg) and
+                       (taicpu(hp1).oper[2]^.typ = top_const) then
                       begin
                       begin
+                        asml.insertbefore(tai_comment.Create(strpnew('Peephole AndAnd2And done')), p);
                         taicpu(p).loadConst(2,taicpu(p).oper[2]^.val and taicpu(hp1).oper[2]^.val);
                         taicpu(p).loadConst(2,taicpu(p).oper[2]^.val and taicpu(hp1).oper[2]^.val);
                         taicpu(p).oppostfix:=taicpu(hp1).oppostfix;
                         taicpu(p).oppostfix:=taicpu(hp1).oppostfix;
                         asml.remove(hp1);
                         asml.remove(hp1);
                         hp1.free;
                         hp1.free;
                       end;
                       end;
                   end;
                   end;
+                A_CMP:
+                  begin
+                    {
+                      change
+                      cmp   reg,const1
+                      moveq reg,const1
+                      movne reg,const2
+                      to
+                      cmp   reg,const1
+                      movne reg,const2
+                    }
+                    if (taicpu(p).oper[1]^.typ = top_const) and
+                       GetNextInstruction(p, hp1) and
+                       MatchInstruction(hp1, A_MOV, [C_EQ, C_NE], [PF_NONE]) and
+                       (taicpu(hp1).oper[1]^.typ = top_const) and
+                       GetNextInstruction(hp1, hp2) and
+                       MatchInstruction(hp2, A_MOV, [C_EQ, C_NE], [PF_NONE]) and
+                       (taicpu(hp1).oper[1]^.typ = top_const) then
+                      begin
+                        RemoveRedundantMove(p, hp1, asml);
+                        RemoveRedundantMove(p, hp2, asml);
+                      end;
+                  end;
               end;
               end;
           end;
           end;
       end;
       end;

+ 4 - 0
compiler/arm/cpubase.pas

@@ -137,6 +137,8 @@ unit cpubase;
         PF_IAX,PF_DBX,PF_FDX,PF_EAX
         PF_IAX,PF_DBX,PF_FDX,PF_EAX
       );
       );
 
 
+      TOpPostfixes = set of TOpPostfix;
+
       TRoundingMode = (RM_None,RM_P,RM_M,RM_Z);
       TRoundingMode = (RM_None,RM_P,RM_M,RM_Z);
 
 
     const
     const
@@ -167,6 +169,8 @@ unit cpubase;
         C_GE,C_LT,C_GT,C_LE,C_AL,C_NV
         C_GE,C_LT,C_GT,C_LE,C_AL,C_NV
       );
       );
 
 
+      TAsmConds = set of TAsmCond;
+
     const
     const
       cond2str : array[TAsmCond] of string[2]=('',
       cond2str : array[TAsmCond] of string[2]=('',
         'eq','ne','cs','cc','mi','pl','vs','vc','hi','ls',
         'eq','ne','cs','cc','mi','pl','vs','vc','hi','ls',

+ 16 - 4
compiler/arm/cpupara.pas

@@ -652,11 +652,17 @@ unit cpupara;
                   OS_F64:
                   OS_F64:
                     begin
                     begin
                       paraloc^.loc:=LOC_REGISTER;
                       paraloc^.loc:=LOC_REGISTER;
-                      paraloc^.register:=NR_FUNCTION_RESULT64_LOW_REG;
+                      if target_info.endian = endian_big then
+                        paraloc^.register:=NR_FUNCTION_RESULT64_HIGH_REG
+                      else
+                        paraloc^.register:=NR_FUNCTION_RESULT64_LOW_REG;
                       paraloc^.size:=OS_32;
                       paraloc^.size:=OS_32;
                       paraloc:=result.add_location;
                       paraloc:=result.add_location;
                       paraloc^.loc:=LOC_REGISTER;
                       paraloc^.loc:=LOC_REGISTER;
-                      paraloc^.register:=NR_FUNCTION_RESULT64_HIGH_REG;
+                      if target_info.endian = endian_big then
+                        paraloc^.register:=NR_FUNCTION_RESULT64_LOW_REG
+                      else
+                        paraloc^.register:=NR_FUNCTION_RESULT64_HIGH_REG;
                       paraloc^.size:=OS_32;
                       paraloc^.size:=OS_32;
                     end;
                     end;
                   OS_32,
                   OS_32,
@@ -683,11 +689,17 @@ unit cpupara;
             if retcgsize in [OS_64,OS_S64] then
             if retcgsize in [OS_64,OS_S64] then
               begin
               begin
                 paraloc^.loc:=LOC_REGISTER;
                 paraloc^.loc:=LOC_REGISTER;
-                paraloc^.register:=NR_FUNCTION_RESULT64_LOW_REG;
+                if target_info.endian = endian_big then
+                  paraloc^.register:=NR_FUNCTION_RESULT64_HIGH_REG
+                else
+                  paraloc^.register:=NR_FUNCTION_RESULT64_LOW_REG;
                 paraloc^.size:=OS_32;
                 paraloc^.size:=OS_32;
                 paraloc:=result.add_location;
                 paraloc:=result.add_location;
                 paraloc^.loc:=LOC_REGISTER;
                 paraloc^.loc:=LOC_REGISTER;
-                paraloc^.register:=NR_FUNCTION_RESULT64_HIGH_REG;
+                if target_info.endian = endian_big then
+                  paraloc^.register:=NR_FUNCTION_RESULT64_LOW_REG
+                else
+                  paraloc^.register:=NR_FUNCTION_RESULT64_HIGH_REG;
                 paraloc^.size:=OS_32;
                 paraloc^.size:=OS_32;
               end
               end
             else
             else

+ 1 - 1
compiler/assemble.pas

@@ -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]));
+                ((target_asm.id in [as_gas,as_ggas,as_darwin,as_powerpc_xcoff]));
       end;
       end;
 
 
 
 

+ 3 - 3
compiler/avr/agavrgas.pas

@@ -54,7 +54,7 @@ unit agavrgas;
        cutils,globals,verbose,
        cutils,globals,verbose,
        systems,
        systems,
        assemble,
        assemble,
-       aasmcpu,
+       aasmbase,aasmcpu,
        itcpugas,
        itcpugas,
        cpuinfo,
        cpuinfo,
        cgbase,cgutils;
        cgbase,cgutils;
@@ -119,7 +119,7 @@ unit agavrgas;
               else if assigned(symbol) or (offset<>0) then
               else if assigned(symbol) or (offset<>0) then
                 begin
                 begin
                   if assigned(symbol) then
                   if assigned(symbol) then
-                    s:=ReplaceForbiddenChars(symbol.name)
+                    s:=ReplaceForbiddenAsmSymbolChars(symbol.name)
                   else
                   else
                      s:='';
                      s:='';
 
 
@@ -155,7 +155,7 @@ unit agavrgas;
             top_ref:
             top_ref:
               if o.ref^.refaddr=addr_full then
               if o.ref^.refaddr=addr_full then
                 begin
                 begin
-                  hs:=ReplaceForbiddenChars(o.ref^.symbol.name);
+                  hs:=ReplaceForbiddenAsmSymbolChars(o.ref^.symbol.name);
                   if o.ref^.offset>0 then
                   if o.ref^.offset>0 then
                    hs:=hs+'+'+tostr(o.ref^.offset)
                    hs:=hs+'+'+tostr(o.ref^.offset)
                   else
                   else

+ 16 - 5
compiler/cgobj.pas

@@ -762,9 +762,11 @@ implementation
       begin
       begin
         alloccpuregisters(list,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
         alloccpuregisters(list,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
 {$if not(defined(i386)) and not(defined(avr))}
 {$if not(defined(i386)) and not(defined(avr))}
-        alloccpuregisters(list,R_FPUREGISTER,paramanager.get_volatile_registers_fpu(pocall_default));
+        if uses_registers(R_FPUREGISTER) then
+          alloccpuregisters(list,R_FPUREGISTER,paramanager.get_volatile_registers_fpu(pocall_default));
 {$ifdef cpumm}
 {$ifdef cpumm}
-        alloccpuregisters(list,R_MMREGISTER,paramanager.get_volatile_registers_mm(pocall_default));
+        if uses_registers(R_MMREGISTER) then
+          alloccpuregisters(list,R_MMREGISTER,paramanager.get_volatile_registers_mm(pocall_default));
 {$endif cpumm}
 {$endif cpumm}
 {$endif not(defined(i386)) and not(defined(avr))}
 {$endif not(defined(i386)) and not(defined(avr))}
       end;
       end;
@@ -783,9 +785,11 @@ implementation
       begin
       begin
         dealloccpuregisters(list,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
         dealloccpuregisters(list,R_INTREGISTER,paramanager.get_volatile_registers_int(pocall_default));
 {$if not(defined(i386)) and not(defined(avr))}
 {$if not(defined(i386)) and not(defined(avr))}
-        dealloccpuregisters(list,R_FPUREGISTER,paramanager.get_volatile_registers_fpu(pocall_default));
+        if uses_registers(R_FPUREGISTER) then
+          dealloccpuregisters(list,R_FPUREGISTER,paramanager.get_volatile_registers_fpu(pocall_default));
 {$ifdef cpumm}
 {$ifdef cpumm}
-        dealloccpuregisters(list,R_MMREGISTER,paramanager.get_volatile_registers_mm(pocall_default));
+        if uses_registers(R_MMREGISTER) then
+          dealloccpuregisters(list,R_MMREGISTER,paramanager.get_volatile_registers_mm(pocall_default));
 {$endif cpumm}
 {$endif cpumm}
 {$endif not(defined(i386)) and not(defined(avr))}
 {$endif not(defined(i386)) and not(defined(avr))}
       end;
       end;
@@ -896,11 +900,16 @@ implementation
     procedure tcg.a_load_reg_cgpara(list : TAsmList;size : tcgsize;r : tregister;const cgpara : TCGPara);
     procedure tcg.a_load_reg_cgpara(list : TAsmList;size : tcgsize;r : tregister;const cgpara : TCGPara);
       var
       var
          ref : treference;
          ref : treference;
+         tmpreg : tregister;
       begin
       begin
          cgpara.check_simple_location;
          cgpara.check_simple_location;
          paramanager.alloccgpara(list,cgpara);
          paramanager.alloccgpara(list,cgpara);
          if cgpara.location^.shiftval<0 then
          if cgpara.location^.shiftval<0 then
-           a_op_const_reg(list,OP_SHL,cgpara.location^.size,-cgpara.location^.shiftval,r);
+           begin
+             tmpreg:=getintregister(list,cgpara.location^.size);
+             a_op_const_reg_reg(list,OP_SHL,cgpara.location^.size,-cgpara.location^.shiftval,r,tmpreg);
+             r:=tmpreg;
+           end;
          case cgpara.location^.loc of
          case cgpara.location^.loc of
             LOC_REGISTER,LOC_CREGISTER:
             LOC_REGISTER,LOC_CREGISTER:
               a_load_reg_reg(list,size,cgpara.location^.size,r,cgpara.location^.register);
               a_load_reg_reg(list,size,cgpara.location^.size,r,cgpara.location^.register);
@@ -930,6 +939,8 @@ implementation
       begin
       begin
          cgpara.check_simple_location;
          cgpara.check_simple_location;
          paramanager.alloccgpara(list,cgpara);
          paramanager.alloccgpara(list,cgpara);
+         if cgpara.location^.shiftval<0 then
+           a:=a shl -cgpara.location^.shiftval;
          case cgpara.location^.loc of
          case cgpara.location^.loc of
             LOC_REGISTER,LOC_CREGISTER:
             LOC_REGISTER,LOC_CREGISTER:
               a_load_const_reg(list,cgpara.location^.size,a,cgpara.location^.register);
               a_load_const_reg(list,cgpara.location^.size,a,cgpara.location^.register);

+ 17 - 6
compiler/dbgstabs.pas

@@ -694,7 +694,13 @@ implementation
                 ss:='-31;';
                 ss:='-31;';
               {u32bit : result:=def_stab_number(s32inttype)+';0;-1;'); }
               {u32bit : result:=def_stab_number(s32inttype)+';0;-1;'); }
               else
               else
-                ss:=def_stabstr_evaluate(def,'r${numberstring};$1;$2;',[tostr(longint(def.low.svalue)),tostr(longint(def.high.svalue))]);
+                begin
+                  if def.size <> std_param_align then
+                    ss:='@s'+tostr(def.size*8)+';'
+                  else
+                    ss:='';
+                  ss:=ss+def_stabstr_evaluate(def,'r${numberstring};$1;$2;',[tostr(longint(def.low.svalue)),tostr(longint(def.high.svalue))]);
+                end;
             end;
             end;
          end;
          end;
         write_def_stabstr(list,def,ss);
         write_def_stabstr(list,def,ss);
@@ -896,7 +902,12 @@ implementation
       begin
       begin
         if not is_packed_array(def) then
         if not is_packed_array(def) then
           begin
           begin
-            tempstr:='ar$1;$2;$3;$4';
+            { Try to used P if ememlent size is smaller than
+              usual integer }
+            if def.elesize <> std_param_align then
+              tempstr:='ar@s'+tostr(def.elesize*8)+';$1;$2;$3;$4'
+            else
+              tempstr:='ar$1;$2;$3;$4';
             if is_dynamic_array(def) then
             if is_dynamic_array(def) then
               tempstr:='*'+tempstr;
               tempstr:='*'+tempstr;
             ss:=def_stabstr_evaluate(def,tempstr,[def_stab_number(tarraydef(def).rangedef),
             ss:=def_stabstr_evaluate(def,tempstr,[def_stab_number(tarraydef(def).rangedef),
@@ -1608,11 +1619,11 @@ implementation
         current_module.flags:=current_module.flags or uf_has_stabs_debuginfo;
         current_module.flags:=current_module.flags or uf_has_stabs_debuginfo;
         if not(target_info.system in systems_darwin) then
         if not(target_info.system in systems_darwin) then
           begin
           begin
-            new_section(current_asmdata.asmlists[al_stabs],sec_data,GetSymTableName(current_module.localsymtable),0);
+            new_section(current_asmdata.asmlists[al_stabs],sec_data,GetSymTableName(current_module.localsymtable),sizeof(pint));
             current_asmdata.asmlists[al_stabs].concat(tai_symbol.Createname_global(make_mangledname('DEBUGINFO',current_module.localsymtable,''),AT_DATA,0));
             current_asmdata.asmlists[al_stabs].concat(tai_symbol.Createname_global(make_mangledname('DEBUGINFO',current_module.localsymtable,''),AT_DATA,0));
           end
           end
         else
         else
-          new_section(current_asmdata.asmlists[al_stabs],sec_code,GetSymTableName(current_module.localsymtable),0);
+          new_section(current_asmdata.asmlists[al_stabs],sec_code,GetSymTableName(current_module.localsymtable),sizeof(pint));
 
 
         { write all global/local variables. This will flag all required tdefs  }
         { write all global/local variables. This will flag all required tdefs  }
         if assigned(current_module.globalsymtable) then
         if assigned(current_module.globalsymtable) then
@@ -1745,7 +1756,7 @@ implementation
         { emit main source n_sourcefile for start of module }
         { emit main source n_sourcefile for start of module }
         current_asmdata.getlabel(hlabel,alt_dbgfile);
         current_asmdata.getlabel(hlabel,alt_dbgfile);
         infile:=current_module.sourcefiles.get_file(1);
         infile:=current_module.sourcefiles.get_file(1);
-        new_section(current_asmdata.asmlists[al_start],sec_code,make_mangledname('DEBUGSTART',current_module.localsymtable,''),0,secorder_begin);
+        new_section(current_asmdata.asmlists[al_start],sec_code,make_mangledname('DEBUGSTART',current_module.localsymtable,''),sizeof(pint),secorder_begin);
         if not(target_info.system in systems_darwin) then
         if not(target_info.system in systems_darwin) then
           current_asmdata.asmlists[al_start].concat(tai_symbol.Createname_global(make_mangledname('DEBUGSTART',current_module.localsymtable,''),AT_DATA,0));
           current_asmdata.asmlists[al_start].concat(tai_symbol.Createname_global(make_mangledname('DEBUGSTART',current_module.localsymtable,''),AT_DATA,0));
         current_asmdata.asmlists[al_start].concat(Tai_stab.Create_str(stabsdir,'"'+BsToSlash(FixPath(getcurrentdir,false))+'",'+
         current_asmdata.asmlists[al_start].concat(Tai_stab.Create_str(stabsdir,'"'+BsToSlash(FixPath(getcurrentdir,false))+'",'+
@@ -1760,7 +1771,7 @@ implementation
           current_asmdata.asmlists[al_end].concat(Tai_stab.Create_str(stabsdir,'"",'+base_stabs_str(STABS_N_OSO,'0','0','0')));
           current_asmdata.asmlists[al_end].concat(Tai_stab.Create_str(stabsdir,'"",'+base_stabs_str(STABS_N_OSO,'0','0','0')));
         { emit empty n_sourcefile for end of module }
         { emit empty n_sourcefile for end of module }
         current_asmdata.getlabel(hlabel,alt_dbgfile);
         current_asmdata.getlabel(hlabel,alt_dbgfile);
-        new_section(current_asmdata.asmlists[al_end],sec_code,make_mangledname('DEBUGEND',current_module.localsymtable,''),0,secorder_end);
+        new_section(current_asmdata.asmlists[al_end],sec_code,make_mangledname('DEBUGEND',current_module.localsymtable,''),sizeof(pint),secorder_end);
         if not(target_info.system in systems_darwin) then
         if not(target_info.system in systems_darwin) then
           current_asmdata.asmlists[al_end].concat(tai_symbol.Createname_global(make_mangledname('DEBUGEND',current_module.localsymtable,''),AT_DATA,0));
           current_asmdata.asmlists[al_end].concat(tai_symbol.Createname_global(make_mangledname('DEBUGEND',current_module.localsymtable,''),AT_DATA,0));
         current_asmdata.asmlists[al_end].concat(Tai_stab.Create_str(stabsdir,'"",'+base_stabs_str(stabs_n_sourcefile,'0','0',hlabel.name)));
         current_asmdata.asmlists[al_end].concat(Tai_stab.Create_str(stabsdir,'"",'+base_stabs_str(stabs_n_sourcefile,'0','0',hlabel.name)));

+ 48 - 59
compiler/defcmp.pas

@@ -372,36 +372,10 @@ implementation
                  stringdef :
                  stringdef :
                    begin
                    begin
                      { Constant string }
                      { Constant string }
-                     if (fromtreetype=stringconstn) then
-                      begin
-                        if (tstringdef(def_from).stringtype=tstringdef(def_to).stringtype) and
-                           ((tstringdef(def_from).stringtype<>st_ansistring) or
-                            (tstringdef(def_from).encoding=tstringdef(def_to).encoding)
-                           ) then
-                          eq:=te_equal
-                        else
-                         begin
-                           doconv:=tc_string_2_string;
-                           if (tstringdef(def_from).stringtype = st_ansistring) and
-                              (tstringdef(def_to).stringtype = st_ansistring) then
-                             if (tstringdef(def_to).encoding=globals.CP_UTF8) then
-                               eq:=te_convert_l1
-                             else
-                               eq:=te_convert_l2
-                           else
-                            begin
-                              { Don't prefer conversions from widestring to a
-                                normal string as we can lose information }
-                              if (tstringdef(def_from).stringtype in [st_widestring,st_unicodestring]) and
-                                not (tstringdef(def_to).stringtype in [st_widestring,st_unicodestring]) then
-                                eq:=te_convert_l3
-                              else if tstringdef(def_to).stringtype in [st_widestring,st_unicodestring] then
-                                eq:=te_convert_l2
-                              else
-                                eq:=te_convert_l1;
-                            end;
-                         end;
-                      end
+                     if (fromtreetype=stringconstn) and
+                        is_shortstring(def_from) and
+                        is_shortstring(def_to) then
+                        eq:=te_equal
                      else if (tstringdef(def_to).stringtype=st_ansistring) and
                      else if (tstringdef(def_to).stringtype=st_ansistring) and
                              (tstringdef(def_from).stringtype=st_ansistring) then 
                              (tstringdef(def_from).stringtype=st_ansistring) then 
                       begin
                       begin
@@ -421,11 +395,17 @@ implementation
                         else
                         else
                          begin        
                          begin        
                            doconv := tc_string_2_string;
                            doconv := tc_string_2_string;
-                           if (tstringdef(def_to).encoding=globals.CP_UTF8) then 
+
+                           { prefere conversion to utf8 codepage }
+                           if tstringdef(def_to).encoding = globals.CP_UTF8 then
                              eq:=te_convert_l1
                              eq:=te_convert_l1
+                           { else to AnsiString type }
+                           else if def_to=getansistringdef then
+                             eq:=te_convert_l2
+                           { else to AnsiString with other codepage }
                            else
                            else
-                             eq:=te_convert_l2;
-                         end 
+                             eq:=te_convert_l3;
+                         end
                       end          
                       end          
                      else
                      else
                      { same string type ? }
                      { same string type ? }
@@ -443,44 +423,53 @@ implementation
                          case tstringdef(def_from).stringtype of
                          case tstringdef(def_from).stringtype of
                            st_widestring :
                            st_widestring :
                              begin
                              begin
-                               { Prefer conversions to unicodestring }
-                               if tstringdef(def_to).stringtype=st_unicodestring then
-                                 eq:=te_convert_l1
-                               { else prefer conversions to ansistring }
-                               else if tstringdef(def_to).stringtype=st_ansistring then
-                                 eq:=te_convert_l2
-                               else
-                                 eq:=te_convert_l3;
+                               case tstringdef(def_to).stringtype of
+                                 { Prefer conversions to unicodestring }
+                                 st_unicodestring: eq:=te_convert_l1;
+                                 { else prefer conversions to ansistring }
+                                 st_ansistring: eq:=te_convert_l2;
+                                 else
+                                   eq:=te_convert_l3;
+                               end;
                              end;
                              end;
                            st_unicodestring :
                            st_unicodestring :
                              begin
                              begin
-                               { Prefer conversions to widestring }
-                               if tstringdef(def_to).stringtype=st_widestring then
-                                 eq:=te_convert_l1
-                               { else prefer conversions to ansistring }
-                               else if tstringdef(def_to).stringtype=st_ansistring then
-                                 eq:=te_convert_l2
-                               else
-                                 eq:=te_convert_l3;
+                               case tstringdef(def_to).stringtype of
+                                 { Prefer conversions to widestring }
+                                 st_widestring: eq:=te_convert_l1;
+                                 { else prefer conversions to ansistring }
+                                 st_ansistring: eq:=te_convert_l2;
+                                 else
+                                   eq:=te_convert_l3;
+                               end;
                              end;
                              end;
                            st_shortstring :
                            st_shortstring :
                              begin
                              begin
                                { Prefer shortstrings of different length or conversions
                                { Prefer shortstrings of different length or conversions
                                  from shortstring to ansistring }
                                  from shortstring to ansistring }
-                               if (tstringdef(def_to).stringtype=st_shortstring) then
-                                 eq:=te_convert_l1
-                               else if tstringdef(def_to).stringtype=st_ansistring then
-                                 eq:=te_convert_l2
-                               else
-                                 eq:=te_convert_l3;
+                               case tstringdef(def_to).stringtype of
+                                 st_shortstring: eq:=te_convert_l1;
+                                 st_ansistring:
+                                   if tstringdef(def_to).encoding=globals.CP_UTF8 then
+                                     eq:=te_convert_l2
+                                   else if def_to=getansistringdef then
+                                     eq:=te_convert_l3
+                                   else
+                                     eq:=te_convert_l4;
+                                 st_unicodestring: eq:=te_convert_l5;
+                                 else
+                                   eq:=te_convert_l6;
+                               end;
                              end;
                              end;
                            st_ansistring :
                            st_ansistring :
                              begin
                              begin
                                { Prefer conversion to widestrings }
                                { Prefer conversion to widestrings }
-                               if (tstringdef(def_to).stringtype in [st_widestring,st_unicodestring]) then
-                                 eq:=te_convert_l2
-                               else
-                                 eq:=te_convert_l3;
+                               case tstringdef(def_to).stringtype of
+                                 st_unicodestring: eq:=te_convert_l4;
+                                 st_widestring: eq:=te_convert_l5;
+                                 else
+                                   eq:=te_convert_l6;
+                               end;
                              end;
                              end;
                          end;
                          end;
                        end;
                        end;

+ 3 - 3
compiler/fmodule.pas

@@ -566,7 +566,7 @@ implementation
         tcinitcode:=nil;
         tcinitcode:=nil;
         _exports:=TLinkedList.Create;
         _exports:=TLinkedList.Create;
         dllscannerinputlist:=TFPHashList.Create;
         dllscannerinputlist:=TFPHashList.Create;
-        asmdata:=TAsmData.create(realmodulename^);
+        asmdata:=casmdata.create(realmodulename^);
         InitDebugInfo(self,false);
         InitDebugInfo(self,false);
       end;
       end;
 
 
@@ -699,7 +699,7 @@ implementation
           end;
           end;
         if assigned(asmdata) then
         if assigned(asmdata) then
           begin
           begin
-            if current_asmdata=TAsmData(asmdata) then
+            if current_asmdata=asmdata then
              current_asmdata:=nil;
              current_asmdata:=nil;
             asmdata.free;
             asmdata.free;
             asmdata:=nil;
             asmdata:=nil;
@@ -745,7 +745,7 @@ implementation
         derefdataintflen:=0;
         derefdataintflen:=0;
         sourcefiles.free;
         sourcefiles.free;
         sourcefiles:=tinputfilemanager.create;
         sourcefiles:=tinputfilemanager.create;
-        asmdata:=TAsmData.create(realmodulename^);
+        asmdata:=casmdata.create(realmodulename^);
         InitDebugInfo(self,current_debuginfo_reset);
         InitDebugInfo(self,current_debuginfo_reset);
         _exports.free;
         _exports.free;
         _exports:=tlinkedlist.create;
         _exports:=tlinkedlist.create;

+ 2 - 2
compiler/globals.pas

@@ -835,7 +835,7 @@ implementation
  ****************************************************************************}
  ****************************************************************************}
 
 
     function GetEnvPChar(const envname:string):pchar;
     function GetEnvPChar(const envname:string):pchar;
-      {$ifdef win32}
+      {$ifdef mswindows}
       var
       var
         s     : string;
         s     : string;
         i,len : longint;
         i,len : longint;
@@ -846,7 +846,7 @@ implementation
         GetEnvPchar:=BaseUnix.fpGetEnv(envname);
         GetEnvPchar:=BaseUnix.fpGetEnv(envname);
         {$define GETENVOK}
         {$define GETENVOK}
       {$endif}
       {$endif}
-      {$ifdef win32}
+      {$ifdef mswindows}
         GetEnvPchar:=nil;
         GetEnvPchar:=nil;
         p:=GetEnvironmentStrings;
         p:=GetEnvironmentStrings;
         hp:=p;
         hp:=p;

+ 4 - 1
compiler/globtype.pas

@@ -207,6 +207,8 @@ interface
 
 
        { global target-specific switches }
        { global target-specific switches }
        ttargetswitch = (ts_none,
        ttargetswitch = (ts_none,
+         { generate code that results in smaller TOCs than normal (AIX) }
+         ts_small_toc,
          { for the JVM target: generate integer array initializations via string
          { for the JVM target: generate integer array initializations via string
            constants in order to reduce the generated code size (Java routines
            constants in order to reduce the generated code size (Java routines
            are limited to 64kb of bytecode) }
            are limited to 64kb of bytecode) }
@@ -266,6 +268,7 @@ interface
          'DWARFSETS','STABSABSINCLUDES','DWARFMETHODCLASSPREFIX');
          'DWARFSETS','STABSABSINCLUDES','DWARFMETHODCLASSPREFIX');
 
 
        TargetSwitchStr : array[ttargetswitch] of string[19] = ('',
        TargetSwitchStr : array[ttargetswitch] of string[19] = ('',
+         'SMALLTOC',
          'COMPACTINTARRAYINIT');
          'COMPACTINTARRAYINIT');
 
 
        { switches being applied to all CPUs at the given level }
        { switches being applied to all CPUs at the given level }
@@ -276,7 +279,7 @@ interface
        { whole program optimizations whose information generation requires
        { whole program optimizations whose information generation requires
          information from all loaded units
          information from all loaded units
        }
        }
-       WPOptimizationsNeedingAllUnitInfo = [cs_wpo_devirtualize_calls];
+       WPOptimizationsNeedingAllUnitInfo = [cs_wpo_devirtualize_calls,cs_wpo_optimize_vmts];
 
 
        featurestr : array[tfeature] of string[12] = (
        featurestr : array[tfeature] of string[12] = (
          'HEAP','INITFINAL','RTTI','CLASSES','EXCEPTIONS','EXITCODE',
          'HEAP','INITFINAL','RTTI','CLASSES','EXCEPTIONS','EXITCODE',

+ 78 - 59
compiler/htypechk.pas

@@ -51,6 +51,7 @@ interface
          cl3_count,
          cl3_count,
          cl4_count,
          cl4_count,
          cl5_count,
          cl5_count,
+         cl6_count,
          coper_count : integer; { should be signed }
          coper_count : integer; { should be signed }
          ordinal_distance : double;
          ordinal_distance : double;
          invalid     : boolean;
          invalid     : boolean;
@@ -1414,6 +1415,17 @@ implementation
                      mayberesettypeconvs;
                      mayberesettypeconvs;
                      exit;
                      exit;
                    end;
                    end;
+                 { if we assign something to a field of a record that is not
+                   regable, then then the record can't be kept in a regvar,
+                   because we will force the record into memory for this
+                   subscript operation (to a temp location, so the assignment
+                   will happen to the temp and be lost) }
+                 if not gotsubscript and
+                    not gotderef and
+                    not gotvec and
+                    not tstoreddef(hp.resultdef).is_intregable then
+                   make_not_regable(hp,[ra_addr_regable]);
+
                  gotsubscript:=true;
                  gotsubscript:=true;
                  { loop counter? }
                  { loop counter? }
                  if not(Valid_Const in opts) and
                  if not(Valid_Const in opts) and
@@ -1781,7 +1793,8 @@ implementation
               { string and string[10] are assumed as equal }
               { string and string[10] are assumed as equal }
               { when searching the correct overloaded procedure   }
               { when searching the correct overloaded procedure   }
               if (p.resultdef.typ=stringdef) and
               if (p.resultdef.typ=stringdef) and
-                 (tstringdef(def_to).stringtype=tstringdef(p.resultdef).stringtype) then
+                 (tstringdef(def_to).stringtype=tstringdef(p.resultdef).stringtype) and
+                 (tstringdef(def_to).encoding=tstringdef(p.resultdef).encoding) then
                 eq:=te_equal
                 eq:=te_equal
             end;
             end;
           setdef :
           setdef :
@@ -2317,6 +2330,7 @@ implementation
                           ' l3: '+tostr(hp^.cl3_count)+
                           ' l3: '+tostr(hp^.cl3_count)+
                           ' l4: '+tostr(hp^.cl4_count)+
                           ' l4: '+tostr(hp^.cl4_count)+
                           ' l5: '+tostr(hp^.cl5_count)+
                           ' l5: '+tostr(hp^.cl5_count)+
+                          ' l6: '+tostr(hp^.cl6_count)+
                           ' oper: '+tostr(hp^.coper_count)+
                           ' oper: '+tostr(hp^.coper_count)+
                           ' ord: '+realtostr(hp^.ordinal_distance));
                           ' ord: '+realtostr(hp^.ordinal_distance));
               { Print parameters in left-right order }
               { Print parameters in left-right order }
@@ -2526,15 +2540,12 @@ implementation
               else
               else
               { generic type comparision }
               { generic type comparision }
                begin
                begin
-                 if not(po_compilerproc in hp^.data.procoptions) and
-                    not(po_rtlproc in hp^.data.procoptions) and
-                    is_ansistring(currpara.vardef) and
-                    is_ansistring(currpt.left.resultdef) and
-                    (tstringdef(currpara.vardef).encoding<>tstringdef(currpt.left.resultdef).encoding) and
-                    ((tstringdef(currpara.vardef).encoding=globals.CP_NONE) or
-                     (tstringdef(currpt.left.resultdef).encoding=globals.CP_NONE)
-                    ) then
-                   eq:=te_convert_l1
+                 if (hp^.data.procoptions*[po_rtlproc,po_compilerproc]=[]) and
+                    is_ansistring(def_from) and
+                    is_ansistring(def_to) and
+                    (tstringdef(def_from).encoding<>tstringdef(def_to).encoding) and
+                    (currpara.varspez in [vs_var,vs_out]) then
+                    eq:=te_convert_l1 // don't allow to pass different ansistring types to each-other
                  else
                  else
                    eq:=compare_defs_ext(def_from,def_to,currpt.left.nodetype,convtype,pdoper,cdoptions);
                    eq:=compare_defs_ext(def_from,def_to,currpt.left.nodetype,convtype,pdoper,cdoptions);
 
 
@@ -2587,6 +2598,8 @@ implementation
                   inc(hp^.cl4_count);
                   inc(hp^.cl4_count);
                 te_convert_l5 :
                 te_convert_l5 :
                   inc(hp^.cl5_count);
                   inc(hp^.cl5_count);
+                te_convert_l6 :
+                  inc(hp^.cl6_count);
                 te_convert_operator :
                 te_convert_operator :
                   inc(hp^.coper_count);
                   inc(hp^.coper_count);
                 te_incompatible :
                 te_incompatible :
@@ -2714,48 +2727,53 @@ implementation
            res:=(bestpd^.coper_count-currpd^.coper_count);
            res:=(bestpd^.coper_count-currpd^.coper_count);
            if (res=0) then
            if (res=0) then
             begin
             begin
-             { less cl5 parameters? }
-             res:=(bestpd^.cl5_count-currpd^.cl5_count);
+             { less cl6 parameters? }
+             res:=(bestpd^.cl6_count-currpd^.cl6_count);
              if (res=0) then
              if (res=0) then
               begin
               begin
-               { less cl4 parameters? }
-               res:=(bestpd^.cl4_count-currpd^.cl4_count);
-               if (res=0) then
-                begin
-                 { less cl3 parameters? }
-                 res:=(bestpd^.cl3_count-currpd^.cl3_count);
-                 if (res=0) then
-                  begin
-                    { less cl2 parameters? }
-                    res:=(bestpd^.cl2_count-currpd^.cl2_count);
+                { less cl5 parameters? }
+                res:=(bestpd^.cl5_count-currpd^.cl5_count);
+                if (res=0) then
+                 begin
+                  { less cl4 parameters? }
+                  res:=(bestpd^.cl4_count-currpd^.cl4_count);
+                  if (res=0) then
+                   begin
+                    { less cl3 parameters? }
+                    res:=(bestpd^.cl3_count-currpd^.cl3_count);
                     if (res=0) then
                     if (res=0) then
                      begin
                      begin
-                       { less cl1 parameters? }
-                       res:=(bestpd^.cl1_count-currpd^.cl1_count);
+                       { less cl2 parameters? }
+                       res:=(bestpd^.cl2_count-currpd^.cl2_count);
                        if (res=0) then
                        if (res=0) then
                         begin
                         begin
-                          { more exact parameters? }
-                          res:=(currpd^.exact_count-bestpd^.exact_count);
+                          { less cl1 parameters? }
+                          res:=(bestpd^.cl1_count-currpd^.cl1_count);
                           if (res=0) then
                           if (res=0) then
                            begin
                            begin
-                             { less equal parameters? }
-                             res:=(bestpd^.equal_count-currpd^.equal_count);
+                             { more exact parameters? }
+                             res:=(currpd^.exact_count-bestpd^.exact_count);
                              if (res=0) then
                              if (res=0) then
                               begin
                               begin
-                                { smaller ordinal distance? }
-                                if (currpd^.ordinal_distance<bestpd^.ordinal_distance) then
-                                 res:=1
-                                else
-                                 if (currpd^.ordinal_distance>bestpd^.ordinal_distance) then
-                                  res:=-1
-                                else
-                                 res:=0;
+                                { less equal parameters? }
+                                res:=(bestpd^.equal_count-currpd^.equal_count);
+                                if (res=0) then
+                                 begin
+                                   { smaller ordinal distance? }
+                                   if (currpd^.ordinal_distance<bestpd^.ordinal_distance) then
+                                    res:=1
+                                   else
+                                    if (currpd^.ordinal_distance>bestpd^.ordinal_distance) then
+                                     res:=-1
+                                   else
+                                    res:=0;
+                                 end;
                               end;
                               end;
                            end;
                            end;
                         end;
                         end;
                      end;
                      end;
-                  end;
-                end;
+                   end;
+                 end;
               end;
               end;
             end;
             end;
          end;
          end;
@@ -2766,18 +2784,19 @@ implementation
 { Delphi precedence rules extracted from test programs. Only valid if passing
 { Delphi precedence rules extracted from test programs. Only valid if passing
   a variant parameter to overloaded procedures expecting exactly one parameter.
   a variant parameter to overloaded procedures expecting exactly one parameter.
 
 
-  single > (char, currency, int64, shortstring, ansistring, widestring, extended, double)
-  double/currency > (char, int64, shortstring, ansistring, widestring, extended)
-  extended > (char, int64, shortstring, ansistring, widestring)
-  longint/cardinal > (int64, shortstring, ansistring, widestring, extended, double, single, char, currency)
-  smallint > (longint, int64, shortstring, ansistring, widestring, extended, double single, char, currency);
-  word > (longint, cardinal, int64, shortstring, ansistring, widestring, extended, double single, char, currency);
-  shortint > (longint, smallint, int64, shortstring, ansistring, widestring, extended, double, single, char, currency)
-  byte > (longint, cardinal, word, smallint, int64, shortstring, ansistring, widestring, extended, double, single, char, currency);
-  boolean/formal > (char, int64, shortstring, ansistring, widestring)
-  shortstring > (char, int64, ansistring, widestring)
-  ansistring > (char, int64, widestring)
-  widestring > (char, int64)
+  single > (char, currency, int64, shortstring, ansistring, widestring, unicodestring, extended, double)
+  double/currency > (char, int64, shortstring, ansistring, widestring, unicodestring, extended)
+  extended > (char, int64, shortstring, ansistring, widestring, unicodestring)
+  longint/cardinal > (int64, shortstring, ansistring, widestring, unicodestring, extended, double, single, char, currency)
+  smallint > (longint, int64, shortstring, ansistring, widestring, unicodestring, extended, double single, char, currency);
+  word > (longint, cardinal, int64, shortstring, ansistring, widestring, unicodestring, extended, double single, char, currency);
+  shortint > (longint, smallint, int64, shortstring, ansistring, widestring, unicodestring, extended, double, single, char, currency)
+  byte > (longint, cardinal, word, smallint, int64, shortstring, ansistring, widestring, unicodestring, extended, double, single, char, currency);
+  boolean/formal > (char, int64, shortstring, ansistring, widestring, unicodestring)
+  widestring > (char, int64, shortstring, ansistring, unicodestring)
+  unicodestring > (char, int64, shortstring, ansistring)
+  ansistring > (char, int64, shortstring)
+  shortstring > (char, int64)
 
 
   Relations not mentioned mean that they conflict: no decision possible }
   Relations not mentioned mean that they conflict: no decision possible }
 
 
@@ -2899,14 +2918,6 @@ implementation
         else if (currvcl=tve_extended) or
         else if (currvcl=tve_extended) or
                 (bestvcl=tve_extended) then
                 (bestvcl=tve_extended) then
           result:=1-2*ord(bestvcl=tve_extended)
           result:=1-2*ord(bestvcl=tve_extended)
-        { shortstring is better than everything left }
-        else if (currvcl=tve_sstring) or
-                (bestvcl=tve_sstring) then
-          result:=1-2*ord(bestvcl=tve_sstring)
-        { ansistring is better than everything left }
-        else if (currvcl=tve_astring) or
-                (bestvcl=tve_astring) then
-          result:=1-2*ord(bestvcl=tve_astring)
         { widestring is better than everything left }
         { widestring is better than everything left }
         else if (currvcl=tve_wstring) or
         else if (currvcl=tve_wstring) or
                 (bestvcl=tve_wstring) then
                 (bestvcl=tve_wstring) then
@@ -2914,7 +2925,15 @@ implementation
         { unicodestring is better than everything left }
         { unicodestring is better than everything left }
         else if (currvcl=tve_ustring) or
         else if (currvcl=tve_ustring) or
                 (bestvcl=tve_ustring) then
                 (bestvcl=tve_ustring) then
-          result:=1-2*ord(bestvcl=tve_ustring);
+          result:=1-2*ord(bestvcl=tve_ustring)
+        { ansistring is better than everything left }
+        else if (currvcl=tve_astring) or
+                (bestvcl=tve_astring) then
+          result:=1-2*ord(bestvcl=tve_astring)
+        { shortstring is better than everything left }
+        else if (currvcl=tve_sstring) or
+                (bestvcl=tve_sstring) then
+          result:=1-2*ord(bestvcl=tve_sstring);
 
 
         { all possibilities should have been checked now }
         { all possibilities should have been checked now }
         if (result=-5) then
         if (result=-5) then

+ 1 - 1
compiler/i386/cpupi.pas

@@ -73,7 +73,7 @@ unit cpupi;
         { align to 4 bytes at least
         { align to 4 bytes at least
           otherwise all those subl $2,%esp are meaningless PM }
           otherwise all those subl $2,%esp are meaningless PM }
         if not(target_info.system in [system_i386_darwin,system_i386_iphonesim]) then
         if not(target_info.system in [system_i386_darwin,system_i386_iphonesim]) then
-          result:=Align(tg.direction*tg.lasttemp,min(current_settings.alignment.localalignmin,4))
+          result:=Align(tg.direction*tg.lasttemp,min(current_settings.alignment.localalignmax,4))
         else
         else
           result:=tg.direction*tg.lasttemp+maxpushedparasize;
           result:=tg.direction*tg.lasttemp+maxpushedparasize;
       end;
       end;

+ 1 - 1
compiler/jvm/njvmcon.pas

@@ -273,7 +273,7 @@ implementation
               end;
               end;
           end;
           end;
         result:=ccallnode.createintern(helpername,
         result:=ccallnode.createintern(helpername,
-          ccallparanode.create(cstringconstnode.createwstr(pw),otherparas));
+          ccallparanode.create(cstringconstnode.createunistr(pw),otherparas));
         donewidestring(pw);
         donewidestring(pw);
       end;
       end;
 
 

+ 1 - 1
compiler/jvm/njvmtcon.pas

@@ -111,7 +111,7 @@ implementation
           ccallparanode.create(genintconstnode(arrstringdata.arrdatalen),
           ccallparanode.create(genintconstnode(arrstringdata.arrdatalen),
             ccallparanode.create(genintconstnode(arrstringdata.arrdatastart),
             ccallparanode.create(genintconstnode(arrstringdata.arrdatastart),
               ccallparanode.create(arrstringdata.arraybase.getcopy,
               ccallparanode.create(arrstringdata.arraybase.getcopy,
-                ccallparanode.create(cstringconstnode.createwstr(wstr),nil))))));
+                ccallparanode.create(cstringconstnode.createunistr(wstr),nil))))));
 
 
         inc(arrstringdata.arrdatastart,arrstringdata.arrdatalen);
         inc(arrstringdata.arrdatastart,arrstringdata.arrdatalen);
         arrstringdata.arrstring:='';
         arrstringdata.arrstring:='';

+ 1 - 0
compiler/mips/cpugas.pas

@@ -258,6 +258,7 @@ unit cpugas;
         flags: [af_allowdirect, af_needar, af_smartlink_sections];
         flags: [af_allowdirect, af_needar, af_smartlink_sections];
         labelprefix: '.L';
         labelprefix: '.L';
         comment: '# ';
         comment: '# ';
+        dollarsign: '$';
         );
         );
       as_MIPS_as_info: tasminfo =
       as_MIPS_as_info: tasminfo =
         (
         (

+ 5 - 1
compiler/msg/errore.msg

@@ -3301,8 +3301,12 @@ P*2CN_Generate nil-pointer checks (AIX-only)
 **2Cr_Range checking
 **2Cr_Range checking
 **2CR_Verify object method call validity
 **2CR_Verify object method call validity
 **2Cs<n>_Set stack checking size to <n>
 **2Cs<n>_Set stack checking size to <n>
-**2Ct_Stack checking (for testing only, see manual)
+**2Ct_Stack checking (for testing only, see manual)<<<<<<< HEAD
+p*2CT<x>_Target-specific code generation options
+P*2CT<x>_Target-specific code generation options
 J*2CT<x>_Target-specific code generation options
 J*2CT<x>_Target-specific code generation options
+p*3CTsmalltoc_ Generate smaller TOCs at the expense of execution speed (AIX)
+P*3CTsmalltoc_ Generate smaller TOCs at the expense of execution speed (AIX)
 J*3CTcompactintarrayinit_ Generate smaller (but potentially slower) code for initializing integer array constants
 J*3CTcompactintarrayinit_ Generate smaller (but potentially slower) code for initializing integer array constants
 J*2Cv_Var/out parameter copy-out checking
 J*2Cv_Var/out parameter copy-out checking
 **2CX_Create also smartlinked library
 **2CX_Create also smartlinked library

+ 1 - 1
compiler/msgidx.inc

@@ -941,7 +941,7 @@ const
   option_info=11024;
   option_info=11024;
   option_help_pages=11025;
   option_help_pages=11025;
 
 
-  MsgTxtSize = 65363;
+  MsgTxtSize = 65627;
 
 
   MsgIdxMax : array[1..20] of longint=(
   MsgIdxMax : array[1..20] of longint=(
     26,91,322,118,87,55,116,26,202,63,
     26,91,322,118,87,55,116,26,202,63,

+ 91 - 84
compiler/msgtxt.inc

@@ -1,7 +1,7 @@
 {$ifdef Delphi}
 {$ifdef Delphi}
-const msgtxt : array[0..000272] of string[240]=(
+const msgtxt : array[0..000273] of string[240]=(
 {$else Delphi}
 {$else Delphi}
-const msgtxt : array[0..000272,1..240] of char=(
+const msgtxt : array[0..000273,1..240] of char=(
 {$endif Delphi}
 {$endif Delphi}
   '01000_T_Compiler: $1'#000+
   '01000_T_Compiler: $1'#000+
   '01001_D_Compiler OS: $1'#000+
   '01001_D_Compiler OS: $1'#000+
@@ -1236,13 +1236,19 @@ const msgtxt : array[0..000272,1..240] of char=(
   '**2Cr_Range checking'#010+
   '**2Cr_Range checking'#010+
   '**2CR_Verify object method call validity'#010+
   '**2CR_Verify object method call validity'#010+
   '**2Cs<n>_Set stack checking size to <n>'#010+
   '**2Cs<n>_Set stack checking size to <n>'#010+
-  '**2Ct_Stack checking (for testing only, see manual)'#010+
-  'J*2CT<x>_Target-specifi','c code generation options'#010+
+  '**2Ct_Stack checking (for testing only, see manual)<<<<<<< HEAD'#010+
+  'p*2CT<x>_Ta','rget-specific code generation options'#010+
+  'P*2CT<x>_Target-specific code generation options'#010+
+  'J*2CT<x>_Target-specific code generation options'#010+
+  'p*3CTsmalltoc_ Generate smaller TOCs at the expense of execution speed'+
+  ' (AIX)'#010+
+  'P*3CTsmalltoc_ Generate sma','ller TOCs at the expense of execution spe'+
+  'ed (AIX)'#010+
   'J*3CTcompactintarrayinit_ Generate smaller (but potentially slower) co'+
   'J*3CTcompactintarrayinit_ Generate smaller (but potentially slower) co'+
   'de for initializing integer array constants'#010+
   'de for initializing integer array constants'#010+
   'J*2Cv_Var/out parameter copy-out checking'#010+
   'J*2Cv_Var/out parameter copy-out checking'#010+
-  '**2CX_Create also smartlinked library'#010+
-  '**1d<x>_Defines the ','symbol <x>'#010+
+  '**2CX_Create also smartlinked libr','ary'#010+
+  '**1d<x>_Defines the symbol <x>'#010+
   '**1D_Generate a DEF file'#010+
   '**1D_Generate a DEF file'#010+
   '**2Dd<x>_Set description to <x>'#010+
   '**2Dd<x>_Set description to <x>'#010+
   '**2Dv<x>_Set DLL version to <x>'#010+
   '**2Dv<x>_Set DLL version to <x>'#010+
@@ -1250,133 +1256,133 @@ const msgtxt : array[0..000272,1..240] of char=(
   '**1e<x>_Set path to executable'#010+
   '**1e<x>_Set path to executable'#010+
   '**1E_Same as -Cn'#010+
   '**1E_Same as -Cn'#010+
   '**1fPIC_Same as -Cg'#010+
   '**1fPIC_Same as -Cg'#010+
-  '**1F<x>_Set file names and paths:'#010+
-  '**2Fa<x>[,y]_(for',' a program) load units <x> and [y] before uses is p'+
-  'arsed'#010+
+  '**1F<x>_Set file names and ','paths:'#010+
+  '**2Fa<x>[,y]_(for a program) load units <x> and [y] before uses is par'+
+  'sed'#010+
   '**2Fc<x>_Set input codepage to <x>'#010+
   '**2Fc<x>_Set input codepage to <x>'#010+
   '**2FC<x>_Set RC compiler binary name to <x>'#010+
   '**2FC<x>_Set RC compiler binary name to <x>'#010+
   '**2Fd_Disable the compiler'#039's internal directory cache'#010+
   '**2Fd_Disable the compiler'#039's internal directory cache'#010+
-  '**2FD<x>_Set the directory where to search for com','piler utilities'#010+
+  '**2FD<x>_Set the directory',' where to search for compiler utilities'#010+
   '**2Fe<x>_Redirect error output to <x>'#010+
   '**2Fe<x>_Redirect error output to <x>'#010+
   '**2Ff<x>_Add <x> to framework path (Darwin only)'#010+
   '**2Ff<x>_Add <x> to framework path (Darwin only)'#010+
   '**2FE<x>_Set exe/unit output path to <x>'#010+
   '**2FE<x>_Set exe/unit output path to <x>'#010+
   '**2Fi<x>_Add <x> to include path'#010+
   '**2Fi<x>_Add <x> to include path'#010+
   '**2Fl<x>_Add <x> to library path'#010+
   '**2Fl<x>_Add <x> to library path'#010+
-  '**2FL<x>_Use <x> as dynamic li','nker'#010+
+  '**2FL<','x>_Use <x> as dynamic linker'#010+
   '**2Fm<x>_Load unicode conversion table from <x>.txt in the compiler di'+
   '**2Fm<x>_Load unicode conversion table from <x>.txt in the compiler di'+
   'r'#010+
   'r'#010+
   '**2Fo<x>_Add <x> to object path'#010+
   '**2Fo<x>_Add <x> to object path'#010+
   '**2Fr<x>_Load error message file <x>'#010+
   '**2Fr<x>_Load error message file <x>'#010+
   '**2FR<x>_Set resource (.res) linker to <x>'#010+
   '**2FR<x>_Set resource (.res) linker to <x>'#010+
-  '**2Fu<x>_Add <x> to unit path'#010+
-  '**2FU<x>_Set unit out','put path to <x>, overrides -FE'#010+
+  '**2Fu<x>_Add <x> to unit pa','th'#010+
+  '**2FU<x>_Set unit output path to <x>, overrides -FE'#010+
   '**2FW<x>_Store generated whole-program optimization feedback in <x>'#010+
   '**2FW<x>_Store generated whole-program optimization feedback in <x>'#010+
   '**2Fw<x>_Load previously stored whole-program optimization feedback fr'+
   '**2Fw<x>_Load previously stored whole-program optimization feedback fr'+
   'om <x>'#010+
   'om <x>'#010+
-  '*g1g_Generate debug information (default format for target)'#010+
-  '*g2g','c_Generate checks for pointers'#010+
+  '*g1g_Generate debug information (default',' format for target)'#010+
+  '*g2gc_Generate checks for pointers'#010+
   '*g2gh_Use heaptrace unit (for memory leak/corruption debugging)'#010+
   '*g2gh_Use heaptrace unit (for memory leak/corruption debugging)'#010+
   '*g2gl_Use line info unit (show more info with backtraces)'#010+
   '*g2gl_Use line info unit (show more info with backtraces)'#010+
   '*g2go<x>_Set debug information options'#010+
   '*g2go<x>_Set debug information options'#010+
-  '*g3godwarfsets_ Enable DWARF '#039'set'#039' type debug in','formation (b'+
+  '*g3godwarfsets_ Enable D','WARF '#039'set'#039' type debug information (b'+
   'reaks gdb < 6.5)'#010+
   'reaks gdb < 6.5)'#010+
   '*g3gostabsabsincludes_ Store absolute/full include file paths in Stabs'+
   '*g3gostabsabsincludes_ Store absolute/full include file paths in Stabs'+
   #010+
   #010+
   '*g3godwarfmethodclassprefix_ Prefix method names in DWARF with class n'+
   '*g3godwarfmethodclassprefix_ Prefix method names in DWARF with class n'+
   'ame'#010+
   'ame'#010+
-  '*g2gp_Preserve case in stabs symbol names'#010+
-  '*g2gs_Generate Stabs deb','ug information'#010+
+  '*g2gp_Preserve case in stabs symbol names'#010,
+  '*g2gs_Generate Stabs debug information'#010+
   '*g2gt_Trash local variables (to detect uninitialized uses)'#010+
   '*g2gt_Trash local variables (to detect uninitialized uses)'#010+
   '*g2gv_Generates programs traceable with Valgrind'#010+
   '*g2gv_Generates programs traceable with Valgrind'#010+
   '*g2gw_Generate DWARFv2 debug information (same as -gw2)'#010+
   '*g2gw_Generate DWARFv2 debug information (same as -gw2)'#010+
-  '*g2gw2_Generate DWARFv2 debug information'#010+
-  '*g2gw3_Generate DWA','RFv3 debug information'#010+
+  '*g2gw2_Generate DWARFv2 debug informa','tion'#010+
+  '*g2gw3_Generate DWARFv3 debug information'#010+
   '*g2gw4_Generate DWARFv4 debug information (experimental)'#010+
   '*g2gw4_Generate DWARFv4 debug information (experimental)'#010+
   '**1i_Information'#010+
   '**1i_Information'#010+
   '**2iD_Return compiler date'#010+
   '**2iD_Return compiler date'#010+
   '**2iV_Return short compiler version'#010+
   '**2iV_Return short compiler version'#010+
   '**2iW_Return full compiler version'#010+
   '**2iW_Return full compiler version'#010+
-  '**2iSO_Return compiler OS'#010+
-  '**2iSP_Return compi','ler host processor'#010+
+  '**2iSO_Return compile','r OS'#010+
+  '**2iSP_Return compiler host processor'#010+
   '**2iTO_Return target OS'#010+
   '**2iTO_Return target OS'#010+
   '**2iTP_Return target processor'#010+
   '**2iTP_Return target processor'#010+
   '**1I<x>_Add <x> to include path'#010+
   '**1I<x>_Add <x> to include path'#010+
   '**1k<x>_Pass <x> to the linker'#010+
   '**1k<x>_Pass <x> to the linker'#010+
   '**1l_Write logo'#010+
   '**1l_Write logo'#010+
   '**1M<x>_Set language mode to <x>'#010+
   '**1M<x>_Set language mode to <x>'#010+
-  '**2Mfpc_Free Pascal dialect (default)'#010+
-  '**2Mobjfpc_FPC m','ode with Object Pascal support'#010+
+  '**2Mfpc_Free Pascal dialect (d','efault)'#010+
+  '**2Mobjfpc_FPC mode with Object Pascal support'#010+
   '**2Mdelphi_Delphi 7 compatibility mode'#010+
   '**2Mdelphi_Delphi 7 compatibility mode'#010+
   '**2Mtp_TP/BP 7.0 compatibility mode'#010+
   '**2Mtp_TP/BP 7.0 compatibility mode'#010+
   '**2Mmacpas_Macintosh Pascal dialects compatibility mode'#010+
   '**2Mmacpas_Macintosh Pascal dialects compatibility mode'#010+
   '**1n_Do not read the default config files'#010+
   '**1n_Do not read the default config files'#010+
-  '**1N<x>_Node tree optimizations'#010+
-  '**2N','u_Unroll loops'#010+
+  '**1N<x>_Node',' tree optimizations'#010+
+  '**2Nu_Unroll loops'#010+
   '**1o<x>_Change the name of the executable produced to <x>'#010+
   '**1o<x>_Change the name of the executable produced to <x>'#010+
   '**1O<x>_Optimizations:'#010+
   '**1O<x>_Optimizations:'#010+
   '**2O-_Disable optimizations'#010+
   '**2O-_Disable optimizations'#010+
   '**2O1_Level 1 optimizations (quick and debugger friendly)'#010+
   '**2O1_Level 1 optimizations (quick and debugger friendly)'#010+
-  '**2O2_Level 2 optimizations (-O1 + quick optimizations)'#010+
-  '**','2O3_Level 3 optimizations (-O2 + slow optimizations)'#010+
+  '**2O2_Level 2 optimizations (-O1 +',' quick optimizations)'#010+
+  '**2O3_Level 3 optimizations (-O2 + slow optimizations)'#010+
   '**2Oa<x>=<y>_Set alignment'#010+
   '**2Oa<x>=<y>_Set alignment'#010+
   '**2Oo[NO]<x>_Enable or disable optimizations, see fpc -i for possible '+
   '**2Oo[NO]<x>_Enable or disable optimizations, see fpc -i for possible '+
   'values'#010+
   'values'#010+
-  '**2Op<x>_Set target cpu for optimizing, see fpc -i for possible values'+
-  #010+
-  '**2OW<x>_Gen','erate whole-program optimization feedback for optimizati'+
-  'on <x>, see fpc -i for possible values'#010+
+  '**2Op<x>_Set target cpu for optimizing, see fpc -i for poss','ible valu'+
+  'es'#010+
+  '**2OW<x>_Generate whole-program optimization feedback for optimization'+
+  ' <x>, see fpc -i for possible values'#010+
   '**2Ow<x>_Perform whole-program optimization <x>, see fpc -i for possib'+
   '**2Ow<x>_Perform whole-program optimization <x>, see fpc -i for possib'+
   'le values'#010+
   'le values'#010+
-  '**2Os_Optimize for size rather than speed'#010+
-  '**1pg_Generate profile ','code for gprof (defines FPC_PROFILE)'#010+
+  '**2Os_Optimize for size rather than speed',#010+
+  '**1pg_Generate profile code for gprof (defines FPC_PROFILE)'#010+
   'F*1P<x>_Target CPU / compiler related options:'#010+
   'F*1P<x>_Target CPU / compiler related options:'#010+
   'F*2PB_Show default compiler binary'#010+
   'F*2PB_Show default compiler binary'#010+
   'F*2PP_Show default target cpu'#010+
   'F*2PP_Show default target cpu'#010+
-  'F*2P<x>_Set target CPU (arm,i386,m68k,mips,mipsel,powerpc,powerpc64,sp'+
-  'arc,x86_64'#010+
-  '**1R<x>_As','sembler reading style:'#010+
+  'F*2P<x>_Set target CPU (arm,i386,m68k,mips,mipsel,powerpc,powerpc64',','+
+  'sparc,x86_64'#010+
+  '**1R<x>_Assembler reading style:'#010+
   '**2Rdefault_Use default assembler for target'#010+
   '**2Rdefault_Use default assembler for target'#010+
   '3*2Ratt_Read AT&T style assembler'#010+
   '3*2Ratt_Read AT&T style assembler'#010+
   '3*2Rintel_Read Intel style assembler'#010+
   '3*2Rintel_Read Intel style assembler'#010+
   '6*2RMOT_Read motorola style assembler'#010+
   '6*2RMOT_Read motorola style assembler'#010+
   '**1S<x>_Syntax options:'#010+
   '**1S<x>_Syntax options:'#010+
-  '**2S2_Same as -Mobjfpc'#010+
-  '**2Sc_Support op','erators like C (*=,+=,/= and -=)'#010+
+  '**2S2_Same as -','Mobjfpc'#010+
+  '**2Sc_Support operators like C (*=,+=,/= and -=)'#010+
   '**2Sa_Turn on assertions'#010+
   '**2Sa_Turn on assertions'#010+
   '**2Sd_Same as -Mdelphi'#010+
   '**2Sd_Same as -Mdelphi'#010+
   '**2Se<x>_Error options. <x> is a combination of the following:'#010+
   '**2Se<x>_Error options. <x> is a combination of the following:'#010+
   '**3*_<n> : Compiler halts after the <n> errors (default is 1)'#010+
   '**3*_<n> : Compiler halts after the <n> errors (default is 1)'#010+
-  '**3*_w : Compiler also halts after',' warnings'#010+
+  '**3*_w : C','ompiler also halts after warnings'#010+
   '**3*_n : Compiler also halts after notes'#010+
   '**3*_n : Compiler also halts after notes'#010+
   '**3*_h : Compiler also halts after hints'#010+
   '**3*_h : Compiler also halts after hints'#010+
   '**2Sg_Enable LABEL and GOTO (default in -Mtp and -Mdelphi)'#010+
   '**2Sg_Enable LABEL and GOTO (default in -Mtp and -Mdelphi)'#010+
-  '**2Sh_Use reference counted strings (ansistring by default) instead of'+
-  ' shortstrings'#010+
-  '**2Si','_Turn on inlining of procedures/functions declared as "inline"'#010+
+  '**2Sh_Use reference counted strings (ansistring by default) inste','ad '+
+  'of shortstrings'#010+
+  '**2Si_Turn on inlining of procedures/functions declared as "inline"'#010+
   '**2Sk_Load fpcylix unit'#010+
   '**2Sk_Load fpcylix unit'#010+
   '**2SI<x>_Set interface style to <x>'#010+
   '**2SI<x>_Set interface style to <x>'#010+
   '**3SIcom_COM compatible interface (default)'#010+
   '**3SIcom_COM compatible interface (default)'#010+
   '**3SIcorba_CORBA compatible interface'#010+
   '**3SIcorba_CORBA compatible interface'#010+
-  '**2Sm_Support macros like C (global',')'#010+
+  '**2Sm_Suppo','rt macros like C (global)'#010+
   '**2So_Same as -Mtp'#010+
   '**2So_Same as -Mtp'#010+
   '**2Ss_Constructor name must be init (destructor must be done)'#010+
   '**2Ss_Constructor name must be init (destructor must be done)'#010+
   '**2Sx_Enable exception keywords (default in Delphi/ObjFPC modes)'#010+
   '**2Sx_Enable exception keywords (default in Delphi/ObjFPC modes)'#010+
   '**2Sy_@<pointer> returns a typed pointer, same as $T+'#010+
   '**2Sy_@<pointer> returns a typed pointer, same as $T+'#010+
-  '**1s_Do not call assembler and linker'#010,
+  '**1s_Do not ca','ll assembler and linker'#010+
   '**2sh_Generate script to link on host'#010+
   '**2sh_Generate script to link on host'#010+
   '**2st_Generate script to link on target'#010+
   '**2st_Generate script to link on target'#010+
   '**2sr_Skip register allocation phase (use with -alr)'#010+
   '**2sr_Skip register allocation phase (use with -alr)'#010+
   '**1T<x>_Target operating system:'#010+
   '**1T<x>_Target operating system:'#010+
   '3*2Tdarwin_Darwin/Mac OS X'#010+
   '3*2Tdarwin_Darwin/Mac OS X'#010+
-  '3*2Temx_OS/2 via EMX (including EMX/RSX extender)',#010+
+  '3*2Temx_OS/2 via EMX (inc','luding EMX/RSX extender)'#010+
   '3*2Tfreebsd_FreeBSD'#010+
   '3*2Tfreebsd_FreeBSD'#010+
   '3*2Tgo32v2_Version 2 of DJ Delorie DOS extender'#010+
   '3*2Tgo32v2_Version 2 of DJ Delorie DOS extender'#010+
   '3*2Tiphonesim_ iPhoneSimulator from iOS SDK 3.2+ (older versions: -Tda'+
   '3*2Tiphonesim_ iPhoneSimulator from iOS SDK 3.2+ (older versions: -Tda'+
   'rwin)'#010+
   'rwin)'#010+
   '3*2Tlinux_Linux'#010+
   '3*2Tlinux_Linux'#010+
   '3*2Tnetbsd_NetBSD'#010+
   '3*2Tnetbsd_NetBSD'#010+
-  '3*2Tnetware_Novell Netware Module (clib)'#010+
-  '3*2Tnetwlibc_Novell ','Netware Module (libc)'#010+
+  '3*2Tnetware_Novell Netware Module (cl','ib)'#010+
+  '3*2Tnetwlibc_Novell Netware Module (libc)'#010+
   '3*2Topenbsd_OpenBSD'#010+
   '3*2Topenbsd_OpenBSD'#010+
   '3*2Tos2_OS/2 / eComStation'#010+
   '3*2Tos2_OS/2 / eComStation'#010+
   '3*2Tsunos_SunOS/Solaris'#010+
   '3*2Tsunos_SunOS/Solaris'#010+
@@ -1384,8 +1390,8 @@ const msgtxt : array[0..000272,1..240] of char=(
   '3*2Tsolaris_Solaris'#010+
   '3*2Tsolaris_Solaris'#010+
   '3*2Twatcom_Watcom compatible DOS extender'#010+
   '3*2Twatcom_Watcom compatible DOS extender'#010+
   '3*2Twdosx_WDOSX DOS extender'#010+
   '3*2Twdosx_WDOSX DOS extender'#010+
-  '3*2Twin32_Windows 32 Bit'#010+
-  '3*2Twinc','e_Windows CE'#010+
+  '3*2Twin32','_Windows 32 Bit'#010+
+  '3*2Twince_Windows CE'#010+
   '4*2Tdarwin_Darwin/Mac OS X'#010+
   '4*2Tdarwin_Darwin/Mac OS X'#010+
   '4*2Tlinux_Linux'#010+
   '4*2Tlinux_Linux'#010+
   '4*2Twin64_Win64 (64 bit Windows systems)'#010+
   '4*2Twin64_Win64 (64 bit Windows systems)'#010+
@@ -1394,8 +1400,8 @@ const msgtxt : array[0..000272,1..240] of char=(
   '6*2Tlinux_Linux'#010+
   '6*2Tlinux_Linux'#010+
   '6*2Tpalmos_PalmOS'#010+
   '6*2Tpalmos_PalmOS'#010+
   'A*2Tdarwin_Darwin/iPhoneOS/iOS'#010+
   'A*2Tdarwin_Darwin/iPhoneOS/iOS'#010+
-  'A*2Tlinux_Linux'#010+
-  'A*2Twince_','Windows CE'#010+
+  'A*','2Tlinux_Linux'#010+
+  'A*2Twince_Windows CE'#010+
   'P*2Tamiga_AmigaOS'#010+
   'P*2Tamiga_AmigaOS'#010+
   'P*2Tdarwin_Darwin/Mac OS X'#010+
   'P*2Tdarwin_Darwin/Mac OS X'#010+
   'P*2Tlinux_Linux'#010+
   'P*2Tlinux_Linux'#010+
@@ -1405,111 +1411,112 @@ const msgtxt : array[0..000272,1..240] of char=(
   'S*2Tlinux_Linux'#010+
   'S*2Tlinux_Linux'#010+
   '**1u<x>_Undefines the symbol <x>'#010+
   '**1u<x>_Undefines the symbol <x>'#010+
   '**1U_Unit options:'#010+
   '**1U_Unit options:'#010+
-  '**2Un_Do not check where the unit',' name matches the file name'#010+
+  '**2Un_Do ','not check where the unit name matches the file name'#010+
   '**2Ur_Generate release unit files (never automatically recompiled)'#010+
   '**2Ur_Generate release unit files (never automatically recompiled)'#010+
   '**2Us_Compile a system unit'#010+
   '**2Us_Compile a system unit'#010+
   '**1v<x>_Be verbose. <x> is a combination of the following letters:'#010+
   '**1v<x>_Be verbose. <x> is a combination of the following letters:'#010+
-  '**2*_e : Show errors (default)       0 : Show noth','ing (except errors'+
+  '**2*_e : Show errors (defa','ult)       0 : Show nothing (except errors'+
   ')'#010+
   ')'#010+
   '**2*_w : Show warnings               u : Show unit info'#010+
   '**2*_w : Show warnings               u : Show unit info'#010+
   '**2*_n : Show notes                  t : Show tried/used files'#010+
   '**2*_n : Show notes                  t : Show tried/used files'#010+
   '**2*_h : Show hints                  c : Show conditionals'#010+
   '**2*_h : Show hints                  c : Show conditionals'#010+
-  '**2*_i : Show general info           d : S','how debug info'#010+
+  '**2*_i : Show gene','ral info           d : Show debug info'#010+
   '**2*_l : Show linenumbers            r : Rhide/GCC compatibility mode'#010+
   '**2*_l : Show linenumbers            r : Rhide/GCC compatibility mode'#010+
   '**2*_s : Show time stamps            q : Show message numbers'#010+
   '**2*_s : Show time stamps            q : Show message numbers'#010+
-  '**2*_a : Show everything             x : Executable info (Win32 only)'#010+
-  '**2*_b : Write file nam','es messages   p : Write tree.log with parse t'+
-  'ree'#010+
+  '**2*_a : Show everything             x : Executable info (Win32 only)',
+  #010+
+  '**2*_b : Write file names messages   p : Write tree.log with parse tre'+
+  'e'#010+
   '**2*_    with full path              v : Write fpcdebug.txt with'#010+
   '**2*_    with full path              v : Write fpcdebug.txt with'#010+
   '**2*_                                    lots of debugging info'#010+
   '**2*_                                    lots of debugging info'#010+
-  '**2*_m<x>,<y> : Don'#039't show messages numbered <x> and <y>'#010+
-  'F*1V<','x>_Append '#039'-<x>'#039' to the used compiler binary name (e.g.'+
-  ' for version)'#010+
+  '**2*_m<x>,<y> : Don'#039't show messages nu','mbered <x> and <y>'#010+
+  'F*1V<x>_Append '#039'-<x>'#039' to the used compiler binary name (e.g. f'+
+  'or version)'#010+
   '**1W<x>_Target-specific options (targets)'#010+
   '**1W<x>_Target-specific options (targets)'#010+
   '3*2WA_Specify native type application (Windows)'#010+
   '3*2WA_Specify native type application (Windows)'#010+
   '4*2WA_Specify native type application (Windows)'#010+
   '4*2WA_Specify native type application (Windows)'#010+
-  'A*2WA_Specify native type applica','tion (Windows)'#010+
+  'A*2WA_Spe','cify native type application (Windows)'#010+
   '3*2Wb_Create a bundle instead of a library (Darwin)'#010+
   '3*2Wb_Create a bundle instead of a library (Darwin)'#010+
   'P*2Wb_Create a bundle instead of a library (Darwin)'#010+
   'P*2Wb_Create a bundle instead of a library (Darwin)'#010+
   'p*2Wb_Create a bundle instead of a library (Darwin)'#010+
   'p*2Wb_Create a bundle instead of a library (Darwin)'#010+
-  'A*2Wb_Create a bundle instead of a library (Darwin)'#010+
-  '4*2Wb_Create a bu','ndle instead of a library (Darwin)'#010+
+  'A*2Wb_Create a bundle instead of a library (D','arwin)'#010+
+  '4*2Wb_Create a bundle instead of a library (Darwin)'#010+
   '3*2WB_Create a relocatable image (Windows, Symbian)'#010+
   '3*2WB_Create a relocatable image (Windows, Symbian)'#010+
   '3*2WBxxxx_Set image base to xxxx (Windows, Symbian)'#010+
   '3*2WBxxxx_Set image base to xxxx (Windows, Symbian)'#010+
   '4*2WB_Create a relocatable image (Windows)'#010+
   '4*2WB_Create a relocatable image (Windows)'#010+
-  '4*2WBxxxx_Set image base to xxxx (Windows)'#010+
-  'A*2WB_Create a ','relocatable image (Windows, Symbian)'#010+
+  '4*2WBxxxx_Set image base to xxxx (','Windows)'#010+
+  'A*2WB_Create a relocatable image (Windows, Symbian)'#010+
   'A*2WBxxxx_Set image base to xxxx (Windows, Symbian)'#010+
   'A*2WBxxxx_Set image base to xxxx (Windows, Symbian)'#010+
   '3*2WC_Specify console type application (EMX, OS/2, Windows)'#010+
   '3*2WC_Specify console type application (EMX, OS/2, Windows)'#010+
   '4*2WC_Specify console type application (EMX, OS/2, Windows)'#010+
   '4*2WC_Specify console type application (EMX, OS/2, Windows)'#010+
-  'A*2WC_Specify console type appl','ication (Windows)'#010+
+  'A*2WC_S','pecify console type application (Windows)'#010+
   'P*2WC_Specify console type application (Classic Mac OS)'#010+
   'P*2WC_Specify console type application (Classic Mac OS)'#010+
   '3*2WD_Use DEFFILE to export functions of DLL or EXE (Windows)'#010+
   '3*2WD_Use DEFFILE to export functions of DLL or EXE (Windows)'#010+
   '4*2WD_Use DEFFILE to export functions of DLL or EXE (Windows)'#010+
   '4*2WD_Use DEFFILE to export functions of DLL or EXE (Windows)'#010+
-  'A*2WD_Use DEFFILE to export functions of D','LL or EXE (Windows)'#010+
+  'A*2WD_Use DEFFILE ','to export functions of DLL or EXE (Windows)'#010+
   '3*2We_Use external resources (Darwin)'#010+
   '3*2We_Use external resources (Darwin)'#010+
   '4*2We_Use external resources (Darwin)'#010+
   '4*2We_Use external resources (Darwin)'#010+
   'A*2We_Use external resources (Darwin)'#010+
   'A*2We_Use external resources (Darwin)'#010+
   'P*2We_Use external resources (Darwin)'#010+
   'P*2We_Use external resources (Darwin)'#010+
   'p*2We_Use external resources (Darwin)'#010+
   'p*2We_Use external resources (Darwin)'#010+
-  '3*2WF_Specify full-screen type',' application (EMX, OS/2)'#010+
+  '3*2WF_','Specify full-screen type application (EMX, OS/2)'#010+
   '3*2WG_Specify graphic type application (EMX, OS/2, Windows)'#010+
   '3*2WG_Specify graphic type application (EMX, OS/2, Windows)'#010+
   '4*2WG_Specify graphic type application (EMX, OS/2, Windows)'#010+
   '4*2WG_Specify graphic type application (EMX, OS/2, Windows)'#010+
   'A*2WG_Specify graphic type application (Windows)'#010+
   'A*2WG_Specify graphic type application (Windows)'#010+
-  'P*2WG_Specify graphic type application (Classi','c Mac OS)'#010+
+  'P*2WG_Specify graphic ','type application (Classic Mac OS)'#010+
   '3*2Wi_Use internal resources (Darwin)'#010+
   '3*2Wi_Use internal resources (Darwin)'#010+
   '4*2Wi_Use internal resources (Darwin)'#010+
   '4*2Wi_Use internal resources (Darwin)'#010+
   'A*2Wi_Use internal resources (Darwin)'#010+
   'A*2Wi_Use internal resources (Darwin)'#010+
   'P*2Wi_Use internal resources (Darwin)'#010+
   'P*2Wi_Use internal resources (Darwin)'#010+
   'p*2Wi_Use internal resources (Darwin)'#010+
   'p*2Wi_Use internal resources (Darwin)'#010+
-  '3*2WI_Turn on/off the usage of import se','ctions (Windows)'#010+
+  '3*2WI_Turn on/of','f the usage of import sections (Windows)'#010+
   '4*2WI_Turn on/off the usage of import sections (Windows)'#010+
   '4*2WI_Turn on/off the usage of import sections (Windows)'#010+
   'A*2WI_Turn on/off the usage of import sections (Windows)'#010+
   'A*2WI_Turn on/off the usage of import sections (Windows)'#010+
   '3*2WM<x>_Minimum Mac OS X deployment version: 10.4, 10.5.1, ... (Darwi'+
   '3*2WM<x>_Minimum Mac OS X deployment version: 10.4, 10.5.1, ... (Darwi'+
   'n)'#010+
   'n)'#010+
-  '4*2WM<x>_Minimum Mac OS X deployment',' version: 10.4, 10.5.1, ... (Dar'+
+  '4*2WM<x>_Min','imum Mac OS X deployment version: 10.4, 10.5.1, ... (Dar'+
   'win)'#010+
   'win)'#010+
   'p*2WM<x>_Minimum Mac OS X deployment version: 10.4, 10.5.1, ... (Darwi'+
   'p*2WM<x>_Minimum Mac OS X deployment version: 10.4, 10.5.1, ... (Darwi'+
   'n)'#010+
   'n)'#010+
   'P*2WM<x>_Minimum Mac OS X deployment version: 10.4, 10.5.1, ... (Darwi'+
   'P*2WM<x>_Minimum Mac OS X deployment version: 10.4, 10.5.1, ... (Darwi'+
   'n)'#010+
   'n)'#010+
-  '3*2WN_Do not generate relocation code, needed for debuggi','ng (Windows'+
+  '3*2WN_Do not generate relocation ','code, needed for debugging (Windows'+
   ')'#010+
   ')'#010+
   '4*2WN_Do not generate relocation code, needed for debugging (Windows)'#010+
   '4*2WN_Do not generate relocation code, needed for debugging (Windows)'#010+
   'A*2WN_Do not generate relocation code, needed for debugging (Windows)'#010+
   'A*2WN_Do not generate relocation code, needed for debugging (Windows)'#010+
-  'A*2Wpxxxx_Specify the controller type, see fpc -i for possible values'#010+
-  'V*2Wpxxxx_Specify',' the controller type, see fpc -i for possible value'+
+  'A*2Wpxxxx_Specify the controller type, see fpc -i for possible ','value'+
   's'#010+
   's'#010+
+  'V*2Wpxxxx_Specify the controller type, see fpc -i for possible values'#010+
   '3*2WP<x>_Minimum iOS deployment version: 3.0, 5.0.1, ... (iphonesim)'#010+
   '3*2WP<x>_Minimum iOS deployment version: 3.0, 5.0.1, ... (iphonesim)'#010+
   'A*2WP<x>_Minimum iOS deployment version: 3.0, 5.0.1, ... (Darwin)'#010+
   'A*2WP<x>_Minimum iOS deployment version: 3.0, 5.0.1, ... (Darwin)'#010+
-  '3*2WR_Generate relocation code (Windows)'#010+
-  '4*2WR_Gener','ate relocation code (Windows)'#010+
+  '3*2WR_Generate relocation co','de (Windows)'#010+
+  '4*2WR_Generate relocation code (Windows)'#010+
   'A*2WR_Generate relocation code (Windows)'#010+
   'A*2WR_Generate relocation code (Windows)'#010+
   'P*2WT_Specify MPW tool type application (Classic Mac OS)'#010+
   'P*2WT_Specify MPW tool type application (Classic Mac OS)'#010+
   '**2WX_Enable executable stack (Linux)'#010+
   '**2WX_Enable executable stack (Linux)'#010+
   '**1X_Executable options:'#010+
   '**1X_Executable options:'#010+
-  '**2Xc_Pass --shared/-dynamic to the linker (BeOS,',' Darwin, FreeBSD, L'+
+  '**2Xc_Pass --shared/-dyna','mic to the linker (BeOS, Darwin, FreeBSD, L'+
   'inux)'#010+
   'inux)'#010+
   '**2Xd_Do not use standard library search path (needed for cross compil'+
   '**2Xd_Do not use standard library search path (needed for cross compil'+
   'e)'#010+
   'e)'#010+
   '**2Xe_Use external linker'#010+
   '**2Xe_Use external linker'#010+
   '**2Xg_Create debuginfo in a separate file and add a debuglink section '+
   '**2Xg_Create debuginfo in a separate file and add a debuglink section '+
   'to executable'#010+
   'to executable'#010+
-  '**2XD_Try to link units dynamica','lly      (defines FPC_LINK_DYNAMIC)'#010+
+  '**2XD_Tr','y to link units dynamically      (defines FPC_LINK_DYNAMIC)'#010+
   '**2Xi_Use internal linker'#010+
   '**2Xi_Use internal linker'#010+
   '**2Xm_Generate link map'#010+
   '**2Xm_Generate link map'#010+
   '**2XM<x>_Set the name of the '#039'main'#039' program routine (default i'+
   '**2XM<x>_Set the name of the '#039'main'#039' program routine (default i'+
   's '#039'main'#039')'#010+
   's '#039'main'#039')'#010+
-  'F*2Xp<x>_First search for the compiler binary in the directory <x>'#010+
-  '**2XP<x>_Prepen','d the binutils names with the prefix <x>'#010+
+  'F*2Xp<x>_First search for the compiler binary in the direc','tory <x>'#010+
+  '**2XP<x>_Prepend the binutils names with the prefix <x>'#010+
   '**2Xr<x>_Set the linker'#039's rlink-path to <x> (needed for cross comp'+
   '**2Xr<x>_Set the linker'#039's rlink-path to <x> (needed for cross comp'+
   'ile, see the ld manual for more information) (BeOS, Linux)'#010+
   'ile, see the ld manual for more information) (BeOS, Linux)'#010+
-  '**2XR<x>_Prepend <x> to all linker search paths (BeOS, Darwin, FreeBSD'+
-  ', Li','nux, Mac OS, Solaris)'#010+
+  '**2XR<x>_Prepend <x> to all linker search paths (B','eOS, Darwin, FreeB'+
+  'SD, Linux, Mac OS, Solaris)'#010+
   '**2Xs_Strip all symbols from executable'#010+
   '**2Xs_Strip all symbols from executable'#010+
   '**2XS_Try to link units statically (default, defines FPC_LINK_STATIC)'#010+
   '**2XS_Try to link units statically (default, defines FPC_LINK_STATIC)'#010+
   '**2Xt_Link with static libraries (-static is passed to linker)'#010+
   '**2Xt_Link with static libraries (-static is passed to linker)'#010+
-  '**2XX_Try to smartlink units             (def','ines FPC_LINK_SMART)'#010+
+  '**2XX_Try to smartlin','k units             (defines FPC_LINK_SMART)'#010+
   '**1*_'#010+
   '**1*_'#010+
   '**1?_Show this help'#010+
   '**1?_Show this help'#010+
   '**1h_Shows this help without waiting'
   '**1h_Shows this help without waiting'

+ 4 - 4
compiler/nadd.pas

@@ -676,7 +676,7 @@ implementation
                 addn :
                 addn :
                   begin
                   begin
                      concatwidestrings(ws1,ws2);
                      concatwidestrings(ws1,ws2);
-                     t:=cstringconstnode.createwstr(ws1);
+                     t:=cstringconstnode.createunistr(ws1);
                   end;
                   end;
                 ltn :
                 ltn :
                   t:=cordconstnode.create(byte(comparewidestrings(ws1,ws2)<0),pasbool8type,true);
                   t:=cordconstnode.create(byte(comparewidestrings(ws1,ws2)<0),pasbool8type,true);
@@ -1323,13 +1323,13 @@ implementation
              { There is a widechar? }
              { There is a widechar? }
              else if is_widechar(rd) or is_widechar(ld) then
              else if is_widechar(rd) or is_widechar(ld) then
                begin
                begin
-                 { widechar+widechar gives widestring }
+                 { widechar+widechar gives unicodestring }
                  if nodetype=addn then
                  if nodetype=addn then
                    begin
                    begin
-                     inserttypeconv(left,cwidestringtype);
+                     inserttypeconv(left,cunicodestringtype);
                      if (torddef(rd).ordtype<>uwidechar) then
                      if (torddef(rd).ordtype<>uwidechar) then
                        inserttypeconv(right,cwidechartype);
                        inserttypeconv(right,cwidechartype);
-                     resultdef:=cwidestringtype;
+                     resultdef:=cunicodestringtype;
                    end
                    end
                  else
                  else
                    begin
                    begin

+ 8 - 14
compiler/ncal.pas

@@ -421,7 +421,7 @@ implementation
           end;
           end;
 
 
         { create a temp to store parameter values }
         { create a temp to store parameter values }
-        params:=ctempcreatenode.create(voidtype,0,tt_persistent,true);
+        params:=ctempcreatenode.create(cformaltype,0,tt_persistent,false);
         addstatement(statements,params);
         addstatement(statements,params);
 
 
         calldescnode:=cdataconstnode.create;
         calldescnode:=cdataconstnode.create;
@@ -475,20 +475,14 @@ implementation
               depending on byref bit }
               depending on byref bit }
 
 
             if assignmenttype=voidpointertype then
             if assignmenttype=voidpointertype then
-              begin
-                addstatement(statements,cassignmentnode.create(
-                  ctypeconvnode.create_internal(cderefnode.create(caddnode.create(addn,
-                      caddrnode.create(ctemprefnode.create(params)),
-                    cordconstnode.create(qword(paramssize),ptruinttype,false)
-                  )),voidpointertype),
-                  ctypeconvnode.create_internal(caddrnode.create_internal(para.left),voidpointertype)));
-              end
+              addstatement(statements,cassignmentnode.create(
+                ctypeconvnode.create_internal(ctemprefnode.create_offset(params,paramssize),
+                  voidpointertype),
+                ctypeconvnode.create_internal(caddrnode.create_internal(para.left),voidpointertype)))
             else
             else
               addstatement(statements,cassignmentnode.create(
               addstatement(statements,cassignmentnode.create(
-                ctypeconvnode.create_internal(cderefnode.create(caddnode.create(addn,
-                  caddrnode.create(ctemprefnode.create(params)),
-                  cordconstnode.create(paramssize,ptruinttype,false)
-                )),assignmenttype),
+                ctypeconvnode.create_internal(ctemprefnode.create_offset(params,paramssize),
+                  assignmenttype),
                 ctypeconvnode.create_internal(para.left,assignmenttype)));
                 ctypeconvnode.create_internal(para.left,assignmenttype)));
 
 
             inc(paramssize,max(voidpointertype.size,assignmenttype.size));
             inc(paramssize,max(voidpointertype.size,assignmenttype.size));
@@ -1515,7 +1509,7 @@ implementation
     function look_for_call(var n: tnode; arg: pointer): foreachnoderesult;
     function look_for_call(var n: tnode; arg: pointer): foreachnoderesult;
       begin
       begin
         case n.nodetype of
         case n.nodetype of
-          calln:
+          calln,asn:
             result := fen_norecurse_true;
             result := fen_norecurse_true;
           typen,loadvmtaddrn,loadn,temprefn,arrayconstructorn:
           typen,loadvmtaddrn,loadn,temprefn,arrayconstructorn:
             result := fen_norecurse_false;
             result := fen_norecurse_false;

+ 11 - 14
compiler/ncgcal.pas

@@ -689,9 +689,9 @@ implementation
 {$ifdef vtentry}
 {$ifdef vtentry}
         sym : tasmsymbol;
         sym : tasmsymbol;
 {$endif vtentry}
 {$endif vtentry}
-{$ifdef x86_64}
+{$if defined(x86) or defined(arm)}
         cgpara : tcgpara;
         cgpara : tcgpara;
-{$endif x86_64}
+{$endif}
       begin
       begin
          if not assigned(procdefinition) or
          if not assigned(procdefinition) or
             not(procdefinition.has_paraloc_info in [callerside,callbothsides]) then
             not(procdefinition.has_paraloc_info in [callerside,callbothsides]) then
@@ -958,28 +958,25 @@ implementation
                end;
                end;
            end;
            end;
 
 
+         if cg.uses_registers(R_MMREGISTER) then
+           cg.dealloccpuregisters(current_asmdata.CurrAsmList,R_MMREGISTER,regs_to_save_mm);
+         if cg.uses_registers(R_FPUREGISTER) then
+           cg.dealloccpuregisters(current_asmdata.CurrAsmList,R_FPUREGISTER,regs_to_save_fpu);
+         cg.dealloccpuregisters(current_asmdata.CurrAsmList,R_INTREGISTER,regs_to_save_int);
+
 {$if defined(x86) or defined(arm)}
 {$if defined(x86) or defined(arm)}
          if (procdefinition.proccalloption=pocall_safecall) and
          if (procdefinition.proccalloption=pocall_safecall) and
             (tf_safecall_exceptions in target_info.flags) then
             (tf_safecall_exceptions in target_info.flags) then
            begin
            begin
-{$ifdef x86_64}
              cgpara.init;
              cgpara.init;
              paramanager.getintparaloc(pocall_default,1,cgpara);
              paramanager.getintparaloc(pocall_default,1,cgpara);
-             cg.a_load_reg_cgpara(current_asmdata.CurrAsmList,OS_ADDR,NR_RAX,cgpara);
+             cg.a_load_reg_cgpara(current_asmdata.CurrAsmList,OS_INT,NR_FUNCTION_RESULT_REG,cgpara);
+             paramanager.freecgpara(current_asmdata.CurrAsmList,cgpara);
              cgpara.done;
              cgpara.done;
-{$endif x86_64}
-             cg.allocallcpuregisters(current_asmdata.CurrAsmList);
-             cg.a_call_name(current_asmdata.CurrAsmList,'FPC_SAFECALLCHECK',false);
-             cg.deallocallcpuregisters(current_asmdata.CurrAsmList);
+             cg.g_call(current_asmdata.CurrAsmList,'FPC_SAFECALLCHECK');
            end;
            end;
 {$endif}
 {$endif}
 
 
-         if cg.uses_registers(R_MMREGISTER) then
-           cg.dealloccpuregisters(current_asmdata.CurrAsmList,R_MMREGISTER,regs_to_save_mm);
-         if cg.uses_registers(R_FPUREGISTER) then
-           cg.dealloccpuregisters(current_asmdata.CurrAsmList,R_FPUREGISTER,regs_to_save_fpu);
-         cg.dealloccpuregisters(current_asmdata.CurrAsmList,R_INTREGISTER,regs_to_save_int);
-
          { handle function results }
          { handle function results }
          if (not is_void(resultdef)) then
          if (not is_void(resultdef)) then
            handle_return_value
            handle_return_value

+ 6 - 0
compiler/ncgutil.pas

@@ -2564,6 +2564,12 @@ implementation
                 for j:=0 to ImplIntf.ProcDefs.Count-1 do
                 for j:=0 to ImplIntf.ProcDefs.Count-1 do
                   begin
                   begin
                     pd:=TProcdef(ImplIntf.ProcDefs[j]);
                     pd:=TProcdef(ImplIntf.ProcDefs[j]);
+                    { we don't track method calls via interfaces yet ->
+                      assume that every method called via an interface call
+                      is reachable for now }
+                    if (po_virtualmethod in pd.procoptions) and
+                       not is_objectpascal_helper(tprocdef(pd).struct) then
+                      tobjectdef(tprocdef(pd).struct).register_vmt_call(tprocdef(pd).extnumber);
                     tmps:=make_mangledname('WRPR',_class.owner,_class.objname^+'_$_'+
                     tmps:=make_mangledname('WRPR',_class.owner,_class.objname^+'_$_'+
                       ImplIntf.IntfDef.objname^+'_$_'+tostr(j)+'_$_'+pd.mangledname);
                       ImplIntf.IntfDef.objname^+'_$_'+tostr(j)+'_$_'+pd.mangledname);
                     { create wrapper code }
                     { create wrapper code }

+ 7 - 6
compiler/ncnv.pas

@@ -1054,7 +1054,7 @@ implementation
                end;
                end;
              { Convert to wide/short/ansistring and call default helper }
              { Convert to wide/short/ansistring and call default helper }
              if is_widechar(tarraydef(resultdef).elementdef) then
              if is_widechar(tarraydef(resultdef).elementdef) then
-               inserttypeconv(left,cwidestringtype)
+               inserttypeconv(left,cunicodestringtype)
              else
              else
                begin
                begin
                  if tstringconstnode(left).len>255 then
                  if tstringconstnode(left).len>255 then
@@ -1105,7 +1105,7 @@ implementation
                    concatwidestringchar(ws,tcompilerwidechar(tordconstnode(left).value.uvalue))
                    concatwidestringchar(ws,tcompilerwidechar(tordconstnode(left).value.uvalue))
                  else
                  else
                    concatwidestringchar(ws,asciichar2unicode(chr(tordconstnode(left).value.uvalue)));
                    concatwidestringchar(ws,asciichar2unicode(chr(tordconstnode(left).value.uvalue)));
-                 hp:=cstringconstnode.createwstr(ws);
+                 hp:=cstringconstnode.createunistr(ws);
                  hp.changestringtype(resultdef);
                  hp.changestringtype(resultdef);
                  donewidestring(ws);
                  donewidestring(ws);
                end
                end
@@ -1456,9 +1456,9 @@ implementation
       begin
       begin
          result:=nil;
          result:=nil;
          if is_pwidechar(resultdef) then
          if is_pwidechar(resultdef) then
-          inserttypeconv(left,cwidestringtype)
+           inserttypeconv(left,cunicodestringtype)
          else
          else
-          inserttypeconv(left,cshortstringtype);
+           inserttypeconv(left,cshortstringtype);
          { evaluate again, reset resultdef so the convert_typ
          { evaluate again, reset resultdef so the convert_typ
            will be calculated again and cstring_to_pchar will
            will be calculated again and cstring_to_pchar will
            be used for futher conversion }
            be used for futher conversion }
@@ -1472,7 +1472,7 @@ implementation
       begin
       begin
          result:=nil;
          result:=nil;
          if is_pwidechar(resultdef) then
          if is_pwidechar(resultdef) then
-           inserttypeconv(left,cwidestringtype)
+           inserttypeconv(left,cunicodestringtype)
          else
          else
            if is_pchar(resultdef) and
            if is_pchar(resultdef) and
               (is_widestring(left.resultdef) or
               (is_widestring(left.resultdef) or
@@ -2181,7 +2181,8 @@ implementation
               te_convert_l2,
               te_convert_l2,
               te_convert_l3,
               te_convert_l3,
               te_convert_l4,
               te_convert_l4,
-              te_convert_l5:
+              te_convert_l5,
+              te_convert_l6:
                 { nothing to do }
                 { nothing to do }
                 ;
                 ;
 
 

+ 5 - 5
compiler/ncon.pas

@@ -124,7 +124,7 @@ interface
           cst_type : tconststringtype;
           cst_type : tconststringtype;
           constructor createstr(const s : string);virtual;
           constructor createstr(const s : string);virtual;
           constructor createpchar(s : pchar;l : longint);virtual;
           constructor createpchar(s : pchar;l : longint);virtual;
-          constructor createwstr(w : pcompilerwidestring);virtual;
+          constructor createunistr(w : pcompilerwidestring);virtual;
           constructor ppuload(t:tnodetype;ppufile:tcompilerppufile);override;
           constructor ppuload(t:tnodetype;ppufile:tcompilerppufile);override;
           procedure ppuwrite(ppufile:tcompilerppufile);override;
           procedure ppuwrite(ppufile:tcompilerppufile);override;
           procedure buildderefimpl;override;
           procedure buildderefimpl;override;
@@ -254,7 +254,7 @@ implementation
           begin
           begin
             initwidestring(pWideStringVal);
             initwidestring(pWideStringVal);
             concatwidestringchar(pWideStringVal, tcompilerwidechar(tordconstnode(p).value.uvalue));
             concatwidestringchar(pWideStringVal, tcompilerwidechar(tordconstnode(p).value.uvalue));
-            result:=cstringconstnode.createwstr(pWideStringVal);
+            result:=cstringconstnode.createunistr(pWideStringVal);
           end
           end
         else if is_conststringnode(p) then
         else if is_conststringnode(p) then
           result:=tstringconstnode(p.getcopy)
           result:=tstringconstnode(p.getcopy)
@@ -311,7 +311,7 @@ implementation
               p1:=cstringconstnode.createpchar(pc,len);
               p1:=cstringconstnode.createpchar(pc,len);
             end;
             end;
           constwstring :
           constwstring :
-            p1:=cstringconstnode.createwstr(pcompilerwidestring(p.value.valueptr));
+            p1:=cstringconstnode.createunistr(pcompilerwidestring(p.value.valueptr));
           constreal :
           constreal :
             p1:=crealconstnode.create(pbestreal(p.value.valueptr)^,p.constdef);
             p1:=crealconstnode.create(pbestreal(p.value.valueptr)^,p.constdef);
           constset :
           constset :
@@ -794,14 +794,14 @@ implementation
       end;
       end;
 
 
 
 
-    constructor tstringconstnode.createwstr(w : pcompilerwidestring);
+    constructor tstringconstnode.createunistr(w : pcompilerwidestring);
       begin
       begin
          inherited create(stringconstn);
          inherited create(stringconstn);
          len:=getlengthwidestring(w);
          len:=getlengthwidestring(w);
          initwidestring(pcompilerwidestring(value_str));
          initwidestring(pcompilerwidestring(value_str));
          copywidestring(w,pcompilerwidestring(value_str));
          copywidestring(w,pcompilerwidestring(value_str));
          lab_str:=nil;
          lab_str:=nil;
-         cst_type:=cst_widestring;
+         cst_type:=cst_unicodestring;
       end;
       end;
 
 
 
 

+ 3 - 2
compiler/ngenutil.pas

@@ -368,10 +368,11 @@ implementation
             Moreover, such a local symbol will be removed if it's not
             Moreover, such a local symbol will be removed if it's not
             referenced anywhere, so also create a reference }
             referenced anywhere, so also create a reference }
           if (target_dbg.id=dbg_stabx) and
           if (target_dbg.id=dbg_stabx) and
-             (cs_debuginfo in current_settings.moduleswitches) then
+             (cs_debuginfo in current_settings.moduleswitches) and
+             not assigned(current_asmdata.GetAsmSymbol(sym.name)) then
             begin
             begin
               list.concat(tai_symbol.Create(current_asmdata.DefineAsmSymbol(sym.name,AB_LOCAL,AT_DATA),0));
               list.concat(tai_symbol.Create(current_asmdata.DefineAsmSymbol(sym.name,AB_LOCAL,AT_DATA),0));
-               list.concat(tai_directive.Create(asd_reference,sym.name));
+              list.concat(tai_directive.Create(asd_reference,sym.name));
             end;
             end;
           list.concat(Tai_datablock.create_global(sym.mangledname,l));
           list.concat(Tai_datablock.create_global(sym.mangledname,l));
         end
         end

+ 3 - 3
compiler/ngtcon.pas

@@ -834,8 +834,8 @@ function get_next_varsym(def: tabstractrecorddef; const SymList:TFPHashObjectLis
               current_asmdata.asmlists[al_typedconsts].concat(Tai_label.Create(ll));
               current_asmdata.asmlists[al_typedconsts].concat(Tai_label.Create(ll));
               if (node.nodetype in [stringconstn,ordconstn]) then
               if (node.nodetype in [stringconstn,ordconstn]) then
                 begin
                 begin
-                  { convert to widestring stringconstn }
-                  inserttypeconv(node,cwidestringtype);
+                  { convert to unicodestring stringconstn }
+                  inserttypeconv(node,cunicodestringtype);
                   if (node.nodetype=stringconstn) and
                   if (node.nodetype=stringconstn) and
                      (tstringconstnode(node).cst_type in [cst_widestring,cst_unicodestring]) then
                      (tstringconstnode(node).cst_type in [cst_widestring,cst_unicodestring]) then
                    begin
                    begin
@@ -1119,7 +1119,7 @@ function get_next_varsym(def: tabstractrecorddef; const SymList:TFPHashObjectLis
                      end;
                      end;
                     2:
                     2:
                       begin
                       begin
-                        inserttypeconv(n,cwidestringtype);
+                        inserttypeconv(n,cunicodestringtype);
                         if n.nodetype<>stringconstn then
                         if n.nodetype<>stringconstn then
                           internalerror(2010033003);
                           internalerror(2010033003);
                         ca:=pointer(pcompilerwidestring(tstringconstnode(n).value_str)^.data)
                         ca:=pointer(pcompilerwidestring(tstringconstnode(n).value_str)^.data)

+ 1 - 1
compiler/ninl.pas

@@ -524,7 +524,7 @@ implementation
             else
             else
               inserttypeconv(n,getansistringdef)
               inserttypeconv(n,getansistringdef)
           else if is_widechararray(n.resultdef) then
           else if is_widechararray(n.resultdef) then
-            inserttypeconv(n,cwidestringtype);
+            inserttypeconv(n,cunicodestringtype);
       end;
       end;
 
 
 
 

+ 1 - 1
compiler/nobj.pas

@@ -1487,7 +1487,7 @@ implementation
         end;
         end;
       maybe_new_object_file(current_asmdata.asmlists[al_globals]);
       maybe_new_object_file(current_asmdata.asmlists[al_globals]);
       s:=make_mangledname('IIDSTR',_class.owner,_class.objname^);
       s:=make_mangledname('IIDSTR',_class.owner,_class.objname^);
-      new_section(current_asmdata.asmlists[al_globals],sec_rodata,s,0);
+      new_section(current_asmdata.asmlists[al_globals],sec_rodata,s,sizeof(pint));
       current_asmdata.asmlists[al_globals].concat(Tai_symbol.Createname_global(s,AT_DATA,0));
       current_asmdata.asmlists[al_globals].concat(Tai_symbol.Createname_global(s,AT_DATA,0));
       current_asmdata.asmlists[al_globals].concat(Tai_const.Create_8bit(length(_class.iidstr^)));
       current_asmdata.asmlists[al_globals].concat(Tai_const.Create_8bit(length(_class.iidstr^)));
       current_asmdata.asmlists[al_globals].concat(Tai_string.Create(_class.iidstr^));
       current_asmdata.asmlists[al_globals].concat(Tai_string.Create(_class.iidstr^));

+ 5 - 0
compiler/optdead.pas

@@ -398,6 +398,11 @@ const
       else
       else
         begin
         begin
           symbolprogfullpath:=symbolprogfullpath+' -p ';
           symbolprogfullpath:=symbolprogfullpath+' -p ';
+          { GNU nm shows 64 bit addresses when processing 32 bit binaries on
+            a 64 bit platform, but only skips 8 spaces for the address in case
+            of undefined symbols -> skip undefined symbols }
+          if target_info.system in (systems_linux+systems_windows) then
+            symbolprogfullpath:=symbolprogfullpath+'--defined-only ';
           symbolprogisnm:=true;
           symbolprogisnm:=true;
         end;
         end;
       if not symbolprogfound then
       if not symbolprogfound then

+ 1 - 1
compiler/pexpr.pas

@@ -2819,7 +2819,7 @@ implementation
 
 
              _CWSTRING:
              _CWSTRING:
                begin
                begin
-                 p1:=cstringconstnode.createwstr(patternw);
+                 p1:=cstringconstnode.createunistr(patternw);
                  consume(_CWSTRING);
                  consume(_CWSTRING);
                end;
                end;
 
 

+ 0 - 186
compiler/powerpc/nppcadd.pas

@@ -545,192 +545,6 @@ interface
       end;
       end;
 
 
 
 
-{*****************************************************************************
-                                AddMMX
-*****************************************************************************}
-
-{$ifdef SUPPORT_MMX}
-    procedure ti386addnode.second_addmmx;
-      var
-        op         : TAsmOp;
-        cmpop      : boolean;
-        mmxbase    : tmmxtype;
-        hregister  : tregister;
-      begin
-        pass_left_and_right;
-
-        cmpop:=false;
-        mmxbase:=mmx_type(left.resultdef);
-        case nodetype of
-          addn :
-            begin
-              if (cs_mmx_saturation in current_settings.localswitches) then
-                begin
-                   case mmxbase of
-                      mmxs8bit:
-                        op:=A_PADDSB;
-                      mmxu8bit:
-                        op:=A_PADDUSB;
-                      mmxs16bit,mmxfixed16:
-                        op:=A_PADDSB;
-                      mmxu16bit:
-                        op:=A_PADDUSW;
-                   end;
-                end
-              else
-                begin
-                   case mmxbase of
-                      mmxs8bit,mmxu8bit:
-                        op:=A_PADDB;
-                      mmxs16bit,mmxu16bit,mmxfixed16:
-                        op:=A_PADDW;
-                      mmxs32bit,mmxu32bit:
-                        op:=A_PADDD;
-                   end;
-                end;
-            end;
-          muln :
-            begin
-               case mmxbase of
-                  mmxs16bit,mmxu16bit:
-                    op:=A_PMULLW;
-                  mmxfixed16:
-                    op:=A_PMULHW;
-               end;
-            end;
-          subn :
-            begin
-              if (cs_mmx_saturation in current_settings.localswitches) then
-                begin
-                   case mmxbase of
-                      mmxs8bit:
-                        op:=A_PSUBSB;
-                      mmxu8bit:
-                        op:=A_PSUBUSB;
-                      mmxs16bit,mmxfixed16:
-                        op:=A_PSUBSB;
-                      mmxu16bit:
-                        op:=A_PSUBUSW;
-                   end;
-                end
-              else
-                begin
-                   case mmxbase of
-                      mmxs8bit,mmxu8bit:
-                        op:=A_PSUBB;
-                      mmxs16bit,mmxu16bit,mmxfixed16:
-                        op:=A_PSUBW;
-                      mmxs32bit,mmxu32bit:
-                        op:=A_PSUBD;
-                   end;
-                end;
-            end;
-          xorn:
-            op:=A_PXOR;
-          orn:
-            op:=A_POR;
-          andn:
-            op:=A_PAND;
-          else
-            internalerror(200403183);
-        end;
-
-        { left and right no register?  }
-        { then one must be demanded    }
-        if (left.location.loc<>LOC_MMXREGISTER) then
-         begin
-           if (right.location.loc=LOC_MMXREGISTER) then
-            begin
-              location_swap(left.location,right.location);
-              toggleflag(nf_swapped);
-            end
-           else
-            begin
-              { register variable ? }
-              if (left.location.loc=LOC_CMMXREGISTER) then
-               begin
-                 hregister:=rg.getregistermm(current_asmdata.CurrAsmList);
-                 emit_reg_reg(A_MOVQ,S_NO,left.location.register,hregister);
-               end
-              else
-               begin
-                 if not(left.location.loc in [LOC_REFERENCE,LOC_CREFERENCE]) then
-                  internalerror(200203245);
-
-                 location_release(current_asmdata.CurrAsmList,left.location);
-
-                 hregister:=rg.getregistermm(current_asmdata.CurrAsmList);
-                 emit_ref_reg(A_MOVQ,S_NO,left.location.reference,hregister);
-               end;
-
-              location_reset(left.location,LOC_MMXREGISTER,OS_NO);
-              left.location.register:=hregister;
-            end;
-         end;
-
-        { at this point, left.location.loc should be LOC_MMXREGISTER }
-        if right.location.loc<>LOC_MMXREGISTER then
-         begin
-           if (nodetype=subn) and (nf_swapped in flags) then
-            begin
-              if right.location.loc=LOC_CMMXREGISTER then
-               begin
-                 emit_reg_reg(A_MOVQ,S_NO,right.location.register,R_MM7);
-                 emit_reg_reg(op,S_NO,left.location.register,R_MM7);
-                 emit_reg_reg(A_MOVQ,S_NO,R_MM7,left.location.register);
-               end
-              else
-               begin
-                 if not(left.location.loc in [LOC_REFERENCE,LOC_CREFERENCE]) then
-                  internalerror(200203247);
-                 emit_ref_reg(A_MOVQ,S_NO,right.location.reference,R_MM7);
-                 emit_reg_reg(op,S_NO,left.location.register,R_MM7);
-                 emit_reg_reg(A_MOVQ,S_NO,R_MM7,left.location.register);
-                 location_release(current_asmdata.CurrAsmList,right.location);
-               end;
-            end
-           else
-            begin
-              if (right.location.loc=LOC_CMMXREGISTER) then
-               begin
-                 emit_reg_reg(op,S_NO,right.location.register,left.location.register);
-               end
-              else
-               begin
-                 if not(right.location.loc in [LOC_REFERENCE,LOC_CREFERENCE]) then
-                  internalerror(200203246);
-                 emit_ref_reg(op,S_NO,right.location.reference,left.location.register);
-                 location_release(current_asmdata.CurrAsmList,right.location);
-               end;
-            end;
-          end
-        else
-          begin
-            { right.location=LOC_MMXREGISTER }
-            if (nodetype=subn) and (nf_swapped in flags) then
-             begin
-               emit_reg_reg(op,S_NO,left.location.register,right.location.register);
-               location_swap(left.location,right.location);
-               toggleflag(nf_swapped);
-             end
-            else
-             begin
-               emit_reg_reg(op,S_NO,right.location.register,left.location.register);
-             end;
-          end;
-
-        location_freetemp(current_asmdata.CurrAsmList,right.location);
-        location_release(current_asmdata.CurrAsmList,right.location);
-        if cmpop then
-         begin
-           location_freetemp(current_asmdata.CurrAsmList,left.location);
-           location_release(current_asmdata.CurrAsmList,left.location);
-         end;
-        set_result_location(cmpop,true);
-      end;
-{$endif SUPPORT_MMX}
-
-
 {*****************************************************************************
 {*****************************************************************************
                                 pass_2
                                 pass_2
 *****************************************************************************}
 *****************************************************************************}

+ 1 - 2
compiler/powerpc/rappcgas.pas

@@ -185,8 +185,7 @@ Unit rappcgas;
                      { replace global symbol reference with TOC entry name
                      { replace global symbol reference with TOC entry name
                        for AIX }
                        for AIX }
                      if target_info.system in systems_aix then
                      if target_info.system in systems_aix then
-                       oper.opr.ref.symbol:=
-                         tcgppcgen(cg).get_aix_toc_sym(oper.opr.ref.symbol.name,asmsym2indsymflags(oper.opr.ref.symbol));
+                       tcgppcgen(cg).get_aix_toc_sym(nil,oper.opr.ref.symbol.name,asmsym2indsymflags(oper.opr.ref.symbol),oper.opr.ref,true);
                      oper.opr.ref.refaddr:=addr_pic_no_got;
                      oper.opr.ref.refaddr:=addr_pic_no_got;
                    end;
                    end;
                  Consume_RParen;
                  Consume_RParen;

+ 38 - 141
compiler/powerpc64/cgcpu.pas

@@ -37,14 +37,6 @@ type
     procedure init_register_allocators; override;
     procedure init_register_allocators; override;
     procedure done_register_allocators; override;
     procedure done_register_allocators; override;
 
 
-    { passing parameters, per default the parameter is pushed }
-    { nr gives the number of the parameter (enumerated from   }
-    { left to right), this allows to move the parameter to    }
-    { register, if the cpu supports register calling          }
-    { conventions                                             }
-    procedure a_load_ref_cgpara(list: TAsmList; size: tcgsize; const r: treference;
-      const paraloc: tcgpara); override;
-
     procedure a_call_name(list: TAsmList; const s: string; weak: boolean); override;
     procedure a_call_name(list: TAsmList; const s: string; weak: boolean); override;
     procedure a_call_reg(list: TAsmList; reg: tregister); override;
     procedure a_call_reg(list: TAsmList; reg: tregister); override;
 
 
@@ -135,10 +127,10 @@ type
      if includeCall is true, the method is marked as having a call, not if false. This
      if includeCall is true, the method is marked as having a call, not if false. This
      option is particularly useful to prevent generation of a larger stack frame for the
      option is particularly useful to prevent generation of a larger stack frame for the
      register save and restore helper functions. }
      register save and restore helper functions. }
-    procedure a_call_name_direct(list: TAsmList; s: string; weak: boolean; prependDot : boolean;
+    procedure a_call_name_direct(list: TAsmList; opc: tasmop; s: string; weak: boolean; prependDot : boolean;
       addNOP : boolean; includeCall : boolean = true);
       addNOP : boolean; includeCall : boolean = true);
 
 
-    procedure a_jmp_name_direct(list : TAsmList; s : string; prependDot : boolean);
+    procedure a_jmp_name_direct(list : TAsmList; opc: tasmop; s : string; prependDot : boolean);
 
 
     { emits code to store the given value a into the TOC (if not already in there), and load it from there
     { emits code to store the given value a into the TOC (if not already in there), and load it from there
      as well }
      as well }
@@ -390,124 +382,12 @@ begin
   inherited done_register_allocators;
   inherited done_register_allocators;
 end;
 end;
 
 
-procedure tcgppc.a_load_ref_cgpara(list: TAsmList; size: tcgsize; const r:
-  treference; const paraloc: tcgpara);
-
-var
-  tmpref, ref: treference;
-  location: pcgparalocation;
-  sizeleft: aint;
-  adjusttail : boolean;
-
-begin
-  location := paraloc.location;
-  tmpref := r;
-  sizeleft := paraloc.intsize;
-  adjusttail := false;
-  while assigned(location) do begin
-    paramanager.allocparaloc(list,location);
-    case location^.loc of
-      LOC_REGISTER, LOC_CREGISTER:
-        begin
-          if not(size in [OS_NO,OS_128,OS_S128]) then
-            a_load_ref_reg(list, size, location^.size, tmpref,
-              location^.register)
-          else begin
-            { load non-integral sized memory location into register. This
-             memory location be 1-sizeleft byte sized.
-             Always assume that this memory area is properly aligned, eg. start
-             loading the larger quantities for "odd" quantities first }
-            case sizeleft of
-              1,2,4,8 :
-                a_load_ref_reg(list, int_cgsize(sizeleft), location^.size, tmpref,
-                  location^.register);
-              3 : begin
-                a_reg_alloc(list, NR_R12);
-                a_load_ref_reg(list, OS_16, location^.size, tmpref,
-                  NR_R12);
-                inc(tmpref.offset, tcgsize2size[OS_16]);
-                a_load_ref_reg(list, OS_8, location^.size, tmpref,
-                  location^.register);
-                list.concat(taicpu.op_reg_reg_const_const(A_RLDIMI, location^.register, NR_R12, 8, 40));
-                a_reg_dealloc(list, NR_R12);
-              end;
-              5 : begin
-                a_reg_alloc(list, NR_R12);
-                a_load_ref_reg(list, OS_32, location^.size, tmpref, NR_R12);
-                inc(tmpref.offset, tcgsize2size[OS_32]);
-                a_load_ref_reg(list, OS_8, location^.size, tmpref, location^.register);
-                list.concat(taicpu.op_reg_reg_const_const(A_RLDIMI, location^.register, NR_R12, 8, 24));
-                a_reg_dealloc(list, NR_R12);
-              end;
-              6 : begin
-                a_reg_alloc(list, NR_R12);
-                a_load_ref_reg(list, OS_32, location^.size, tmpref, NR_R12);
-                inc(tmpref.offset, tcgsize2size[OS_32]);
-                a_load_ref_reg(list, OS_16, location^.size, tmpref, location^.register);
-                list.concat(taicpu.op_reg_reg_const_const(A_RLDIMI, location^.register, NR_R12, 16, 16));
-                a_reg_dealloc(list, NR_R12);
-              end;
-              7 : begin
-                a_reg_alloc(list, NR_R12);
-                a_reg_alloc(list, NR_R0);
-                a_load_ref_reg(list, OS_32, location^.size, tmpref, NR_R12);
-                inc(tmpref.offset, tcgsize2size[OS_32]);
-                a_load_ref_reg(list, OS_16, location^.size, tmpref, NR_R0);
-                inc(tmpref.offset, tcgsize2size[OS_16]);
-                a_load_ref_reg(list, OS_8, location^.size, tmpref, location^.register);
-                list.concat(taicpu.op_reg_reg_const_const(A_RLDIMI, NR_R0, NR_R12, 16, 16));
-                list.concat(taicpu.op_reg_reg_const_const(A_RLDIMI, location^.register, NR_R0, 8, 8));
-                a_reg_dealloc(list, NR_R0);
-                a_reg_dealloc(list, NR_R12);
-              end;
-              else begin
-                { still > 8 bytes to load, so load data single register now }
-                a_load_ref_reg(list, location^.size, location^.size, tmpref,
-                  location^.register);
-                { the block is > 8 bytes, so we have to store any bytes not
-                 a multiple of the register size beginning with the MSB }
-                adjusttail := true;
-              end;
-            end;
-            if (adjusttail) and (sizeleft < sizeof(pint)) then
-              a_op_const_reg(list, OP_SHL, OS_INT,
-                (sizeof(pint) - sizeleft) * sizeof(pint),
-                location^.register);
-          end;
-        end;
-      LOC_REFERENCE:
-        begin
-          reference_reset_base(ref, location^.reference.index,
-            location^.reference.offset,paraloc.alignment);
-          g_concatcopy(list, tmpref, ref, sizeleft);
-          if assigned(location^.next) then
-            internalerror(2005010710);
-        end;
-      LOC_FPUREGISTER, LOC_CFPUREGISTER:
-        case location^.size of
-          OS_F32, OS_F64:
-            a_loadfpu_ref_reg(list, location^.size, location^.size, tmpref, location^.register);
-        else
-          internalerror(2002072801);
-        end;
-      LOC_VOID:
-        { nothing to do }
-        ;
-    else
-      internalerror(2002081103);
-    end;
-    inc(tmpref.offset, tcgsize2size[location^.size]);
-    dec(sizeleft, tcgsize2size[location^.size]);
-    location := location^.next;
-  end;
-end;
-
 { calling a procedure by name }
 { calling a procedure by name }
 
 
 procedure tcgppc.a_call_name(list: TAsmList; const s: string; weak: boolean);
 procedure tcgppc.a_call_name(list: TAsmList; const s: string; weak: boolean);
 begin
 begin
     if (target_info.system <> system_powerpc64_darwin) then
     if (target_info.system <> system_powerpc64_darwin) then
-      a_call_name_direct(list, s, weak, false, true)
+      a_call_name_direct(list, A_BL, s, weak, target_info.system=system_powerpc64_aix, true)
     else
     else
       begin
       begin
         list.concat(taicpu.op_sym(A_BL,get_darwin_call_stub(s,weak)));
         list.concat(taicpu.op_sym(A_BL,get_darwin_call_stub(s,weak)));
@@ -516,14 +396,14 @@ begin
 end;
 end;
 
 
 
 
-procedure tcgppc.a_call_name_direct(list: TAsmList; s: string; weak: boolean; prependDot : boolean; addNOP : boolean; includeCall : boolean);
+procedure tcgppc.a_call_name_direct(list: TAsmList; opc: tasmop; s: string; weak: boolean; prependDot : boolean; addNOP : boolean; includeCall : boolean);
 begin
 begin
   if (prependDot) then
   if (prependDot) then
     s := '.' + s;
     s := '.' + s;
   if not(weak) then
   if not(weak) then
-    list.concat(taicpu.op_sym(A_BL, current_asmdata.RefAsmSymbol(s)))
+    list.concat(taicpu.op_sym(opc, current_asmdata.RefAsmSymbol(s)))
   else
   else
-    list.concat(taicpu.op_sym(A_BL, current_asmdata.WeakRefAsmSymbol(s)));
+    list.concat(taicpu.op_sym(opc, current_asmdata.WeakRefAsmSymbol(s)));
   if (addNOP) then
   if (addNOP) then
     list.concat(taicpu.op_none(A_NOP));
     list.concat(taicpu.op_none(A_NOP));
 
 
@@ -572,7 +452,7 @@ begin
     in R11 }
     in R11 }
     a_reg_alloc(list, NR_R11);
     a_reg_alloc(list, NR_R11);
     a_load_reg_reg(list, OS_ADDR, OS_ADDR, reg, NR_R11);
     a_load_reg_reg(list, OS_ADDR, OS_ADDR, reg, NR_R11);
-    a_call_name_direct(list, '.ptrgl', false, false, false);
+    a_call_name_direct(list, A_BL, '.ptrgl', false, false, false);
     a_reg_dealloc(list, NR_R11);
     a_reg_dealloc(list, NR_R11);
   end;
   end;
 
 
@@ -714,6 +594,8 @@ var
   ref2: treference;
   ref2: treference;
   tmpreg: tregister;
   tmpreg: tregister;
 begin
 begin
+  if target_info.system=system_powerpc64_aix then
+    g_load_check_simple(list,ref,65536);
   {$IFDEF EXTDEBUG}
   {$IFDEF EXTDEBUG}
   list.concat(tai_comment.create(strpnew('a_load_ref_reg ' + ref2string(ref))));
   list.concat(tai_comment.create(strpnew('a_load_ref_reg ' + ref2string(ref))));
   {$ENDIF EXTDEBUG}
   {$ENDIF EXTDEBUG}
@@ -1220,13 +1102,13 @@ begin
   a_jmp(list, A_BC, TOpCmp2AsmCond[cmp_op], 0, l);
   a_jmp(list, A_BC, TOpCmp2AsmCond[cmp_op], 0, l);
 end;
 end;
 
 
-procedure tcgppc.a_jmp_name_direct(list : TAsmList; s : string; prependDot : boolean);
+procedure tcgppc.a_jmp_name_direct(list : TAsmList; opc: tasmop; s : string; prependDot : boolean);
 var
 var
   p: taicpu;
   p: taicpu;
 begin
 begin
   if (prependDot) then
   if (prependDot) then
     s := '.' + s;
     s := '.' + s;
-  p := taicpu.op_sym(A_B, current_asmdata.RefAsmSymbol(s));
+  p := taicpu.op_sym(opc, current_asmdata.RefAsmSymbol(s));
   p.is_jmp := true;
   p.is_jmp := true;
   list.concat(p)
   list.concat(p)
 end;
 end;
@@ -1242,7 +1124,7 @@ begin
       list.concat(p)
       list.concat(p)
     end
     end
   else
   else
-    a_jmp_name_direct(list, s, true);
+    a_jmp_name_direct(list, A_B, s, true);
 end;
 end;
 
 
 procedure tcgppc.a_jmp_always(list: TAsmList; l: tasmlabel);
 procedure tcgppc.a_jmp_always(list: TAsmList; l: tasmlabel);
@@ -1412,7 +1294,7 @@ procedure tcgppc.g_profilecode(list: TAsmList);
 begin
 begin
   current_procinfo.procdef.paras.ForEachCall(TObjectListCallback(@profilecode_savepara), list);
   current_procinfo.procdef.paras.ForEachCall(TObjectListCallback(@profilecode_savepara), list);
 
 
-  a_call_name_direct(list, '_mcount', false, false, true);
+  a_call_name_direct(list, A_BL, '_mcount', false, false, true);
 
 
   current_procinfo.procdef.paras.ForEachCall(TObjectListCallback(@profilecode_restorepara), list);
   current_procinfo.procdef.paras.ForEachCall(TObjectListCallback(@profilecode_restorepara), list);
 end;
 end;
@@ -1441,6 +1323,7 @@ var
     regcount : TSuperRegister;
     regcount : TSuperRegister;
     href : TReference;
     href : TReference;
     mayNeedLRStore : boolean;
     mayNeedLRStore : boolean;
+    opc : tasmop;
   begin
   begin
     { there are two ways to do this: manually, by generating a few "std" instructions,
     { there are two ways to do this: manually, by generating a few "std" instructions,
      or via the restore helper functions. The latter are selected by the -Og switch,
      or via the restore helper functions. The latter are selected by the -Og switch,
@@ -1449,13 +1332,17 @@ var
        (target_info.system <> system_powerpc64_darwin) then begin
        (target_info.system <> system_powerpc64_darwin) then begin
       mayNeedLRStore := false;
       mayNeedLRStore := false;
       if ((fprcount > 0) and (gprcount > 0)) then begin
       if ((fprcount > 0) and (gprcount > 0)) then begin
+        if target_info.system=system_powerpc64_aix then
+          opc:=A_BLA
+        else
+          opc:=A_BL;
         a_op_const_reg_reg(list, OP_SUB, OS_INT, 8 * fprcount, NR_R1, NR_R12);
         a_op_const_reg_reg(list, OP_SUB, OS_INT, 8 * fprcount, NR_R1, NR_R12);
-        a_call_name_direct(list, '_savegpr1_' + intToStr(32-gprcount), false, false, false, false);
-        a_call_name_direct(list, '_savefpr_' + intToStr(32-fprcount), false, false, false, false);
+        a_call_name_direct(list, opc, '_savegpr1_' + intToStr(32-gprcount), false, false, false, false);
+        a_call_name_direct(list, opc, '_savefpr_' + intToStr(32-fprcount), false, false, false, false);
       end else if (gprcount > 0) then
       end else if (gprcount > 0) then
-        a_call_name_direct(list, '_savegpr0_' + intToStr(32-gprcount), false, false, false, false)
+        a_call_name_direct(list, opc, '_savegpr0_' + intToStr(32-gprcount), false, false, false, false)
       else if (fprcount > 0) then
       else if (fprcount > 0) then
-        a_call_name_direct(list, '_savefpr_' + intToStr(32-fprcount), false, false, false, false)
+        a_call_name_direct(list, opc, '_savefpr_' + intToStr(32-fprcount), false, false, false, false)
       else
       else
         mayNeedLRStore := true;
         mayNeedLRStore := true;
     end else begin
     end else begin
@@ -1579,20 +1466,30 @@ var
     needsExitCode : Boolean;
     needsExitCode : Boolean;
     href : treference;
     href : treference;
     regcount : TSuperRegister;
     regcount : TSuperRegister;
+    callopc,
+    jmpopc: tasmop;
   begin
   begin
     { there are two ways to do this: manually, by generating a few "ld" instructions,
     { there are two ways to do this: manually, by generating a few "ld" instructions,
      or via the restore helper functions. The latter are selected by the -Og switch,
      or via the restore helper functions. The latter are selected by the -Og switch,
      i.e. "optimize for size" }
      i.e. "optimize for size" }
     if (cs_opt_size in current_settings.optimizerswitches) then begin
     if (cs_opt_size in current_settings.optimizerswitches) then begin
+      if target_info.system=system_powerpc64_aix then begin
+        callopc:=A_BLA;
+        jmpopc:=A_BA;
+      end
+      else begin
+        callopc:=A_BL;
+        jmpopc:=A_B;
+      end;
       needsExitCode := false;
       needsExitCode := false;
       if ((fprcount > 0) and (gprcount > 0)) then begin
       if ((fprcount > 0) and (gprcount > 0)) then begin
         a_op_const_reg_reg(list, OP_SUB, OS_INT, 8 * fprcount, NR_R1, NR_R12);
         a_op_const_reg_reg(list, OP_SUB, OS_INT, 8 * fprcount, NR_R1, NR_R12);
-        a_call_name_direct(list, '_restgpr1_' + intToStr(32-gprcount), false, false, false, false);
-        a_jmp_name_direct(list, '_restfpr_' + intToStr(32-fprcount), false);
+        a_call_name_direct(list, callopc, '_restgpr1_' + intToStr(32-gprcount), false, false, false, false);
+        a_jmp_name_direct(list, jmpopc, '_restfpr_' + intToStr(32-fprcount), false);
       end else if (gprcount > 0) then
       end else if (gprcount > 0) then
-        a_jmp_name_direct(list, '_restgpr0_' + intToStr(32-gprcount), false)
+        a_jmp_name_direct(list, jmpopc, '_restgpr0_' + intToStr(32-gprcount), false)
       else if (fprcount > 0) then
       else if (fprcount > 0) then
-        a_jmp_name_direct(list, '_restfpr_' + intToStr(32-fprcount), false)
+        a_jmp_name_direct(list, jmpopc, '_restfpr_' + intToStr(32-fprcount), false)
       else
       else
         needsExitCode := true;
         needsExitCode := true;
     end else begin
     end else begin
@@ -1693,7 +1590,7 @@ var
   tempreg : TRegister;
   tempreg : TRegister;
 
 
 begin
 begin
-  if (target_info.system = system_powerpc64_darwin) then
+  if (target_info.system in [system_powerpc64_darwin,system_powerpc64_aix]) then
     begin
     begin
       inherited a_loadaddr_ref_reg(list,ref,r);
       inherited a_loadaddr_ref_reg(list,ref,r);
       exit;
       exit;
@@ -2003,7 +1900,7 @@ begin
     internalerror(200310131);
     internalerror(200310131);
 
 
   { if this is a PIC'ed address, handle it and exit }
   { if this is a PIC'ed address, handle it and exit }
-  if (ref.refaddr = addr_pic) then begin
+  if (ref.refaddr in [addr_pic,addr_pic_no_got]) then begin
     if (ref.offset <> 0) then
     if (ref.offset <> 0) then
       internalerror(2006010501);
       internalerror(2006010501);
     if (ref.index <> NR_NO) then
     if (ref.index <> NR_NO) then

+ 23 - 9
compiler/powerpc64/cpupara.pas

@@ -62,7 +62,7 @@ implementation
 
 
 uses
 uses
   verbose, systems,
   verbose, systems,
-  defutil,
+  defutil,symtable,
   procinfo, cpupi;
   procinfo, cpupi;
 
 
 function tppcparamanager.get_volatile_registers_int(calloption:
 function tppcparamanager.get_volatile_registers_int(calloption:
@@ -287,6 +287,7 @@ function tppcparamanager.create_paraloc_info_intern(p: tabstractprocdef; side:
   var curintreg, curfloatreg, curmmreg: tsuperregister; var cur_stack_offset:
   var curintreg, curfloatreg, curmmreg: tsuperregister; var cur_stack_offset:
   aword; isVararg : boolean): longint;
   aword; isVararg : boolean): longint;
 var
 var
+  fsym: tfieldvarsym;
   stack_offset: longint;
   stack_offset: longint;
   paralen: aint;
   paralen: aint;
   nextintreg, nextfloatreg, nextmmreg : tsuperregister;
   nextintreg, nextfloatreg, nextmmreg : tsuperregister;
@@ -298,6 +299,7 @@ var
   paracgsize: tcgsize;
   paracgsize: tcgsize;
 
 
   parashift : byte;
   parashift : byte;
+  adjusttail: boolean;
 
 
 begin
 begin
 {$IFDEF extdebug}
 {$IFDEF extdebug}
@@ -350,11 +352,11 @@ begin
         { if a record has only one field and that field is }
         { if a record has only one field and that field is }
         { non-composite (not array or record), it must be  }
         { non-composite (not array or record), it must be  }
         { passed according to the rules of that type.       }
         { passed according to the rules of that type.       }
-        if (trecorddef(hp.vardef).symtable.SymList.count = 1) and
-          (not trecorddef(hp.vardef).isunion)  and
-          (tabstractvarsym(trecorddef(hp.vardef).symtable.SymList[0]).vardef.typ in [orddef, enumdef, floatdef])  then begin
-          paradef :=
-            tabstractvarsym(trecorddef(hp.vardef).symtable.SymList[0]).vardef;
+        if tabstractrecordsymtable(tabstractrecorddef(hp.vardef).symtable).has_single_field(fsym) and
+          ((fsym.vardef.typ = floatdef) or
+           (not(target_info.system in systems_aix) and
+            (fsym.vardef.typ in [orddef, enumdef]))) then begin
+          paradef := fsym.vardef;
           loc := getparaloc(paradef);
           loc := getparaloc(paradef);
           paracgsize := def_cgsize(paradef);
           paracgsize := def_cgsize(paradef);
         end else begin
         end else begin
@@ -394,8 +396,8 @@ begin
         paraloc^.loc := LOC_VOID;
         paraloc^.loc := LOC_VOID;
       end else
       end else
         internalerror(2005011310);
         internalerror(2005011310);
+    adjusttail:=paralen>8;
     { can become < 0 for e.g. 3-byte records }
     { can become < 0 for e.g. 3-byte records }
-
     while (paralen > 0) do begin
     while (paralen > 0) do begin
       paraloc := hp.paraloc[side].add_location;
       paraloc := hp.paraloc[side].add_location;
       { In case of po_delphi_nested_cc, the parent frame pointer
       { In case of po_delphi_nested_cc, the parent frame pointer
@@ -410,7 +412,19 @@ begin
         { make sure we don't lose whether or not the type is signed }
         { make sure we don't lose whether or not the type is signed }
         if (paracgsize <> OS_NO) and (paradef.typ <> orddef) then
         if (paracgsize <> OS_NO) and (paradef.typ <> orddef) then
           paracgsize := int_cgsize(paralen);
           paracgsize := int_cgsize(paralen);
-        if (paracgsize in [OS_NO,OS_128,OS_S128]) then
+
+        { aix requires that record data (including partial data) stored in
+          parameter registers is left-aligned. Other targets only do this if
+          the total size of the parameter was > 8 bytes. }
+        if (((target_info.system in systems_aix) and
+             (paradef.typ = recorddef)) or
+            adjusttail) and
+           (paralen < sizeof(aint)) then
+          begin
+            paraloc^.shiftval := (sizeof(aint)-paralen)*(-8);
+            paraloc^.size := OS_INT;
+          end
+        else if (paracgsize in [OS_NO,OS_128,OS_S128]) then
           paraloc^.size := OS_INT
           paraloc^.size := OS_INT
         else
         else
           paraloc^.size := paracgsize;
           paraloc^.size := paracgsize;
@@ -486,7 +500,7 @@ begin
 
 
   result := create_paraloc_info_intern(p, callerside, p.paras, curintreg,
   result := create_paraloc_info_intern(p, callerside, p.paras, curintreg,
     curfloatreg, curmmreg, cur_stack_offset, false);
     curfloatreg, curmmreg, cur_stack_offset, false);
-  if (p.proccalloption in [pocall_cdecl, pocall_cppdecl]) then begin
+  if (p.proccalloption in [pocall_cdecl, pocall_cppdecl, pocall_mwpascal]) then begin
     { just continue loading the parameters in the registers }
     { just continue loading the parameters in the registers }
     result := create_paraloc_info_intern(p, callerside, varargspara, curintreg,
     result := create_paraloc_info_intern(p, callerside, varargspara, curintreg,
       curfloatreg, curmmreg, cur_stack_offset, true);
       curfloatreg, curmmreg, cur_stack_offset, true);

+ 9 - 3
compiler/powerpc64/rappcgas.pas

@@ -196,8 +196,7 @@ begin
               { replace global symbol reference with TOC entry name
               { replace global symbol reference with TOC entry name
                 for AIX }
                 for AIX }
               if target_info.system in systems_aix then
               if target_info.system in systems_aix then
-                oper.opr.ref.symbol:=
-                  tcgppcgen(cg).get_aix_toc_sym(oper.opr.ref.symbol.name,asmsym2indsymflags(oper.opr.ref.symbol));
+                tcgppcgen(cg).get_aix_toc_sym(nil,oper.opr.ref.symbol.name,asmsym2indsymflags(oper.opr.ref.symbol),oper.opr.ref,true);
               oper.opr.ref.refaddr:=addr_pic_no_got;
               oper.opr.ref.refaddr:=addr_pic_no_got;
             end;
             end;
           Consume_RParen;
           Consume_RParen;
@@ -360,7 +359,7 @@ var
             if (oper.opr.val<>0) then
             if (oper.opr.val<>0) then
               Message(asmr_e_wrong_sym_type);
               Message(asmr_e_wrong_sym_type);
             oper.opr.typ:=OPR_SYMBOL;
             oper.opr.typ:=OPR_SYMBOL;
-            oper.opr.symbol:=current_asmdata.RefAsmSymbol(mangledname);
+            oper.opr.symbol:=current_asmdata.DefineAsmSymbol(mangledname,AB_EXTERNAL,AT_FUNCTION);
           end
           end
         else
         else
           inc(oper.opr.val,l);
           inc(oper.opr.val,l);
@@ -764,7 +763,14 @@ begin
     if (instr.Operands[1].opr.ref.base<>NR_NO) or
     if (instr.Operands[1].opr.ref.base<>NR_NO) or
       (instr.Operands[1].opr.ref.index<>NR_NO) then
       (instr.Operands[1].opr.ref.index<>NR_NO) then
       Message(asmr_e_syn_operand);
       Message(asmr_e_syn_operand);
+    if (target_info.system in systems_dotted_function_names) and
+       assigned(instr.Operands[1].opr.ref.symbol) then
+      instr.Operands[1].opr.ref.symbol:=current_asmdata.DefineAsmSymbol('.'+instr.Operands[1].opr.ref.symbol.name,instr.Operands[1].opr.ref.symbol.bind,AT_FUNCTION);
   end;
   end;
+  if (target_info.system in systems_dotted_function_names) and
+     (instr.Operands[1].opr.typ = OPR_SYMBOL) and
+     (instr.Operands[1].opr.symbol.typ=AT_FUNCTION) then
+    instr.Operands[1].opr.symbol:=current_asmdata.DefineAsmSymbol('.'+instr.Operands[1].opr.symbol.name,instr.Operands[1].opr.symbol.bind,AT_FUNCTION);
 end;
 end;
 
 
 procedure tppcattreader.handleopcode;
 procedure tppcattreader.handleopcode;

+ 10 - 14
compiler/ppcgen/agppcgas.pas

@@ -152,18 +152,17 @@ unit agppcgas;
                 s:=s+tostr(offset);
                 s:=s+tostr(offset);
             end;
             end;
 
 
-           if (refaddr in verbose_refaddrs) then
+           if not(refaddr in [addr_no,addr_pic_no_got]) then
              begin
              begin
                s := s+')';
                s := s+')';
-               if not(target_info.system in [system_powerpc_darwin,system_powerpc64_darwin]) then
+               if (refaddr in verbose_refaddrs) and
+                  not(target_info.system in [system_powerpc_darwin,system_powerpc64_darwin]) then
                  s := s+refaddr2str[refaddr];
                  s := s+refaddr2str[refaddr];
              end;
              end;
 {$ifdef cpu64bitaddr}
 {$ifdef cpu64bitaddr}
-           if (refaddr = addr_pic) then
-	     if (target_info.system <> system_powerpc64_linux) then
-	       s := s + ')'
-	     else
-	       s := s + ')@got';
+           if (refaddr=addr_pic) and
+	      (target_info.system=system_powerpc64_linux) then
+             s := s + '@got';
 {$endif cpu64bitaddr}
 {$endif cpu64bitaddr}
 
 
            if (index=NR_NO) then
            if (index=NR_NO) then
@@ -464,13 +463,6 @@ unit agppcgas;
         i: longint;
         i: longint;
       begin
       begin
         inherited WriteExtraHeader;
         inherited WriteExtraHeader;
-        { AIX assembler notation for .quad is .llong, let assembler itself
-          perform the substitution; the aix assembler uses .quad for defining
-          128 bit floating point numbers, but
-            a) we don't support those yet
-            b) once we support them, we'll encode them byte per byte like other
-               floating point numbers }
-        AsmWriteln(#9'.set'#9'.quad,.llong');
         { map cr registers to plain numbers }
         { map cr registers to plain numbers }
         for i:=0 to 7 do
         for i:=0 to 7 do
           AsmWriteln(#9'.set'#9'cr'+tostr(i)+','+tostr(i));
           AsmWriteln(#9'.set'#9'cr'+tostr(i)+','+tostr(i));
@@ -584,7 +576,11 @@ unit agppcgas;
                AIX assembler, ignore by GNU assembler)
                AIX assembler, ignore by GNU assembler)
            -mpwr5: we actually support Power3 and higher, but the AIX assembler
            -mpwr5: we actually support Power3 and higher, but the AIX assembler
                has no parameter to select that one (only -mpwr3 and -mpwr5) }
                has no parameter to select that one (only -mpwr3 and -mpwr5) }
+{$ifdef cpu64bitaddr}
+         asmcmd : '-a64 -u -o $OBJ $ASM -mpwr5';
+{$else cpu64bitaddr}
          asmcmd : '-u -o $OBJ $ASM -mpwr5';
          asmcmd : '-u -o $OBJ $ASM -mpwr5';
+{$endif cpu64bitaddr}
          supported_targets : [system_powerpc_aix,system_powerpc64_aix];
          supported_targets : [system_powerpc_aix,system_powerpc64_aix];
          flags : [af_needar,af_smartlink_sections,af_stabs_use_function_absolute_addresses];
          flags : [af_needar,af_smartlink_sections,af_stabs_use_function_absolute_addresses];
          labelprefix : 'L';
          labelprefix : 'L';

+ 139 - 27
compiler/ppcgen/cgppc.pas

@@ -67,7 +67,7 @@ unit cgppc;
         procedure a_bit_scan_reg_reg(list: TAsmList; reverse: boolean; size: TCGSize; src, dst: TRegister); override;
         procedure a_bit_scan_reg_reg(list: TAsmList; reverse: boolean; size: TCGSize; src, dst: TRegister); override;
         procedure g_stackpointer_alloc(list : TAsmList;localsize : longint);override;
         procedure g_stackpointer_alloc(list : TAsmList;localsize : longint);override;
 
 
-        function get_aix_toc_sym(const symname: string; const flags: tindsymflags):tasmsymbol;
+        procedure get_aix_toc_sym(list: TAsmList; const symname: string; const flags: tindsymflags; out ref: treference; force_direct_toc: boolean);
         procedure g_load_check_simple(list: TAsmList; const ref: treference; size: aint);
         procedure g_load_check_simple(list: TAsmList; const ref: treference; size: aint);
         procedure g_external_wrapper(list: TAsmList; pd: TProcDef; const externalname: string); override;
         procedure g_external_wrapper(list: TAsmList; pd: TProcDef; const externalname: string); override;
        protected
        protected
@@ -98,9 +98,34 @@ unit cgppc;
         function load_got_symbol(list : TAsmList; const symbol : string; const flags: tindsymflags) : tregister;
         function load_got_symbol(list : TAsmList; const symbol : string; const flags: tindsymflags) : tregister;
      end;
      end;
 
 
+
+  TPPCAsmData = class(TAsmData)
+   private
+    { number of entries in the TOC }
+    fdirecttocentries,
+    { number of fake TOC subsections we have created }
+    ftocsections,
+    { number of fake TOC entries in the current TOC subsection }
+    fcurrenttocentries: longint;
+   public
+    procedure GetNextSmallTocEntry(out tocnr, entrynr: longint);
+    property DirectTOCEntries: longint read fdirecttocentries write fdirecttocentries;
+  end;
+
+
+  TTOCAsmSymbol = class(TAsmSymbol)
+   private
+    { we split the toc into several sections of 32KB each, this number
+      indicates which subsection this symbol is defined in }
+    ftocsecnr: longint;
+   public
+    property TocSecNr: longint read ftocsecnr;
+  end;
+
   const
   const
     TOpCmp2AsmCond: Array[topcmp] of TAsmCondFlag = (C_NONE,C_EQ,C_GT,
     TOpCmp2AsmCond: Array[topcmp] of TAsmCondFlag = (C_NONE,C_EQ,C_GT,
                          C_LT,C_GE,C_LE,C_NE,C_LE,C_LT,C_GE,C_GT);
                          C_LT,C_GE,C_LE,C_NE,C_LE,C_LT,C_GE,C_GT);
+    TocSecBaseName = 'toc_table';
 
 
 
 
 {$ifdef extdebug}
 {$ifdef extdebug}
@@ -800,17 +825,16 @@ unit cgppc;
       ref: treference;
       ref: treference;
     begin
     begin
       if target_info.system=system_powerpc64_linux then
       if target_info.system=system_powerpc64_linux then
-        l:=current_asmdata.getasmsymbol(symbol)
+        begin
+          l:=current_asmdata.getasmsymbol(symbol);
+          reference_reset_symbol(ref,l,0,sizeof(pint));
+          ref.base:=NR_RTOC;
+          ref.refaddr:=addr_pic;
+        end
       else if target_info.system in systems_aix then
       else if target_info.system in systems_aix then
-        l:=get_aix_toc_sym(symbol,flags)
+        get_aix_toc_sym(list,symbol,flags,ref,false)
       else
       else
         internalerror(2007102010);
         internalerror(2007102010);
-      reference_reset_symbol(ref,l,0,sizeof(pint));
-      ref.base:=NR_RTOC;
-      if target_info.system in systems_aix then
-        ref.refaddr:=addr_pic_no_got
-      else
-        ref.refaddr:=addr_pic;
 
 
       result := getaddressregister(list);
       result := getaddressregister(list);
 {$ifdef cpu64bitaddr}
 {$ifdef cpu64bitaddr}
@@ -821,30 +845,100 @@ unit cgppc;
     end;
     end;
 
 
 
 
-  function tcgppcgen.get_aix_toc_sym(const symname: string; const flags: tindsymflags): tasmsymbol;
+  procedure tcgppcgen.get_aix_toc_sym(list: TAsmList; const symname: string; const flags: tindsymflags; out ref: treference; force_direct_toc: boolean);
+    const
+      { The TOC on AIX is limited to 32KB worth of entries on AIX. If you need
+        more entries, you have to add a level of indirection. In some cases,
+        it's not possible to do this (e.g. assembler code). So by default, we
+        use direct TOC entries until we're 500 from the maximum, and then start
+        using indirect TOC entries. }
+      AutoDirectTOCLimit = (high(smallint) div sizeof(pint)) - 500;
     var
     var
+      tmpref: treference;
+      { can have more than 16384 (32 bit) or 8192 (64 bit) toc entries and, as
+        as consequence, toc subsections -> 5 extra characters for the number}
+      tocsecname: string[length('tocsubtable')+5];
       nlsymname: string;
       nlsymname: string;
       newsymname: ansistring;
       newsymname: ansistring;
+      sym: TAsmSymbol;
+      tocsym: TTOCAsmSymbol;
+      tocnr,
+      entrynr: longint;
+      tmpreg: tregister;
     begin
     begin
       { all global symbol accesses always must be done via the TOC }
       { all global symbol accesses always must be done via the TOC }
       nlsymname:='LC..'+symname;
       nlsymname:='LC..'+symname;
-      result:=current_asmdata.getasmsymbol(nlsymname);
-      if not assigned(result) then
+      reference_reset_symbol(ref,current_asmdata.getasmsymbol(nlsymname),0,sizeof(pint));
+      if (assigned(ref.symbol) and
+          not(ref.symbol is TTOCAsmSymbol)) or
+         (not(ts_small_toc in current_settings.targetswitches) and
+          (TPPCAsmData(current_asmdata).DirectTOCEntries<AutoDirectTOCLimit)) or
+         force_direct_toc then
         begin
         begin
-          new_section(current_asmdata.AsmLists[al_picdata],sec_toc,'',sizeof(pint));
-          result:=current_asmdata.DefineAsmSymbol(nlsymname,AB_LOCAL,AT_DATA);
-          current_asmdata.asmlists[al_picdata].concat(tai_symbol.create(result,0));
-          { do not assign the result of these statements to result: the access
-            must be done via the LC..symname symbol; these are just to define
-            the symbol that's being accessed as either weak or not }
-          if not(is_weak in flags) then
-            current_asmdata.RefAsmSymbol(symname)
-          else if is_data in flags then
-            current_asmdata.WeakRefAsmSymbol(symname)
-          else
-            current_asmdata.WeakRefAsmSymbol('.'+symname);
-          newsymname:=ReplaceForbiddenAsmSymbolChars(symname);
-          current_asmdata.asmlists[al_picdata].concat(tai_directive.Create(asd_toc_entry,newsymname+'[TC],'+newsymname));
+          ref.refaddr:=addr_pic_no_got;
+          ref.base:=NR_RTOC;
+          if not assigned(ref.symbol) then
+            begin
+              TPPCAsmData(current_asmdata).DirectTOCEntries:=TPPCAsmData(current_asmdata).DirectTOCEntries+1;
+              new_section(current_asmdata.AsmLists[al_picdata],sec_toc,'',sizeof(pint));
+              ref.symbol:=current_asmdata.DefineAsmSymbol(nlsymname,AB_LOCAL,AT_DATA);
+              current_asmdata.asmlists[al_picdata].concat(tai_symbol.create(ref.symbol,0));
+              { do not assign the result of these statements to ref.symbol: the
+                access must be done via the LC..symname symbol; these are just
+                to define the symbol that's being accessed as either weak or
+                not }
+              if not(is_weak in flags) then
+                current_asmdata.RefAsmSymbol(symname)
+              else if is_data in flags then
+                current_asmdata.WeakRefAsmSymbol(symname)
+              else
+                current_asmdata.WeakRefAsmSymbol('.'+symname);
+              newsymname:=ReplaceForbiddenAsmSymbolChars(symname);
+              current_asmdata.asmlists[al_picdata].concat(tai_directive.Create(asd_toc_entry,newsymname+'[TC],'+newsymname));
+            end;
+        end
+      else
+        begin
+          if not assigned(ref.symbol) then
+            begin
+              TPPCAsmData(current_asmdata).GetNextSmallTocEntry(tocnr,entrynr);
+              { new TOC entry? }
+              if entrynr=0 then
+                begin
+                  { create new toc entry that contains the address of the next
+                    table of addresses }
+                  get_aix_toc_sym(list,'tocsubtable'+tostr(tocnr),[is_data],tmpref,true);
+                  sym:=tmpref.symbol;
+                  { base address for this batch of toc table entries that we'll
+                    put in a data block instead }
+                  new_section(current_asmdata.AsmLists[al_indirectpicdata],sec_rodata,'',sizeof(pint));
+                  sym:=current_asmdata.DefineAsmSymbol('tocsubtable'+tostr(tocnr),AB_LOCAL,AT_DATA);
+                  current_asmdata.asmlists[al_indirectpicdata].concat(tai_symbol.create(sym,0));
+                end;
+              { add the reference to the actual symbol inside the tocsubtable }
+              if not(is_weak in flags) then
+                current_asmdata.RefAsmSymbol(symname)
+              else if is_data in flags then
+                current_asmdata.WeakRefAsmSymbol(symname)
+              else
+                current_asmdata.WeakRefAsmSymbol('.'+symname);
+              tocsym:=TTOCAsmSymbol(current_asmdata.DefineAsmSymbolByClass(TTOCAsmSymbol,nlsymname,AB_LOCAL,AT_DATA));
+              ref.symbol:=tocsym;
+              tocsym.ftocsecnr:=tocnr;
+              current_asmdata.asmlists[al_indirectpicdata].concat(tai_symbol.create(tocsym,0));
+              newsymname:=ReplaceForbiddenAsmSymbolChars(symname);
+              sym:=current_asmdata.RefAsmSymbol(newsymname);
+              current_asmdata.asmlists[al_indirectpicdata].concat(tai_const.Create_sym(sym));
+            end;
+          { first load the address of the table from the TOC }
+          get_aix_toc_sym(list,'tocsubtable'+tostr(TTOCAsmSymbol(ref.symbol).ftocsecnr),[is_data],tmpref,true);
+          tmpreg:=getaddressregister(list);
+          a_load_ref_reg(list,OS_ADDR,OS_ADDR,tmpref,tmpreg);
+          { and now set up the address of the entry, relative to the start of
+            the table }
+          ref.base:=tmpreg;
+          ref.refaddr:=addr_pic;
+          ref.relsymbol:=current_asmdata.GetAsmSymbol('tocsubtable'+tostr(TTOCAsmSymbol(ref.symbol).ftocsecnr));
         end;
         end;
     end;
     end;
 
 
@@ -989,7 +1083,8 @@ unit cgppc;
         if (((target_info.system = system_powerpc64_linux) and
         if (((target_info.system = system_powerpc64_linux) and
              (cs_create_pic in current_settings.moduleswitches)) or
              (cs_create_pic in current_settings.moduleswitches)) or
             (target_info.system in systems_aix)) and
             (target_info.system in systems_aix)) and
-           (assigned(ref.symbol)) then
+           (assigned(ref.symbol) and
+            not assigned(ref.relsymbol)) then
           begin
           begin
             tmpreg := load_got_symbol(list, ref.symbol.name, asmsym2indsymflags(ref.symbol));
             tmpreg := load_got_symbol(list, ref.symbol.name, asmsym2indsymflags(ref.symbol));
             if (ref.base = NR_NO) then
             if (ref.base = NR_NO) then
@@ -1149,5 +1244,22 @@ unit cgppc;
       end;
       end;
 
 
 
 
+
+    { TPPCAsmData }
+
+    procedure TPPCAsmData.GetNextSmallTocEntry(out tocnr, entrynr: longint);
+      begin
+        if fcurrenttocentries>(high(word) div sizeof(pint)) then
+          begin
+            fcurrenttocentries:=0;
+            inc(ftocsections);
+          end;
+        tocnr:=ftocsections;
+        entrynr:=fcurrenttocentries;
+        inc(fcurrenttocentries);
+      end;
+
+begin
+  casmdata:=TPPCAsmData;
 end.
 end.
 
 

+ 3 - 4
compiler/ppcmips.lpi

@@ -8,12 +8,11 @@
         <MainUnitHasUsesSectionForAllUnits Value="False"/>
         <MainUnitHasUsesSectionForAllUnits Value="False"/>
         <MainUnitHasCreateFormStatements Value="False"/>
         <MainUnitHasCreateFormStatements Value="False"/>
         <MainUnitHasTitleStatement Value="False"/>
         <MainUnitHasTitleStatement Value="False"/>
-        <AlwaysBuild Value="False"/>
         <LRSInOutputDirectory Value="False"/>
         <LRSInOutputDirectory Value="False"/>
       </Flags>
       </Flags>
       <SessionStorage Value="InProjectDir"/>
       <SessionStorage Value="InProjectDir"/>
       <MainUnit Value="0"/>
       <MainUnit Value="0"/>
-      <Title Value="pp"/>
+      <Title Value="ppmips"/>
     </General>
     </General>
     <BuildModes Count="1">
     <BuildModes Count="1">
       <Item1 Name="default" Default="True"/>
       <Item1 Name="default" Default="True"/>
@@ -59,7 +58,7 @@
     </Units>
     </Units>
   </ProjectOptions>
   </ProjectOptions>
   <CompilerOptions>
   <CompilerOptions>
-    <Version Value="9"/>
+    <Version Value="11"/>
     <PathDelim Value="\"/>
     <PathDelim Value="\"/>
     <Target>
     <Target>
       <Filename Value="mips\pp"/>
       <Filename Value="mips\pp"/>
@@ -79,7 +78,7 @@
     </Parsing>
     </Parsing>
     <Linking>
     <Linking>
       <Debugging>
       <Debugging>
-        <GenerateDebugInfo Value="True"/>
+        <DebugInfoType Value="dsStabs"/>
       </Debugging>
       </Debugging>
     </Linking>
     </Linking>
     <Other>
     <Other>

+ 10 - 8
compiler/ppcmipsel.lpi

@@ -1,21 +1,22 @@
 <?xml version="1.0"?>
 <?xml version="1.0"?>
 <CONFIG>
 <CONFIG>
   <ProjectOptions>
   <ProjectOptions>
+    <Version Value="9"/>
     <PathDelim Value="\"/>
     <PathDelim Value="\"/>
-    <Version Value="7"/>
     <General>
     <General>
       <Flags>
       <Flags>
         <MainUnitHasUsesSectionForAllUnits Value="False"/>
         <MainUnitHasUsesSectionForAllUnits Value="False"/>
         <MainUnitHasCreateFormStatements Value="False"/>
         <MainUnitHasCreateFormStatements Value="False"/>
         <MainUnitHasTitleStatement Value="False"/>
         <MainUnitHasTitleStatement Value="False"/>
-        <AlwaysBuild Value="False"/>
         <LRSInOutputDirectory Value="False"/>
         <LRSInOutputDirectory Value="False"/>
       </Flags>
       </Flags>
       <SessionStorage Value="InProjectDir"/>
       <SessionStorage Value="InProjectDir"/>
       <MainUnit Value="0"/>
       <MainUnit Value="0"/>
-      <TargetFileExt Value=".exe"/>
-      <Title Value="pp"/>
+      <Title Value="ppmipsel"/>
     </General>
     </General>
+    <BuildModes Count="1">
+      <Item1 Name="default" Default="True"/>
+    </BuildModes>
     <PublishOptions>
     <PublishOptions>
       <Version Value="2"/>
       <Version Value="2"/>
       <IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
       <IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
@@ -57,14 +58,14 @@
     </Units>
     </Units>
   </ProjectOptions>
   </ProjectOptions>
   <CompilerOptions>
   <CompilerOptions>
-    <Version Value="8"/>
+    <Version Value="11"/>
     <PathDelim Value="\"/>
     <PathDelim Value="\"/>
     <Target>
     <Target>
       <Filename Value="mips\pp"/>
       <Filename Value="mips\pp"/>
     </Target>
     </Target>
     <SearchPaths>
     <SearchPaths>
-      <IncludeFiles Value="mips\"/>
-      <OtherUnitFiles Value="mips\;systems\"/>
+      <IncludeFiles Value="mips"/>
+      <OtherUnitFiles Value="mips;systems"/>
       <UnitOutputDirectory Value="mips\lazbuild"/>
       <UnitOutputDirectory Value="mips\lazbuild"/>
     </SearchPaths>
     </SearchPaths>
     <Parsing>
     <Parsing>
@@ -72,11 +73,12 @@
         <CStyleOperator Value="False"/>
         <CStyleOperator Value="False"/>
         <AllowLabel Value="False"/>
         <AllowLabel Value="False"/>
         <CPPInline Value="False"/>
         <CPPInline Value="False"/>
+        <UseAnsiStrings Value="False"/>
       </SyntaxOptions>
       </SyntaxOptions>
     </Parsing>
     </Parsing>
     <Linking>
     <Linking>
       <Debugging>
       <Debugging>
-        <GenerateDebugInfo Value="True"/>
+        <DebugInfoType Value="dsStabs"/>
       </Debugging>
       </Debugging>
     </Linking>
     </Linking>
     <Other>
     <Other>

+ 4 - 3
compiler/ptconst.pas

@@ -145,10 +145,11 @@ implementation
               begin
               begin
                 { see same code in ncgutil.insertbssdata }
                 { see same code in ncgutil.insertbssdata }
                 if (target_dbg.id=dbg_stabx) and
                 if (target_dbg.id=dbg_stabx) and
-                   (cs_debuginfo in current_settings.moduleswitches) then
+                   (cs_debuginfo in current_settings.moduleswitches) and
+                   not assigned(current_asmdata.GetAsmSymbol(sym.name)) then
                   begin
                   begin
-                    list.concat(tai_symbol.Create(current_asmdata.DefineAsmSymbol(sym.name+'.',AB_LOCAL,AT_DATA),0));
-                    list.concat(tai_directive.Create(asd_reference,sym.name+'.'));
+                    list.concat(tai_symbol.Create(current_asmdata.DefineAsmSymbol(sym.name,AB_LOCAL,AT_DATA),0));
+                    list.concat(tai_directive.Create(asd_reference,sym.name));
                   end;
                   end;
                 list.concat(Tai_symbol.Createname_global(sym.mangledname,AT_DATA,0))
                 list.concat(Tai_symbol.Createname_global(sym.mangledname,AT_DATA,0))
               end
               end

+ 6 - 5
compiler/symconst.pas

@@ -563,6 +563,7 @@ type
   tequaltype = (
   tequaltype = (
     te_incompatible,
     te_incompatible,
     te_convert_operator,
     te_convert_operator,
+    te_convert_l6,
     te_convert_l5,     { ad infinitum... }
     te_convert_l5,     { ad infinitum... }
     te_convert_l4,     { and yet even less preferred conversion }
     te_convert_l4,     { and yet even less preferred conversion }
     te_convert_l3,     { even less preferred conversion (possibly with loss of data) }
     te_convert_l3,     { even less preferred conversion (possibly with loss of data) }
@@ -575,10 +576,10 @@ type
   tvariantequaltype = (
   tvariantequaltype = (
     tve_incompatible,
     tve_incompatible,
     tve_chari64,
     tve_chari64,
-    tve_ustring,
-    tve_wstring,
-    tve_astring,
     tve_sstring,
     tve_sstring,
+    tve_astring,
+    tve_wstring,
+    tve_ustring,
     tve_boolformal,
     tve_boolformal,
     tve_extended,
     tve_extended,
     tve_dblcurrency,
     tve_dblcurrency,
@@ -638,8 +639,8 @@ inherited_objectoptions : tobjectoptions = [oo_has_virtual,oo_has_private,oo_has
      );
      );
 
 
      EqualTypeName : array[tequaltype] of string[16] = (
      EqualTypeName : array[tequaltype] of string[16] = (
-       'incompatible','convert_operator','convert_l5','convert_l4','convert_l3','convert_l2',
-       'convert_l1','equal','exact'
+       'incompatible','convert_operator','convert_l6', 'convert_l5','convert_l4','convert_l3',
+       'convert_l2','convert_l1','equal','exact'
      );
      );
 
 
      visibilityName : array[tvisibility] of string[16] = (
      visibilityName : array[tvisibility] of string[16] = (

+ 7 - 7
compiler/systems/i_aix.pas

@@ -53,7 +53,7 @@ unit i_aix;
             staticlibext : '.a';
             staticlibext : '.a';
             staticlibprefix : 'libp';
             staticlibprefix : 'libp';
             sharedlibprefix : 'lib';
             sharedlibprefix : 'lib';
-            sharedClibext : '.so';
+            sharedClibext : '.a';
             staticClibext : '.a';
             staticClibext : '.a';
             staticClibprefix : 'lib';
             staticClibprefix : 'lib';
             sharedClibprefix : 'lib';
             sharedClibprefix : 'lib';
@@ -96,8 +96,8 @@ unit i_aix;
             system       : system_powerpc64_aix;
             system       : system_powerpc64_aix;
             name         : 'AIX for PowerPC64';
             name         : 'AIX for PowerPC64';
             shortname    : 'AIX';
             shortname    : 'AIX';
-            flags        : [tf_needs_symbol_size,tf_needs_symbol_type,tf_files_case_sensitive,
-                            tf_requires_proper_alignment,tf_smartlink_sections,tf_has_winlike_resources];
+            flags        : [tf_files_case_sensitive,tf_requires_proper_alignment,
+                            tf_smartlink_sections,tf_has_winlike_resources];
             cpu          : cpu_powerpc64;
             cpu          : cpu_powerpc64;
             unit_env     : '';
             unit_env     : '';
             extradefines : 'UNIX;HASUNIX';
             extradefines : 'UNIX;HASUNIX';
@@ -111,11 +111,11 @@ unit i_aix;
             objext       : '.o';
             objext       : '.o';
             resext       : '.res';
             resext       : '.res';
             resobjext    : '.or';
             resobjext    : '.or';
-            sharedlibext : '.so';
+            sharedlibext : '.a';
             staticlibext : '.a';
             staticlibext : '.a';
             staticlibprefix : 'libp';
             staticlibprefix : 'libp';
             sharedlibprefix : 'lib';
             sharedlibprefix : 'lib';
-            sharedClibext : '.so';
+            sharedClibext : '.a';
             staticClibext : '.a';
             staticClibext : '.a';
             staticClibprefix : 'lib';
             staticClibprefix : 'lib';
             sharedClibprefix : 'lib';
             sharedClibprefix : 'lib';
@@ -138,9 +138,9 @@ unit i_aix;
                 procalign       : 8;
                 procalign       : 8;
                 loopalign       : 4;
                 loopalign       : 4;
                 jumpalign       : 0;
                 jumpalign       : 0;
-                constalignmin   : 4;
+                constalignmin   : 8;
                 constalignmax   : 16;
                 constalignmax   : 16;
-                varalignmin     : 4;
+                varalignmin     : 8;
                 varalignmax     : 16;
                 varalignmax     : 16;
                 localalignmin   : 0;
                 localalignmin   : 0;
                 localalignmax   : 16;
                 localalignmax   : 16;

+ 12 - 12
compiler/systems/i_bsd.pas

@@ -229,17 +229,17 @@ unit i_bsd;
             endian       : endian_little;
             endian       : endian_little;
             alignment    :
             alignment    :
               (
               (
-                procalign       : 4;
+                procalign       : 16;
                 loopalign       : 4;
                 loopalign       : 4;
                 jumpalign       : 0;
                 jumpalign       : 0;
                 constalignmin   : 0;
                 constalignmin   : 0;
-                constalignmax   : 1;
+                constalignmax   : 8;
                 varalignmin     : 0;
                 varalignmin     : 0;
-                varalignmax     : 1;
-                localalignmin   : 0;
-                localalignmax   : 1;
+                varalignmax     : 16;
+                localalignmin   : 4;
+                localalignmax   : 8;
                 recordalignmin  : 0;
                 recordalignmin  : 0;
-                recordalignmax  : 2;
+                recordalignmax  : 16;
                 maxCrecordalign : 4
                 maxCrecordalign : 4
               );
               );
             first_parm_offset : 8;
             first_parm_offset : 8;
@@ -290,17 +290,17 @@ unit i_bsd;
             endian       : endian_little;
             endian       : endian_little;
             alignment    :
             alignment    :
               (
               (
-                procalign       : 4;
+                procalign       : 16;
                 loopalign       : 4;
                 loopalign       : 4;
                 jumpalign       : 0;
                 jumpalign       : 0;
                 constalignmin   : 0;
                 constalignmin   : 0;
-                constalignmax   : 1;
+                constalignmax   : 8;
                 varalignmin     : 0;
                 varalignmin     : 0;
-                varalignmax     : 1;
-                localalignmin   : 0;
-                localalignmax   : 1;
+                varalignmax     : 16;
+                localalignmin   : 4;
+                localalignmax   : 8;
                 recordalignmin  : 0;
                 recordalignmin  : 0;
-                recordalignmax  : 2;
+                recordalignmax  : 16;
                 maxCrecordalign : 4
                 maxCrecordalign : 4
               );
               );
             first_parm_offset : 8;
             first_parm_offset : 8;

+ 17 - 2
compiler/utils/Makefile

@@ -1,8 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2012/04/13]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2012/04/25]
 #
 #
 default: all
 default: all
-MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux jvm-java jvm-android
+MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-netbsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux jvm-java jvm-android
 BSDs = freebsd netbsd openbsd darwin
 BSDs = freebsd netbsd openbsd darwin
 UNIXs = linux $(BSDs) solaris qnx haiku aix
 UNIXs = linux $(BSDs) solaris qnx haiku aix
 LIMIT83fs = go32v2 os2 emx watcom
 LIMIT83fs = go32v2 os2 emx watcom
@@ -429,6 +429,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 override TARGET_PROGRAMS+=fpc ppufiles ppudump ppumove fpcsubst mkarmins mkx86ins
 override TARGET_PROGRAMS+=fpc ppufiles ppudump ppumove fpcsubst mkarmins mkx86ins
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+override TARGET_PROGRAMS+=fpc ppufiles ppudump ppumove fpcsubst mkarmins mkx86ins
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 override TARGET_PROGRAMS+=fpc ppufiles ppudump ppumove fpcsubst mkarmins mkx86ins
 override TARGET_PROGRAMS+=fpc ppufiles ppudump ppumove fpcsubst mkarmins mkx86ins
 endif
 endif
@@ -636,6 +639,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 override CLEAN_UNITS+=ppu crc usubst
 override CLEAN_UNITS+=ppu crc usubst
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+override CLEAN_UNITS+=ppu crc usubst
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 override CLEAN_UNITS+=ppu crc usubst
 override CLEAN_UNITS+=ppu crc usubst
 endif
 endif
@@ -844,6 +850,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 override COMPILER_UNITDIR+=..
 override COMPILER_UNITDIR+=..
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+override COMPILER_UNITDIR+=..
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 override COMPILER_UNITDIR+=..
 override COMPILER_UNITDIR+=..
 endif
 endif
@@ -1051,6 +1060,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 override COMPILER_SOURCEDIR+=..
 override COMPILER_SOURCEDIR+=..
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+override COMPILER_SOURCEDIR+=..
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 override COMPILER_SOURCEDIR+=..
 override COMPILER_SOURCEDIR+=..
 endif
 endif
@@ -1871,6 +1883,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+REQUIRE_PACKAGES_RTL=1
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 endif
 endif

+ 167 - 31
compiler/x86_64/aoptcpu.pas

@@ -41,6 +41,7 @@ uses
   cutils,
   cutils,
   verbose,
   verbose,
   cgbase, cgutils,
   cgbase, cgutils,
+  aoptobj,
   aasmbase, aasmdata, aasmcpu;
   aasmbase, aasmdata, aasmcpu;
 
 
 function isFoldableArithOp(hp1: taicpu; reg: tregister): boolean;
 function isFoldableArithOp(hp1: taicpu; reg: tregister): boolean;
@@ -49,11 +50,11 @@ begin
   case hp1.opcode of
   case hp1.opcode of
     A_ADD, A_SUB, A_OR, A_XOR, A_AND, A_SHL, A_SHR, A_SAR:
     A_ADD, A_SUB, A_OR, A_XOR, A_AND, A_SHL, A_SHR, A_SAR:
       isFoldableArithOp :=
       isFoldableArithOp :=
+        (taicpu(hp1).oper[1]^.typ = top_reg) and
+        (taicpu(hp1).oper[1]^.reg = reg) and
         ((taicpu(hp1).oper[0]^.typ = top_const) or
         ((taicpu(hp1).oper[0]^.typ = top_const) or
         ((taicpu(hp1).oper[0]^.typ = top_reg) and
         ((taicpu(hp1).oper[0]^.typ = top_reg) and
-        (taicpu(hp1).oper[0]^.reg<>reg))) and
-        (taicpu(hp1).oper[1]^.typ = top_reg) and
-        (taicpu(hp1).oper[1]^.reg = reg);
+        (taicpu(hp1).oper[0]^.reg<>reg)));
     A_INC, A_DEC:
     A_INC, A_DEC:
       isFoldableArithOp :=
       isFoldableArithOp :=
         (taicpu(hp1).oper[0]^.typ = top_reg) and
         (taicpu(hp1).oper[0]^.typ = top_reg) and
@@ -65,6 +66,8 @@ function TCpuAsmOptimizer.PeepHoleOptPass1Cpu(var p: tai): boolean;
 var
 var
   next1: tai;
   next1: tai;
   hp1, hp2: tai;
   hp1, hp2: tai;
+  GetNextIntruction_p : boolean;
+  TmpUsedRegs : TAllUsedRegs;
 begin
 begin
   Result := False;
   Result := False;
   case p.typ of
   case p.typ of
@@ -90,9 +93,11 @@ begin
             begin
             begin
               taicpu(hp1).loadConst(0, taicpu(p).oper[0]^.val and
               taicpu(hp1).loadConst(0, taicpu(p).oper[0]^.val and
                 taicpu(hp1).oper[0]^.val);
                 taicpu(hp1).oper[0]^.val);
+              if (cs_asm_source in current_settings.globalswitches) then
+                asml.insertbefore(tai_comment.create(strpnew('PeepHole Optimization,var1')),p);
               asml.remove(p);
               asml.remove(p);
               p.Free;
               p.Free;
-              p := hp1;
+              p:=hp1;
             end;
             end;
 (*                      else
 (*                      else
   {change "and x, reg; jxx" to "test x, reg", if reg is deallocated before the
   {change "and x, reg; jxx" to "test x, reg", if reg is deallocated before the
@@ -105,6 +110,97 @@ begin
                          not(getsupreg(taicpu(p).oper[1]^.reg) in UsedRegs) then
                          not(getsupreg(taicpu(p).oper[1]^.reg) in UsedRegs) then
                         taicpu(p).opcode := A_TEST;*)
                         taicpu(p).opcode := A_TEST;*)
           end;
           end;
+        A_MOV:
+        { removes superfluous And's after mov's }
+          begin
+            if not(cs_opt_level3 in current_settings.optimizerswitches) then
+              exit;
+            GetNextIntruction_p:=GetNextInstruction(p, hp1);
+            if (taicpu(p).oper[1]^.typ = top_reg) and
+               GetNextIntruction_p and
+               (tai(hp1).typ = ait_instruction) and
+               (taicpu(hp1).opcode = A_AND) and
+               (taicpu(hp1).oper[0]^.typ = top_const) and
+               (taicpu(hp1).oper[1]^.typ = top_reg) and
+               (taicpu(hp1).oper[1]^.reg = taicpu(p).oper[1]^.reg) then
+              case taicpu(p).opsize Of
+                S_L:
+                  if (taicpu(hp1).oper[0]^.val = $ffffffff) then
+                    begin
+                      if (cs_asm_source in current_settings.globalswitches) then
+                        asml.insertbefore(tai_comment.create(strpnew('PeepHole Optimization,var2a')),p);
+                      asml.remove(hp1);
+                      hp1.free;
+                    end;
+              end
+            else if (taicpu(p).oper[1]^.typ = top_reg) and
+              GetNextIntruction_p and
+              (hp1.typ = ait_instruction) and
+              GetNextInstruction(hp1, hp2) and
+              (hp2.typ = ait_instruction) and
+              (taicpu(hp2).opcode = A_MOV) and
+              (taicpu(hp2).oper[0]^.typ = top_reg) and
+              OpsEqual(taicpu(hp2).oper[1]^, taicpu(p).oper[0]^) and
+              (IsFoldableArithOp(taicpu(hp1), taicpu(p).oper[1]^.reg) or
+               ((taicpu(p).opsize=S_L) and (taicpu(hp1).opsize=S_Q) and
+                IsFoldableArithOp(taicpu(hp1), newreg(R_INTREGISTER,getsupreg(taicpu(p).oper[1]^.reg),R_SUBQ)))
+              ) then
+              { change   movsX/movzX    reg/ref, reg2             }
+              {          add/sub/or/... reg3/$const, reg2         }
+              {          mov            reg2 reg/ref              }
+              { to       add/sub/or/... reg3/$const, reg/ref      }
+              begin
+                CopyUsedRegs(TmpUsedRegs);
+                UpdateUsedRegs(TmpUsedRegs, tai(p.next));
+                UpdateUsedRegs(TmpUsedRegs, tai(hp1.next));
+                If not(RegUsedAfterInstruction(taicpu(p).oper[1]^.reg,hp2,TmpUsedRegs)) then
+                  begin
+                    { by example:
+                        movswl  %si,%eax        movswl  %si,%eax      p
+                        decl    %eax            addl    %edx,%eax     hp1
+                        movw    %ax,%si         movw    %ax,%si       hp2
+                      ->
+                        movswl  %si,%eax        movswl  %si,%eax      p
+                        decw    %eax            addw    %edx,%eax     hp1
+                        movw    %ax,%si         movw    %ax,%si       hp2
+                    }
+                   if (cs_asm_source in current_settings.globalswitches) then
+                     begin
+                        asml.insertbefore(tai_comment.create(strpnew('PeepHole Optimization,var2')),p);
+                        asml.insertbefore(tai_comment.create(strpnew('P='+std_op2str[taicpu(p).opcode])),p);
+                        asml.insertbefore(tai_comment.create(strpnew('HP1='+std_op2str[taicpu(hp1).opcode])),p);
+                        asml.insertbefore(tai_comment.create(strpnew('HP2='+std_op2str[taicpu(hp2).opcode])),p);
+                     end;
+                    taicpu(hp1).changeopsize(taicpu(hp2).opsize);
+                    {
+                      ->
+                        movswl  %si,%eax        movswl  %si,%eax      p
+                        decw    %si             addw    %dx,%si       hp1
+                        movw    %ax,%si         movw    %ax,%si       hp2
+                    }
+                    case taicpu(hp1).ops of
+                      1:
+                        taicpu(hp1).loadoper(0, taicpu(hp2).oper[1]^);
+                      2:
+                        taicpu(hp1).loadoper(1, taicpu(hp2).oper[1]^);
+                      else
+                        internalerror(2008042701);
+                    end;
+                    {
+                      ->
+                        decw    %si             addw    %dx,%si       p
+                    }
+                    if (cs_asm_source in current_settings.globalswitches) then
+                      asml.insertbefore(tai_comment.create(strpnew('PeepHole Optimization,var2')),p);
+                    asml.remove(p);
+                    asml.remove(hp2);
+                    p.Free;
+                    hp2.Free;
+                    p := hp1;
+                 end;
+                ReleaseUsedRegs(TmpUsedRegs);
+              end
+          end;
         A_MOVSX,
         A_MOVSX,
         A_MOVZX:
         A_MOVZX:
           begin
           begin
@@ -155,6 +251,8 @@ begin
                 ->
                 ->
                   decw    %si             addw    %dx,%si       p
                   decw    %si             addw    %dx,%si       p
               }
               }
+              if (cs_asm_source in current_settings.globalswitches) then
+                asml.insertbefore(tai_comment.create(strpnew('PeepHole Optimization,var3')),p);
               asml.remove(p);
               asml.remove(p);
               asml.remove(hp2);
               asml.remove(hp2);
               p.Free;
               p.Free;
@@ -171,26 +269,34 @@ begin
               (taicpu(hp1).oper[0]^.typ = top_const) and
               (taicpu(hp1).oper[0]^.typ = top_const) and
               (taicpu(hp1).oper[1]^.typ = top_reg) and
               (taicpu(hp1).oper[1]^.typ = top_reg) and
               (taicpu(hp1).oper[1]^.reg = taicpu(p).oper[1]^.reg) then
               (taicpu(hp1).oper[1]^.reg = taicpu(p).oper[1]^.reg) then
-              case taicpu(p).opsize of
-                S_BL, S_BW, S_BQ:
-                  if (taicpu(hp1).oper[0]^.val = $ff) then
-                    begin
-                      asml.remove(hp1);
-                      hp1.Free;
-                    end;
-                S_WL, S_WQ:
-                  if (taicpu(hp1).oper[0]^.val = $ffff) then
-                    begin
-                      asml.remove(hp1);
-                      hp1.Free;
-                    end;
-                S_LQ:
-                  if (taicpu(hp1).oper[0]^.val = $ffffffff) then
-                    begin
-                      asml.remove(hp1);
-                      hp1.Free;
+                begin
+                  case taicpu(p).opsize of
+                    S_BL, S_BW, S_BQ:
+                      if (taicpu(hp1).oper[0]^.val = $ff) then
+                        begin
+                          if (cs_asm_source in current_settings.globalswitches) then
+                            asml.insertbefore(tai_comment.create(strpnew('PeepHole Optimization,var4')),p);
+                          asml.remove(hp1);
+                          hp1.Free;
+                        end;
+                    S_WL, S_WQ:
+                      if (taicpu(hp1).oper[0]^.val = $ffff) then
+                        begin
+                          if (cs_asm_source in current_settings.globalswitches) then
+                            asml.insertbefore(tai_comment.create(strpnew('PeepHole Optimization,var5')),p);
+                          asml.remove(hp1);
+                          hp1.Free;
+                        end;
+                    S_LQ:
+                      if (taicpu(hp1).oper[0]^.val = $ffffffff) then
+                        begin
+                          if (cs_asm_source in current_settings.globalswitches) then
+                            asml.insertbefore(tai_comment.create(strpnew('PeepHole Optimization,var6')),p);
+                          asml.remove(hp1);
+                          hp1.Free;
+                        end;
                     end;
                     end;
-                end;
+               end;
             { changes some movzx constructs to faster synonims (all examples
             { changes some movzx constructs to faster synonims (all examples
               are given with eax/ax, but are also valid for other registers)}
               are given with eax/ax, but are also valid for other registers)}
             if (taicpu(p).oper[1]^.typ = top_reg) then
             if (taicpu(p).oper[1]^.typ = top_reg) then
@@ -206,6 +312,8 @@ begin
                       taicpu(p).opcode := A_AND;
                       taicpu(p).opcode := A_AND;
                       taicpu(p).changeopsize(S_W);
                       taicpu(p).changeopsize(S_W);
                       taicpu(p).loadConst(0, $ff);
                       taicpu(p).loadConst(0, $ff);
+                      if (cs_asm_source in current_settings.globalswitches) then
+                        asml.insertbefore(tai_comment.create(strpnew('PeepHole Optimization,var7')),p);
                       end
                       end
                     else if GetNextInstruction(p, hp1) and
                     else if GetNextInstruction(p, hp1) and
                       (tai(hp1).typ = ait_instruction) and
                       (tai(hp1).typ = ait_instruction) and
@@ -217,6 +325,8 @@ begin
                       { Change "movzbw %reg1, %reg2; andw $const, %reg2"
                       { Change "movzbw %reg1, %reg2; andw $const, %reg2"
                         to "movw %reg1, reg2; andw $(const1 and $ff), %reg2"}
                         to "movw %reg1, reg2; andw $(const1 and $ff), %reg2"}
                       begin
                       begin
+                        if (cs_asm_source in current_settings.globalswitches) then
+                          asml.insertbefore(tai_comment.create(strpnew('PeepHole Optimization,var8')),p);
                         taicpu(p).opcode := A_MOV;
                         taicpu(p).opcode := A_MOV;
                         taicpu(p).changeopsize(S_W);
                         taicpu(p).changeopsize(S_W);
                         setsubreg(taicpu(p).oper[0]^.reg, R_SUBW);
                         setsubreg(taicpu(p).oper[0]^.reg, R_SUBW);
@@ -231,9 +341,11 @@ begin
                       (cs_opt_size in current_settings.optimizerswitches) then
                       (cs_opt_size in current_settings.optimizerswitches) then
                       { Change "movzbl %al, %eax" to "andl $0x0ffh, %eax"}
                       { Change "movzbl %al, %eax" to "andl $0x0ffh, %eax"}
                       begin
                       begin
-                      taicpu(p).opcode := A_AND;
-                      taicpu(p).changeopsize(S_L);
-                      taicpu(p).loadConst(0, $ff);
+                        if (cs_asm_source in current_settings.globalswitches) then
+                          asml.insertbefore(tai_comment.create(strpnew('PeepHole Optimization,var9')),p);
+                        taicpu(p).opcode := A_AND;
+                        taicpu(p).changeopsize(S_L);
+                        taicpu(p).loadConst(0, $ff);
                       end
                       end
                     else if GetNextInstruction(p, hp1) and
                     else if GetNextInstruction(p, hp1) and
                       (tai(hp1).typ = ait_instruction) and
                       (tai(hp1).typ = ait_instruction) and
@@ -245,9 +357,14 @@ begin
                       { Change "movzbl %reg1, %reg2; andl $const, %reg2"
                       { Change "movzbl %reg1, %reg2; andl $const, %reg2"
                         to "movl %reg1, reg2; andl $(const1 and $ff), %reg2"}
                         to "movl %reg1, reg2; andl $(const1 and $ff), %reg2"}
                       begin
                       begin
+                        if (cs_asm_source in current_settings.globalswitches) then
+                          asml.insertbefore(tai_comment.create(strpnew('PeepHole Optimization,var10')),p);
                         taicpu(p).opcode := A_MOV;
                         taicpu(p).opcode := A_MOV;
                         taicpu(p).changeopsize(S_L);
                         taicpu(p).changeopsize(S_L);
-                        setsubreg(taicpu(p).oper[0]^.reg, R_SUBWHOLE);
+                        { do not use R_SUBWHOLE
+                          as movl %rdx,%eax
+                          is invalid in assembler PM }
+                        setsubreg(taicpu(p).oper[0]^.reg, R_SUBD);
                         taicpu(hp1).loadConst(
                         taicpu(hp1).loadConst(
                           0, taicpu(hp1).oper[0]^.val and $ff);
                           0, taicpu(hp1).oper[0]^.val and $ff);
                       end;
                       end;
@@ -259,9 +376,11 @@ begin
                       (cs_opt_size in current_settings.optimizerswitches) then
                       (cs_opt_size in current_settings.optimizerswitches) then
                       { Change "movzwl %ax, %eax" to "andl $0x0ffffh, %eax" }
                       { Change "movzwl %ax, %eax" to "andl $0x0ffffh, %eax" }
                       begin
                       begin
-                      taicpu(p).opcode := A_AND;
-                      taicpu(p).changeopsize(S_L);
-                      taicpu(p).loadConst(0, $ffff);
+                        if (cs_asm_source in current_settings.globalswitches) then
+                          asml.insertbefore(tai_comment.create(strpnew('PeepHole Optimization,var11')),p);
+                        taicpu(p).opcode := A_AND;
+                        taicpu(p).changeopsize(S_L);
+                        taicpu(p).loadConst(0, $ffff);
                       end
                       end
                     else if GetNextInstruction(p, hp1) and
                     else if GetNextInstruction(p, hp1) and
                       (tai(hp1).typ = ait_instruction) and
                       (tai(hp1).typ = ait_instruction) and
@@ -273,9 +392,14 @@ begin
                       { Change "movzwl %reg1, %reg2; andl $const, %reg2"
                       { Change "movzwl %reg1, %reg2; andl $const, %reg2"
                         to "movl %reg1, reg2; andl $(const1 and $ffff), %reg2"}
                         to "movl %reg1, reg2; andl $(const1 and $ffff), %reg2"}
                       begin
                       begin
+                        if (cs_asm_source in current_settings.globalswitches) then
+                          asml.insertbefore(tai_comment.create(strpnew('PeepHole Optimization,var12')),p);
                         taicpu(p).opcode := A_MOV;
                         taicpu(p).opcode := A_MOV;
                         taicpu(p).changeopsize(S_L);
                         taicpu(p).changeopsize(S_L);
-                        setsubreg(taicpu(p).oper[0]^.reg, R_SUBWHOLE);
+                        { do not use R_SUBWHOLE
+                          as movl %rdx,%eax
+                          is invalid in assembler PM }
+                        setsubreg(taicpu(p).oper[0]^.reg, R_SUBD);
                         taicpu(hp1).loadConst(
                         taicpu(hp1).loadConst(
                           0, taicpu(hp1).oper[0]^.val and $ffff);
                           0, taicpu(hp1).oper[0]^.val and $ffff);
                       end;
                       end;
@@ -295,36 +419,48 @@ begin
                   case taicpu(p).opsize of
                   case taicpu(p).opsize of
                     S_BL:
                     S_BL:
                       begin
                       begin
+                        if (cs_asm_source in current_settings.globalswitches) then
+                          asml.insertbefore(tai_comment.create(strpnew('PeepHole Optimization,var13')),p);
                         taicpu(p).changeopsize(S_L);
                         taicpu(p).changeopsize(S_L);
                         taicpu(hp1).loadConst(
                         taicpu(hp1).loadConst(
                           0, taicpu(hp1).oper[0]^.val and $ff);
                           0, taicpu(hp1).oper[0]^.val and $ff);
                       end;
                       end;
                     S_WL:
                     S_WL:
                       begin
                       begin
+                        if (cs_asm_source in current_settings.globalswitches) then
+                          asml.insertbefore(tai_comment.create(strpnew('PeepHole Optimization,var14')),p);
                         taicpu(p).changeopsize(S_L);
                         taicpu(p).changeopsize(S_L);
                         taicpu(hp1).loadConst(
                         taicpu(hp1).loadConst(
                           0, taicpu(hp1).oper[0]^.val and $ffff);
                           0, taicpu(hp1).oper[0]^.val and $ffff);
                       end;
                       end;
                     S_BW:
                     S_BW:
                       begin
                       begin
+                        if (cs_asm_source in current_settings.globalswitches) then
+                          asml.insertbefore(tai_comment.create(strpnew('PeepHole Optimization,var15')),p);
                         taicpu(p).changeopsize(S_W);
                         taicpu(p).changeopsize(S_W);
                         taicpu(hp1).loadConst(
                         taicpu(hp1).loadConst(
                           0, taicpu(hp1).oper[0]^.val and $ff);
                           0, taicpu(hp1).oper[0]^.val and $ff);
                       end;
                       end;
                     S_BQ:
                     S_BQ:
                       begin
                       begin
+                        if (cs_asm_source in current_settings.globalswitches) then
+                          asml.insertbefore(tai_comment.create(strpnew('PeepHole Optimization,var16')),p);
                         taicpu(p).changeopsize(S_Q);
                         taicpu(p).changeopsize(S_Q);
                         taicpu(hp1).loadConst(
                         taicpu(hp1).loadConst(
                           0, taicpu(hp1).oper[0]^.val and $ff);
                           0, taicpu(hp1).oper[0]^.val and $ff);
                       end;
                       end;
                     S_WQ:
                     S_WQ:
                       begin
                       begin
+                        if (cs_asm_source in current_settings.globalswitches) then
+                          asml.insertbefore(tai_comment.create(strpnew('PeepHole Optimization,var17')),p);
                         taicpu(p).changeopsize(S_Q);
                         taicpu(p).changeopsize(S_Q);
                         taicpu(hp1).loadConst(
                         taicpu(hp1).loadConst(
                           0, taicpu(hp1).oper[0]^.val and $ffff);
                           0, taicpu(hp1).oper[0]^.val and $ffff);
                       end;
                       end;
                     S_LQ:
                     S_LQ:
                       begin
                       begin
+                        if (cs_asm_source in current_settings.globalswitches) then
+                          asml.insertbefore(tai_comment.create(strpnew('PeepHole Optimization,var18')),p);
                         taicpu(p).changeopsize(S_Q);
                         taicpu(p).changeopsize(S_Q);
                         taicpu(hp1).loadConst(
                         taicpu(hp1).loadConst(
                           0, taicpu(hp1).oper[0]^.val and $ffffffff);
                           0, taicpu(hp1).oper[0]^.val and $ffffffff);

+ 30 - 2
ide/Makefile

@@ -1,8 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2012/04/13]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2012/04/25]
 #
 #
 default: all
 default: all
-MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux
+MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-netbsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux
 BSDs = freebsd netbsd openbsd darwin
 BSDs = freebsd netbsd openbsd darwin
 UNIXs = linux $(BSDs) solaris qnx haiku aix
 UNIXs = linux $(BSDs) solaris qnx haiku aix
 LIMIT83fs = go32v2 os2 emx watcom
 LIMIT83fs = go32v2 os2 emx watcom
@@ -313,6 +313,9 @@ endif
 ifeq ($(OS_TARGET),openbsd)
 ifeq ($(OS_TARGET),openbsd)
 needusrlocallib=1
 needusrlocallib=1
 endif
 endif
+ifeq ($(OS_TARGET),netbsd)
+neednostdlib=1
+endif
 ifdef needlinkparam
 ifdef needlinkparam
 override SPECIALLINK=-Xe -k--allow-multiple-definition
 override SPECIALLINK=-Xe -k--allow-multiple-definition
 endif
 endif
@@ -494,6 +497,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 override TARGET_DIRS+=compiler
 override TARGET_DIRS+=compiler
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+override TARGET_DIRS+=compiler
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 override TARGET_DIRS+=compiler
 override TARGET_DIRS+=compiler
 endif
 endif
@@ -695,6 +701,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 override TARGET_PROGRAMS+=fp
 override TARGET_PROGRAMS+=fp
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+override TARGET_PROGRAMS+=fp
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 override TARGET_PROGRAMS+=fp
 override TARGET_PROGRAMS+=fp
 endif
 endif
@@ -898,6 +907,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 override COMPILER_OPTIONS+=-Sg
 override COMPILER_OPTIONS+=-Sg
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+override COMPILER_OPTIONS+=-Sg
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 override COMPILER_OPTIONS+=-Sg
 override COMPILER_OPTIONS+=-Sg
 endif
 endif
@@ -2180,6 +2192,19 @@ REQUIRE_PACKAGES_CHM=1
 REQUIRE_PACKAGES_FCL-BASE=1
 REQUIRE_PACKAGES_FCL-BASE=1
 REQUIRE_PACKAGES_FCL-XML=1
 REQUIRE_PACKAGES_FCL-XML=1
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_FCL-PROCESS=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_FPMKUNIT=1
+REQUIRE_PACKAGES_FV=1
+REQUIRE_PACKAGES_GDBINT=1
+REQUIRE_PACKAGES_REGEXPR=1
+REQUIRE_PACKAGES_CHM=1
+REQUIRE_PACKAGES_FCL-BASE=1
+REQUIRE_PACKAGES_FCL-XML=1
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_PASZLIB=1
 REQUIRE_PACKAGES_PASZLIB=1
@@ -3656,6 +3681,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 TARGET_DIRS_COMPILER=1
 TARGET_DIRS_COMPILER=1
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+TARGET_DIRS_COMPILER=1
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 TARGET_DIRS_COMPILER=1
 TARGET_DIRS_COMPILER=1
 endif
 endif

+ 3 - 0
ide/Makefile.fpc

@@ -61,6 +61,9 @@ endif
 ifeq ($(OS_TARGET),openbsd)
 ifeq ($(OS_TARGET),openbsd)
 needusrlocallib=1
 needusrlocallib=1
 endif
 endif
+ifeq ($(OS_TARGET),netbsd)
+neednostdlib=1
+endif
 
 
 ifdef needlinkparam
 ifdef needlinkparam
 override SPECIALLINK=-Xe -k--allow-multiple-definition
 override SPECIALLINK=-Xe -k--allow-multiple-definition

+ 17 - 2
ide/compiler/Makefile

@@ -1,8 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2012/04/11]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2012/04/25]
 #
 #
 default: all
 default: all
-MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux
+MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-netbsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux
 BSDs = freebsd netbsd openbsd darwin
 BSDs = freebsd netbsd openbsd darwin
 UNIXs = linux $(BSDs) solaris qnx haiku aix
 UNIXs = linux $(BSDs) solaris qnx haiku aix
 LIMIT83fs = go32v2 os2 emx watcom
 LIMIT83fs = go32v2 os2 emx watcom
@@ -454,6 +454,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 override TARGET_UNITS+=compunit
 override TARGET_UNITS+=compunit
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+override TARGET_UNITS+=compunit
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 override TARGET_UNITS+=compunit
 override TARGET_UNITS+=compunit
 endif
 endif
@@ -656,6 +659,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 override COMPILER_OPTIONS+=-Ur -dNOCATCH
 override COMPILER_OPTIONS+=-Ur -dNOCATCH
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+override COMPILER_OPTIONS+=-Ur -dNOCATCH
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 override COMPILER_OPTIONS+=-Ur -dNOCATCH
 override COMPILER_OPTIONS+=-Ur -dNOCATCH
 endif
 endif
@@ -857,6 +863,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 override COMPILER_INCLUDEDIR+=$(COMPILERDIR) $(COMPILERDIR)/$(PPC_TARGET)
 override COMPILER_INCLUDEDIR+=$(COMPILERDIR) $(COMPILERDIR)/$(PPC_TARGET)
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+override COMPILER_INCLUDEDIR+=$(COMPILERDIR) $(COMPILERDIR)/$(PPC_TARGET)
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 override COMPILER_INCLUDEDIR+=$(COMPILERDIR) $(COMPILERDIR)/$(PPC_TARGET)
 override COMPILER_INCLUDEDIR+=$(COMPILERDIR) $(COMPILERDIR)/$(PPC_TARGET)
 endif
 endif
@@ -1058,6 +1067,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 override COMPILER_UNITDIR+=$(COMPILERDIR) $(COMPILERDIR)/$(PPC_TARGET) $(COMPILERDIR)/targets $(COMPILERDIR)/systems
 override COMPILER_UNITDIR+=$(COMPILERDIR) $(COMPILERDIR)/$(PPC_TARGET) $(COMPILERDIR)/targets $(COMPILERDIR)/systems
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+override COMPILER_UNITDIR+=$(COMPILERDIR) $(COMPILERDIR)/$(PPC_TARGET) $(COMPILERDIR)/targets $(COMPILERDIR)/systems
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 override COMPILER_UNITDIR+=$(COMPILERDIR) $(COMPILERDIR)/$(PPC_TARGET) $(COMPILERDIR)/targets $(COMPILERDIR)/systems
 override COMPILER_UNITDIR+=$(COMPILERDIR) $(COMPILERDIR)/$(PPC_TARGET) $(COMPILERDIR)/targets $(COMPILERDIR)/systems
 endif
 endif
@@ -1858,6 +1870,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+REQUIRE_PACKAGES_RTL=1
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 endif
 endif

+ 8 - 2
ide/fakegdb/Makefile

@@ -1,8 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2012/04/11]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2012/04/25]
 #
 #
 default: all
 default: all
-MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux
+MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-netbsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux
 BSDs = freebsd netbsd openbsd darwin
 BSDs = freebsd netbsd openbsd darwin
 UNIXs = linux $(BSDs) solaris qnx haiku aix
 UNIXs = linux $(BSDs) solaris qnx haiku aix
 LIMIT83fs = go32v2 os2 emx watcom
 LIMIT83fs = go32v2 os2 emx watcom
@@ -429,6 +429,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 override TARGET_UNITS+=gdbcon gdbint
 override TARGET_UNITS+=gdbcon gdbint
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+override TARGET_UNITS+=gdbcon gdbint
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 override TARGET_UNITS+=gdbcon gdbint
 override TARGET_UNITS+=gdbcon gdbint
 endif
 endif
@@ -1230,6 +1233,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+REQUIRE_PACKAGES_RTL=1
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 endif
 endif

+ 17 - 2
installer/Makefile

@@ -1,8 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2012/04/11]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2012/04/25]
 #
 #
 default: all
 default: all
-MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux
+MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-netbsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux
 BSDs = freebsd netbsd openbsd darwin
 BSDs = freebsd netbsd openbsd darwin
 UNIXs = linux $(BSDs) solaris qnx haiku aix
 UNIXs = linux $(BSDs) solaris qnx haiku aix
 LIMIT83fs = go32v2 os2 emx watcom
 LIMIT83fs = go32v2 os2 emx watcom
@@ -477,6 +477,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 override CLEAN_UNITS+=scroll insthelp
 override CLEAN_UNITS+=scroll insthelp
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+override CLEAN_UNITS+=scroll insthelp
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 override CLEAN_UNITS+=scroll insthelp
 override CLEAN_UNITS+=scroll insthelp
 endif
 endif
@@ -718,6 +721,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 override COMPILER_UNITDIR+=../ide
 override COMPILER_UNITDIR+=../ide
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+override COMPILER_UNITDIR+=../ide
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 override COMPILER_UNITDIR+=../ide
 override COMPILER_UNITDIR+=../ide
 endif
 endif
@@ -1788,6 +1794,15 @@ REQUIRE_PACKAGES_FPMKUNIT=1
 REQUIRE_PACKAGES_FV=1
 REQUIRE_PACKAGES_FV=1
 REQUIRE_PACKAGES_UNZIP=1
 REQUIRE_PACKAGES_UNZIP=1
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_FCL-PROCESS=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_FPMKUNIT=1
+REQUIRE_PACKAGES_FV=1
+REQUIRE_PACKAGES_UNZIP=1
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_PASZLIB=1
 REQUIRE_PACKAGES_PASZLIB=1

+ 5 - 2
packages/Makefile

@@ -1,8 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2012/04/11]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2012/04/25]
 #
 #
 default: all
 default: all
-MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux
+MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-netbsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux
 BSDs = freebsd netbsd openbsd darwin
 BSDs = freebsd netbsd openbsd darwin
 UNIXs = linux $(BSDs) solaris qnx haiku aix
 UNIXs = linux $(BSDs) solaris qnx haiku aix
 LIMIT83fs = go32v2 os2 emx watcom
 LIMIT83fs = go32v2 os2 emx watcom
@@ -1054,6 +1054,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+REQUIRE_PACKAGES_RTL=1
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 endif
 endif

+ 9 - 2
packages/a52/Makefile

@@ -1,8 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2012/04/11]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2012/04/25]
 #
 #
 default: all
 default: all
-MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux
+MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-netbsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux
 BSDs = freebsd netbsd openbsd darwin
 BSDs = freebsd netbsd openbsd darwin
 UNIXs = linux $(BSDs) solaris qnx haiku aix
 UNIXs = linux $(BSDs) solaris qnx haiku aix
 LIMIT83fs = go32v2 os2 emx watcom
 LIMIT83fs = go32v2 os2 emx watcom
@@ -1217,6 +1217,13 @@ REQUIRE_PACKAGES_FCL-PROCESS=1
 REQUIRE_PACKAGES_HASH=1
 REQUIRE_PACKAGES_HASH=1
 REQUIRE_PACKAGES_FPMKUNIT=1
 REQUIRE_PACKAGES_FPMKUNIT=1
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_FCL-PROCESS=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_FPMKUNIT=1
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_PASZLIB=1
 REQUIRE_PACKAGES_PASZLIB=1

+ 9 - 2
packages/amunits/Makefile

@@ -1,8 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2012/04/11]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2012/04/25]
 #
 #
 default: all
 default: all
-MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux
+MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-netbsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux
 BSDs = freebsd netbsd openbsd darwin
 BSDs = freebsd netbsd openbsd darwin
 UNIXs = linux $(BSDs) solaris qnx haiku aix
 UNIXs = linux $(BSDs) solaris qnx haiku aix
 LIMIT83fs = go32v2 os2 emx watcom
 LIMIT83fs = go32v2 os2 emx watcom
@@ -1217,6 +1217,13 @@ REQUIRE_PACKAGES_FCL-PROCESS=1
 REQUIRE_PACKAGES_HASH=1
 REQUIRE_PACKAGES_HASH=1
 REQUIRE_PACKAGES_FPMKUNIT=1
 REQUIRE_PACKAGES_FPMKUNIT=1
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_FCL-PROCESS=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_FPMKUNIT=1
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_PASZLIB=1
 REQUIRE_PACKAGES_PASZLIB=1

+ 17 - 2
packages/amunits/src/utilunits/Makefile

@@ -1,8 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2012/04/11]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2012/04/25]
 #
 #
 default: all
 default: all
-MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux
+MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-netbsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux
 BSDs = freebsd netbsd openbsd darwin
 BSDs = freebsd netbsd openbsd darwin
 UNIXs = linux $(BSDs) solaris qnx haiku aix
 UNIXs = linux $(BSDs) solaris qnx haiku aix
 LIMIT83fs = go32v2 os2 emx watcom
 LIMIT83fs = go32v2 os2 emx watcom
@@ -429,6 +429,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 override TARGET_UNITS+=amigautils consoleio deadkeys doublebuffer easyasl hisoft linklist longarray msgbox pastoc pcq systemvartags tagsarray timerutils vartags wbargs
 override TARGET_UNITS+=amigautils consoleio deadkeys doublebuffer easyasl hisoft linklist longarray msgbox pastoc pcq systemvartags tagsarray timerutils vartags wbargs
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+override TARGET_UNITS+=amigautils consoleio deadkeys doublebuffer easyasl hisoft linklist longarray msgbox pastoc pcq systemvartags tagsarray timerutils vartags wbargs
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 override TARGET_UNITS+=amigautils consoleio deadkeys doublebuffer easyasl hisoft linklist longarray msgbox pastoc pcq systemvartags tagsarray timerutils vartags wbargs
 override TARGET_UNITS+=amigautils consoleio deadkeys doublebuffer easyasl hisoft linklist longarray msgbox pastoc pcq systemvartags tagsarray timerutils vartags wbargs
 endif
 endif
@@ -631,6 +634,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 override COMPILER_INCLUDEDIR+=../inc
 override COMPILER_INCLUDEDIR+=../inc
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+override COMPILER_INCLUDEDIR+=../inc
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 override COMPILER_INCLUDEDIR+=../inc
 override COMPILER_INCLUDEDIR+=../inc
 endif
 endif
@@ -832,6 +838,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 override COMPILER_UNITDIR+=../units
 override COMPILER_UNITDIR+=../units
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+override COMPILER_UNITDIR+=../units
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 override COMPILER_UNITDIR+=../units
 override COMPILER_UNITDIR+=../units
 endif
 endif
@@ -1033,6 +1042,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 override COMPILER_SOURCEDIR+=.
 override COMPILER_SOURCEDIR+=.
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+override COMPILER_SOURCEDIR+=.
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 override COMPILER_SOURCEDIR+=.
 override COMPILER_SOURCEDIR+=.
 endif
 endif
@@ -1833,6 +1845,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+REQUIRE_PACKAGES_RTL=1
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 endif
 endif

+ 9 - 2
packages/aspell/Makefile

@@ -1,8 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2012/04/11]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2012/04/25]
 #
 #
 default: all
 default: all
-MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux
+MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-netbsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux
 BSDs = freebsd netbsd openbsd darwin
 BSDs = freebsd netbsd openbsd darwin
 UNIXs = linux $(BSDs) solaris qnx haiku aix
 UNIXs = linux $(BSDs) solaris qnx haiku aix
 LIMIT83fs = go32v2 os2 emx watcom
 LIMIT83fs = go32v2 os2 emx watcom
@@ -1217,6 +1217,13 @@ REQUIRE_PACKAGES_FCL-PROCESS=1
 REQUIRE_PACKAGES_HASH=1
 REQUIRE_PACKAGES_HASH=1
 REQUIRE_PACKAGES_FPMKUNIT=1
 REQUIRE_PACKAGES_FPMKUNIT=1
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_FCL-PROCESS=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_FPMKUNIT=1
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_PASZLIB=1
 REQUIRE_PACKAGES_PASZLIB=1

+ 9 - 2
packages/bfd/Makefile

@@ -1,8 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2012/04/11]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2012/04/25]
 #
 #
 default: all
 default: all
-MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux
+MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-netbsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux
 BSDs = freebsd netbsd openbsd darwin
 BSDs = freebsd netbsd openbsd darwin
 UNIXs = linux $(BSDs) solaris qnx haiku aix
 UNIXs = linux $(BSDs) solaris qnx haiku aix
 LIMIT83fs = go32v2 os2 emx watcom
 LIMIT83fs = go32v2 os2 emx watcom
@@ -1217,6 +1217,13 @@ REQUIRE_PACKAGES_FCL-PROCESS=1
 REQUIRE_PACKAGES_HASH=1
 REQUIRE_PACKAGES_HASH=1
 REQUIRE_PACKAGES_FPMKUNIT=1
 REQUIRE_PACKAGES_FPMKUNIT=1
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_FCL-PROCESS=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_FPMKUNIT=1
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_PASZLIB=1
 REQUIRE_PACKAGES_PASZLIB=1

+ 9 - 2
packages/bzip2/Makefile

@@ -1,8 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2012/04/11]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2012/04/25]
 #
 #
 default: all
 default: all
-MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux
+MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-netbsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux
 BSDs = freebsd netbsd openbsd darwin
 BSDs = freebsd netbsd openbsd darwin
 UNIXs = linux $(BSDs) solaris qnx haiku aix
 UNIXs = linux $(BSDs) solaris qnx haiku aix
 LIMIT83fs = go32v2 os2 emx watcom
 LIMIT83fs = go32v2 os2 emx watcom
@@ -1217,6 +1217,13 @@ REQUIRE_PACKAGES_FCL-PROCESS=1
 REQUIRE_PACKAGES_HASH=1
 REQUIRE_PACKAGES_HASH=1
 REQUIRE_PACKAGES_FPMKUNIT=1
 REQUIRE_PACKAGES_FPMKUNIT=1
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_FCL-PROCESS=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_FPMKUNIT=1
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_PASZLIB=1
 REQUIRE_PACKAGES_PASZLIB=1

+ 1 - 1
packages/bzip2/src/bzip2.pas

@@ -87,7 +87,7 @@ Type
 
 
 implementation
 implementation
 
 
-{$ifdef i386}
+{$ifdef cpui386}
   {$i bzip2i386.inc}
   {$i bzip2i386.inc}
 {$endif}
 {$endif}
 
 

+ 3 - 3
packages/bzip2/src/bzip2i386.inc

@@ -33,11 +33,11 @@ asm
 {  mov edx,offset c
 {  mov edx,offset c
   call mcount}
   call mcount}
   xor edx,edx
   xor edx,edx
-  lea ebx,[esi+Tbzip2_decode_stream.cftab]
-  mov ecx,[esi+Tbzip2_decode_stream.tt_count]
+  lea ebx,[eax+Tbzip2_decode_stream.cftab]
+  mov ecx,[eax+Tbzip2_decode_stream.tt_count]
   push esi
   push esi
   push ebp
   push ebp
-  mov esi,[esi+Tbzip2_decode_stream.tt]
+  mov esi,[eax+Tbzip2_decode_stream.tt]
   mov edi,esi
   mov edi,esi
   lea ebp,[4*ecx+esi]
   lea ebp,[4*ecx+esi]
   jmp @a2
   jmp @a2

+ 3 - 3
packages/bzip2/src/bzip2si386.inc

@@ -8,11 +8,11 @@ asm
 {  mov edx,offset c
 {  mov edx,offset c
   call mcount}
   call mcount}
   xor edx,edx
   xor edx,edx
-  lea ebx,[esi+TDecompressBzip2Stream.cftab]
-  mov ecx,[esi+TDecompressBzip2Stream.tt_count]
+  lea ebx,[eax+TDecompressBzip2Stream.cftab]
+  mov ecx,[eax+TDecompressBzip2Stream.tt_count]
   push esi
   push esi
   push ebp
   push ebp
-  mov esi,[esi+TDecompressBzip2Stream.tt]
+  mov esi,[eax+TDecompressBzip2Stream.tt]
   mov edi,esi
   mov edi,esi
   lea ebp,[4*ecx+esi]
   lea ebp,[4*ecx+esi]
   jmp @a2
   jmp @a2

+ 1 - 1
packages/bzip2/src/bzip2stream.pp

@@ -96,7 +96,7 @@ Type
 
 
 implementation
 implementation
 
 
-{$ifdef i386}
+{$ifdef cpui386}
   {$i bzip2si386.inc}
   {$i bzip2si386.inc}
 {$endif}
 {$endif}
 
 

+ 9 - 2
packages/cairo/Makefile

@@ -1,8 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2012/04/11]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2012/04/25]
 #
 #
 default: all
 default: all
-MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux
+MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-netbsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux
 BSDs = freebsd netbsd openbsd darwin
 BSDs = freebsd netbsd openbsd darwin
 UNIXs = linux $(BSDs) solaris qnx haiku aix
 UNIXs = linux $(BSDs) solaris qnx haiku aix
 LIMIT83fs = go32v2 os2 emx watcom
 LIMIT83fs = go32v2 os2 emx watcom
@@ -1217,6 +1217,13 @@ REQUIRE_PACKAGES_FCL-PROCESS=1
 REQUIRE_PACKAGES_HASH=1
 REQUIRE_PACKAGES_HASH=1
 REQUIRE_PACKAGES_FPMKUNIT=1
 REQUIRE_PACKAGES_FPMKUNIT=1
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_FCL-PROCESS=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_FPMKUNIT=1
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_PASZLIB=1
 REQUIRE_PACKAGES_PASZLIB=1

+ 9 - 2
packages/cdrom/Makefile

@@ -1,8 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2012/04/11]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2012/04/25]
 #
 #
 default: all
 default: all
-MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux
+MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-netbsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux
 BSDs = freebsd netbsd openbsd darwin
 BSDs = freebsd netbsd openbsd darwin
 UNIXs = linux $(BSDs) solaris qnx haiku aix
 UNIXs = linux $(BSDs) solaris qnx haiku aix
 LIMIT83fs = go32v2 os2 emx watcom
 LIMIT83fs = go32v2 os2 emx watcom
@@ -1217,6 +1217,13 @@ REQUIRE_PACKAGES_FCL-PROCESS=1
 REQUIRE_PACKAGES_HASH=1
 REQUIRE_PACKAGES_HASH=1
 REQUIRE_PACKAGES_FPMKUNIT=1
 REQUIRE_PACKAGES_FPMKUNIT=1
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_FCL-PROCESS=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_FPMKUNIT=1
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_PASZLIB=1
 REQUIRE_PACKAGES_PASZLIB=1

+ 13 - 2
packages/cdrom/examples/Makefile

@@ -1,8 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2012/04/11]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2012/04/25]
 #
 #
 default: all
 default: all
-MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux
+MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-netbsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux
 BSDs = freebsd netbsd openbsd darwin
 BSDs = freebsd netbsd openbsd darwin
 UNIXs = linux $(BSDs) solaris qnx haiku aix
 UNIXs = linux $(BSDs) solaris qnx haiku aix
 LIMIT83fs = go32v2 os2 emx watcom
 LIMIT83fs = go32v2 os2 emx watcom
@@ -427,6 +427,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 override TARGET_PROGRAMS+=getdiscid showcds
 override TARGET_PROGRAMS+=getdiscid showcds
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+override TARGET_PROGRAMS+=getdiscid showcds
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 override TARGET_PROGRAMS+=getdiscid showcds
 override TARGET_PROGRAMS+=getdiscid showcds
 endif
 endif
@@ -1453,6 +1456,14 @@ REQUIRE_PACKAGES_HASH=1
 REQUIRE_PACKAGES_FPMKUNIT=1
 REQUIRE_PACKAGES_FPMKUNIT=1
 REQUIRE_PACKAGES_CDROM=1
 REQUIRE_PACKAGES_CDROM=1
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_FCL-PROCESS=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_FPMKUNIT=1
+REQUIRE_PACKAGES_CDROM=1
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_PASZLIB=1
 REQUIRE_PACKAGES_PASZLIB=1

+ 9 - 2
packages/chm/Makefile

@@ -1,8 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2012/04/11]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2012/04/25]
 #
 #
 default: all
 default: all
-MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux
+MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-netbsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux
 BSDs = freebsd netbsd openbsd darwin
 BSDs = freebsd netbsd openbsd darwin
 UNIXs = linux $(BSDs) solaris qnx haiku aix
 UNIXs = linux $(BSDs) solaris qnx haiku aix
 LIMIT83fs = go32v2 os2 emx watcom
 LIMIT83fs = go32v2 os2 emx watcom
@@ -1222,6 +1222,13 @@ REQUIRE_PACKAGES_FCL-PROCESS=1
 REQUIRE_PACKAGES_HASH=1
 REQUIRE_PACKAGES_HASH=1
 REQUIRE_PACKAGES_FPMKUNIT=1
 REQUIRE_PACKAGES_FPMKUNIT=1
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_FCL-PROCESS=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_FPMKUNIT=1
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_PASZLIB=1
 REQUIRE_PACKAGES_PASZLIB=1

+ 9 - 2
packages/cocoaint/Makefile

@@ -1,8 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2012/04/11]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2012/04/25]
 #
 #
 default: all
 default: all
-MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux
+MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-netbsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux
 BSDs = freebsd netbsd openbsd darwin
 BSDs = freebsd netbsd openbsd darwin
 UNIXs = linux $(BSDs) solaris qnx haiku aix
 UNIXs = linux $(BSDs) solaris qnx haiku aix
 LIMIT83fs = go32v2 os2 emx watcom
 LIMIT83fs = go32v2 os2 emx watcom
@@ -1217,6 +1217,13 @@ REQUIRE_PACKAGES_FCL-PROCESS=1
 REQUIRE_PACKAGES_HASH=1
 REQUIRE_PACKAGES_HASH=1
 REQUIRE_PACKAGES_FPMKUNIT=1
 REQUIRE_PACKAGES_FPMKUNIT=1
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_FCL-PROCESS=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_FPMKUNIT=1
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_PASZLIB=1
 REQUIRE_PACKAGES_PASZLIB=1

+ 9 - 2
packages/dblib/Makefile

@@ -1,8 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2012/04/11]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2012/04/25]
 #
 #
 default: all
 default: all
-MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux
+MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-netbsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux
 BSDs = freebsd netbsd openbsd darwin
 BSDs = freebsd netbsd openbsd darwin
 UNIXs = linux $(BSDs) solaris qnx haiku aix
 UNIXs = linux $(BSDs) solaris qnx haiku aix
 LIMIT83fs = go32v2 os2 emx watcom
 LIMIT83fs = go32v2 os2 emx watcom
@@ -1217,6 +1217,13 @@ REQUIRE_PACKAGES_FCL-PROCESS=1
 REQUIRE_PACKAGES_HASH=1
 REQUIRE_PACKAGES_HASH=1
 REQUIRE_PACKAGES_FPMKUNIT=1
 REQUIRE_PACKAGES_FPMKUNIT=1
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_FCL-PROCESS=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_FPMKUNIT=1
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_PASZLIB=1
 REQUIRE_PACKAGES_PASZLIB=1

+ 9 - 2
packages/dbus/Makefile

@@ -1,8 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2012/04/11]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2012/04/25]
 #
 #
 default: all
 default: all
-MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux
+MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-netbsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux
 BSDs = freebsd netbsd openbsd darwin
 BSDs = freebsd netbsd openbsd darwin
 UNIXs = linux $(BSDs) solaris qnx haiku aix
 UNIXs = linux $(BSDs) solaris qnx haiku aix
 LIMIT83fs = go32v2 os2 emx watcom
 LIMIT83fs = go32v2 os2 emx watcom
@@ -1217,6 +1217,13 @@ REQUIRE_PACKAGES_FCL-PROCESS=1
 REQUIRE_PACKAGES_HASH=1
 REQUIRE_PACKAGES_HASH=1
 REQUIRE_PACKAGES_FPMKUNIT=1
 REQUIRE_PACKAGES_FPMKUNIT=1
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_FCL-PROCESS=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_FPMKUNIT=1
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_PASZLIB=1
 REQUIRE_PACKAGES_PASZLIB=1

+ 13 - 2
packages/dbus/examples/Makefile

@@ -1,8 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2012/04/11]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2012/04/25]
 #
 #
 default: all
 default: all
-MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux
+MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-netbsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux
 BSDs = freebsd netbsd openbsd darwin
 BSDs = freebsd netbsd openbsd darwin
 UNIXs = linux $(BSDs) solaris qnx haiku aix
 UNIXs = linux $(BSDs) solaris qnx haiku aix
 LIMIT83fs = go32v2 os2 emx watcom
 LIMIT83fs = go32v2 os2 emx watcom
@@ -427,6 +427,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 override TARGET_PROGRAMS+=busexample
 override TARGET_PROGRAMS+=busexample
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+override TARGET_PROGRAMS+=busexample
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 override TARGET_PROGRAMS+=busexample
 override TARGET_PROGRAMS+=busexample
 endif
 endif
@@ -1453,6 +1456,14 @@ REQUIRE_PACKAGES_HASH=1
 REQUIRE_PACKAGES_FPMKUNIT=1
 REQUIRE_PACKAGES_FPMKUNIT=1
 REQUIRE_PACKAGES_DBUS=1
 REQUIRE_PACKAGES_DBUS=1
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_FCL-PROCESS=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_FPMKUNIT=1
+REQUIRE_PACKAGES_DBUS=1
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_PASZLIB=1
 REQUIRE_PACKAGES_PASZLIB=1

+ 9 - 2
packages/dts/Makefile

@@ -1,8 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2012/04/11]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2012/04/25]
 #
 #
 default: all
 default: all
-MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux
+MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-netbsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux
 BSDs = freebsd netbsd openbsd darwin
 BSDs = freebsd netbsd openbsd darwin
 UNIXs = linux $(BSDs) solaris qnx haiku aix
 UNIXs = linux $(BSDs) solaris qnx haiku aix
 LIMIT83fs = go32v2 os2 emx watcom
 LIMIT83fs = go32v2 os2 emx watcom
@@ -1217,6 +1217,13 @@ REQUIRE_PACKAGES_FCL-PROCESS=1
 REQUIRE_PACKAGES_HASH=1
 REQUIRE_PACKAGES_HASH=1
 REQUIRE_PACKAGES_FPMKUNIT=1
 REQUIRE_PACKAGES_FPMKUNIT=1
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_FCL-PROCESS=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_FPMKUNIT=1
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_PASZLIB=1
 REQUIRE_PACKAGES_PASZLIB=1

+ 9 - 2
packages/fastcgi/Makefile

@@ -1,8 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2012/04/11]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2012/04/25]
 #
 #
 default: all
 default: all
-MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux
+MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-netbsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux
 BSDs = freebsd netbsd openbsd darwin
 BSDs = freebsd netbsd openbsd darwin
 UNIXs = linux $(BSDs) solaris qnx haiku aix
 UNIXs = linux $(BSDs) solaris qnx haiku aix
 LIMIT83fs = go32v2 os2 emx watcom
 LIMIT83fs = go32v2 os2 emx watcom
@@ -1217,6 +1217,13 @@ REQUIRE_PACKAGES_FCL-PROCESS=1
 REQUIRE_PACKAGES_HASH=1
 REQUIRE_PACKAGES_HASH=1
 REQUIRE_PACKAGES_FPMKUNIT=1
 REQUIRE_PACKAGES_FPMKUNIT=1
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_FCL-PROCESS=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_FPMKUNIT=1
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_PASZLIB=1
 REQUIRE_PACKAGES_PASZLIB=1

+ 9 - 2
packages/fcl-async/Makefile

@@ -1,8 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2012/04/11]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2012/04/25]
 #
 #
 default: all
 default: all
-MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux
+MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-netbsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux
 BSDs = freebsd netbsd openbsd darwin
 BSDs = freebsd netbsd openbsd darwin
 UNIXs = linux $(BSDs) solaris qnx haiku aix
 UNIXs = linux $(BSDs) solaris qnx haiku aix
 LIMIT83fs = go32v2 os2 emx watcom
 LIMIT83fs = go32v2 os2 emx watcom
@@ -1217,6 +1217,13 @@ REQUIRE_PACKAGES_FCL-PROCESS=1
 REQUIRE_PACKAGES_HASH=1
 REQUIRE_PACKAGES_HASH=1
 REQUIRE_PACKAGES_FPMKUNIT=1
 REQUIRE_PACKAGES_FPMKUNIT=1
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_FCL-PROCESS=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_FPMKUNIT=1
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_PASZLIB=1
 REQUIRE_PACKAGES_PASZLIB=1

+ 9 - 2
packages/fcl-base/Makefile

@@ -1,8 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2012/04/11]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2012/04/25]
 #
 #
 default: all
 default: all
-MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux
+MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-netbsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux
 BSDs = freebsd netbsd openbsd darwin
 BSDs = freebsd netbsd openbsd darwin
 UNIXs = linux $(BSDs) solaris qnx haiku aix
 UNIXs = linux $(BSDs) solaris qnx haiku aix
 LIMIT83fs = go32v2 os2 emx watcom
 LIMIT83fs = go32v2 os2 emx watcom
@@ -1217,6 +1217,13 @@ REQUIRE_PACKAGES_FCL-PROCESS=1
 REQUIRE_PACKAGES_HASH=1
 REQUIRE_PACKAGES_HASH=1
 REQUIRE_PACKAGES_FPMKUNIT=1
 REQUIRE_PACKAGES_FPMKUNIT=1
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_FCL-PROCESS=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_FPMKUNIT=1
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_PASZLIB=1
 REQUIRE_PACKAGES_PASZLIB=1

+ 21 - 2
packages/fcl-base/examples/Makefile

@@ -1,8 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2012/04/11]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2012/04/25]
 #
 #
 default: all
 default: all
-MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux
+MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-netbsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux
 BSDs = freebsd netbsd openbsd darwin
 BSDs = freebsd netbsd openbsd darwin
 UNIXs = linux $(BSDs) solaris qnx haiku aix
 UNIXs = linux $(BSDs) solaris qnx haiku aix
 LIMIT83fs = go32v2 os2 emx watcom
 LIMIT83fs = go32v2 os2 emx watcom
@@ -427,6 +427,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 override TARGET_PROGRAMS+=stringl dparser fstream mstream list threads testrtf cfgtest xmldump htdump testez tidea b64test b64test2 b64enc b64dec restest testz testz2 istream doecho testol testcont txmlreg testreg tstelcmd testapp testcgi testbs testbf cachetest poolmm1 poolmm2 tarmakercons tarmakerconsgzip avltreetest testmime decodeascii85 encodeascii85  sockcli isockcli dsockcli socksvr isocksvr dsocksvr testhres testnres testsres testrhre testrnre testrsre testur ipcserver ipcclient debugtest dbugsrv asiotest testtimer
 override TARGET_PROGRAMS+=stringl dparser fstream mstream list threads testrtf cfgtest xmldump htdump testez tidea b64test b64test2 b64enc b64dec restest testz testz2 istream doecho testol testcont txmlreg testreg tstelcmd testapp testcgi testbs testbf cachetest poolmm1 poolmm2 tarmakercons tarmakerconsgzip avltreetest testmime decodeascii85 encodeascii85  sockcli isockcli dsockcli socksvr isocksvr dsocksvr testhres testnres testsres testrhre testrnre testrsre testur ipcserver ipcclient debugtest dbugsrv asiotest testtimer
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+override TARGET_PROGRAMS+=stringl dparser fstream mstream list threads testrtf cfgtest xmldump htdump testez tidea b64test b64test2 b64enc b64dec restest testz testz2 istream doecho testol testcont txmlreg testreg tstelcmd testapp testcgi testbs testbf cachetest poolmm1 poolmm2 tarmakercons tarmakerconsgzip avltreetest testmime decodeascii85 encodeascii85
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 override TARGET_PROGRAMS+=stringl dparser fstream mstream list threads testrtf cfgtest xmldump htdump testez tidea b64test b64test2 b64enc b64dec restest testz testz2 istream doecho testol testcont txmlreg testreg tstelcmd testapp testcgi testbs testbf cachetest poolmm1 poolmm2 tarmakercons tarmakerconsgzip avltreetest testmime decodeascii85 encodeascii85  sockcli isockcli dsockcli socksvr isocksvr dsocksvr testhres testnres testsres testrhre testrnre testrsre testur ipcserver ipcclient debugtest dbugsrv asiotest testtimer
 override TARGET_PROGRAMS+=stringl dparser fstream mstream list threads testrtf cfgtest xmldump htdump testez tidea b64test b64test2 b64enc b64dec restest testz testz2 istream doecho testol testcont txmlreg testreg tstelcmd testapp testcgi testbs testbf cachetest poolmm1 poolmm2 tarmakercons tarmakerconsgzip avltreetest testmime decodeascii85 encodeascii85  sockcli isockcli dsockcli socksvr isocksvr dsocksvr testhres testnres testsres testrhre testrnre testrsre testur ipcserver ipcclient debugtest dbugsrv asiotest testtimer
 endif
 endif
@@ -1813,6 +1816,22 @@ REQUIRE_PACKAGES_FCL-REGISTRY=1
 REQUIRE_PACKAGES_FCL-WEB=1
 REQUIRE_PACKAGES_FCL-WEB=1
 REQUIRE_PACKAGES_FCL-XML=1
 REQUIRE_PACKAGES_FCL-XML=1
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_FCL-PROCESS=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_FPMKUNIT=1
+REQUIRE_PACKAGES_FCL-BASE=1
+REQUIRE_PACKAGES_FCL-DB=1
+REQUIRE_PACKAGES_FCL-FPCUNIT=1
+REQUIRE_PACKAGES_FCL-IMAGE=1
+REQUIRE_PACKAGES_FCL-NET=1
+REQUIRE_PACKAGES_FCL-PASSRC=1
+REQUIRE_PACKAGES_FCL-REGISTRY=1
+REQUIRE_PACKAGES_FCL-WEB=1
+REQUIRE_PACKAGES_FCL-XML=1
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_PASZLIB=1
 REQUIRE_PACKAGES_PASZLIB=1

+ 9 - 2
packages/fcl-db/Makefile

@@ -1,8 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2012/04/11]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2012/04/25]
 #
 #
 default: all
 default: all
-MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux
+MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-netbsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux
 BSDs = freebsd netbsd openbsd darwin
 BSDs = freebsd netbsd openbsd darwin
 UNIXs = linux $(BSDs) solaris qnx haiku aix
 UNIXs = linux $(BSDs) solaris qnx haiku aix
 LIMIT83fs = go32v2 os2 emx watcom
 LIMIT83fs = go32v2 os2 emx watcom
@@ -1217,6 +1217,13 @@ REQUIRE_PACKAGES_FCL-PROCESS=1
 REQUIRE_PACKAGES_HASH=1
 REQUIRE_PACKAGES_HASH=1
 REQUIRE_PACKAGES_FPMKUNIT=1
 REQUIRE_PACKAGES_FPMKUNIT=1
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_FCL-PROCESS=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_FPMKUNIT=1
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_PASZLIB=1
 REQUIRE_PACKAGES_PASZLIB=1

+ 23 - 2
packages/fcl-db/src/base/Makefile

@@ -1,8 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2012/04/11]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2012/04/25]
 #
 #
 default: all
 default: all
-MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux
+MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-netbsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux
 BSDs = freebsd netbsd openbsd darwin
 BSDs = freebsd netbsd openbsd darwin
 UNIXs = linux $(BSDs) solaris qnx haiku aix
 UNIXs = linux $(BSDs) solaris qnx haiku aix
 LIMIT83fs = go32v2 os2 emx watcom
 LIMIT83fs = go32v2 os2 emx watcom
@@ -430,6 +430,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 override TARGET_UNITS+=dbconst db dbwhtml bufdataset_parser bufdataset dbcoll sqlscript xmldatapacketreader
 override TARGET_UNITS+=dbconst db dbwhtml bufdataset_parser bufdataset dbcoll sqlscript xmldatapacketreader
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+override TARGET_UNITS+=dbconst db dbwhtml bufdataset_parser bufdataset dbcoll sqlscript xmldatapacketreader
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 override TARGET_UNITS+=dbconst db dbwhtml bufdataset_parser bufdataset dbcoll sqlscript xmldatapacketreader
 override TARGET_UNITS+=dbconst db dbwhtml bufdataset_parser bufdataset dbcoll sqlscript xmldatapacketreader
 endif
 endif
@@ -631,6 +634,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 override TARGET_RSTS+=dbconst dbcoll sqlscript xmldatapacketreader
 override TARGET_RSTS+=dbconst dbcoll sqlscript xmldatapacketreader
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+override TARGET_RSTS+=dbconst dbcoll sqlscript xmldatapacketreader
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 override TARGET_RSTS+=dbconst dbcoll sqlscript xmldatapacketreader
 override TARGET_RSTS+=dbconst dbcoll sqlscript xmldatapacketreader
 endif
 endif
@@ -833,6 +839,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 override COMPILER_OPTIONS+=-S2h
 override COMPILER_OPTIONS+=-S2h
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+override COMPILER_OPTIONS+=-S2h
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 override COMPILER_OPTIONS+=-S2h
 override COMPILER_OPTIONS+=-S2h
 endif
 endif
@@ -1034,6 +1043,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 override COMPILER_UNITDIR+=../dbase
 override COMPILER_UNITDIR+=../dbase
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+override COMPILER_UNITDIR+=../dbase
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 override COMPILER_UNITDIR+=../dbase
 override COMPILER_UNITDIR+=../dbase
 endif
 endif
@@ -2104,6 +2116,15 @@ REQUIRE_PACKAGES_FPMKUNIT=1
 REQUIRE_PACKAGES_FCL-BASE=1
 REQUIRE_PACKAGES_FCL-BASE=1
 REQUIRE_PACKAGES_FCL-XML=1
 REQUIRE_PACKAGES_FCL-XML=1
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_FCL-PROCESS=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_FPMKUNIT=1
+REQUIRE_PACKAGES_FCL-BASE=1
+REQUIRE_PACKAGES_FCL-XML=1
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_PASZLIB=1
 REQUIRE_PACKAGES_PASZLIB=1

+ 65 - 41
packages/fcl-db/src/base/bufdataset.pas

@@ -951,11 +951,14 @@ begin
       PCurRecLinkItem[DblLinkIndex.IndNr].next := PCurRecLinkItem[0].next;
       PCurRecLinkItem[DblLinkIndex.IndNr].next := PCurRecLinkItem[0].next;
       PCurRecLinkItem[DblLinkIndex.IndNr].prior := PCurRecLinkItem[0].prior;
       PCurRecLinkItem[DblLinkIndex.IndNr].prior := PCurRecLinkItem[0].prior;
       end;
       end;
-    end;
+    end
+  else
+    // Empty dataset
+    Exit;
 
 
 // Set FirstRecBuf and FCurrentRecBuf
 // Set FirstRecBuf and FCurrentRecBuf
   DblLinkIndex.FFirstRecBuf:=Index0.FFirstRecBuf;
   DblLinkIndex.FFirstRecBuf:=Index0.FFirstRecBuf;
-  (FCurrentIndex as TDoubleLinkedBufIndex).FCurrentRecBuf:=DblLinkIndex.FFirstRecBuf;
+  DblLinkIndex.FCurrentRecBuf:=DblLinkIndex.FFirstRecBuf;
 // Link in the FLastRecBuf that belongs to this index
 // Link in the FLastRecBuf that belongs to this index
   PCurRecLinkItem[DblLinkIndex.IndNr].next:=DblLinkIndex.FLastRecBuf;
   PCurRecLinkItem[DblLinkIndex.IndNr].next:=DblLinkIndex.FLastRecBuf;
   DblLinkIndex.FLastRecBuf[DblLinkIndex.IndNr].prior:=PCurRecLinkItem;
   DblLinkIndex.FLastRecBuf[DblLinkIndex.IndNr].prior:=PCurRecLinkItem;
@@ -975,7 +978,7 @@ begin
 // of as we finish dealing with them.
 // of as we finish dealing with them.
 
 
   p := DblLinkIndex.FFirstRecBuf;
   p := DblLinkIndex.FFirstRecBuf;
-  DblLinkIndex.ffirstRecBuf := nil;
+  DblLinkIndex.FFirstRecBuf := nil;
   q := p;
   q := p;
   MergeAmount := 0;
   MergeAmount := 0;
 
 
@@ -1079,7 +1082,7 @@ begin
   Result:= True;
   Result:= True;
 end;
 end;
 
 
-function TCustomBufDataset.intAllocRecordBuffer: TRecordBuffer;
+function TCustomBufDataset.IntAllocRecordBuffer: TRecordBuffer;
 begin
 begin
   // Note: Only the internal buffers of TDataset provide bookmark information
   // Note: Only the internal buffers of TDataset provide bookmark information
   result := AllocMem(FRecordsize+sizeof(TBufRecLinkItem)*FMaxIndexesCount);
   result := AllocMem(FRecordsize+sizeof(TBufRecLinkItem)*FMaxIndexesCount);
@@ -1203,7 +1206,7 @@ procedure TCustomBufDataset.InternalLast;
 begin
 begin
   FetchAll;
   FetchAll;
   with FCurrentIndex do
   with FCurrentIndex do
-  SetToLastRecord;
+    SetToLastRecord;
 end;
 end;
 
 
 function TDoubleLinkedBufIndex.GetCurrentRecord: TRecordBuffer;
 function TDoubleLinkedBufIndex.GetCurrentRecord: TRecordBuffer;
@@ -1362,6 +1365,7 @@ procedure TDoubleLinkedBufIndex.InitialiseSpareRecord(const ASpareRecord : TReco
 begin
 begin
   FFirstRecBuf := pointer(ASpareRecord);
   FFirstRecBuf := pointer(ASpareRecord);
   FLastRecBuf := FFirstRecBuf;
   FLastRecBuf := FFirstRecBuf;
+  FLastRecBuf[IndNr].prior:=nil;
   FLastRecBuf[IndNr].next:=FLastRecBuf;
   FLastRecBuf[IndNr].next:=FLastRecBuf;
   FCurrentRecBuf := FLastRecBuf;
   FCurrentRecBuf := FLastRecBuf;
 end;
 end;
@@ -1903,7 +1907,6 @@ end;
 
 
 procedure TCustomBufDataset.InternalDelete;
 procedure TCustomBufDataset.InternalDelete;
 var i         : Integer;
 var i         : Integer;
-    StartInd  : Integer;
     RemRec    : pointer;
     RemRec    : pointer;
     RemRecBookmrk : TBufBookmark;
     RemRecBookmrk : TBufBookmark;
     free_rec: Boolean;
     free_rec: Boolean;
@@ -1913,10 +1916,9 @@ begin
   // Remove the record from all active indexes
   // Remove the record from all active indexes
   FCurrentIndex.StoreCurrentRecIntoBookmark(@RemRecBookmrk);
   FCurrentIndex.StoreCurrentRecIntoBookmark(@RemRecBookmrk);
   RemRec := FCurrentIndex.CurrentBuffer;
   RemRec := FCurrentIndex.CurrentBuffer;
-  FIndexes[0].RemoveRecordFromIndex(RemRecBookmrk);
-  if FCurrentIndex=FIndexes[1] then StartInd := 1 else StartInd := 2;
-  for i := StartInd to FIndexesCount-1 do
-    findexes[i].RemoveRecordFromIndex(RemRecBookmrk);
+  for i := 0 to FIndexesCount-1 do
+    if (i<>1) or (FCurrentIndex=FIndexes[i]) then
+      FIndexes[i].RemoveRecordFromIndex(RemRecBookmrk);
 
 
   if not GetActiveRecordUpdateBuffer then
   if not GetActiveRecordUpdateBuffer then
     begin
     begin
@@ -2153,10 +2155,11 @@ end;
 
 
 procedure TCustomBufDataset.InternalPost;
 procedure TCustomBufDataset.InternalPost;
 
 
-Var CurrBuff     :  TRecordBuffer;
+Var ABuff        : TRecordBuffer;
     i            : integer;
     i            : integer;
     blobbuf      : tbufblobfield;
     blobbuf      : tbufblobfield;
     NullMask     : pbyte;
     NullMask     : pbyte;
+    ABookmark    : PBufBookmark;
 
 
 begin
 begin
   inherited InternalPost;
   inherited InternalPost;
@@ -2164,43 +2167,48 @@ begin
    if assigned(FUpdateBlobBuffers[i]) and (FUpdateBlobBuffers[i]^.FieldNo>0) then
    if assigned(FUpdateBlobBuffers[i]) and (FUpdateBlobBuffers[i]^.FieldNo>0) then
     begin
     begin
     blobbuf.BlobBuffer := FUpdateBlobBuffers[i];
     blobbuf.BlobBuffer := FUpdateBlobBuffers[i];
-    CurrBuff := ActiveBuffer;
-    NullMask := pbyte(CurrBuff);
+    ABuff := ActiveBuffer;
+    NullMask := PByte(ABuff);
 
 
-    inc(CurrBuff,FFieldBufPositions[FUpdateBlobBuffers[i]^.FieldNo-1]);
-    Move(blobbuf, CurrBuff^, GetFieldSize(FieldDefs[FUpdateBlobBuffers[i]^.FieldNo-1]));
+    inc(ABuff,FFieldBufPositions[FUpdateBlobBuffers[i]^.FieldNo-1]);
+    Move(blobbuf, ABuff^, GetFieldSize(FieldDefs[FUpdateBlobBuffers[i]^.FieldNo-1]));
     unSetFieldIsNull(NullMask,FUpdateBlobBuffers[i]^.FieldNo-1);
     unSetFieldIsNull(NullMask,FUpdateBlobBuffers[i]^.FieldNo-1);
     
     
     FUpdateBlobBuffers[i]^.FieldNo := -1;
     FUpdateBlobBuffers[i]^.FieldNo := -1;
     end;
     end;
 
 
-  if state = dsInsert then
+  if State = dsInsert then
     begin
     begin
-    if GetBookmarkFlag(ActiveBuffer) = bfEOF then
-      FIndexes[0].ScrollLast
-    else
-      // The active buffer is the newly created TDataset record,
-      // from which the bookmark is set to the record where the new record should be
-      // inserted
-      InternalSetToRecord(ActiveBuffer);
-
-    with FIndexes[0] do
+    // The active buffer is the newly created TDataset record,
+    // from which the bookmark is set to the record where the new record should be
+    // inserted
+    ABookmark := PBufBookmark(ActiveBuffer + FRecordSize);
+    // Create the new record buffer
+    ABuff := IntAllocRecordBuffer;
+
+    // Add new record to all active indexes
+    for i := 0 to FIndexesCount-1 do
+      if (i<>1) or (FIndexes[i]=FCurrentIndex) then
       begin
       begin
-      // Create the new record buffer
-      FCurrentIndex.InsertRecordBeforeCurrentRecord(IntAllocRecordBuffer);
-      ScrollBackward;
-      // Add the record to the other indexes
-      for i := 1 to FIndexesCount-1 do if ((i>1) or (FIndexes[i]=FCurrentIndex)) then
-        FIndexes[i].InsertRecordBeforeCurrentRecord(CurrentRecord);
+        if ABookmark^.BookmarkFlag = bfEOF then
+          // append (at end)
+          FIndexes[i].ScrollLast
+        else
+          // insert (before current record)
+          FIndexes[i].GotoBookmark(ABookmark);
+
+        FIndexes[i].InsertRecordBeforeCurrentRecord(ABuff);
+        // new inserted record becomes current record
+        FIndexes[i].ScrollBackward;
       end;
       end;
 
 
     // Link the newly created record buffer to the newly created TDataset record
     // Link the newly created record buffer to the newly created TDataset record
-    with PBufBookmark(ActiveBuffer + FRecordSize)^ do
+    with ABookmark^ do
       begin
       begin
       FCurrentIndex.StoreCurrentRecIntoBookmark(@BookmarkData);
       FCurrentIndex.StoreCurrentRecIntoBookmark(@BookmarkData);
       BookmarkFlag := bfInserted;
       BookmarkFlag := bfInserted;
       end;
       end;
-      
+
     inc(FBRecordCount);
     inc(FBRecordCount);
     end
     end
   else
   else
@@ -2683,18 +2691,35 @@ end;
 procedure TCustomBufDataset.CreateDataset;
 procedure TCustomBufDataset.CreateDataset;
 begin
 begin
   CheckInactive;
   CheckInactive;
-  CreateFields;
+  if not ((FieldCount=0) or (FieldDefs.Count=0)) then
+    begin
+    Open;
+    Exit;
+    end;
+  if (FieldDefs.Count>0) then
+    begin
+    CreateFields;
+    Open;
+    end
+  else if (fields.Count>0) then
+    begin
+    InitFieldDefsFromfields;
+    BindFields(True);
+    Open;
+    end
+  else
+    raise Exception.Create(SErrNoFieldsDefined);
 end;
 end;
 
 
 function TCustomBufDataset.BookmarkValid(ABookmark: TBookmark): Boolean;
 function TCustomBufDataset.BookmarkValid(ABookmark: TBookmark): Boolean;
 begin
 begin
-  Result:=assigned(FCurrentIndex) and  FCurrentIndex.BookmarkValid(ABookmark);
+  Result:=assigned(FCurrentIndex) and  FCurrentIndex.BookmarkValid(pointer(ABookmark));
 end;
 end;
 
 
 function TCustomBufDataset.CompareBookmarks(Bookmark1, Bookmark2: TBookmark
 function TCustomBufDataset.CompareBookmarks(Bookmark1, Bookmark2: TBookmark
   ): Longint;
   ): Longint;
 begin
 begin
-  if Assigned(FCurrentIndex) and FCurrentIndex.CompareBookmarks(Bookmark1,Bookmark2) then
+  if Assigned(FCurrentIndex) and FCurrentIndex.CompareBookmarks(pointer(Bookmark1),pointer(Bookmark2)) then
     Result := 0
     Result := 0
   else
   else
     Result := -1;
     Result := -1;
@@ -2845,9 +2870,7 @@ begin
 
 
   if Active then
   if Active then
     begin
     begin
-    (FIndexes[FIndexesCount-1] as TDoubleLinkedBufIndex).FFirstRecBuf := pointer(IntAllocRecordBuffer);
-    (FIndexes[FIndexesCount-1] as TDoubleLinkedBufIndex).FLastRecBuf := (FIndexes[FIndexesCount-1] as TDoubleLinkedBufIndex).FFirstRecBuf;
-    (FCurrentIndex as TDoubleLinkedBufIndex).FCurrentRecBuf := (FIndexes[FIndexesCount-1] as TDoubleLinkedBufIndex).FLastRecBuf;
+    FIndexes[FIndexesCount-1].InitialiseSpareRecord(IntAllocRecordBuffer);
     BuildIndex(FIndexes[FIndexesCount-1]);
     BuildIndex(FIndexes[FIndexesCount-1]);
     end
     end
   else if FIndexesCount>FMaxIndexesCount then
   else if FIndexesCount>FMaxIndexesCount then
@@ -2897,6 +2920,8 @@ end;
 procedure TCustomBufDataset.InternalRefresh;
 procedure TCustomBufDataset.InternalRefresh;
 var StoreDefaultFields: boolean;
 var StoreDefaultFields: boolean;
 begin
 begin
+  if length(FUpdateBuffer)>0 then
+    DatabaseError(SErrApplyUpdBeforeRefresh);
   StoreDefaultFields:=DefaultFields;
   StoreDefaultFields:=DefaultFields;
   SetDefaultFields(False);
   SetDefaultFields(False);
   FreeFieldBuffers;
   FreeFieldBuffers;
@@ -3026,9 +3051,8 @@ begin
   end;
   end;
 
 
   // Set The filter-buffer
   // Set The filter-buffer
-  StoreDSState:=State;
+  StoreDSState:=SetTempState(dsFilter);
   FFilterBuffer:=FCurrentIndex.SpareBuffer;
   FFilterBuffer:=FCurrentIndex.SpareBuffer;
-  SetTempState(dsFilter);
   SetFieldValues(keyfields,KeyValues);
   SetFieldValues(keyfields,KeyValues);
   CurrLinkItem := (FCurrentIndex as TDoubleLinkedBufIndex).FFirstRecBuf;
   CurrLinkItem := (FCurrentIndex as TDoubleLinkedBufIndex).FFirstRecBuf;
   FilterBuffer:=IntAllocRecordBuffer;
   FilterBuffer:=IntAllocRecordBuffer;

+ 14 - 4
packages/fcl-db/src/base/dataset.inc

@@ -1311,6 +1311,10 @@ begin
   FFiltered := value;
   FFiltered := value;
 end;
 end;
 
 
+procedure TDataSet.SetFound(const Value: Boolean);
+begin
+  FFound := Value;
+end;
 
 
 Procedure TDataset.SetModified(Value: Boolean);
 Procedure TDataset.SetModified(Value: Boolean);
 
 
@@ -1786,7 +1790,9 @@ Procedure TDataset.FreeBookmark(ABookmark: TBookmark);
 
 
 
 
 begin
 begin
-  FreeMem(ABookMark,FBookMarkSize);
+  {$ifdef noautomatedbookmark}
+   FreeMem(ABookMark,FBookMarkSize);
+  {$endif}
 end;
 end;
 
 
 Function TDataset.GetBookmark: TBookmark;
 Function TDataset.GetBookmark: TBookmark;
@@ -1795,8 +1801,12 @@ Function TDataset.GetBookmark: TBookmark;
 begin
 begin
   if BookmarkAvailable then
   if BookmarkAvailable then
     begin
     begin
-    GetMem (Result,FBookMarkSize);
-    GetBookMarkdata(ActiveBuffer,Result);
+    {$ifdef noautomatedbookmark}
+      GetMem (Result,FBookMarkSize);
+    {$else}
+      setlength(Result,FBookMarkSize);
+    {$endif}
+    GetBookMarkdata(ActiveBuffer,pointer(Result));
     end
     end
   else
   else
     Result:=Nil;
     Result:=Nil;
@@ -1855,7 +1865,7 @@ begin
     begin
     begin
     CheckBrowseMode;
     CheckBrowseMode;
     DoBeforeScroll;
     DoBeforeScroll;
-    InternalGotoBookMark(ABookMark);
+    InternalGotoBookMark(pointer(ABookMark));
     Resync([rmExact,rmCenter]);
     Resync([rmExact,rmCenter]);
     DoAfterScroll;
     DoAfterScroll;
     end;
     end;

+ 7 - 2
packages/fcl-db/src/base/db.pas

@@ -1243,9 +1243,13 @@ type
   end;
   end;
 
 
 { TDataSet }
 { TDataSet }
-
+  
+  {$ifdef noautomatedbookmark}
   TBookmark = Pointer;
   TBookmark = Pointer;
-  TBookmarkStr = string;
+  {$else}
+  TBookMark = TBytes;
+  {$endif}
+  TBookmarkStr = ansistring;
 
 
   PBookmarkFlag = ^TBookmarkFlag;
   PBookmarkFlag = ^TBookmarkFlag;
   TBookmarkFlag = (bfCurrent, bfBOF, bfEOF, bfInserted);
   TBookmarkFlag = (bfCurrent, bfBOF, bfEOF, bfInserted);
@@ -1487,6 +1491,7 @@ type
     procedure SetFilterOptions(Value: TFilterOptions); virtual;
     procedure SetFilterOptions(Value: TFilterOptions); virtual;
     procedure SetFilterText(const Value: string); virtual;
     procedure SetFilterText(const Value: string); virtual;
     procedure SetFieldValues(const fieldname: string; Value: Variant); virtual;
     procedure SetFieldValues(const fieldname: string; Value: Variant); virtual;
+    procedure SetFound(const Value: Boolean); virtual;
     procedure SetModified(Value: Boolean);
     procedure SetModified(Value: Boolean);
     procedure SetName(const Value: TComponentName); override;
     procedure SetName(const Value: TComponentName); override;
     procedure SetOnFilterRecord(const Value: TFilterRecordEvent); virtual;
     procedure SetOnFilterRecord(const Value: TFilterRecordEvent); virtual;

+ 2 - 0
packages/fcl-db/src/base/dbconst.pas

@@ -109,6 +109,8 @@ Resourcestring
   SRollingBack             = 'Rolling back transaction';
   SRollingBack             = 'Rolling back transaction';
   SCommitRetaining         = 'Commit and retaining transaction';
   SCommitRetaining         = 'Commit and retaining transaction';
   SRollBackRetaining       = 'Rollback and retaining transaction';
   SRollBackRetaining       = 'Rollback and retaining transaction';
+  SErrNoFieldsDefined      = 'Can not create a dataset when there are no fielddefinitions or fields defined';
+  SErrApplyUpdBeforeRefresh= 'Must apply updates before refreshing data';
 
 
 Implementation
 Implementation
 
 

+ 6 - 1
packages/fcl-db/src/base/fields.inc

@@ -1752,7 +1752,12 @@ end;
 Procedure TAutoIncField.SetAsLongint(AValue : Longint);
 Procedure TAutoIncField.SetAsLongint(AValue : Longint);
 
 
 begin
 begin
-  DataBaseError(SCantSetAutoIncfields);
+  // Some databases allows insertion of explicit values into identity columns
+  // (some of them also allows (some not) updating identity columns)
+  // So allow it at client side and leave check for server side
+  if not(FDataSet.State in [dsFilter,dsSetKey,dsInsert]) then
+    DataBaseError(SCantSetAutoIncFields);
+  inherited;
 end;
 end;
 
 
 { TFloatField }
 { TFloatField }

+ 19 - 2
packages/fcl-db/src/codegen/Makefile

@@ -1,8 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2012/04/11]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2012/04/25]
 #
 #
 default: all
 default: all
-MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux
+MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-netbsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux
 BSDs = freebsd netbsd openbsd darwin
 BSDs = freebsd netbsd openbsd darwin
 UNIXs = linux $(BSDs) solaris qnx haiku aix
 UNIXs = linux $(BSDs) solaris qnx haiku aix
 LIMIT83fs = go32v2 os2 emx watcom
 LIMIT83fs = go32v2 os2 emx watcom
@@ -429,6 +429,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 override TARGET_UNITS+=fpddcodegen fpcgcreatedbf fpcgdbcoll fpcgsqlconst fpcgtiopf fpddpopcode
 override TARGET_UNITS+=fpddcodegen fpcgcreatedbf fpcgdbcoll fpcgsqlconst fpcgtiopf fpddpopcode
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+override TARGET_UNITS+=fpddcodegen fpcgcreatedbf fpcgdbcoll fpcgsqlconst fpcgtiopf fpddpopcode
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 override TARGET_UNITS+=fpddcodegen fpcgcreatedbf fpcgdbcoll fpcgsqlconst fpcgtiopf fpddpopcode
 override TARGET_UNITS+=fpddcodegen fpcgcreatedbf fpcgdbcoll fpcgsqlconst fpcgtiopf fpddpopcode
 endif
 endif
@@ -630,6 +633,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 override TARGET_RSTS+=fpddcodegen fpcgsqlconst fpddpopcode
 override TARGET_RSTS+=fpddcodegen fpcgsqlconst fpddpopcode
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+override TARGET_RSTS+=fpddcodegen fpcgsqlconst fpddpopcode
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 override TARGET_RSTS+=fpddcodegen fpcgsqlconst fpddpopcode
 override TARGET_RSTS+=fpddcodegen fpcgsqlconst fpddpopcode
 endif
 endif
@@ -832,6 +838,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 override COMPILER_OPTIONS+=-S2h
 override COMPILER_OPTIONS+=-S2h
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+override COMPILER_OPTIONS+=-S2h
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 override COMPILER_OPTIONS+=-S2h
 override COMPILER_OPTIONS+=-S2h
 endif
 endif
@@ -1857,6 +1866,14 @@ REQUIRE_PACKAGES_HASH=1
 REQUIRE_PACKAGES_FPMKUNIT=1
 REQUIRE_PACKAGES_FPMKUNIT=1
 REQUIRE_PACKAGES_FCL-BASE=1
 REQUIRE_PACKAGES_FCL-BASE=1
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_FCL-PROCESS=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_FPMKUNIT=1
+REQUIRE_PACKAGES_FCL-BASE=1
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_PASZLIB=1
 REQUIRE_PACKAGES_PASZLIB=1

+ 26 - 2
packages/fcl-db/src/datadict/Makefile

@@ -1,8 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2012/04/11]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2012/04/25]
 #
 #
 default: all
 default: all
-MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux
+MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-netbsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux
 BSDs = freebsd netbsd openbsd darwin
 BSDs = freebsd netbsd openbsd darwin
 UNIXs = linux $(BSDs) solaris qnx haiku aix
 UNIXs = linux $(BSDs) solaris qnx haiku aix
 LIMIT83fs = go32v2 os2 emx watcom
 LIMIT83fs = go32v2 os2 emx watcom
@@ -429,6 +429,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 override TARGET_UNITS+=fpdatadict fpdddiff fpdddbf fpddsqldb  fpddfb fpddmysql40 fpddmysql41 fpddmysql50 fpddodbc fpddpq fpddoracle fpddsqlite3 fpddregstd
 override TARGET_UNITS+=fpdatadict fpdddiff fpdddbf fpddsqldb  fpddfb fpddmysql40 fpddmysql41 fpddmysql50 fpddodbc fpddpq fpddoracle fpddsqlite3 fpddregstd
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+override TARGET_UNITS+=fpdatadict fpdddiff fpdddbf fpddsqldb  fpddfb fpddmysql40 fpddmysql41 fpddmysql50 fpddodbc fpddpq fpddoracle fpddsqlite3 fpddregstd
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 override TARGET_UNITS+=fpdatadict fpdddiff fpdddbf fpddsqldb
 override TARGET_UNITS+=fpdatadict fpdddiff fpdddbf fpddsqldb
 endif
 endif
@@ -630,6 +633,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 override TARGET_RSTS+=fpdatadict fpddfb fpddsqldb fpdddiff  fpddfb fpddmysql40 fpddmysql41 fpddmysql50 fpddodbc fpddpq fpddoracle fpddsqlite3 fpddregstd
 override TARGET_RSTS+=fpdatadict fpddfb fpddsqldb fpdddiff  fpddfb fpddmysql40 fpddmysql41 fpddmysql50 fpddodbc fpddpq fpddoracle fpddsqlite3 fpddregstd
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+override TARGET_RSTS+=fpdatadict fpddfb fpddsqldb fpdddiff  fpddfb fpddmysql40 fpddmysql41 fpddmysql50 fpddodbc fpddpq fpddoracle fpddsqlite3 fpddregstd
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 override TARGET_RSTS+=fpdatadict fpddfb fpddsqldb fpdddiff
 override TARGET_RSTS+=fpdatadict fpddfb fpddsqldb fpdddiff
 endif
 endif
@@ -832,6 +838,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 override COMPILER_OPTIONS+=-S2h
 override COMPILER_OPTIONS+=-S2h
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+override COMPILER_OPTIONS+=-S2h
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 override COMPILER_OPTIONS+=-S2h
 override COMPILER_OPTIONS+=-S2h
 endif
 endif
@@ -2022,6 +2031,21 @@ REQUIRE_PACKAGES_SQLITE=1
 REQUIRE_PACKAGES_ODBC=1
 REQUIRE_PACKAGES_ODBC=1
 REQUIRE_PACKAGES_POSTGRES=1
 REQUIRE_PACKAGES_POSTGRES=1
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_FCL-PROCESS=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_FPMKUNIT=1
+REQUIRE_PACKAGES_FCL-BASE=1
+REQUIRE_PACKAGES_FCL-XML=1
+REQUIRE_PACKAGES_IBASE=1
+REQUIRE_PACKAGES_MYSQL=1
+REQUIRE_PACKAGES_ORACLE=1
+REQUIRE_PACKAGES_SQLITE=1
+REQUIRE_PACKAGES_ODBC=1
+REQUIRE_PACKAGES_POSTGRES=1
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_PASZLIB=1
 REQUIRE_PACKAGES_PASZLIB=1

+ 25 - 2
packages/fcl-db/src/dbase/Makefile

@@ -1,8 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2012/04/11]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2012/04/25]
 #
 #
 default: all
 default: all
-MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux
+MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-netbsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux
 BSDs = freebsd netbsd openbsd darwin
 BSDs = freebsd netbsd openbsd darwin
 UNIXs = linux $(BSDs) solaris qnx haiku aix
 UNIXs = linux $(BSDs) solaris qnx haiku aix
 LIMIT83fs = go32v2 os2 emx watcom
 LIMIT83fs = go32v2 os2 emx watcom
@@ -437,6 +437,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 override TARGET_UNITS+=dbf
 override TARGET_UNITS+=dbf
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+override TARGET_UNITS+=dbf
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 override TARGET_UNITS+=dbf
 override TARGET_UNITS+=dbf
 endif
 endif
@@ -638,6 +641,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 override TARGET_EXAMPLES+=testdbf
 override TARGET_EXAMPLES+=testdbf
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+override TARGET_EXAMPLES+=testdbf
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 override TARGET_EXAMPLES+=testdbf
 override TARGET_EXAMPLES+=testdbf
 endif
 endif
@@ -839,6 +845,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 override CLEAN_UNITS+=dbf_collate dbf_common dbf_cursor dbf_dbffile dbf_fields dbf_idxcur dbf_idxfile dbf_lang dbf_memo dbf_parser dbf_pgfile dbf_prscore dbf_prsdef dbf_prssupp dbf_str
 override CLEAN_UNITS+=dbf_collate dbf_common dbf_cursor dbf_dbffile dbf_fields dbf_idxcur dbf_idxfile dbf_lang dbf_memo dbf_parser dbf_pgfile dbf_prscore dbf_prsdef dbf_prssupp dbf_str
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+override CLEAN_UNITS+=dbf_collate dbf_common dbf_cursor dbf_dbffile dbf_fields dbf_idxcur dbf_idxfile dbf_lang dbf_memo dbf_parser dbf_pgfile dbf_prscore dbf_prsdef dbf_prssupp dbf_str
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 override CLEAN_UNITS+=dbf_collate dbf_common dbf_cursor dbf_dbffile dbf_fields dbf_idxcur dbf_idxfile dbf_lang dbf_memo dbf_parser dbf_pgfile dbf_prscore dbf_prsdef dbf_prssupp dbf_str
 override CLEAN_UNITS+=dbf_collate dbf_common dbf_cursor dbf_dbffile dbf_fields dbf_idxcur dbf_idxfile dbf_lang dbf_memo dbf_parser dbf_pgfile dbf_prscore dbf_prsdef dbf_prssupp dbf_str
 endif
 endif
@@ -1040,6 +1049,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 override INSTALL_UNITS+=dbf_collate dbf_common dbf_cursor dbf_dbffile dbf_fields dbf_idxcur dbf_idxfile dbf_lang dbf_memo dbf_parser dbf_pgfile dbf_prscore dbf_prsdef dbf_prssupp dbf_str
 override INSTALL_UNITS+=dbf_collate dbf_common dbf_cursor dbf_dbffile dbf_fields dbf_idxcur dbf_idxfile dbf_lang dbf_memo dbf_parser dbf_pgfile dbf_prscore dbf_prsdef dbf_prssupp dbf_str
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+override INSTALL_UNITS+=dbf_collate dbf_common dbf_cursor dbf_dbffile dbf_fields dbf_idxcur dbf_idxfile dbf_lang dbf_memo dbf_parser dbf_pgfile dbf_prscore dbf_prsdef dbf_prssupp dbf_str
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 override INSTALL_UNITS+=dbf_collate dbf_common dbf_cursor dbf_dbffile dbf_fields dbf_idxcur dbf_idxfile dbf_lang dbf_memo dbf_parser dbf_pgfile dbf_prscore dbf_prsdef dbf_prssupp dbf_str
 override INSTALL_UNITS+=dbf_collate dbf_common dbf_cursor dbf_dbffile dbf_fields dbf_idxcur dbf_idxfile dbf_lang dbf_memo dbf_parser dbf_pgfile dbf_prscore dbf_prsdef dbf_prssupp dbf_str
 endif
 endif
@@ -1242,6 +1254,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 override COMPILER_OPTIONS+=-S2 -Sh
 override COMPILER_OPTIONS+=-S2 -Sh
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+override COMPILER_OPTIONS+=-S2 -Sh
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 override COMPILER_OPTIONS+=-S2 -Sh
 override COMPILER_OPTIONS+=-S2 -Sh
 endif
 endif
@@ -2267,6 +2282,14 @@ REQUIRE_PACKAGES_HASH=1
 REQUIRE_PACKAGES_FPMKUNIT=1
 REQUIRE_PACKAGES_FPMKUNIT=1
 REQUIRE_PACKAGES_FCL-BASE=1
 REQUIRE_PACKAGES_FCL-BASE=1
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_FCL-PROCESS=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_FPMKUNIT=1
+REQUIRE_PACKAGES_FCL-BASE=1
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_PASZLIB=1
 REQUIRE_PACKAGES_PASZLIB=1

+ 20 - 2
packages/fcl-db/src/export/Makefile

@@ -1,8 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2012/04/11]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2012/04/25]
 #
 #
 default: all
 default: all
-MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux
+MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-netbsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux
 BSDs = freebsd netbsd openbsd darwin
 BSDs = freebsd netbsd openbsd darwin
 UNIXs = linux $(BSDs) solaris qnx haiku aix
 UNIXs = linux $(BSDs) solaris qnx haiku aix
 LIMIT83fs = go32v2 os2 emx watcom
 LIMIT83fs = go32v2 os2 emx watcom
@@ -429,6 +429,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 override TARGET_UNITS+=fpdbexport fpcsvexport fpfixedexport fpsqlexport fpsimplexmlexport fpsimplejsonexport fpdbfexport fptexexport fprtfexport fpxmlxsdexport fpstdexports
 override TARGET_UNITS+=fpdbexport fpcsvexport fpfixedexport fpsqlexport fpsimplexmlexport fpsimplejsonexport fpdbfexport fptexexport fprtfexport fpxmlxsdexport fpstdexports
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+override TARGET_UNITS+=fpdbexport fpcsvexport fpfixedexport fpsqlexport fpsimplexmlexport fpsimplejsonexport fpdbfexport fptexexport fprtfexport fpxmlxsdexport fpstdexports
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 override TARGET_UNITS+=fpdbexport fpcsvexport fpfixedexport fpsqlexport fpsimplexmlexport fpsimplejsonexport fpdbfexport fptexexport fprtfexport fpxmlxsdexport fpstdexports
 override TARGET_UNITS+=fpdbexport fpcsvexport fpfixedexport fpsqlexport fpsimplexmlexport fpsimplejsonexport fpdbfexport fptexexport fprtfexport fpxmlxsdexport fpstdexports
 endif
 endif
@@ -630,6 +633,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 override TARGET_RSTS+=fpdbexport fpcsvexport fpfixedexport fpsqlexport fpsimplexmlexport fpsimplejsonexport fpdbfexport fptexexport fprtfexport fpxmlxsdexport fpstdexports
 override TARGET_RSTS+=fpdbexport fpcsvexport fpfixedexport fpsqlexport fpsimplexmlexport fpsimplejsonexport fpdbfexport fptexexport fprtfexport fpxmlxsdexport fpstdexports
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+override TARGET_RSTS+=fpdbexport fpcsvexport fpfixedexport fpsqlexport fpsimplexmlexport fpsimplejsonexport fpdbfexport fptexexport fprtfexport fpxmlxsdexport fpstdexports
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 override TARGET_RSTS+=fpdbexport fpcsvexport fpfixedexport fpsqlexport fpsimplexmlexport fpsimplejsonexport fpdbfexport fptexexport fprtfexport fpxmlxsdexport fpstdexports
 override TARGET_RSTS+=fpdbexport fpcsvexport fpfixedexport fpsqlexport fpsimplexmlexport fpsimplejsonexport fpdbfexport fptexexport fprtfexport fpxmlxsdexport fpstdexports
 endif
 endif
@@ -832,6 +838,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 override COMPILER_OPTIONS+=-S2h
 override COMPILER_OPTIONS+=-S2h
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+override COMPILER_OPTIONS+=-S2h
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 override COMPILER_OPTIONS+=-S2h
 override COMPILER_OPTIONS+=-S2h
 endif
 endif
@@ -1902,6 +1911,15 @@ REQUIRE_PACKAGES_FPMKUNIT=1
 REQUIRE_PACKAGES_FCL-BASE=1
 REQUIRE_PACKAGES_FCL-BASE=1
 REQUIRE_PACKAGES_FCL-XML=1
 REQUIRE_PACKAGES_FCL-XML=1
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_FCL-PROCESS=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_FPMKUNIT=1
+REQUIRE_PACKAGES_FCL-BASE=1
+REQUIRE_PACKAGES_FCL-XML=1
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_PASZLIB=1
 REQUIRE_PACKAGES_PASZLIB=1

+ 14 - 2
packages/fcl-db/src/json/Makefile

@@ -1,8 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2012/04/11]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2012/04/25]
 #
 #
 default: all
 default: all
-MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux
+MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-netbsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux
 BSDs = freebsd netbsd openbsd darwin
 BSDs = freebsd netbsd openbsd darwin
 UNIXs = linux $(BSDs) solaris qnx haiku aix
 UNIXs = linux $(BSDs) solaris qnx haiku aix
 LIMIT83fs = go32v2 os2 emx watcom
 LIMIT83fs = go32v2 os2 emx watcom
@@ -429,6 +429,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 override TARGET_UNITS+=fpjsondataset
 override TARGET_UNITS+=fpjsondataset
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+override TARGET_UNITS+=fpjsondataset
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 override TARGET_UNITS+=fpjsondataset
 override TARGET_UNITS+=fpjsondataset
 endif
 endif
@@ -1500,6 +1503,15 @@ REQUIRE_PACKAGES_FPMKUNIT=1
 REQUIRE_PACKAGES_FCL-BASE=1
 REQUIRE_PACKAGES_FCL-BASE=1
 REQUIRE_PACKAGES_FCL-JSON=1
 REQUIRE_PACKAGES_FCL-JSON=1
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_FCL-PROCESS=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_FPMKUNIT=1
+REQUIRE_PACKAGES_FCL-BASE=1
+REQUIRE_PACKAGES_FCL-JSON=1
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_PASZLIB=1
 REQUIRE_PACKAGES_PASZLIB=1

+ 19 - 2
packages/fcl-db/src/memds/Makefile

@@ -1,8 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2012/04/11]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2012/04/25]
 #
 #
 default: all
 default: all
-MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux
+MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-netbsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux
 BSDs = freebsd netbsd openbsd darwin
 BSDs = freebsd netbsd openbsd darwin
 UNIXs = linux $(BSDs) solaris qnx haiku aix
 UNIXs = linux $(BSDs) solaris qnx haiku aix
 LIMIT83fs = go32v2 os2 emx watcom
 LIMIT83fs = go32v2 os2 emx watcom
@@ -429,6 +429,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 override TARGET_UNITS+=memds
 override TARGET_UNITS+=memds
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+override TARGET_UNITS+=memds
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 override TARGET_UNITS+=memds
 override TARGET_UNITS+=memds
 endif
 endif
@@ -630,6 +633,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 override TARGET_RSTS+=memds
 override TARGET_RSTS+=memds
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+override TARGET_RSTS+=memds
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 override TARGET_RSTS+=memds
 override TARGET_RSTS+=memds
 endif
 endif
@@ -831,6 +837,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 override TARGET_EXAMPLES+=testpop testopen testld testcp
 override TARGET_EXAMPLES+=testpop testopen testld testcp
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+override TARGET_EXAMPLES+=testpop testopen testld testcp
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 override TARGET_EXAMPLES+=testpop testopen testld testcp
 override TARGET_EXAMPLES+=testpop testopen testld testcp
 endif
 endif
@@ -1857,6 +1866,14 @@ REQUIRE_PACKAGES_HASH=1
 REQUIRE_PACKAGES_FPMKUNIT=1
 REQUIRE_PACKAGES_FPMKUNIT=1
 REQUIRE_PACKAGES_FCL-BASE=1
 REQUIRE_PACKAGES_FCL-BASE=1
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_FCL-PROCESS=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_FPMKUNIT=1
+REQUIRE_PACKAGES_FCL-BASE=1
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_PASZLIB=1
 REQUIRE_PACKAGES_PASZLIB=1

+ 17 - 2
packages/fcl-db/src/paradox/Makefile

@@ -1,8 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2012/04/11]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2012/04/25]
 #
 #
 default: all
 default: all
-MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux
+MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-netbsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux
 BSDs = freebsd netbsd openbsd darwin
 BSDs = freebsd netbsd openbsd darwin
 UNIXs = linux $(BSDs) solaris qnx haiku aix
 UNIXs = linux $(BSDs) solaris qnx haiku aix
 LIMIT83fs = go32v2 os2 emx watcom
 LIMIT83fs = go32v2 os2 emx watcom
@@ -429,6 +429,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 override TARGET_UNITS+=paradox
 override TARGET_UNITS+=paradox
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+override TARGET_UNITS+=paradox
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 override TARGET_UNITS+=paradox
 override TARGET_UNITS+=paradox
 endif
 endif
@@ -630,6 +633,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 override TARGET_RSTS+=paradox
 override TARGET_RSTS+=paradox
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+override TARGET_RSTS+=paradox
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 override TARGET_RSTS+=paradox
 override TARGET_RSTS+=paradox
 endif
 endif
@@ -1701,6 +1707,15 @@ REQUIRE_PACKAGES_FPMKUNIT=1
 REQUIRE_PACKAGES_PXLIB=1
 REQUIRE_PACKAGES_PXLIB=1
 REQUIRE_PACKAGES_FCL-BASE=1
 REQUIRE_PACKAGES_FCL-BASE=1
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_FCL-PROCESS=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_FPMKUNIT=1
+REQUIRE_PACKAGES_PXLIB=1
+REQUIRE_PACKAGES_FCL-BASE=1
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_PASZLIB=1
 REQUIRE_PACKAGES_PASZLIB=1

+ 16 - 2
packages/fcl-db/src/sdf/Makefile

@@ -1,8 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2012/04/11]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2012/04/25]
 #
 #
 default: all
 default: all
-MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux
+MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-netbsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux
 BSDs = freebsd netbsd openbsd darwin
 BSDs = freebsd netbsd openbsd darwin
 UNIXs = linux $(BSDs) solaris qnx haiku aix
 UNIXs = linux $(BSDs) solaris qnx haiku aix
 LIMIT83fs = go32v2 os2 emx watcom
 LIMIT83fs = go32v2 os2 emx watcom
@@ -429,6 +429,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 override TARGET_UNITS+=sdfdata
 override TARGET_UNITS+=sdfdata
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+override TARGET_UNITS+=sdfdata
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 override TARGET_UNITS+=sdfdata
 override TARGET_UNITS+=sdfdata
 endif
 endif
@@ -630,6 +633,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 override TARGET_EXAMPLES+=testsdf testfix
 override TARGET_EXAMPLES+=testsdf testfix
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+override TARGET_EXAMPLES+=testsdf testfix
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 override TARGET_EXAMPLES+=testsdf testfix
 override TARGET_EXAMPLES+=testsdf testfix
 endif
 endif
@@ -1656,6 +1662,14 @@ REQUIRE_PACKAGES_HASH=1
 REQUIRE_PACKAGES_FPMKUNIT=1
 REQUIRE_PACKAGES_FPMKUNIT=1
 REQUIRE_PACKAGES_FCL-BASE=1
 REQUIRE_PACKAGES_FCL-BASE=1
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_FCL-PROCESS=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_FPMKUNIT=1
+REQUIRE_PACKAGES_FCL-BASE=1
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_PASZLIB=1
 REQUIRE_PACKAGES_PASZLIB=1

+ 22 - 2
packages/fcl-db/src/sql/Makefile

@@ -1,8 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2012/04/11]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2012/04/25]
 #
 #
 default: all
 default: all
-MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux
+MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-netbsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux
 BSDs = freebsd netbsd openbsd darwin
 BSDs = freebsd netbsd openbsd darwin
 UNIXs = linux $(BSDs) solaris qnx haiku aix
 UNIXs = linux $(BSDs) solaris qnx haiku aix
 LIMIT83fs = go32v2 os2 emx watcom
 LIMIT83fs = go32v2 os2 emx watcom
@@ -429,6 +429,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 override TARGET_UNITS+=fpsqltree fpsqlscanner fpsqlparser
 override TARGET_UNITS+=fpsqltree fpsqlscanner fpsqlparser
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+override TARGET_UNITS+=fpsqltree fpsqlscanner fpsqlparser
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 override TARGET_UNITS+=fpsqltree fpsqlscanner fpsqlparser
 override TARGET_UNITS+=fpsqltree fpsqlscanner fpsqlparser
 endif
 endif
@@ -630,6 +633,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 override TARGET_RSTS+=fpsqltree fpsqlscanner fpsqlparser
 override TARGET_RSTS+=fpsqltree fpsqlscanner fpsqlparser
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+override TARGET_RSTS+=fpsqltree fpsqlscanner fpsqlparser
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 override TARGET_RSTS+=fpsqltree fpsqlscanner fpsqlparser
 override TARGET_RSTS+=fpsqltree fpsqlscanner fpsqlparser
 endif
 endif
@@ -832,6 +838,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 override COMPILER_OPTIONS+=-S2h
 override COMPILER_OPTIONS+=-S2h
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+override COMPILER_OPTIONS+=-S2h
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 override COMPILER_OPTIONS+=-S2h
 override COMPILER_OPTIONS+=-S2h
 endif
 endif
@@ -1033,6 +1042,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 override COMPILER_UNITDIR+=../dbase
 override COMPILER_UNITDIR+=../dbase
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+override COMPILER_UNITDIR+=../dbase
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 override COMPILER_UNITDIR+=../dbase
 override COMPILER_UNITDIR+=../dbase
 endif
 endif
@@ -2058,6 +2070,14 @@ REQUIRE_PACKAGES_HASH=1
 REQUIRE_PACKAGES_FPMKUNIT=1
 REQUIRE_PACKAGES_FPMKUNIT=1
 REQUIRE_PACKAGES_FCL-BASE=1
 REQUIRE_PACKAGES_FCL-BASE=1
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_FCL-PROCESS=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_FPMKUNIT=1
+REQUIRE_PACKAGES_FCL-BASE=1
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_PASZLIB=1
 REQUIRE_PACKAGES_PASZLIB=1

+ 38 - 2
packages/fcl-db/src/sqldb/Makefile

@@ -1,8 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2012/04/11]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2012/04/25]
 #
 #
 default: all
 default: all
-MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux
+MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-netbsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux
 BSDs = freebsd netbsd openbsd darwin
 BSDs = freebsd netbsd openbsd darwin
 UNIXs = linux $(BSDs) solaris qnx haiku aix
 UNIXs = linux $(BSDs) solaris qnx haiku aix
 LIMIT83fs = go32v2 os2 emx watcom
 LIMIT83fs = go32v2 os2 emx watcom
@@ -357,6 +357,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 override TARGET_DIRS+=interbase postgres mysql odbc oracle sqlite mssql
 override TARGET_DIRS+=interbase postgres mysql odbc oracle sqlite mssql
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+override TARGET_DIRS+=interbase postgres mysql odbc oracle sqlite mssql
+endif
 ifeq ($(FULL_TARGET),x86_64-openbsd)
 ifeq ($(FULL_TARGET),x86_64-openbsd)
 override TARGET_DIRS+=interbase postgres mysql odbc oracle sqlite mssql
 override TARGET_DIRS+=interbase postgres mysql odbc oracle sqlite mssql
 endif
 endif
@@ -528,6 +531,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 override TARGET_UNITS+=sqldb
 override TARGET_UNITS+=sqldb
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+override TARGET_UNITS+=sqldb
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 override TARGET_UNITS+=sqldb
 override TARGET_UNITS+=sqldb
 endif
 endif
@@ -729,6 +735,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 override TARGET_RSTS+=sqldb
 override TARGET_RSTS+=sqldb
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+override TARGET_RSTS+=sqldb
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 override TARGET_RSTS+=sqldb
 override TARGET_RSTS+=sqldb
 endif
 endif
@@ -931,6 +940,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 override COMPILER_OPTIONS+=-S2
 override COMPILER_OPTIONS+=-S2
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+override COMPILER_OPTIONS+=-S2
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 override COMPILER_OPTIONS+=-S2
 override COMPILER_OPTIONS+=-S2
 endif
 endif
@@ -2098,6 +2110,21 @@ REQUIRE_PACKAGES_ORACLE=1
 REQUIRE_PACKAGES_SQLITE=1
 REQUIRE_PACKAGES_SQLITE=1
 REQUIRE_PACKAGES_DBLIB=1
 REQUIRE_PACKAGES_DBLIB=1
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_FCL-PROCESS=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_FPMKUNIT=1
+REQUIRE_PACKAGES_FCL-XML=1
+REQUIRE_PACKAGES_IBASE=1
+REQUIRE_PACKAGES_POSTGRES=1
+REQUIRE_PACKAGES_MYSQL=1
+REQUIRE_PACKAGES_ODBC=1
+REQUIRE_PACKAGES_ORACLE=1
+REQUIRE_PACKAGES_SQLITE=1
+REQUIRE_PACKAGES_DBLIB=1
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_PASZLIB=1
 REQUIRE_PACKAGES_PASZLIB=1
@@ -3526,6 +3553,15 @@ TARGET_DIRS_ORACLE=1
 TARGET_DIRS_SQLITE=1
 TARGET_DIRS_SQLITE=1
 TARGET_DIRS_MSSQL=1
 TARGET_DIRS_MSSQL=1
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+TARGET_DIRS_INTERBASE=1
+TARGET_DIRS_POSTGRES=1
+TARGET_DIRS_MYSQL=1
+TARGET_DIRS_ODBC=1
+TARGET_DIRS_ORACLE=1
+TARGET_DIRS_SQLITE=1
+TARGET_DIRS_MSSQL=1
+endif
 ifeq ($(FULL_TARGET),x86_64-openbsd)
 ifeq ($(FULL_TARGET),x86_64-openbsd)
 TARGET_DIRS_INTERBASE=1
 TARGET_DIRS_INTERBASE=1
 TARGET_DIRS_POSTGRES=1
 TARGET_DIRS_POSTGRES=1

+ 17 - 2
packages/fcl-db/src/sqldb/interbase/Makefile

@@ -1,8 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2012/04/11]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2012/04/25]
 #
 #
 default: all
 default: all
-MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux
+MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii powerpc-aix sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-netbsd x86_64-solaris x86_64-openbsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded powerpc64-aix avr-embedded armeb-linux armeb-embedded mips-linux mipsel-linux
 BSDs = freebsd netbsd openbsd darwin
 BSDs = freebsd netbsd openbsd darwin
 UNIXs = linux $(BSDs) solaris qnx haiku aix
 UNIXs = linux $(BSDs) solaris qnx haiku aix
 LIMIT83fs = go32v2 os2 emx watcom
 LIMIT83fs = go32v2 os2 emx watcom
@@ -429,6 +429,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 override TARGET_UNITS+=ibconnection
 override TARGET_UNITS+=ibconnection
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+override TARGET_UNITS+=ibconnection
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 override TARGET_UNITS+=ibconnection
 override TARGET_UNITS+=ibconnection
 endif
 endif
@@ -631,6 +634,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 override COMPILER_OPTIONS+=-S2
 override COMPILER_OPTIONS+=-S2
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+override COMPILER_OPTIONS+=-S2
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 override COMPILER_OPTIONS+=-S2
 override COMPILER_OPTIONS+=-S2
 endif
 endif
@@ -1701,6 +1707,15 @@ REQUIRE_PACKAGES_FPMKUNIT=1
 REQUIRE_PACKAGES_FCL-XML=1
 REQUIRE_PACKAGES_FCL-XML=1
 REQUIRE_PACKAGES_IBASE=1
 REQUIRE_PACKAGES_IBASE=1
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-netbsd)
+REQUIRE_PACKAGES_RTL=1
+REQUIRE_PACKAGES_PASZLIB=1
+REQUIRE_PACKAGES_FCL-PROCESS=1
+REQUIRE_PACKAGES_HASH=1
+REQUIRE_PACKAGES_FPMKUNIT=1
+REQUIRE_PACKAGES_FCL-XML=1
+REQUIRE_PACKAGES_IBASE=1
+endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
 ifeq ($(FULL_TARGET),x86_64-solaris)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_PASZLIB=1
 REQUIRE_PACKAGES_PASZLIB=1

部分文件因为文件数量过多而无法显示