Error linking jpeg library (skipping incompatible...)

Post Reply
nebiun
Posts: 42
Joined: Sat Dec 28, 2013 2:42 pm

Error linking jpeg library (skipping incompatible...)

Post by nebiun » Sun Oct 14, 2018 2:58 pm

Hi.
I need some help (again!)
I had another problem during compiling of an old project.
In linking phase, compiler showed this message:

c:/devkitpro/devkitppc/bin/../lib/gcc/powerpc-eabi/8.1.0/../../../../powerpc-eabi/bin/ld.exe: skipping incompatible C:/devkitPro/portlibs/ppc/lib\libjpeg.a when searching for -ljpeg
c:/devkitpro/devkitppc/bin/../lib/gcc/powerpc-eabi/8.1.0/../../../../powerpc-eabi/bin/ld.exe: cannot find -ljpeg
collect2.exe: error: ld returned 1 exit status

Project use GRRLIB recompiled from source with last PPC and library versions.


pacman output:

Code: Select all

# pacman -Sl | grep installato
msys autoconf 2.69-5 [installato: 2.69-3]
msys automake-wrapper 11-1 [installato: 10-1]
msys automake1.10 1.10.3-3 [installato]
msys automake1.11 1.11.6-3 [installato]
msys automake1.12 1.12.6-3 [installato]
msys automake1.13 1.13.4-4 [installato]
msys automake1.14 1.14.1-3 [installato]
msys automake1.15 1.15.1-1 [installato]
msys automake1.6 1.6.3-2 [installato]
msys automake1.7 1.7.9-2 [installato]
msys automake1.8 1.8.5-3 [installato]
msys automake1.9 1.9.6-2 [installato]
msys bash 4.4.019-3 [installato]
msys bash-completion 2.8-2 [installato: 2.5-1]
msys bsdcpio 3.3.3-3 [installato: 3.3.2-1]
msys bsdtar 3.3.3-3 [installato: 3.3.2-1]
msys bzip2 1.0.6-2 [installato]
msys ca-certificates 20170717-2 [installato]
msys coreutils 8.30-1 [installato: 8.26-2]
msys curl 7.61.0-2 [installato: 7.58.0-1]
msys dash 0.5.10.2-1 [installato: 0.5.9.1-1]
msys db 5.3.28-2 [installato]
msys diffutils 3.6-1 [installato: 3.5-1]
msys dtc 1.4.7-1 [installato: 1.4.4-1]
msys file 5.34-1 [installato: 5.32-1]
msys filesystem 2018.08-1 [installato]
msys findutils 4.6.0-1 [installato]
msys flex 2.6.4-1 [installato]
msys gawk 4.2.1-1 [installato: 4.2.0-1]
msys gcc-libs 7.3.0-3 [installato: 6.4.0-3]
msys gdbm 1.18-1 [installato: 1.11-3]
msys getent 2.18.90-2 [installato]
msys gettext 0.19.8.1-1 [installato]
msys glib2 2.54.3-1 [installato: 2.48.2-1]
msys gmp 6.1.2-1 [installato]
msys gnupg 2.2.9-1 [installato: 1.4.22-3]
msys grep 3.1-1 [installato: 3.0-1]
msys gzip 1.9-1 [installato]
msys heimdal-libs 7.5.0-2 [installato: 1.5.3-9]
msys icu 62.1-1 [installato: 60.2-1]
msys inetutils 1.9.4-1 [installato]
msys info 6.5-2 [installato: 6.3-1]
msys less 530-1 [installato: 529-1]
msys libarchive 3.3.3-3 [installato: 3.3.2-1]
msys libargp 20110921-2 [installato: 20110921-1]
msys libasprintf 0.19.8.1-1 [installato]
msys libassuan 2.5.1-1 [installato: 2.4.3-1]
msys libbz2 1.0.6-2 [installato]
msys libcrypt 2.1-2 [installato: 2.1-1]
msys libcurl 7.61.0-2 [installato: 7.58.0-1]
msys libdb 5.3.28-2 [installato]
msys libedit 3.1-20170329 [installato]
msys libexpat 2.2.6-1 [installato: 2.2.5-1]
msys libffi 3.2.1-3 [installato: 3.2.1-1]
msys libgcrypt 1.8.3-2 [installato: 1.8.1-1]
msys libgdbm 1.18-1 [installato: 1.11-3]
msys libgettextpo 0.19.8.1-1 [installato]
msys libgpg-error 1.32-1 [installato: 1.27-1]
msys libgpgme 1.11.1-1 [installato: 1.6.0-1]
msys libiconv 1.15-1 [installato: 1.14-2]
msys libidn2 2.0.5-1 [installato: 2.0.4-2]
msys libintl 0.19.8.1-1 [installato]
msys libltdl 2.4.6-4 [installato: 2.4.6-2]
msys liblzma 5.2.4-1 [installato: 5.2.3-1]
msys liblzo2 2.10-2 [installato: 2.10-1]
msys libmetalink 0.1.3-2 [installato]
msys libnettle 3.4-1 [installato: 3.3-1]
msys libnghttp2 1.30.0-1 [installato]
msys libopenssl 1.0.2.p-2 [installato: 1.0.2.m-1]
msys libp11-kit 0.23.9-1 [installato]
msys libpcre 8.42-1 [installato: 8.40-2]
msys libpcre16 8.42-1 [installato: 8.40-2]
msys libpcre32 8.42-1 [installato: 8.40-2]
msys libpcrecpp 8.42-1 [installato: 8.40-2]
msys libpcreposix 8.42-1 [installato: 8.40-2]
msys libpsl 0.20.2-1 [installato: 0.19.1-1]
msys libreadline 7.0.005-1 [installato: 7.0.003-2]
msys libsqlite 3.21.0-4 [installato: 3.19.3.0-2]
msys libssh2 1.8.0-1 [installato]
msys libtasn1 4.13-1 [installato]
msys libtool 2.4.6-4 [installato: 2.4.6-2]
msys libunistring 0.9.10-1 [installato: 0.9.7-2]
msys libutil-linux 2.32.1-1 [installato: 2.26.2-1]
msys libxml2 2.9.8-1 [installato: 2.9.7-2]
msys libxslt 1.1.32-1 [installato]
msys lndir 1.0.3-1 [installato]
msys m4 1.4.18-2 [installato: 1.4.18-1]
msys make 4.2.1-1 [installato]
msys mintty 1~2.9.1-1 [installato]
msys mpfr 4.0.1-1 [installato]
msys msys2-keyring r9.397a52e-1 [installato]
msys msys2-launcher-git 0.3.32.56c2ba7-2 [installato]
msys msys2-runtime 2.11.1-2 [installato]
msys ncurses 6.1.20180908-1 [installato: 6.1.20180217-1]
msys openssl 1.0.2.p-2 [installato: 1.0.2.m-1]
msys p11-kit 0.23.9-1 [installato]
msys pacman 5.1.1-3 [installato]
msys pacman-mirrors 20180604-2 [installato]
msys pactoys-git r2.07ca37f-1 [installato]
msys pax-git 20161104.2-1 [installato]
msys pcre 8.42-1 [installato: 8.40-2]
msys perl 5.28.0-1 [installato: 5.24.1-4]
msys pkgfile 17-1 [installato]
msys rebase 4.4.4-1 [installato: 4.4.2-1]
msys sed 4.5-1 [installato: 4.4-2]
msys tar 1.30-1 [installato]
msys tftp-hpa 5.2-2 [installato]
msys time 1.9-1 [installato: 1.7-1]
msys ttyrec 1.0.8-2 [installato: 1.0.8-1]
msys tzcode 2018.c-1 [installato]
msys util-linux 2.32.1-1 [installato: 2.26.2-1]
msys wget 1.19.5-1 [installato: 1.19.4-1]
msys which 2.21-2 [installato]
msys xz 5.2.4-1 [installato: 5.2.3-1]
msys zlib 1.2.11-1 [installato]
dkp-libs gamecube-examples 20180910-1 [installato]
dkp-libs libfat-ogc 1.1.3-1 [installato]
dkp-libs libogc 1.8.20-1 [installato]
dkp-libs ppc-bzip2 1.0.6-1 [installato]
dkp-libs ppc-freetype 2.9-3 [installato]
dkp-libs ppc-libjpeg-turbo 1.5.3-1 [installato]
dkp-libs ppc-libogg 1.3.3-2 [installato]
dkp-libs ppc-libpng 1.6.34-1 [installato]
dkp-libs ppc-libvorbisidec 1.2.1-1 [installato]
dkp-libs ppc-mpg123 1.25.10-1 [installato]
dkp-libs ppc-mxml 2.11-1 [installato]
dkp-libs ppc-zlib 1.2.11-1 [installato]
dkp-libs wii-examples 20180910-1 [installato]
dkp-windows devkitPPC r32-1 [installato]
dkp-windows devkitpro-keyring r1.787e015-2 [installato]
dkp-windows freeimage-dll 3.17.0-1 [installato]
dkp-windows gamecube-tools 1.0.2-1 [installato]
dkp-windows general-tools 1.0.2-2 [installato]
dkp-windows tool-dlls 1.0-1 [installato]
dkp-windows wiiload 0.5.1-1 [installato]

nebiun
Posts: 42
Joined: Sat Dec 28, 2013 2:42 pm

Re: Error linking jpeg library (skipping incompatible...)

Post by nebiun » Fri Oct 19, 2018 3:17 pm

Tried to compile sources by myself, but no lucky

Code: Select all

 [email protected] MSYS ~/Downloads/WIIdev/libjpeg-turbo-1.5.3
# source /opt/devkitpro/devkitppc.sh

[email protected] MSYS ~/Downloads/WIIdev/libjpeg-turbo-1.5.3
# source /opt/devkitpro/ppcvars.sh

[email protected] MSYS ~/Downloads/WIIdev/libjpeg-turbo-1.5.3
# ./configure --prefix="/opt/devkitpro/portlibs/ppc" --host=powerpc-eabi --disable-shared --enable-static
configure: loading site script /etc/config.site
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for powerpc-eabi-strip... powerpc-eabi-strip
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking for style of include used by make... GNU
checking for powerpc-eabi-gcc... powerpc-eabi-gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... yes
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether powerpc-eabi-gcc accepts -g... yes
checking for powerpc-eabi-gcc option to accept ISO C89... none needed
checking whether powerpc-eabi-gcc understands -c and -o together... yes
checking dependency style of powerpc-eabi-gcc... gcc3
checking how to run the C preprocessor... powerpc-eabi-gcc -E
checking for powerpc-eabi-gcc... (cached) powerpc-eabi-gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether powerpc-eabi-gcc accepts -g... (cached) yes
checking for powerpc-eabi-gcc option to accept ISO C89... (cached) none needed
checking whether powerpc-eabi-gcc understands -c and -o together... (cached) yes
checking dependency style of powerpc-eabi-gcc... (cached) gcc3
checking for powerpc-eabi-ar... powerpc-eabi-gcc-ar
checking the archiver (powerpc-eabi-gcc-ar) interface... ar
checking dependency style of powerpc-eabi-gcc... gcc3
checking build system type... x86_64-pc-msys
checking host system type... powerpc-unknown-eabi
checking how to print strings... printf
checking for a sed that does not truncate output... /usr/bin/sed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by powerpc-eabi-gcc... c:/devkitpro/devkitppc/powerpc-eabi/bin/ld.exe
checking if the linker (c:/devkitpro/devkitppc/powerpc-eabi/bin/ld.exe) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /opt/devkitpro/devkitPPC/bin/powerpc-eabi-nm
checking the name lister (/opt/devkitpro/devkitPPC/bin/powerpc-eabi-nm) interface... BSD nm
checking whether ln -s works... no, using cp -pR
checking the maximum length of command line arguments... 24000
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert x86_64-pc-msys file names to powerpc-unknown-eabi format... func_convert_file_noop
checking how to convert x86_64-pc-msys file names to toolchain format... func_convert_file_noop
checking for c:/devkitpro/devkitppc/powerpc-eabi/bin/ld.exe option to reload object files... -r
checking for powerpc-eabi-objdump... powerpc-eabi-objdump
checking how to recognize dependent libraries... unknown
checking for powerpc-eabi-dlltool... no
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for powerpc-eabi-ar... (cached) powerpc-eabi-gcc-ar
checking for archiver @FILE support... @
checking for powerpc-eabi-strip... (cached) powerpc-eabi-strip
checking for powerpc-eabi-ranlib... powerpc-eabi-gcc-ranlib
checking command to parse /opt/devkitpro/devkitPPC/bin/powerpc-eabi-nm output from powerpc-eabi-gcc object... ok
checking for sysroot... no
checking for powerpc-eabi-mt... no
checking for mt... no
checking if : is a manifest tool... no
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... no
checking for objdir... .libs
checking if powerpc-eabi-gcc supports -fno-rtti -fno-exceptions... no
checking for powerpc-eabi-gcc option to produce PIC... -fPIC -DPIC
checking if powerpc-eabi-gcc PIC flag -fPIC -DPIC works... yes
checking if powerpc-eabi-gcc static flag -static works... no
checking if powerpc-eabi-gcc supports -c -o file.o... yes
checking if powerpc-eabi-gcc supports -c -o file.o... (cached) yes
checking whether the powerpc-eabi-gcc linker (c:/devkitpro/devkitppc/powerpc-eabi/bin/ld.exe) supports shared libraries... yes
checking dynamic linker characteristics... no
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... no
checking whether to build shared libraries... no
checking whether to build static libraries... yes
checking whether ln -s works... no, using cp -pR
checking for powerpc-eabi-pkg-config... no
checking for pkg-config... no
checking size of size_t... 4
checking whether compiler supports pointers to undefined structures... yes
checking whether __SUNPRO_C is declared... no
checking for ANSI C header files... (cached) yes
checking stddef.h usability... yes
checking stddef.h presence... yes
checking for stddef.h... yes
checking for stdlib.h... (cached) yes
checking locale.h usability... yes
checking locale.h presence... yes
checking for locale.h... yes
checking for string.h... (cached) yes
checking for sys/types.h... (cached) yes
checking for an ANSI C-conforming const... yes
checking whether char is unsigned... yes
checking for inline... inline
checking for size_t... yes
checking for unsigned char... yes
checking for unsigned short... yes
checking if right shift is signed... Assuming that right shift is signed on target machine.
checking for memset... yes
checking for memcpy... yes
checking libjpeg API version... 6.2
checking whether to include in-memory source/destination managers... yes
checking libjpeg shared library version... 62.2.0
checking whether the linker supports version scripts... yes (GNU style)
checking whether to use version script when building libjpeg-turbo... yes
checking for inline... inline __attribute__((always_inline))
checking whether to include arithmetic encoding support... yes
checking whether to include arithmetic decoding support... yes
checking whether to use 12-bit samples... no
checking whether to build TurboJPEG C wrapper... yes
checking whether to build TurboJPEG Java wrapper... no
checking if we have SIMD optimisations for cpu type... no ("PowerPC SPE")
configure: WARNING: SIMD support not available for this CPU.  Performance will suffer.
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating pkgscripts/libjpeg-turbo.spec.tmpl
config.status: creating pkgscripts/makecygwinpkg.tmpl
config.status: creating pkgscripts/makedpkg.tmpl
config.status: creating pkgscripts/makemacpkg.tmpl
config.status: creating pkgscripts/uninstall.tmpl
config.status: creating pkgscripts/libjpeg.pc
config.status: creating pkgscripts/libturbojpeg.pc
config.status: creating tjbenchtest
config.status: creating libjpeg.map
config.status: creating Makefile
config.status: creating simd/Makefile
config.status: creating java/Makefile
config.status: creating md5/Makefile
config.status: creating config.h
config.status: creating jconfig.h
config.status: creating jconfigint.h
config.status: executing depfiles commands
config.status: executing libtool commands

[email protected] MSYS ~/Downloads/WIIdev/libjpeg-turbo-1.5.3
# make
make  all-recursive
make[1]: ingresso nella directory "/home/Nebiun/Downloads/WIIdev/libjpeg-turbo-1.5.3"
Making all in java
make[2]: ingresso nella directory "/home/Nebiun/Downloads/WIIdev/libjpeg-turbo-1.5.3/java"
echo timestamp > classnoinst.stamp
make[2]: uscita dalla directory "/home/Nebiun/Downloads/WIIdev/libjpeg-turbo-1.5.3/java"
Making all in md5
make[2]: ingresso nella directory "/home/Nebiun/Downloads/WIIdev/libjpeg-turbo-1.5.3/md5"
  CC       md5cmp-md5cmp.o
  CC       md5cmp-md5.o
md5.c: In function 'Encode':
md5.c:71:11: warning: implicit declaration of function 'htole32' [-Wimplicit-function-declaration]
   op[i] = htole32(input[i]);
           ^~~~~~~
md5.c: In function 'Decode':
md5.c:86:15: warning: implicit declaration of function 'le32toh' [-Wimplicit-function-declaration]
   output[i] = le32toh(ip[i]);
               ^~~~~~~
  CC       md5cmp-md5hl.o
  CCLD     md5cmp
c:/devkitpro/devkitppc/bin/../lib/gcc/powerpc-eabi/8.1.0/../../../../powerpc-eabi/bin/ld.exe: warning: cannot find entry symbol _start; defaulting to 00000000018000b8
md5cmp-md5.o: In function `MD5Transform':
md5.c:(.text.MD5Transform+0x74): undefined reference to `le32toh'
md5cmp-md5.o: In function `MD5Pad':
md5.c:(.text.MD5Pad+0x1c): undefined reference to `htole32'
md5.c:(.text.MD5Pad+0x2c): undefined reference to `htole32'
md5cmp-md5.o: In function `MD5Final':
md5.c:(.text.MD5Final+0x44): undefined reference to `htole32'
collect2.exe: error: ld returned 1 exit status
make[2]: *** [Makefile:361: md5cmp] Error 1
make[2]: uscita dalla directory "/home/Nebiun/Downloads/WIIdev/libjpeg-turbo-1.5.3/md5"
make[1]: *** [Makefile:1555: all-recursive] Error 1
make[1]: uscita dalla directory "/home/Nebiun/Downloads/WIIdev/libjpeg-turbo-1.5.3"
make: *** [Makefile:742: all] Error 2

nebiun
Posts: 42
Joined: Sat Dec 28, 2013 2:42 pm

Re: Error linking jpeg library (skipping incompatible...)

Post by nebiun » Mon Oct 22, 2018 6:07 pm

Code: Select all

md5.c:(.text.MD5Transform+0x74): undefined reference to `le32toh'
md5cmp-md5.o: In function `MD5Pad':
md5.c:(.text.MD5Pad+0x1c): undefined reference to `htole32'
md5.c:(.text.MD5Pad+0x2c): undefined reference to `htole32'
md5cmp-md5.o: In function `MD5Final':
md5.c:(.text.MD5Final+0x44): undefined reference to `htole32'
These macros are defined in <machine/endian.h>, but in PPC version of the file they are missing :shock:
Now, how had someone compiled libjpeg-turbo without these macros?
And, can he (or she) explain me how I can do the same? :D

Thanks

WinterMute
Site Admin
Posts: 1336
Joined: Tue Aug 09, 2005 3:21 am
Location: UK
Contact:

Re: Error linking jpeg library (skipping incompatible...)

Post by WinterMute » Mon Oct 22, 2018 11:15 pm

Apologies, I didn't check the package properly. Forgot attempts to cross compile fall back to native tools when the cross compiler isn't found.

I'll have a look tomorrow. Newlib headers don't contain these non standard functions which are only used on big endian systems, I'll need to patch somewhere for the ppc package but it's just a matter of looking for the cleanest way to do it.
Help keep devkitPro toolchains free, Donate today

devkitPro IRC support
Personal Blog

nebiun
Posts: 42
Joined: Sat Dec 28, 2013 2:42 pm

Re: Error linking jpeg library (skipping incompatible...)

Post by nebiun » Sat Nov 03, 2018 3:20 pm

Adding

Code: Select all

#		define htobe16(x) htons(x)
#		define htole16(x) (x)
#		define be16toh(x) ntohs(x)
#		define le16toh(x) (x)
 
#		define htobe32(x) htonl(x)
#		define htole32(x) (x)
#		define be32toh(x) ntohl(x)
#		define le32toh(x) (x)
 
#		define htobe64(x) htonll(x)
#		define htole64(x) (x)
#		define be64toh(x) ntohll(x)
#		define le64toh(x) (x)

to <machine/_endian.h> (just behind last #endif) has solved for me.
I generated libjpeg-turbo 1.5.3 and compile my projects.
I does not known if this is the cleanest way, but I think is the simplest one. :wink:

nebiun
Posts: 42
Joined: Sat Dec 28, 2013 2:42 pm

Re: Error linking jpeg library (skipping incompatible...)

Post by nebiun » Tue Nov 06, 2018 12:28 pm

Built the library with last:
pacman-packages/ppc/libjpeg-turbo/PKGBUILD

and then my old projects. All right!
Thanks.

WinterMute
Site Admin
Posts: 1336
Joined: Tue Aug 09, 2005 3:21 am
Location: UK
Contact:

Re: Error linking jpeg library (skipping incompatible...)

Post by WinterMute » Fri Nov 09, 2018 3:50 pm

nebiun wrote:Built the library with last:
pacman-packages/ppc/libjpeg-turbo/PKGBUILD

and then my old projects. All right!
Thanks.
You didn't need to compile it, it was packaged and available via (dkp-)pacman before I pushed the changes that fixed the build.

Sorry, I meant to respond here when I fixed it but other stuff got in the way.
Help keep devkitPro toolchains free, Donate today

devkitPro IRC support
Personal Blog

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests