[fpc-devel]Hey, Tomas...

KO Myung-Hun komh at chollian.net
Wed Oct 25 14:10:52 CEST 2000


Hi,

I'm using configuration file created by install program, and I modified

that slightly.

Below is my PPC386.CFG

---------
#
# Example ppc386.cfg for Free Pascal Compiler Version 1.0.2
#

# ----------------------
# Defines (preprocessor)
# ----------------------

#
# nested #IFNDEF, #IFDEF, #ENDIF, #ELSE, #DEFINE, #UNDEF are allowed
#
# -d is the same as #DEFINE
# -u is the same as #UNDEF
#

# When not m68k is defined at the commandline, define i386
#IFNDEF m68k
  #DEFINE i386
#ENDIF

#
# Some examples (for switches see below, and the -? helppages)
#
# Try compiling with the -dRELEASE or -dDEBUG on the commandline
#

# For a release compile with optimizes and strip debuginfo
#IFDEF RELEASE
  -OG2p2
  -Xs
  #WRITE Compiling Release Version
#ENDIF

# For a debug version compile with debuginfo and all codegeneration
checks on
#IFDEF DEBUG
  -g
  -Crtoi
  #WRITE Compiling Debug Version
#ENDIF

# ----------------
# Parsing switches
# ----------------

# All assembler blocks are intel styled by default
#-Rintel

# All assembler blocks are AT&T styled by default
#-Ratt

# All assembler blocks are directly copied to asm
#-Rdirect

# Semantic checking
#  -S2        switch some Delphi 2 extensions on
#  -Sc        supports operators like C (*=,+=,/= and -=)
#  -Sd        tries to be Delphi compatible
#  -Se<x>     compiler stops after the <x> errors (default is 1)
#  -Sg        allow LABEL and GOTO
#  -Sh        Use ansistrings
#  -Si        support C++ styled INLINE
#  -Sm        support macros like C (global)
#  -So        tries to be TP/BP 7.0 compatible
#  -Sp        tries to be gpc compatible
#  -Ss        constructor name must be init (destructor must be done)
#  -St        allow static keyword in objects
# Allow goto, inline, C-operators
-Sgic

# ---------------
# Code generation
# ---------------

# Uncomment the next line if you always want static/dynamic units by
default
# (can be overruled with -CD, -CS at the commandline)
#-CS
#-CD

# Set the default heapsize to 8Mb
#-Ch8000000

# Set default codegeneration checks (iocheck, overflow, range, stack)
#-Ci
#-Co
#-Cr
#-Ct

# Optimizer switches
# -Og        generate smaller code
# -OG        generate faster code (default)
# -Or        keep certain variables in registers (still BUGGY!!!)
# -Ou        enable uncertain optimizations (see docs)
# -O1        level 1 optimizations (quick optimizations)
# -O2        level 2 optimizations (-O1 + slower optimizations)
# -O3        level 3 optimizations (same as -O2u)
# -Op        target processor
#     -Op1  set target processor to 386/486
#     -Op2  set target processor to Pentium/PentiumMMX (tm)
#     -Op3  set target processor to PPro/PII/c6x86/K6 (tm)

# Optimize always for Size and Pentium
#-Og2p2


# -----------------------
# Set Filenames and Paths
# -----------------------

# Both slashes and backslashes are allowed in paths

# path to the messagefile, not necessary anymore but can be used to
override
# the default language
#-Frf:\lang\fpc/msg/errore.msg
#-Frf:\lang\fpc/msg/errorn.msg
#-Frf:\lang\fpc/msg/errores.msg
#-Frf:\lang\fpc/msg/errord.msg
#-Frf:\lang\fpc/msg/errorr.msg

# path to the gcclib
#-Flf:\lang\fpc/lib

# searchpath for includefiles
# release them only if you know what you do
# because this could cause a rebuild of the runtime library
# if you tell them compiler/ide to build the project (FK)
#-Fif:\lang\fpc/source/rtl/inc;f:\lang\fpc/source/rtl/i386

# searchpath for objectfiles
#-Fof:\lang\fpc/source/rtl/inc;f:\lang\fpc/source/rtl/i386

# searchpath for units and other system dependent things
-Fuf:\lang\fpc/units/$TARGET
-Fuf:\lang\fpc/units/$TARGET/*
-Fuf:\lang\fpc/units/$TARGET/rtl
-Fuf:\lang\fpc/units/$TARGET/api
-Fuf:\lang\work\units

# searchpath for libraries
#-Flf:\lang\fpc/lib
#-Fl/lib;/usr/lib

# searchpath for tools
#-FDf:\lang\fpc/bin/$TARGET
-FDf:\lang\emx\bin

# -------------
# Linking
# -------------

# generate always debugging information for GDB (slows down the
compiling
# process)
#-gl

# always pass an option to the linker
#-k-s

# Always strip debuginfo from the executable
-Xs


# -------------
# Miscellaneous
# -------------

# Write always a nice FPC logo ;)
-l

# Verbosity
# e : Show errors (default)       d : Show debug info
# w : Show warnings               u : Show used files
# n : Show notes                  t : Show tried files
# h : Show hints                  m : Show defined macros
# i : Show general info           p : Show compiled procedures
# l : Show linenumbers            c : Show conditionals
# a : Show everything             0 : Show nothing (except errors)

# Display Info, Warnings, Notes and Hints
-viwnh
# If you don't want so much verbosity use
#-vw
--------

And below is short example that show the problem.

--------
uses
    DosCalls;

var
    Handle : Longint;
    ActionTaken : Longint;
    FPtr : Longint;
    RC : Longint;

begin
    RC :=  DosOpen( 'test.pas', Handle, ActionTaken, 0, 0, doOpen,
                doDenyNone or doRandom or doReadWrite, nil );

    if RC <> 0 then
    begin
        WriteLn('Open error!!! : ', RC );
        Exit;
    end;

    DosSetFilePtr( Handle, 0, dsRelative, FPtr );

    DosClose( Handle );
end.
---------

If there is 'cdecl' at declaration of helper, SYS3171 is reported,

else program terminated normally.

For better FPC !!!

    from KO Myung-Hun...







More information about the fpc-devel mailing list