Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 23

Thread: freepascal on intel osx?

  1. #11

    freepascal on intel osx?

    well i tried installing the ppc binary (i assumed it would run ok under rosetta) and it gets a bit further but still with errors:

    make compiler_cycle RELEASE=1
    make -C compiler cycle
    make tempclean ppc3
    /bin/rm -f ppcrossppc ppc ppc1 ppc2 ppc3 ./msg2inc
    make 'OLDFPC=' next
    make rtlclean rtl
    make -C /Users/jon/fpc/rtl clean
    /bin/rm -f fpcmade.powerpc-darwin Package.fpc ppas.sh script.res link.res
    /bin/rm -f *.s *_ppas.sh
    make -C darwin clean
    /bin/rm -f /Users/jon/fpc/rtl/units/powerpc-darwin/system.ppu /Users/jon/fpc/rtl/units/powerpc-darwin/unixtype.ppu /Users/jon/fpc/rtl/units/powerpc-darwin/ctypes.ppu /Users/jon/fpc/rtl/units/powerpc-darwin/objpas.ppu /Users/jon/fpc/rtl/units/powerpc-darwin/macpas.ppu /Users/jon/fpc/rtl/units/powerpc-darwin/strings.ppu /Users/jon/fpc/rtl/units/powerpc-darwin/sysctl.ppu /Users/jon/fpc/rtl/units/powerpc-darwin/baseunix.ppu /Users/jon/fpc/rtl/units/powerpc-darwin/unixutil.ppu /Users/jon/fpc/rtl/units/powerpc-darwin/unix.ppu /Users/jon/fpc/rtl/units/powerpc-darwin/initc.ppu /Users/jon/fpc/rtl/units/powerpc-darwin/cmem.ppu /Users/jon/fpc/rtl/units/powerpc-darwin/matrix.ppu /Users/jon/fpc/rtl/units/powerpc-darwin/dynlibs.ppu /Users/jon/fpc/rtl/units/powerpc-darwin/dos.ppu /Users/jon/fpc/rtl/units/powerpc-darwin/dl.ppu /Users/jon/fpc/rtl/units/powerpc-darwin/objects.ppu /Users/jon/fpc/rtl/units/powerpc-darwin/printer.ppu /Users/jon/fpc/rtl/units/powerpc-darwin/sockets.ppu /Users/jon/fpc/rtl/units/powerpc-darwin/sysutils.ppu /Users/jon/fpc/rtl/units/powerpc-darwin/typinfo.ppu /Users/jon/fpc/rtl/units/powerpc-darwin/classes.ppu /Users/jon/fpc/rtl/units/powerpc-darwin/math.ppu /Users/jon/fpc/rtl/units/powerpc-darwin/varutils.ppu /Users/jon/fpc/rtl/units/powerpc-darwin/charset.ppu /Users/jon/fpc/rtl/units/powerpc-darwin/ucomplex.ppu /Users/jon/fpc/rtl/units/powerpc-darwin/getopts.ppu /Users/jon/fpc/rtl/units/powerpc-darwin/heaptrc.ppu /Users/jon/fpc/rtl/units/powerpc-darwin/lineinfo.ppu /Users/jon/fpc/rtl/units/powerpc-darwin/errors.ppu /Users/jon/fpc/rtl/units/powerpc-darwin/terminfo.ppu /Users/jon/fpc/rtl/units/powerpc-darwin/termio.ppu /Users/jon/fpc/rtl/units/powerpc-darwin/video.ppu /Users/jon/fpc/rtl/units/powerpc-darwin/crt.ppu /Users/jon/fpc/rtl/units/powerpc-darwin/mouse.ppu /Users/jon/fpc/rtl/units/powerpc-darwin/keyboard.ppu /Users/jon/fpc/rtl/units/powerpc-darwin/console.ppu /Users/jon/fpc/rtl/units/powerpc-darwin/variants.ppu /Users/jon/fpc/rtl/units/powerpc-darwin/types.ppu /Users/jon/fpc/rtl/units/powerpc-darwin/sysctl.ppu /Users/jon/fpc/rtl/units/powerpc-darwin/dateutils.ppu /Users/jon/fpc/rtl/units/powerpc-darwin/sysconst.ppu /Users/jon/fpc/rtl/units/powerpc-darwin/cthreads.ppu /Users/jon/fpc/rtl/units/powerpc-darwin/strutils.ppu /Users/jon/fpc/rtl/units/powerpc-darwin/rtlconsts.ppu /Users/jon/fpc/rtl/units/powerpc-darwin/cwstring.ppu /Users/jon/fpc/rtl/units/powerpc-darwin/fpmkunit.ppu
    /bin/rm -f /Users/jon/fpc/rtl/units/powerpc-darwin/math.rst /Users/jon/fpc/rtl/units/powerpc-darwin/varutils.rst /Users/jon/fpc/rtl/units/powerpc-darwin/typinfo.rst /Users/jon/fpc/rtl/units/powerpc-darwin/classes.rst /Users/jon/fpc/rtl/units/powerpc-darwin/variants.rst /Users/jon/fpc/rtl/units/powerpc-darwin/dateutils.rst /Users/jon/fpc/rtl/units/powerpc-darwin/sysconst.rst /Users/jon/fpc/rtl/units/powerpc-darwin/rtlconsts.rst /Users/jon/fpc/rtl/units/powerpc-darwin/fpmkunit.rst
    /bin/rm -f fpcmade.powerpc-darwin Package.fpc ppas.sh script.res link.res
    /bin/rm -f *.s *_ppas.sh
    make -C /Users/jon/fpc/rtl 'OPT=' all
    make -C darwin all
    /usr/local/bin/ppcppc -dNOMOUSE -Ur -dFPC_USE_LIBC -Ur -Xs -O1r -n -Fi../inc -Fi../powerpc -Fi../unix -Fi../bsd -Fi../bsd/powerpc -Fi../darwin/powerpc -FE. -FU/Users/jon/fpc/rtl/units/powerpc-darwin -dpowerpc -dRELEASE -Us -Sg ../bsd/system.pp
    system.pp(257,1) Error: Error while assembling exitcode 1
    system.pp(257,1) Fatal: There were 2 errors compiling module, stopping
    system.pp(257,1) Fatal: Compilation aborted
    and then the terminal is flooded with things like this:

    system.pp:39667:no such 386 instruction: `lwz'
    system.pp:39668:no such 386 instruction: `li'
    system.pp:39669:no such 386 instruction: `addis'
    system.pp:39670:more than 1 memory reference in instruction
    system.pp:39671:no such 386 instruction: `blt'
    system.pp:39672:no such 386 instruction: `li'
    system.pp:39673:no such 386 instruction: `addis'
    system.pp:39674:invalid character '.' in opcode
    system.pp:39675:no such 386 instruction: `beq'
    system.pp:39676:invalid character '.' in opcode
    system.pp:39677:no such 386 instruction: `beq'
    system.pp:39678:invalid character '.' in opcode
    system.pp:39679:no such 386 instruction: `bne'
    system.pp:39681:no such 386 instruction: `mr'
    system.pp:39682:no such 386 instruction: `lwz'
    system.pp:39683:no such 386 instruction: `lwz'
    system.pp:39684:no such 386 instruction: `lwz'
    system.pp:39685:no such 386 instruction: `bl'
    system.pp:39686:no such 386 instruction: `mr'
    system.pp:39687perands given don't match any known 386 instruction
    system.pp:39688:no such 386 instruction: `bge'
    system.pp:39689:no such 386 instruction: `lis'

  2. #12

    freepascal on intel osx?

    Your compiler is not yet aware of Intel Macs, but it can be circumvented.

    Create a script ppc-as which contains:

    #!/bin/sh
    as -arch ppc $*

    Then create also a script for the linker ppc-ld, which contains:

    #!/bin/sh
    ld -arch ppc $*

    ... and try "make all OPT=-XPppc".

  3. #13

    freepascal on intel osx?

    Sorry, i dont understand what to do with the scripts. do i put them somewhere (and what should the filenames be)? do i run them from the terminal (didnt seem to have any effect)

    from the new errors, it seems its still looking for what the scripts turn off

    make all OPT=-XPppc

    /usr/local/bin/ppcppc -Fu../rtl/units/powerpc-darwin -Fu../packages/base/hash -Fu../packages/base/paszlib -Fu../packages/base/netdb -Fu../packages/base/libasync -Fu../packages/base/pthreads -Fu../fcl/units/powerpc-darwin -Fu../packages/base/pasjpeg -Fu../packages/base/ibase -Fu../packages/base/postgres -Fu../packages/base/mysql -Fu../packages/base/odbc -Fu../packages/base/oracle -Fu../packages/base/sqlite -FE. -FUunits/powerpc-darwin -XPppc -dpowerpc ppdep.pp
    Free Pascal Compiler version 2.0.2 [2005/11/15] for powerpc
    Copyright (c) 1993-2005 by Florian Klaempfl
    Target OS: Darwin for PowerPC
    Compiling ppdep.pp
    Assembling ppdep
    ppdep.pp(577,1) Error: Assembler ppcas not found, switching to external assembling
    ppdep.pp(577,1) Fatal: There were 1 errors compiling module, stopping
    ppdep.pp(577,1) Fatal: Compilation aborted
    make: *** [ppdep] Error 1

  4. #14

    freepascal on intel osx?

    It will search the assembler in the PATH. Apparently it is searching for "ppcas" instead of "ppc-as", that should be easy to fix

    (Rename the scripts or try "-XPppc-" )

  5. #15

    freepascal on intel osx?

    ok great, i think its nearly there, but nearly not. in the main fpc folder im doing "make all OPT=-XPppc" and after about a minute i get this

    make -C /Users/jon/fpc/rtl 'OPT=-XPppc' all
    make -C darwin all
    /Users/jon/fpc/compiler/ppc1 -dNOMOUSE -Ur -dFPC_USE_LIBC -Ur -Xs -O2 -n -Fi../inc -Fi../powerpc -Fi../unix -Fi../bsd -Fi../bsd/powerpc -Fi../darwin/powerpc -FE. -FU/Users/jon/fpc/rtl/units/powerpc-darwin -XPppc -dpowerpc -dRELEASE -Us -Sg ../bsd/system.pp
    Error: Error while assembling exitcode 1
    Fatal: There were 2 errors compiling module, stopping
    Fatal: Compilation aborted
    as: more than one -arch option (not allowed, use cc(1) instead)
    make[7]: *** [system.ppu] Error 1
    make[6]: *** [darwin_all] Error 2
    make[5]: *** [rtl] Error 2
    make[4]: *** [next] Error 2
    make[3]: *** [ppc2] Error 2
    make[2]: *** [cycle] Error 2
    make[1]: *** [compiler_cycle] Error 2
    make: *** [build-stamp.powerpc-darwin] Error 2
    looks like its still doing a lot of ppc things... (im hoping to get an intel version out of this)

  6. #16

    freepascal on intel osx?

    Argh! After bootstrapping the compiler the compiler does know about Intel macs and uses -arch twice, one time by the compiler, one time by our script.

    Take the ppc1 from the compiler directory (move it to /usr/local/bin/ppcppc_211 or something.

    Then try "make all FPC=/usr/local/bin/ppcppc_211".

    About the Intel version. Don't worry, we'll get there. We need to have a PowerPC cross-compiler first.

  7. #17

    freepascal on intel osx?

    it worked! where abouts is the new compiler and where do i put it? (the installer did this all for me last time ops: )

    thanks for getting this far dmantione

  8. #18

    freepascal on intel osx?

    Good! You can do "make install" afterwards to install the newly build compiler.

    Now the cross-compiler:
    * Go to the directory compiler.
    * Type "make i386 FPC=/path/to/fpc-source/compiler/ppcppc'
    * Now a compiler ppc386 will be built. It is still a PowerPC binary, but instead of PowerPC code it generates i386 code.
    * Copy ppc386 to /usr/local/bin

    If you have the cross-compiler:
    * Go into the root of the FPC source directory again.
    * Type "make all FPC=/usr/local/bin/ppc386"
    * This should build the Intel release.

  9. #19

    freepascal on intel osx?

    ok, it seemed to compile the ppc386 without errors, i copied it to the /usr/local/bin folder and went to compile all again, this is what i got:

    jons-computer:~/fpc jon$ make all FPC=/usr/local/bin/ppc386
    Makefile:172: *** The Makefile doesn't support target darwin-Fatal:, please run fpcmake first. Stop.
    if i run the earlier built ppcppc i get this

    jons-computer:~/fpc jon$ ppcppc
    Free Pascal Compiler version 2.1.1 [2006/07/08] for powerpc
    Copyright (c) 1993-2006 by Florian Klaempfl

    compiler options...
    if i run ppc386 i get this

    jons-computer:~/fpc jon$ ppc386
    Fatal: Internal error 2004121201
    Fatal: Compilation aborted

  10. #20

    freepascal on intel osx?

    That Makefile error is because of the broken ppc386. I have no idea where that internalerror comes from, which is kind of bad news :/

    Can youy try to "make clean" in the compiler directory first before doing "make i386 FPC=/path/to/compiler"? Before you do that, mjake sure you back up the ppcppc in that directory as it will be deleted.

Page 2 of 3 FirstFirst 123 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •