[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] cross-tools libs & gcc invocation



Paul Wratt wrote:
so the following would produce an object file suitable for linking
(where you did not have a Makefile either)?
m68k-atari-mint-gcc eg_lib_src.c

No, the following is correct:
m68k-atari-mint-gcc -c eg_lib_src.c
The result will be an object file named eg_lib_src.o

and specifically for 040 the following would be optimal (using multilibs):
m68k-atari-mint-gcc -g -v -Wall -O2 -fomit-frame-pointer -m68020-60 -s
-o eg_lib_src.o eg_lib_src.c

Do not use both -g and -s.
-g indicates to embed source level debug information in the .o file
-s indicates to the linker to strip (remove) all the debug information from the final executable.

Also, I repeat: never link production programs on MiNT with -g because they will be linked with libc_g.a, the debug and unoptimal version.

Basically, if you don't plan to use gdb, never use -g.

Except that, your command line is correct and optimal:
m68k-atari-mint-gcc -v -Wall -O2 -fomit-frame-pointer -m68020-60 -o eg_lib_src.o eg_lib_src.c

--
Vincent Rivière