Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2014-02

subtools fpcres and parameter -Xp

7 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Mattias Gaertner

Hi,

How does the compiler (2.6.2, 2.6.4, 2.7.1) search for sub tools like fpcres?

For example: first in its working directory, then in PATH, etc.

What parameters effects this search? -Xp?

Mattias

Reply by email

Sven Barth
to Mattias Gaertner
Mattias Gaertner wrote 6 lines
Hi, How does the compiler (2.6.2, 2.6.4, 2.7.1) search for sub tools like fpcres? For example: first in its working directory, then in PATH, etc.

Usual order is this:
- path specified by -FD
- path of compiler executable (ppcXXX)
- PATH variable (or "Commands" on Mac OS Classic)

What parameters effects this search? -Xp?

No, -FD is the parameter for this.

Regards,
Sven

Reply by email

patspiper
to Sven Barth
Sven Barth wrote 14 lines
Am 11.02.2014 23:19, schrieb Mattias Gaertner: > Hi, > > How does the compiler (2.6.2, 2.6.4, 2.7.1) search for sub tools like > fpcres? > > For example: first in its working directory, then in PATH, etc. Usual order is this: - path specified by -FD - path of compiler executable (ppcXXX) - PATH variable (or "Commands" on Mac OS Classic) > What parameters effects this search? -Xp? No, -FD is the parameter for this.

Isn't -FD used for the binutils/crossbinutils?

If so, then how are the tools which are in the fpc (not ppcxxx) executable folder (such as fpcres) located?

Stephano

Reply by email

Sven Barth
to patspiper
patspiper wrote 20 lines
On 12/02/14 10:03, Sven Barth wrote: > Am 11.02.2014 23:19, schrieb Mattias Gaertner: >> Hi, >> >> How does the compiler (2.6.2, 2.6.4, 2.7.1) search for sub tools like >> fpcres? >> >> For example: first in its working directory, then in PATH, etc. > Usual order is this: > - path specified by -FD > - path of compiler executable (ppcXXX) > - PATH variable (or "Commands" on Mac OS Classic) > >> What parameters effects this search? -Xp? > No, -FD is the parameter for this. Isn't -FD used for the binutils/crossbinutils? If so, then how are the tools which are in the fpc (not ppcxxx) executable folder (such as fpcres) located?

To quote myself:

Usual order is this: - path specified by -FD - path of compiler executable (ppcXXX) - PATH variable (or "Commands" on Mac OS Classic)

Regards,
Sven

Reply by email

Mattias Gaertner
to Sven Barth: Usual order is this: - path specified by -FD - path of compiler executable (ppcXXX) -…
Show quoted text 18 lines
Sven Barth hat am 12. Februar 2014 um 09:03 geschrieben: Am 11.02.2014 23:19, schrieb Mattias Gaertner: > Hi, > > How does the compiler (2.6.2, 2.6.4, 2.7.1) search for sub tools like > fpcres? > > For example: first in its working directory, then in PATH, etc. Usual order is this: - path specified by -FD - path of compiler executable (ppcXXX) - PATH variable (or "Commands" on Mac OS Classic) > What parameters effects this search? -Xp? No, -FD is the parameter for this.

Thanks.

To summarize:
When someone installs under Linux fpc 2.6.2 via installer and 2.7.1 manually to /usr/local you get:
fpc 2.6.2:
/usr/bin/fpc,fpcres,...
/usr/lib/fpc/2.6.2/ppc386
fpc 2.7.1:
/usr/local/bin/fpc,fpcres,...
/usr/local/lib/fpc/2.7.1/ppc386,ppcx86,...

Then you can
a) set PATH
b) or call /full/path/ppcxxx and pass -FD
c) or call fpc and pass -FD and -Xp
d) or call fpc and pass -FD and -V

Correct?

Mattias

Reply by email

Sven Barth

My answer to Mattias should have gone to the list, so for completeness I include the full mail instead of leaving things out.

Mattias Gaertner wrote 22 lines
> Sven Barth hat am 12. Februar 2014 um 16:04 > geschrieben: > [...] > > a) set PATH > > b) or call /full/path/ppcxxx and pass -FD > > c) or call fpc and pass -FD and -Xp > > d) or call fpc and pass -FD and -V > > > > Correct? > Disclaimer: I don't know currently where fpc searches for ppcX if no -Xp is > given, I'd need to recheck that and maybe the corresponding lib dirs need to > be in PATH as well. > a) should work > b) should work as well, but won't allow you to cross compile to a different > architecture I meant, if I cross compile to i386 I call /full/path/ppc386. > c) should work What is the difference to b?

Difference to b is that you can pass the target platform to fpc to have it select the right compiler executable. For b you'll need to do this by switching the ppcxxx manually.

Show quoted text 6 lines
> d) won't work as -V merely adds "-"+param as a suffix to the compiler > binary's name Obviously the -V requires corresponding ppcxxx-postfix files or symlinks. What is the problem here?

I was referring to your specific scenario. There were no sufixes for the compilers so -V won't help here. Otherwise it will of course work.

Show quoted text 12 lines
> Please also note the following: you won't be able to compile for an > architecture that the fpc driver does not support. E.g. JVM was added in 2.7.1 > so a 2.6.2 fpc won't know how to find ppcjvm as we don't have 1:1 > correspondences between target name and compiler name (e.g. x86_64 vs. > ppcx64). Ah, thanks, that's important. Mattias

Regards,
Sven

Reply by email

patspiper
to Sven Barth: To quote myself: Sven
Sven Barth wrote 27 lines
Am 12.02.2014 10:01, schrieb patspiper: > On 12/02/14 10:03, Sven Barth wrote: >> Am 11.02.2014 23:19, schrieb Mattias Gaertner: >>> Hi, >>> >>> How does the compiler (2.6.2, 2.6.4, 2.7.1) search for sub tools like >>> fpcres? >>> >>> For example: first in its working directory, then in PATH, etc. >> Usual order is this: >> - path specified by -FD >> - path of compiler executable (ppcXXX) >> - PATH variable (or "Commands" on Mac OS Classic) >> >>> What parameters effects this search? -Xp? >> No, -FD is the parameter for this. > > Isn't -FD used for the binutils/crossbinutils? > > If so, then how are the tools which are in the fpc (not ppcxxx) > executable folder (such as fpcres) located? To quote myself: > Usual order is this: > - path specified by -FD > - path of compiler executable (ppcXXX) > - PATH variable (or "Commands" on Mac OS Classic)

If -FD<toolspath> and -XP<binutilsprefix> are specified, then fpc searches for '<binutilsprefix>-fpcres' in <toolspath> and PATH, and if it does not find it there, searches for 'fpcres' in PATH only. Is it intentional that it excludes <toolspath> from the latter search?

Related code is in comprsrc.pas function tresourcefile.compile.

Stephano

Reply by email