libimobiledevice/libplist

Static building multiple undefined reference errors (since 91c0aa8)

DanTheMann15 opened this issue · 2 comments

I tried compiling libplist for tsschecker and img4tool and i ran into this issue.

Host: Windows (x86_64)
Target: Windows (x86_64)
Toolchain: MSYS2

the same error happens when cross compiling static on ubuntu as well.

the arguments i passed were:
./autogen.sh --enable-static --disable-shared --without-cython --prefix=/usr/local
and then
make LDFLAGS=-all-static

( i even tried without specifying LDFLAGS=-all-static, no luck. )

the full log is attached as a text document: libplist_msys2_buildlog_20230627_0310.txt

i did some git checkouts to find when it last worked and turns out that 91c0aa8 was the commit that broke static compilation of the tool, and it's been broken since. so i think the program itself might need updating to handle the PLIST_API changes in the headers.

Update: i can't compile anything that uses libplist statically either.

i get the same errors in the libs as well... ugh...

Update: I think i figured it out... when compiling static, for some reason LIBPLIST_STATIC doesn't get defined, the same thing occurs in libirecovery as well.

defining LIBPLIST_STATIC fixes compilation, i don't know why it doesn't do it automatically when --enable-static --disable-shared is passed, but it needs some looking into.