Sign in Join

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

Mailing lists / fpc-devel / 2021-08

Using -a or -s option forces change to external assembler

3 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

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

Christo Crause

On Linux 64 bit the compiler defaults to using the internal assembler. When adding the -a command line option an external assembler is called. This is unexpected based on the description of the -a option. Specifying -Aelf (to force using the internal assembler) is also ignored when used with -a, without a message. Also when using the -s option the internal assembler is disabled, again somewhat unexpectedly in my opinion.

Is this behaviour documented somewhere else? Since it is unexpected (at least from my understanding of the documentation), can this behaviour be added to the command line help output?

Would it make sense to implement an alternative interpretation, where the internal assembler is used if specified/default with just an output writer for the -a case? In the case of -s there would be no assembler output, so the user can then only check and tweak the linking step.

Best regards,
Christo

Reply by email

Jonas Maebe
to Christo Crause
Christo Crause wrote
Would it make sense to implement an alternative interpretation, where the internal assembler is used if specified/default with just an output writer for the -a case?

The compiler only supports activating a single assembler writer at a time. I'm not sure it worth reworking that logic just to support writing a text assembler file and then assembling using the internal assembler.

In the case of -s there would be no assembler output, so the user can then only check and tweak the linking step.

You can use the -Cn parameter for that.

Jonas

Reply by email

Tomas Hajny
to Jonas Maebe
Jonas Maebe wrote 10 lines
On 22/08/2021 16:48, Christo Crause via fpc-devel wrote: > Would it make sense to implement an alternative interpretation, where > the internal assembler is used if specified/default with just an > output > writer for the -a case? The compiler only supports activating a single assembler writer at a time. I'm not sure it worth reworking that logic just to support writing a text assembler file and then assembling using the internal assembler.

Apart from complicating things, using a different writers for the text output and for assembled binary might result in differences (assembled output from the text assembler source might not be absolutely equal to the result of the internal assembler) which might lead to serious confusions. Obviously, we may extend the description of this option in the documentation (and also of -s) in order to avoid surprises - feel free to create a bug report for the docs.

Tomas

Reply by email