Sign in Join

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

Mailing lists / fpc-devel / 2004-01

fpc and ppc386

8 messages · 6 people · –

Reply by email Subscribe to this list Your subscription

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

Christopher Kirkpatrick

I have compiled cvs from the latest CVS in SuSE linux v 9.0. When I type the command fpc i get the response
Error: /usr/local/bin/ppc386 cannot be executed

However ppc386 is present in the same directory as fpc, with the same date and time stamp and the same date and time stamp as the file in ~/FreePascal/fpc/compiler. The file marked fpc is considerably smaller than ppc386
The file ppc386 (in either location) executes perfectly correctly as the freepascal compiler, so what is the matter with my fpc command? (Incidentally, the compiler functions correctly from lazarus compiled from the most recent cvs).

I could probably live with invoking ppc486 instaed of fpc, but it is an annoyance.

Christopher Kirkpatrick

Reply by email

Marco van de Voort
to Christopher Kirkpatrick
Show quoted text 15 lines
I have compiled cvs from the latest CVS in SuSE linux v 9.0. When I type the command fpc i get the response Error: /usr/local/bin/ppc386 cannot be executed However ppc386 is present in the same directory as fpc, with the same date and time stamp and the same date and time stamp as the file in ~/FreePascal/fpc/compiler. The file marked fpc is considerably smaller than ppc386 The file ppc386 (in either location) executes perfectly correctly as the freepascal compiler, so what is the matter with my fpc command? (Incidentally, the compiler functions correctly from lazarus compiled from the most recent cvs). I could probably live with invoking ppc486 instaed of fpc, but it is an annoyance.

We haven't figured this problem out entirely yet. On some systems it works, on some it doesn't.

The file "fpc" is a frontend binary that selects the right processor backend (ppc386), and its use is limited to compiling.

Removing fpc and symlinking fpc to ppc386 is the best for now I think.

Reply by email

Unknown author

I can further confirm that the problem exists in Fedora Core 1.

Thanks, deleting FPC and reconstructing the symlink solved the problem (for the time being).

Chris

Earlier message 31 lines
---------- Original Message ---------------------------------- From: Sebastian G�nther Reply-To: Date: Mon, 02 Feb 2004 12:48:35 +0100 >Marco van de Voort schrieb: >> >> We haven't figured this problem out entirely yet. On some systems it works, >> on some it doesn't. > >can confirm this problem for Debian 3.0 > > >_______________________________________________ >fpc-devel maillist - >http://lists.freepascal.org/mailman/listinfo/fpc-devel > >________________________________________________________________________ >This email has been scanned using the CleanPort MEF antivirus >system. Funded for members by the Doctors.net.uk Bulletin service >How does this protect me? http://www.Doctors.net.uk/qualityemail >________________________________________________________________________ > > > _______________________________________________________________________ All email and attachments sent from http://www.Doctors.net.uk have been scanned by the MessageLabs SkyScan antivirus system _______________________________________________________________________

Reply by email

Florian Klaempfl
to Unknown author
I can further confirm that the problem exists in Fedora Core 1. Thanks, deleting FPC and reconstructing the symlink solved the problem (for the time being).

Can you explain what you did exactly. It might help us to find the problem?

Reply by email

Michalis Kamburelis

OK, I just figured out what was the cause of this problem.

In SysUtils.ExecuteProcess you were wrapping ppcbin compiler filename (like '/usr/local/ppc386') inside quotes (to make it something like '"/usr/local/ppc386"') but you were not stripping those quotes anywhere before passing this to execve (i.e. FpExecVE). So it shouldn't work (since execve should not tolerate any additional quotes in filename, even if it does on some UNIXes).

Patch to rtl/unix/unixutil.pp attached with (too many?) comments, it modifies StringToPPChar behavior so that it strips those quotes.

Regards,
Michalis

Reply by email

Marco van de Voort
to Michalis Kamburelis
Show quoted text 11 lines
OK, I just figured out what was the cause of this problem. In SysUtils.ExecuteProcess you were wrapping ppcbin compiler filename (like '/usr/local/ppc386') inside quotes (to make it something like '"/usr/local/ppc386"') but you were not stripping those quotes anywhere before passing this to execve (i.e. FpExecVE). So it shouldn't work (since execve should not tolerate any additional quotes in filename, even if it does on some UNIXes). Patch to rtl/unix/unixutil.pp attached with (too many?) comments, it modifies StringToPPChar behavior so that it strips those quotes.

While this is a solution in theory, I think this is only "hacking" a broken design.

I today commited fixes that keeps commandline and program to execute separately.

However that only solves the case for the program that is to be executed.

Arguments containing spaces will still go wrong. (Unix is very strict in this regard, arguments must be separated by the application). The best solution is to not have an interface that requires the arguments to be separated, iow, the primary function should be of the form

function execute(programtobeexecuted:ansistring);const arg : array of ansistring):cint;

This because there are several kinds of escaping spaces. Windows traditionally uses quotes, but unix uses escaping with backspaces.

However I will review your changes anyway, since at least they make sense for applications using the old interfaces.

Reply by email