* x86_64
@ 2003-12-10 23:35 Ananda Bhattacharya
0 siblings, 0 replies; 11+ messages in thread
From: Ananda Bhattacharya @ 2003-12-10 23:35 UTC (permalink / raw)
To: gcc-help
Hi,
This is a pretty simple quesion, I was wondering if
anyone here compiled povray on an Opteron, and if so what
flags were uses in the Makefie CFLAGS and CXFLAGS options.
I just cannot get it to compile any help regarding this
matter will be great.
Here is the error that i am getting
Making all in src
make[1]: Entering directory
`/arnold/keg/anandab/download/povray-3.50c/src'
c++ -DPREFIX=\"/usr/local\"
-DPOV_LIB_DIR=\"/usr/local/share/povray-3.5\"
-DCOMPILER_VER=\".Linux.gcc\"
-DSYSCONFDIR=\"/usr/local/etc\" -DUSE_IO_RESTRICTIONS=\"\"
`if [ "Xgcc" = "Xgcc" ]; then echo "-Wno-multichar"; fi `
-O3 -finline-functions -ffast-math -fomit-frame-pointer
-funroll-loops -fexpensive-optimizations
-foptimize-sibling-calls -minline-all-stringops
-Wno-multichar -c bbox.cpp
In file included from bbox.cpp:47:
optout.h:49:2: #error You must complete the following
DISTRIBUTION_MESSAGE macro
bbox.cpp: In function `int sort_and_split(BBOX_TREE**,
BBOX_TREE**&, long int*,
long int, long int)':
bbox.cpp:1872: warning: assignment to `long int' from
`double'
bbox.cpp:1872: warning: argument to `long int' from `double'
make[1]: *** [bbox.o] Error 1
##################################################
What should my correct compiler flags be.
thanks
PS this might be a trivial problem so sorry for bothering
anyone.
-Ananda
--
Recruiter: "How do you write a perl script?"
Canidate : "You type it."
-Actual phone interview, Circa Nov 2003
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: x86_64
2009-01-20 2:46 ` x86_64 Bob Plantz
@ 2009-01-20 14:35 ` Andrew Haley
0 siblings, 0 replies; 11+ messages in thread
From: Andrew Haley @ 2009-01-20 14:35 UTC (permalink / raw)
To: Bob Plantz; +Cc: John Fine, Yang Zhang, GCC-help
Bob Plantz wrote:
> On Mon, 2009-01-19 at 18:34 +0000, Andrew Haley wrote:
>
>> http://refspecs.freestandards.org/elf/x86_64-abi-0.95.pdf
>
> v0.99 is available at
>
> http://www.x86-64.org/documentation.html
Yeah, thanks. I've tried to persuade the LSB to update that link,
but the ABI is frozen at that version, bugs and all.
Andrew.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: x86_64
2009-01-19 18:34 ` x86_64 Andrew Haley
@ 2009-01-20 2:46 ` Bob Plantz
2009-01-20 14:35 ` x86_64 Andrew Haley
0 siblings, 1 reply; 11+ messages in thread
From: Bob Plantz @ 2009-01-20 2:46 UTC (permalink / raw)
To: Andrew Haley; +Cc: John Fine, Yang Zhang, GCC-help
On Mon, 2009-01-19 at 18:34 +0000, Andrew Haley wrote:
>
> http://refspecs.freestandards.org/elf/x86_64-abi-0.95.pdf
>
> Andrew.
>
v0.99 is available at
http://www.x86-64.org/documentation.html
Bob
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: x86_64
2009-01-19 18:24 ` x86_64 John Fine
@ 2009-01-19 18:34 ` Andrew Haley
2009-01-20 2:46 ` x86_64 Bob Plantz
0 siblings, 1 reply; 11+ messages in thread
From: Andrew Haley @ 2009-01-19 18:34 UTC (permalink / raw)
To: John Fine; +Cc: Yang Zhang, GCC-help
John Fine wrote:
> Andrew Haley wrote:
>> Yang Zhang wrote:
>>
>>> The x86_64 output also sports a .section eh_frame despite the fact that
>>> I'm not using g++, which seems to just contain some data layout
>>> description of the above labeled items.
>>>
>>
>> I presume you saw my reply; all the answers are there.
>>
>>
>
> Was that content that shouldn't go to the mailing list for some reason?
Not at all; I don't know why the reply didn't go to the list
The reply was:
Start at
http://refspecs.freestandards.org/
then
http://refspecs.freestandards.org/elf/x86_64-abi-0.95.pdf
Andrew.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: x86_64
2009-01-19 17:04 ` x86_64 Andrew Haley
2009-01-19 17:17 ` x86_64 Yang Zhang
@ 2009-01-19 18:24 ` John Fine
2009-01-19 18:34 ` x86_64 Andrew Haley
1 sibling, 1 reply; 11+ messages in thread
From: John Fine @ 2009-01-19 18:24 UTC (permalink / raw)
To: Andrew Haley; +Cc: Yang Zhang, GCC-help
Andrew Haley wrote:
> Yang Zhang wrote:
>
>> The x86_64 output also sports a .section eh_frame despite the fact that
>> I'm not using g++, which seems to just contain some data layout
>> description of the above labeled items.
>>
>
> I presume you saw my reply; all the answers are there.
>
>
Was that content that shouldn't go to the mailing list for some reason?
I know a fair amount of this stuff myself already, but not so much that
I don't want to learn more. Also, someone finding this question later
by a search of the mailing list archive might want to see the answers as
well.
(Your reply with answers is not visible at
http://gcc.gnu.org/ml/gcc-help/2009-01/ )
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: x86_64
2009-01-19 17:04 ` x86_64 Andrew Haley
@ 2009-01-19 17:17 ` Yang Zhang
2009-01-19 18:24 ` x86_64 John Fine
1 sibling, 0 replies; 11+ messages in thread
From: Yang Zhang @ 2009-01-19 17:17 UTC (permalink / raw)
To: Andrew Haley; +Cc: John Fine, GCC-help
Andrew Haley wrote:
> Yang Zhang wrote:
>> John Fine wrote:
>>> If you understand the 32-bit and you can read the AMD manuals, I don't
>>> see what else might be confusing you (actually even the above register
>>> lists were in one of the AMD manuals).
>>>
>>> What is confusing about the use of local labels by the compiler?
>> There are many of these labels in the x86_64 output and none in the x86
>> output. I can't piece together how they're being used.
>>
>> The x86_64 output also sports a .section eh_frame despite the fact that
>> I'm not using g++, which seems to just contain some data layout
>> description of the above labeled items.
>
> I presume you saw my reply; all the answers are there.
>
> Andrew.
Yes, thanks - I'm looking through it now.
--
Yang Zhang
http://www.mit.edu/~y_z/
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: x86_64
2009-01-19 16:56 ` x86_64 Yang Zhang
@ 2009-01-19 17:04 ` Andrew Haley
2009-01-19 17:17 ` x86_64 Yang Zhang
2009-01-19 18:24 ` x86_64 John Fine
0 siblings, 2 replies; 11+ messages in thread
From: Andrew Haley @ 2009-01-19 17:04 UTC (permalink / raw)
To: Yang Zhang; +Cc: John Fine, GCC-help
Yang Zhang wrote:
> John Fine wrote:
>> If you understand the 32-bit and you can read the AMD manuals, I don't
>> see what else might be confusing you (actually even the above register
>> lists were in one of the AMD manuals).
>>
>> What is confusing about the use of local labels by the compiler?
>
> There are many of these labels in the x86_64 output and none in the x86
> output. I can't piece together how they're being used.
>
> The x86_64 output also sports a .section eh_frame despite the fact that
> I'm not using g++, which seems to just contain some data layout
> description of the above labeled items.
I presume you saw my reply; all the answers are there.
Andrew.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: x86_64
2009-01-19 10:47 x86_64 Yang Zhang
2009-01-19 15:21 ` x86_64 John Fine
@ 2009-01-19 16:57 ` Bob Plantz
1 sibling, 0 replies; 11+ messages in thread
From: Bob Plantz @ 2009-01-19 16:57 UTC (permalink / raw)
To: Yang Zhang; +Cc: GCC-help
On Mon, 2009-01-19 at 05:16 -0500, Yang Zhang wrote:
> Are there any good resources for learning about gcc's x86_64 assembly
> output? When I run `gcc -S a.c` for a simple test C program like the
> one below, I can completely understand the resulting go.s on a 32-bit
> x86, but as soon as I run that on a 64-bit machine, I'm lost. I know
> what the instructions are (i.e. I know how to use the AMD manuals), but
> I'd like to learn about gcc's assembly output: the exact new calling
> conventions (registers seem to be more liberally used over the stack now
> even without opt), all these
> .LFB/.LCFI/.LFE/.Lframe/.LSCIE/.LSFDE/.LASFDE/... labels, and so on.
> Thanks in advance for any guidance.
>
> void foo(int a, int b, int c) { char xs[5]; char ys[10]; }
> int main() { foo(1,2,3); return 0; }
>
Many of the local labels you see are coming from the DWARF2 unwind
table. I don't know a lot about it, but I believe it's used for
exception processing, for example, using a debugger.
You can eliminate this table with the following options:
$ gcc -O0 -g -Wa,-adhls -fno-asynchronous-unwind-tables \
> myProg.c > myProg.lst
These options will also provide some comments in the assembly listing
that refer back to the C source code. This should help you "cut to the
chase" in trying to figure this out.
Bob Plantz
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: x86_64
2009-01-19 15:21 ` x86_64 John Fine
@ 2009-01-19 16:56 ` Yang Zhang
2009-01-19 17:04 ` x86_64 Andrew Haley
0 siblings, 1 reply; 11+ messages in thread
From: Yang Zhang @ 2009-01-19 16:56 UTC (permalink / raw)
To: John Fine; +Cc: GCC-help
John Fine wrote:
> If you understand the 32-bit and you can read the AMD manuals, I don't
> see what else might be confusing you (actually even the above register
> lists were in one of the AMD manuals).
>
> What is confusing about the use of local labels by the compiler?
There are many of these labels in the x86_64 output and none in the x86
output. I can't piece together how they're being used.
The x86_64 output also sports a .section eh_frame despite the fact that
I'm not using g++, which seems to just contain some data layout
description of the above labeled items.
I'm using gcc 4.3.2 if that matters.
Yang
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: x86_64
2009-01-19 10:47 x86_64 Yang Zhang
@ 2009-01-19 15:21 ` John Fine
2009-01-19 16:56 ` x86_64 Yang Zhang
2009-01-19 16:57 ` x86_64 Bob Plantz
1 sibling, 1 reply; 11+ messages in thread
From: John Fine @ 2009-01-19 15:21 UTC (permalink / raw)
To: Yang Zhang; +Cc: GCC-help
I forget where it is documented. I have the following two register
lists taped on the bottom bezel of one of my CRT's, because I debug a
lot of C++ code in assembler view and this key part of the calling
convention is important whenever you debug C++ in assembler view:
1) Parameters passed in registers, left to right: rdi, rsi, rdx, rcx,
r8, r9
2) registers preserved by call: rbp, rbx, r12-r15
so in your example, assuming foo was NOT optimized to be inline, "a"
would be passed in rdi, "b" would be passed in rsi and "c" would be
passed in rdx.
Obviously it gets more complicated when you mix in data types other than
pointers and integers. Also, I hope obvious, in member functions "this"
is passed in as if it were the leftmost parameter.
If you understand the 32-bit and you can read the AMD manuals, I don't
see what else might be confusing you (actually even the above register
lists were in one of the AMD manuals).
What is confusing about the use of local labels by the compiler?
Yang Zhang wrote:
> Are there any good resources for learning about gcc's x86_64 assembly
> output? When I run `gcc -S a.c` for a simple test C program like the
> one below, I can completely understand the resulting go.s on a 32-bit
> x86, but as soon as I run that on a 64-bit machine, I'm lost. I know
> what the instructions are (i.e. I know how to use the AMD manuals),
> but I'd like to learn about gcc's assembly output: the exact new
> calling conventions (registers seem to be more liberally used over the
> stack now even without opt), all these
> .LFB/.LCFI/.LFE/.Lframe/.LSCIE/.LSFDE/.LASFDE/... labels, and so on.
> Thanks in advance for any guidance.
>
> void foo(int a, int b, int c) { char xs[5]; char ys[10]; }
> int main() { foo(1,2,3); return 0; }
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* x86_64
@ 2009-01-19 10:47 Yang Zhang
2009-01-19 15:21 ` x86_64 John Fine
2009-01-19 16:57 ` x86_64 Bob Plantz
0 siblings, 2 replies; 11+ messages in thread
From: Yang Zhang @ 2009-01-19 10:47 UTC (permalink / raw)
To: GCC-help
Are there any good resources for learning about gcc's x86_64 assembly
output? When I run `gcc -S a.c` for a simple test C program like the
one below, I can completely understand the resulting go.s on a 32-bit
x86, but as soon as I run that on a 64-bit machine, I'm lost. I know
what the instructions are (i.e. I know how to use the AMD manuals), but
I'd like to learn about gcc's assembly output: the exact new calling
conventions (registers seem to be more liberally used over the stack now
even without opt), all these
.LFB/.LCFI/.LFE/.Lframe/.LSCIE/.LSFDE/.LASFDE/... labels, and so on.
Thanks in advance for any guidance.
void foo(int a, int b, int c) { char xs[5]; char ys[10]; }
int main() { foo(1,2,3); return 0; }
--
Yang Zhang
http://www.mit.edu/~y_z/
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2009-01-20 14:35 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-12-10 23:35 x86_64 Ananda Bhattacharya
2009-01-19 10:47 x86_64 Yang Zhang
2009-01-19 15:21 ` x86_64 John Fine
2009-01-19 16:56 ` x86_64 Yang Zhang
2009-01-19 17:04 ` x86_64 Andrew Haley
2009-01-19 17:17 ` x86_64 Yang Zhang
2009-01-19 18:24 ` x86_64 John Fine
2009-01-19 18:34 ` x86_64 Andrew Haley
2009-01-20 2:46 ` x86_64 Bob Plantz
2009-01-20 14:35 ` x86_64 Andrew Haley
2009-01-19 16:57 ` x86_64 Bob Plantz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).