Does the compiler generates (an) assembler file(s)?
I did not find here:
http://www.freepascal.org/docs-html/prog/prog.html

Mailing lists / fpc-pascal / 2012-08
15 messages · 7 people · –
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
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)?
Rainer Stratmann wroteI 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.
Jonas
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
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.
No, because command line switches override the switches in the configuration file, and…
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?
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
For finding a solution: what does the message from fpc compiler: "Note: Switching assembler to default writing assembler" means exactly?
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.
Both are applied. Use the above to find out what happens.
Mattias
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).
On Sun, 19 Aug 2012 16:45:59 +0200 Can you try a newer version? See Project / Project…
Mattias Gaertner wroteCan 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/...
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. (?)
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
For finding a solution: what does the message from fpc compiler: "Note: Switching…
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