Closed githubaf closed 2 years ago
make: *** No targets specified and no makefile found. Stop.
Do you use eclipse? It seems to create the makefiles when doing "Build project" I can of course add them all to git if you like.
fixed that one - the resulting file is very small /shrug
guess you have to add some symbols via -u _function
to get these picked up.
ok, better now. please test once live
There is no ld crash any longer. But the executable file just crashes here. I will look if other options such as -ffast-math -mregparm have an influence.
-> -ffast-math -mregparm are not guilty.
For a test I compiled all sources without "-ffunction-sections -fdata-secetions" but linked with --gc-sections,--print-gc-sections. The executable still wouldn't start.
/home/developer/opt/m68k-amigaos_16May22/lib/gcc/m68k-amigaos/6.5.0b/../../../../m68k-amigaos/bin/ld: removing unused section '.data' in file './vgl/boards.o'
/home/developer/opt/m68k-amigaos_16May22/lib/gcc/m68k-amigaos/6.5.0b/../../../../m68k-amigaos/bin/ld: removing unused section '.data' in file './vgl/clib.o'
/home/developer/opt/m68k-amigaos_16May22/lib/gcc/m68k-amigaos/6.5.0b/../../../../m68k-amigaos/bin/ld: removing unused section '.data' in file './vgl/defpal.o'
/home/developer/opt/m68k-amigaos_16May22/lib/gcc/m68k-amigaos/6.5.0b/../../../../m68k-amigaos/bin/ld: removing unused section '.data' in file './vgl/dumbbitblt.o'
/home/developer/opt/m68k-amigaos_16May22/lib/gcc/m68k-amigaos/6.5.0b/../../../../m68k-amigaos/bin/ld: removing unused section '.bss' in file './vgl/dumbpoly.o'
/home/developer/opt/m68k-amigaos_16May22/lib/gcc/m68k-amigaos/6.5.0b/../../../../m68k-amigaos/bin/ld: removing unused section '.data' in file './vgl/dumbtext.o'
/home/developer/opt/m68k-amigaos_16May22/lib/gcc/m68k-amigaos/6.5.0b/../../../../m68k-amigaos/bin/ld: removing unused section '.data' in file './vgl/fontsmall.o'
./HyperKhorner4M-1_gcc.o
./Images.o
./InteractiveDraw.o
./InteractiveUtils.o
./InteractiveView.o
/home/developer/opt/m68k-amigaos_16May22/lib/gcc/m68k-amigaos/6.5.0b/../../../../m68k-amigaos/bin/ld: removing unused section '.text' in file './MUIFloatInt.o'
/home/developer/opt/m68k-amigaos_16May22/lib/gcc/m68k-amigaos/6.5.0b/../../../../m68k-amigaos/bin/ld: removing unused section '.data' in file './MUIFloatInt.o'
/home/developer/opt/m68k-amigaos_16May22/lib/gcc/m68k-amigaos/6.5.0b/../../../../m68k-amigaos/bin/ld: removing unused section '.data' in file './MapExtra.o'
/home/developer/opt/m68k-amigaos_16May22/lib/gcc/m68k-amigaos/6.5.0b/../../../../m68k-amigaos/bin/ld: removing unused section '.text' in file '/home/developer/opt/m68k-amigaos_16May22/m68k-amigaos/libnix/lib/libnix.a(atol.o)'
Is the empty section
removing unused section '.text' in file './MUIFloatInt.o'
correct? There are used functions...
As a nice part: when building WCS with -ffunction-sections -fdata-secetions and linking with --gc-sections,--print-gc-sections it really founds several unused functions that I had overseen before. So undefining them and compiling without garbage collection resulted in a smaller working executable.
if the program does not run, then there is a bug, something is not evaluated to determine what should be picked up...
... but:
Is the empty section
removing unused section '.text' in file './MUIFloatInt.o'
correct? There are used functions...really? which one? All seems either
static
, excluded via#ifdef
or not used...
If I compile with -ffunctions-sections and -fdata-sections and link with -gc, the linker says
m68k-amigaos/bin/ld: removing unused section '.text.mSync' in file './MUIFloatInt.o'
m68k-amigaos/bin/ld: removing unused section '.text.mNew' in file './MUIFloatInt.o'
m68k-amigaos/bin/ld: removing unused section '.text.mDispose' in file './MUIFloatInt.o'
m68k-amigaos/bin/ld: removing unused section '.text.mInc' in file './MUIFloatInt.o'
m68k-amigaos/bin/ld: removing unused section '.text.mDec' in file './MUIFloatInt.o'
m68k-amigaos/bin/ld: removing unused section '.text.mStr' in file './MUIFloatInt.o'
m68k-amigaos/bin/ld: removing unused section '.text.mSet' in file './MUIFloatInt.o'
m68k-amigaos/bin/ld: removing unused section '.text.mGet' in file './MUIFloatInt.o'
m68k-amigaos/bin/ld: removing unused section '.text.mChangeFocus' in file './MUIFloatInt.o'
m68k-amigaos/bin/ld: removing unused section '.text.mLoseFocus' in file './MUIFloatInt.o'
m68k-amigaos/bin/ld: removing unused section '.text.Dispatcher' in file './MUIFloatInt.o'
m68k-amigaos/bin/ld: removing unused section '.text.DoIncDec' in file './MUIFloatInt.o'
m68k-amigaos/bin/ld: removing unused section '.text.CalcIncDec' in file './MUIFloatInt.o'
That made me wonder. They are used, aren't they? (Maybe that is correct but looks strange?)
Dispatcher isn't use elsewhere - thus the static functions aren't used either.
You are right, sorry for confusion. Nice gcc found that. Makes the executable another 4.5kBytes smaller. (But the problem with the -gc linked executable is still there)
updated github
you have to figure out what's left out but should be there...
If I compare the output of m68k-amigaos-nm or the linker-mapfile, for instance _cpucheck _CreateExtIO DoMethod getMathIeeeDoubBasBase ___getUtilityBase
are missing in the bad executable.
But I find the static functions and variables in the bad file.
The program starts and works (but not entirely correct) when compiled/linked without -fbaserel. I will test more.
The program starts and works (but not entirely correct) when compiled/linked without -fbaserel. I will test more.
uh - ah - baserel: guess then all .data and .bss must be kept
Status: I am currently trying to find more indicative. The program seems to do nothing when started, no GUI, just nothing. I am adding KPrintF to find where the program hangs.
KPrintF shows that main is called several times!??? It looks like a loop where after a fixed sequence of lines main() is called again.
../WCS.c main() is called.
../WCS.c main() calls ../AGUI.c WCS_App_New()
../AGUI.c WCS_App_New() calls ../RexxSupport.c Rexx_New()
../RexxSupport.c Rexx_New() calls CreatePort(), that does not return!!!
---> ../WCS.c main() is called again at the very beginning!
I am not sure about the map-file. Is CreatePort() included or removed from the executable?
hm, that SAS/C output is not that helpful... but:
Discarded input sections
...
.text 0x0000000000000000 0xbc /opt/amiga/m68k-amigaos/lib/libamiga.a(CreatePort.o)
...
it is referenced from RexxSupport.o
SYMBOL TABLE:
...
00000000 *UND* 0001 81 _CreatePort
Disassembly of section .text.Rexx_New:
00000000 00000000 _Rexx_New:
...
13e: 4eb9 0000 0000 jsr 0 0 _CreatePort
but some stuff from RexxSupport.o is also dropped and that's the default .text
section.
What if these undefined symbols are all attached to the default .text
section? => none of these gets picked up...
GAH!
The library libamiga.a
is in the old a.out format -> can't work!
Now it gets picked up
.text 0x0000000000015980 0xbc /opt/amiga/m68k-amigaos/lib/libamiga.a(CreatePort.o)
0x0000000000015980 CreatePort
0x00000000000159fa DeletePort
Super! We are comming closer. WCS with garbage collection can now start again without hanging or repeating main(). Image calculation does not crash.
~~The calculated picture has distorted rocks, however (when compiled with garbage collection). Seems like a surface is missing? Water looks good and so do sky, sun and clouds.~~ I will investigate more. Update: All is fine now. I compiled with -m68040 but mistakenly linked without -m68040. I wonder why this had so little impact?
Thank you very much for your permanent improvements!
I tried your last changes for garbage collection with WCS now, but the linker crashes.
The Eclipse-project is on https://github.com/githubaf/3DNature Build confuguartion -> set Active -> gc-sections Build project
A quick gdb call shows