Closed AKuHAK closed 5 years ago
This is in gcc: #define LIB_SPEC "-L/usr/local/ps2dev/ps2sdk/ee/lib /usr/local/ps2dev/ps2sdk/ee/lib/libc.a -lkernel -lc -lg -lm"
, so it already includes libm by default. If your toolchain is compiled after april 2018 it should be safe.
I just reinstalled ps2toolchain from scratch and get the same error:
ee-gcc -I/usr/local/ps2dev/ps2sdk/ports/include -Isrc/ -o pngtest.elf src/pngtest.o -L/usr/local/ps2dev/ps2sdk/ee/lib -L/usr/local/ps2dev/ps2sdk/ports/lib lib/libpng.a -lz
/usr/local/ps2dev/ee/lib/gcc-lib/ee/3.2.3/../../../../ee/lib/libm.a(w_pow.o)(.text+0xf8): In function `pow':
../../../../../newlib/libm/math/w_pow.c:210: undefined reference to `__errno'
/usr/local/ps2dev/ee/lib/gcc-lib/ee/3.2.3/../../../../ee/lib/libm.a(w_pow.o)(.text+0x10c):../../../../../newlib/libm/math/w_pow.c:164: undefined reference to `__errno'
/usr/local/ps2dev/ee/lib/gcc-lib/ee/3.2.3/../../../../ee/lib/libm.a(w_pow.o)(.text+0x2b8):../../../../../newlib/libm/math/w_pow.c:207: undefined reference to `__errno'
collect2: ld returned 1 exit status
Makefile:39: recipe for target 'pngtest.elf' failed
I complile tested your patch-2 branch and it looks like there are indeed problems with some samples requiring libm. The error messages are all related to a missing __errno dependency. For instance:
/usr/local/ps2dev/ee/lib/gcc-lib/ee/3.2.3/../../../../ee/lib/libm.a(w_pow.o)(.text+0xf8): In function `pow':
../../../../../newlib/libm/math/w_pow.c:210: undefined reference to `__errno'
/usr/local/ps2dev/ee/lib/gcc-lib/ee/3.2.3/../../../../ee/lib/libm.a(w_pow.o)(.text+0x10c):../../../../../newlib/libm/math/w_pow.c:164: undefined reference to `__errno'
/usr/local/ps2dev/ee/lib/gcc-lib/ee/3.2.3/../../../../ee/lib/libm.a(w_pow.o)(.text+0x2b8):../../../../../newlib/libm/math/w_pow.c:207: undefined reference to `__errno'
If I'm reading this right, libm is already included and is missing a dependency. The strange thing is, when including libm again, the dependency is somehow resolved...
To fix the compile errors for the make sample
target I added the following:
Added -ldebug -lm
to:
aalib/test/Makefile:
Added -lm
to:
sdlgfx/Test/fonts/Makefile
sdlgfx/Test/rotozoom/Makefile
sdlgfx/Test/framerate/Makefile
sdlgfx/Test/gfxprimitives/Makefile
Can you validate this and add these to the PR?
Tested and confirmed
libpng updated to latest upstream version v1.5.30 zlib updated to latest upstream version v1.2.11 freetype moved to submodule fixed some samples
P.S. I readded -lm for libpng sample compilng @rickgaiser are you sure that your changes are safe?