Re: [fpc-pascal] How to handle fpc.cfg on Ubuntu with 3.0.4 and 3.2.0 co-existing?

2021-02-05 Thread Graeme Geldenhuys via fpc-pascal
On 05/02/2021 11:18 pm, Bo Berglund via fpc-pascal wrote:
> Can they share the same fpc.cfg file (or rather .fpc.cfg)?

Yes, I've been doing so for probably the last 10 years. I have
7 different FPC versions installed on my system - all working together.

The trick is to have paths as follows in you ~/.fpc.cfg file:

=
# searchpath for units and other system dependent things
-Fu/data/devel/fpc-$fpcversion/$fpctarget/lib/fpc/$fpcversion/units/$fpctarget
-Fu/data/devel/fpc-$fpcversion/$fpctarget/lib/fpc/$fpcversion/units/$fpctarget/*
-Fu/data/devel/fpc-$fpcversion/$fpctarget/lib/fpc/$fpcversion/units/$fpctarget/rtl

# searchpath for fppkg user-specific packages
-Fu~/.fppkg/lib/fpc/$fpcversion/units/$FPCTARGET/*

# searchpath for libraries
-Fl/data/devel/fpc-$fpcversion/$fpctarget/lib/fpc/$fpcversion/units/$fpctarget
-Fl/lib;/usr/lib;/usr/local/lib

# Path to fpc utility applications like fpcres
-FD/data/devel/fpc-$fpcversion/$fpctarget/bin/
=

I'm happy to send you a full copy of my ~/.fpc.cfg file if that will help.

And as you can see from my paths above, all my FPC version are all installed
under the /data/devel/* path and looks like this:

=
/data/devel/fpc-2.6.4
├── src/
├── x86_64-freebsd/
└── x86_64-linux/
/data/devel/fpc-3.0.0
├── go.sh*
├── src/
├── x86_64-freebsd/
└── x86_64-linux/
/data/devel/fpc-3.0.2
├── go.sh*
├── src/
├── x86_64-freebsd/
└── x86_64-linux/
/data/devel/fpc-3.0.4
├── go.sh*
├── src/
├── x86_64-freebsd/
└── x86_64-linux/
/data/devel/fpc-3.2.0
├── go.sh*
├── src/
├── x86_64-freebsd/
└── x86_64-linux/
/data/devel/fpc-3.2.1
├── go.sh*
├── src/
└── x86_64-linux/
/data/devel/fpc-3.3.1
├── go-arduino.sh*
├── go-freebsd.sh*
├── go.sh*
├── src/
└── x86_64-linux/

=


The "go.sh" files you see are to compile the desired FPC version with the
previous stable FPC version, and install it into the correct location.

=[ example go.sh ]===
#!/bin/sh

TARGET_VER=3.2.0
TARGET=x86_64-linux
COMPILER=/data/devel/fpc-3.0.4/$TARGET/bin/ppcx64

cd src

make clean
make all FPC=$COMPILER OPT="-Fl/usr/local/lib"
make install INSTALL_PREFIX=/data/devel/fpc-$TARGET_VER/$TARGET 
FPC=/data/devel/fpc-$TARGET_VER/src/compiler/ppcx64
=

I use this same setup in my Windows VMs too, when I need to support multiple
FPC versions.

Regards,
  Graeme

-- 
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

My public PGP key:  http://tinyurl.com/graeme-pgp
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


[fpc-pascal] How to handle fpc.cfg on Ubuntu with 3.0.4 and 3.2.0 co-existing?

2021-02-05 Thread Bo Berglund via fpc-pascal
I have an Ubuntu 18.04 laptop on which I have installed fpc 3.0.4/Lazarus 2.0.8
from sources via svn almost a year back into *my home dir*. No system-wide
install.

Now I am in the process of also installing fpc 3.2.0 from sources.
I have a script for installing on a clean machine that I am reading from and
using the appropriate calls when most has been already installed.
So for fpc my steps are:

cd ~/dev/fpc/3.2.0 (this is the source dir filled via svn)
make clean
make all FPC="$HOME/bin/ppcx64" (fpc 3.0.4 is symlinked here)
make install PREFIX=$HOME FPC="$HOME/bin/ppcx64"
make sourceinstall PREFIX=$HOME

This all works fine.

Now my notes say that I need to create the fpc.cfg file using:

$HOME/lib/fpc/3.2.0/samplecfg "$HOME/lib/fpc/3.2.0" "$HOME"

This creates the file $HOME/fpc.cfg, which is then renamed:
mv "$HOME/fpc.cfg" "$HOME/.fpc.cfg"

But my existing installation already contains the $HOME/.fpc.cfg, which is used
by Lazarus 2.0.8/fpc 3.0.4...

So what is the deal here if I want to have both Lazarus 2.0.10/fpc 3.2.0 and the
old Lazarus 2.0.8/fpc 3.0.4 operational?

Can they share the same fpc.cfg file (or rather .fpc.cfg)?

I renamed the existing .fpc.cfg before doing the last step so I have both the
new fpc.cfg and the old .fpc.cfg_3.0.4 and the diff between them looks like
this:

$ diff fpc.cfg .fpc.cfg_3.0.4
2c2
< # Config file generated by fpcmkcfg on 5-2-21 - 23:49:17
---
> # Config file generated by fpcmkcfg on 15-4-20 - 01:01:27
35,37d34
< #ELSE
<   # Strip debuginfo from the executable if not in debug mode
<   -Xs
43a41,42
> # path to Xcode 4.3+ utilities (no problem if it doesn't exist)
> -FD/Applications/Xcode.app/Contents/Developer/usr/bin
149,150c148,152
< # Search for $fpctarget/$fpcsubarch-$fpcmemorymodel/ subdirectory first
< # for i8086 CPU
---
> # searchpath for units and other system dependent things
> -Fu/home/bosse/lib/fpc/$fpcversion/units/$fpctarget
> -Fu/home/bosse/lib/fpc/$fpcversion/units/$fpctarget/*
> -Fu/home/bosse/lib/fpc/$fpcversion/units/$fpctarget/rtl
>
157,161d158
< # searchpath for units and other system dependent things
< -Fu/home/bosse/lib/fpc/$fpcversion/units/$fpctarget
< -Fu/home/bosse/lib/fpc/$fpcversion/units/$fpctarget/*
< -Fu/home/bosse/lib/fpc/$fpcversion/units/$fpctarget/rtl
<
175,177d171
< # searchpath for tools
< -FD/home/bosse/lib/fpc/$fpcversion/bin/$FPCTARGET
<
190a185,187
> # searchpath for tools
> -FD/home/bosse/lib/fpc/$fpcversion/bin/$FPCTARGET
>
250a248,250
>
> # Always strip debuginfo from the executable
> -Xs

Unfortunately I cannot decode this because I am not used to this diff format...
Can I keep my existing .fpc.cfg file or should I rename the fpc.cfg to .fpc.cfg?

I have not yet built Lazarus...


-- 
Bo Berglund
Developer in Sweden

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Statically linked-in fpc code

2021-02-05 Thread Adriaan van Os via fpc-pascal

Michael Van Canneyt via fpc-pascal wrote:

Not sure where the 1.3.31 came from, but stack checking is mentioned in
1.7.72;


For fpc-3.0.4 stack stacking is mentioned in 1.3.31 as a global directive. For 3.2.0 stack checking 
is indeed mentioned in 1.2.72 as a local directive. If the directive has changed from global to 
local, that change (if not doc-only) could have triggered that it is now broken for statically 
linked-in code.


Anybody made code changes related to stack-checking ?

Regards,

Adriaan van Os

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Statically linked-in fpc code

2021-02-05 Thread Michael Van Canneyt via fpc-pascal



On Fri, 5 Feb 2021, Michael Van Canneyt via fpc-pascal wrote:




On Fri, 5 Feb 2021, Sven Barth via fpc-pascal wrote:


Adriaan van Os via fpc-pascal  schrieb am
Fr., 5. Feb. 2021, 10:50:


Adriaan van Os via fpc-pascal wrote:

Jonas Maebe via fpc-pascal wrote:

On 2021-02-05 09:24, Adriaan van Os via fpc-pascal wrote:

It's crazy !



The default fpc.cfg file contains this (both in 3.0.4 and 3.2.0):



Thanks for tne reply.


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


I find such sneaky configuration files an extremely bad idea !


Also

1. Section 1.3.31 of the Programmer's manual says "By default, no stack
checking is performed."



The default of the compiler *without* a configuration file (maybe we should
mention that somewhere in the Programmer's Guide). For example C operators
are disabled by default as well (see Programmer's Guide 1.2.10), but the
default configuration file enables them.


Not sure where the 1.3.31 came from, but stack checking is mentioned in
1.7.72;


Make that 1.2.72 :-(

Michael.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Statically linked-in fpc code

2021-02-05 Thread Michael Van Canneyt via fpc-pascal



On Fri, 5 Feb 2021, Sven Barth via fpc-pascal wrote:


Adriaan van Os via fpc-pascal  schrieb am
Fr., 5. Feb. 2021, 10:50:


Adriaan van Os via fpc-pascal wrote:

Jonas Maebe via fpc-pascal wrote:

On 2021-02-05 09:24, Adriaan van Os via fpc-pascal wrote:

It's crazy !



The default fpc.cfg file contains this (both in 3.0.4 and 3.2.0):



Thanks for tne reply.


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


I find such sneaky configuration files an extremely bad idea !


Also

1. Section 1.3.31 of the Programmer's manual says "By default, no stack
checking is performed."



The default of the compiler *without* a configuration file (maybe we should
mention that somewhere in the Programmer's Guide). For example C operators
are disabled by default as well (see Programmer's Guide 1.2.10), but the
default configuration file enables them.


Not sure where the 1.3.31 came from, but stack checking is mentioned in
1.7.72;

https://www.freepascal.org/docs-html/current/prog/progsu72.html#x79-780001.2.72

I added a warning about defaults in the introduction of the section on
directives, as it is valid for all defaults mentioned.

Michael.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Statically linked-in fpc code

2021-02-05 Thread Sven Barth via fpc-pascal
Adriaan van Os via fpc-pascal  schrieb am
Fr., 5. Feb. 2021, 10:50:

> Adriaan van Os via fpc-pascal wrote:
> > Jonas Maebe via fpc-pascal wrote:
> >> On 2021-02-05 09:24, Adriaan van Os via fpc-pascal wrote:
> >>> It's crazy !
> >>> 
> >>
> >> The default fpc.cfg file contains this (both in 3.0.4 and 3.2.0):
> >>
> >
> > Thanks for tne reply.
> >
> >> # For a debug version compile with debuginfo and all codegeneration
> >> checks on
> >> #IFDEF DEBUG
> >>   -gl
> >>   -Crtoi
> >>   #WRITE Compiling Debug Version
> >> #ENDIF
> >
> > I find such sneaky configuration files an extremely bad idea !
>
> Also
>
> 1. Section 1.3.31 of the Programmer's manual says "By default, no stack
> checking is performed."
>

The default of the compiler *without* a configuration file (maybe we should
mention that somewhere in the Programmer's Guide). For example C operators
are disabled by default as well (see Programmer's Guide 1.2.10), but the
default configuration file enables them.

Regards,
Sven
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Statically linked-in fpc code

2021-02-05 Thread Jonas Maebe via fpc-pascal
On 05/02/2021 10:50, Adriaan van Os via fpc-pascal wrote:
> Also
> 
> 1. Section 1.3.31 of the Programmer's manual says "By default, no stack
> checking is performed."

That is correct.

> 2. If it is broken with gpc-3.2.0, such the more reason to put it off.
> It doesn't do real stack-checking anyway.

It's not broken in general. E.g. the compiler cycles fine with -Ct on
Darwin.


Jonas
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Statically linked-in fpc code

2021-02-05 Thread Adriaan van Os via fpc-pascal

Adriaan van Os via fpc-pascal wrote:

Jonas Maebe via fpc-pascal wrote:

On 2021-02-05 09:24, Adriaan van Os via fpc-pascal wrote:

It's crazy !



The default fpc.cfg file contains this (both in 3.0.4 and 3.2.0):



Thanks for tne reply.

# For a debug version compile with debuginfo and all codegeneration 
checks on

#IFDEF DEBUG
  -gl
  -Crtoi
  #WRITE Compiling Debug Version
#ENDIF


I find such sneaky configuration files an extremely bad idea !


Also

1. Section 1.3.31 of the Programmer's manual says "By default, no stack checking is 
performed."

2. If it is broken with gpc-3.2.0, such the more reason to put it off. It doesn't do real 
stack-checking anyway.


Regards,

Adriaan van Os

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Statically linked-in fpc code

2021-02-05 Thread Adriaan van Os via fpc-pascal

Jonas Maebe via fpc-pascal wrote:

On 2021-02-05 09:24, Adriaan van Os via fpc-pascal wrote:

It's crazy !



The default fpc.cfg file contains this (both in 3.0.4 and 3.2.0):



Thanks for tne reply.

# For a debug version compile with debuginfo and all codegeneration 
checks on

#IFDEF DEBUG
  -gl
  -Crtoi
  #WRITE Compiling Debug Version
#ENDIF


I find such sneaky configuration files an extremely bad idea !



It seems the stack checking code causes issues for you in 3.2.0 for some 
reason.


It runs fine when compiling on the same Mac with gcc-3.0.4. So, there must have been a change 
between 3.0.4 and 3.2.0 ?


Regards,

Adriaan van Os

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Statically linked-in fpc code

2021-02-05 Thread Jonas Maebe via fpc-pascal

On 2021-02-05 09:24, Adriaan van Os via fpc-pascal wrote:

It's crazy !



The default fpc.cfg file contains this (both in 3.0.4 and 3.2.0):

# For a debug version compile with debuginfo and all codegeneration 
checks on

#IFDEF DEBUG
  -gl
  -Crtoi
  #WRITE Compiling Debug Version
#ENDIF

It seems the stack checking code causes issues for you in 3.2.0 for some 
reason.



Jonas
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Statically linked-in fpc code

2021-02-05 Thread Adriaan van Os via fpc-pascal

Jonas Maebe via fpc-pascal wrote:

On 04/02/2021 21:26, Adriaan van Os via fpc-pascal wrote:

I am getting crashes on Mac OS X 10.8.5 in a C-program with statically
linked-in fpc code. The crashes seem related to fpc unit initialisation.
This happens with fpc-3.2.0 but not when compiling the same code with
fpc-3.0.4. Has something changed from 3.0.4 to 3.2.0 related to unit
initialisation ?


Not that I remember. Where exactly does it crash?


It's crazy !


Regards,

Adriaan van Os
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal