Sign in Join

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

Mailing lists / fpc-pascal / 2012-08

Assembler file generate by compiler

15 messages · 7 people · –

Reply by email Subscribe to this list Your subscription

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

Rainer Stratmann
to Martin
Martin wrote 10 lines
On 18/08/2012 21:03, Rainer Stratmann wrote: > Does the compiler generates (an) assembler file(s)? > > I did not find here: > http://www.freepascal.org/docs-html/prog/prog.html http://www.freepascal.org/docs-html/user/userch5.html#x33-400005 http://www.freepascal.org/docs-html/user/usersu15.html#x38-450005.1.4 see the options starting with -a

I did option -a, the compiler needs longer now, but where can I see the generated file(s)?

Reply by email

Rainer Stratmann
to Jonas Maebe
Jonas Maebe wrote 5 lines
On 18 Aug 2012, at 22:48, Rainer Stratmann wrote: > I did option -a, the compiler needs longer now, but where can I see the > generated file(s)? In the same directory that contains the generated .o and .ppu files.

They are not there.
In the fpc.cfg is a switch that the assembler has to feed by a pipe. Is that the reason?

Reply by email

Jonas Maebe
to Rainer Stratmann
Rainer Stratmann wrote 10 lines
Am Saturday 18 August 2012 23:53:36 schrieb Jonas Maebe: > On 18 Aug 2012, at 22:48, Rainer Stratmann wrote: >> I did option -a, the compiler needs longer now, but where can I see the >> generated file(s)? > > In the same directory that contains the generated .o and .ppu files. They are not there. In the fpc.cfg is a switch that the assembler has to feed by a pipe. Is that the reason?

No, because command line switches override the switches in the configuration file, and "-a" means "leave the generated assembler files behind". When asking for help, it's also always a good idea to provide all information that may be relevant, such as the actual command line you are using and platform you are on.

Jonas

Reply by email

Mark Morgan Lloyd
to Jonas Maebe
Jonas Maebe wrote 12 lines
On 19 Aug 2012, at 10:55, Rainer Stratmann wrote: > Am Saturday 18 August 2012 23:53:36 schrieb Jonas Maebe: >> On 18 Aug 2012, at 22:48, Rainer Stratmann wrote: >>> I did option -a, the compiler needs longer now, but where can I see the >>> generated file(s)? >> In the same directory that contains the generated .o and .ppu files. > They are not there. > In the fpc.cfg is a switch that the assembler has to feed by a pipe. > Is that the reason? No, because command line switches override the switches in the configuration file, and "-a" means "leave the generated assembler files behind". When asking for help, it's also always a good idea to provide all information that may be relevant, such as the actual command line you are using and platform you are on.

On Linux:

$ fpc -h |head -12
Free Pascal Compiler version 2.7.1 [2012/07/17] for sparc Copyright (c) 1993-2012 by Florian Klaempfl and others /usr/local/bin/fpc [options] <inputfile> [options] Put + after a boolean switch option to enable it, - to disable it -a The compiler doesn't delete the generated assembler file -al List sourcecode lines in assembler file -an List node info in assembler file (-dEXTDEBUG compiler) -ap Use pipes instead of creating temporary assembler files -ar List register allocation/release info in assembler file -at List temp allocation/release info in assembler file -A<x> Output format:

$ fpc -a testSockAddrConv.pas
Free Pascal Compiler version 2.7.1 [2012/07/17] for sparc Copyright (c) 1993-2012 by Florian Klaempfl and others Target OS: Linux for SPARC
Compiling testSockAddrConv.pas
Assembling testsockaddrconv
Linking testSockAddrConv
29 lines compiled, 2.1 sec
0 2> ls -lt |head
total 6984356
-rwxr-xr-x 1 markMLl markMLl 55572 2012-08-19 09:09 testSockAddrConv -rw-r--r-- 1 markMLl markMLl 8896 2012-08-19 09:09 testSockAddrConv.o -rw-r--r-- 1 markMLl markMLl 12957 2012-08-19 09:09 testSockAddrConv.s -rw-r--r-- 1 markMLl markMLl 67338240 2012-08-13 10:30 cos_117.img

$ head<testSockAddrConv.s -12
.file "testSockAddrConv.pas"
# Begin asmlist al_begin
# End asmlist al_begin
# Begin asmlist al_stabs
# End asmlist al_stabs
# Begin asmlist al_procedures

.section .text.n_main
.balign 4
.globl PASCALMAIN
.type PASCALMAIN,@function
PASCALMAIN:

Your mileage might vary for other OSes.

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email

Rainer Stratmann
to Jonas Maebe: No, because command line switches override the switches in the configuration file, and…
Jonas Maebe wrote 17 lines
On 19 Aug 2012, at 10:55, Rainer Stratmann wrote: > Am Saturday 18 August 2012 23:53:36 schrieb Jonas Maebe: >> On 18 Aug 2012, at 22:48, Rainer Stratmann wrote: >>> I did option -a, the compiler needs longer now, but where can I see the >>> generated file(s)? >> >> In the same directory that contains the generated .o and .ppu files. > > They are not there. > In the fpc.cfg is a switch that the assembler has to feed by a pipe. > Is that the reason? No, because command line switches override the switches in the configuration file, and "-a" means "leave the generated assembler files behind". When asking for help, it's also always a good idea to provide all information that may be relevant, such as the actual command line you are using and platform you are on.

lazarus v0.9.30-0
fpc 2.4.2-0 [2010/11/11] for i386

I put "-a" to projectsettings -> other -> userdefined settings

Output of the message window when compiling:
Note: Switching assembler to default writing assembler

I can still not see an assemblerfile...

If I activate extrafpc.cfg what happens then with the settings in the dialog boxes?

Reply by email

Jonas Maebe
to Rainer Stratmann
Rainer Stratmann wrote 8 lines
fpc 2.4.2-0 [2010/11/11] for i386 I put "-a" to projectsettings -> other -> userdefined settings Output of the message window when compiling: Note: Switching assembler to default writing assembler I can still not see an assemblerfile...

Try using the command line compiler instead, or ask on the Lazarus list. And in the future, please always mention what exactly you are doing from the start.

If I activate extrafpc.cfg what happens then with the settings in the dialog boxes?

I don't know, ask on the Lazarus list. Lazarus and FPC are developed by different people.

Jonas

Reply by email

Rainer Stratmann
to Jonas Maebe
Jonas Maebe wrote 19 lines
On 19 Aug 2012, at 16:45, Rainer Stratmann wrote: > fpc 2.4.2-0 [2010/11/11] for i386 > > I put "-a" to projectsettings -> other -> userdefined settings > > Output of the message window when compiling: > Note: Switching assembler to default writing assembler > > I can still not see an assemblerfile... Try using the command line compiler instead, or ask on the Lazarus list. And in the future, please always mention what exactly you are doing from the start. > If I activate extrafpc.cfg what happens then with the settings in the > dialog boxes? I don't know, ask on the Lazarus list. Lazarus and FPC are developed by different people.

For finding a solution: what does the message from fpc compiler: "Note: Switching assembler to default writing assembler" means exactly?

Reply by email

Mattias Gaertner
to Rainer Stratmann: lazarus v0.9.30-0 fpc 2.4.2-0 [2010/11/11] for i386 I put "-a" to projectsettings ->…
[...] lazarus v0.9.30-0 fpc 2.4.2-0 [2010/11/11] for i386

Can you try a newer version?

I put "-a" to projectsettings -> other -> userdefined settings

See Project / Project Options / Show Options.
You can copy+paste the options from there.

Show quoted text 7 lines
Output of the message window when compiling: Note: Switching assembler to default writing assembler I can still not see an assemblerfile... If I activate extrafpc.cfg what happens then with the settings in the dialog boxes?

Both are applied. Use the above to find out what happens.

Mattias

Reply by email

leledumbo
to Rainer Stratmann: For finding a solution: what does the message from fpc compiler: "Note: Switching…
For finding a solution: what does the message from fpc compiler:

"Note: Switching assembler to default writing assembler" means exactly?

http://www.freepascal.org/docs-html/user/userse70.html AFAIK when -a is given, the internal assembler can't be executed (the internal assembler seems to work at data structure level, not textual level).

View this message in context: http://free-pascal-general.1045716.n5.nabble.com/Assembler-file-generate-by-compiler-tp5710837p5710865.html Sent from the Free Pascal - General mailing list .

Reply by email

Rainer Stratmann
to Mattias Gaertner: On Sun, 19 Aug 2012 16:45:59 +0200 Can you try a newer version? See Project / Project…
Mattias Gaertner wrote
Can you try a newer version?

I am afraid of all the problems then with installing on a linux computer. The computer further has no connection to the internet. I try step by step to get more independend from lazarus first. Then it will be far more easier I hope.

> I put "-a" to projectsettings -> other -> userdefined settings See Project / Project Options / Show Options. You can copy+paste the options from there.

That's what I was looking for.
This button is on a special place where I do not assume it.

I found the assembler files now!
They are located in the subdir lib/i386-linux/...

Show quoted text 9 lines
> Output of the message window when compiling: > Note: Switching assembler to default writing assembler > > I can still not see an assemblerfile... > > If I activate extrafpc.cfg what happens then with the settings in the > dialog boxes? Both are applied. Use the above to find out what happens.

Thanks.
Is there a way to switch off the settings in the dialog boxes so that extrafpc.cfg only is used?
If not I assume extrafpc.cfg overwrites the settings in the dialog boxes. (?)

Reply by email

Mattias Gaertner
to Rainer Stratmann
Show quoted text 9 lines
[...] > > If I activate extrafpc.cfg what happens then with the settings in the > > dialog boxes? > > Both are applied. Use the above to find out what happens. Thanks. Is there a way to switch off the settings in the dialog boxes so that extrafpc.cfg only is used?

You have to switch them off one by one.

If not I assume extrafpc.cfg overwrites the settings in the dialog boxes. (?)

FPC reads options from left to right.

Mattias

Reply by email

Sven Barth
to Rainer Stratmann: For finding a solution: what does the message from fpc compiler: "Note: Switching…
Rainer Stratmann wrote 24 lines
Am Sunday 19 August 2012 16:50:20 schrieb Jonas Maebe: > On 19 Aug 2012, at 16:45, Rainer Stratmann wrote: >> fpc 2.4.2-0 [2010/11/11] for i386 >> >> I put "-a" to projectsettings -> other -> userdefined settings >> >> Output of the message window when compiling: >> Note: Switching assembler to default writing assembler >> >> I can still not see an assemblerfile... > > Try using the command line compiler instead, or ask on the Lazarus list. > And in the future, please always mention what exactly you are doing from > the start. > >> If I activate extrafpc.cfg what happens then with the settings in the >> dialog boxes? > > I don't know, ask on the Lazarus list. Lazarus and FPC are developed by > different people. For finding a solution: what does the message from fpc compiler: "Note: Switching assembler to default writing assembler" means exactly?

As leledumbo said: by default the compiler for i386 and x86_64 uses the internal assembler which uses the generated assembler code class tree and converts that to binary code directly, thus no file is generated. If you now pass an "-a" option the compiler switches to an assembler were the generation of files is done and then calls that assembler (e.g. GNU as) to assemble the assembler file to binary code.

Regards,
Sven

Reply by email