translate offsets to library calls

This forum is for general developer support questions.
User avatar
tonyw
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 1479
Joined: Wed Mar 09, 2011 1:36 pm
Location: Sydney, Australia

Re: translate offsets to library calls

Post by tonyw »

@JosDuchit:

I think you have to perform the final link with -g as well. Certainly I have -g in both the gcc -c command line and the link line.
eg:

CFLAGS = -mcrt=newlib -O2 -fomit-frame-pointer -fno-builtin -fstrength-reduce -c\
-D__NOGLOBALIFACE__ -D$(DBUG) -D$(ENV) -mmultiple \
-Iinc/ -I../../../include \
-Wall -W -Wundef -Wshadow -Wpointer-arith \
-Wsign-compare -Wmissing-prototypes \
-Wmissing-declarations \
-Waggregate-return -Wwrite-strings -Werror -g
LDFLAGS = -mcrt=newlib -nostartfiles -g
cheers
tony
User avatar
ssolie
Beta Tester
Beta Tester
Posts: 1010
Joined: Mon Dec 20, 2010 8:51 pm
Location: Canada
Contact:

Re: translate offsets to library calls

Post by ssolie »

When using debugging it is best to use -gstabs on both the compiler and linker lines. Just using "-g" may not always work when binaries get large.
ExecSG Team Lead
JosDuchIt
Posts: 291
Joined: Sun Jun 26, 2011 5:47 pm
Contact:

Re: translate offsets to library calls

Post by JosDuchIt »

@TonyW

Till now i just compile and link directly.
gcc guis:Dev/G4C_2011/guiNotCleaned.c -xc -gstabs -lm -lauto -o guis:G4T11nco
gcc guis:Dev/G4C_2011/guiIFace.c -xc -gstabs -lm -o guis:G4T11if

Both those sources do the same job , in the last i have opened all 9 libraries explicitly.
Both "include" a large number of "header files" eg window.h that in fact contain specific funtions.

I looked at your CFLAGS and was rather puzzled : are you suggesting i should use them? I looked through the gcc handbook to know what they mean. Frankly for some of them i still don't see the light.

At this stage i surely am not interested in optimizing, and the use of -Werror would prevent the source from compiling since i have not yet cleaned up deprecated functions (Seek, Examone, ..) most of the time.
Could you explain your -D options (which are not found in the gcc handbook ) ? Thanks
User avatar
ChrisH
Beta Tester
Beta Tester
Posts: 920
Joined: Mon Dec 20, 2010 9:09 pm
Contact:

Re: translate offsets to library calls

Post by ChrisH »

ssolie wrote:When using debugging it is best to use -gstabs on both the compiler and linker lines. Just using "-g" may not always work when binaries get large.
I recall that either -gstabs or -ggdb (not sure if I tried both) did not work with a particularly large C++ program (about 80k lines, 3MB stripped executable). I think the intermediate assembler didn't like some long names in the (artificially generated) source code.

So I ended-up using just -g , which seemed to work fine in my large program. Why might it not?
Post Reply