termux / termux-packages

A package build system for Termux.
https://termux.dev
Other
13.25k stars 3.05k forks source link

[Bug]: Fails when compiling partialZipBrowser #20760

Closed mast3rz3ro closed 1 month ago

mast3rz3ro commented 4 months ago

Problem description

Hi there,

The interesting part from configure output:

./configure: 4387: CXXFLAGS+= -std=c++11: not found     ./configure: 4388: CXXFLAGS+= -D PZB_VERSION_COMMIT_COUNT=\"40\": not found
./configure: 4389: CXXFLAGS+= -D PZB_VERSION_COMMIT_SHA=\"00a03a52a30e4d3f75c837eb76ec412e3b0d1236\": not found

After running make:

main.cpp:453:24: error: expected ')'                      453 |     printf("Version: " PZB_VERSION_COMMIT_SHA" - " PZB_VERSION_COMMIT_COUNT"\n");

After removing the version variables from main.c compiles fine, however I'm still not able to use it:

$ pzb
CANNOT LINK EXECUTABLE "pzb": cannot locate symbol "__aarch64_ldadd8_acq_rel" referenced by "/data/data/com.termux/files/usr/lib/libgeneral.so.0.0.0"...

Waiting for your answers! Thanks!

What steps will reproduce the bug?

git clone https://github.com/tihmstar/partialZipBrowser cd partialZipBrowser && ./autogen.sh && make

What is the expected behavior?

Begin able to use the utility without no issues.

System information

Termux Variables:                                       TERMUX_APK_RELEASE=F_DROID                              TERMUX_APP_PACKAGE_MANAGER=apt                          TERMUX_APP_PID=10744                                    TERMUX_IS_DEBUGGABLE_BUILD=0                            TERMUX_VERSION=0.118.0                                  TERMUX__USER_ID=0                                       Packages CPU architecture:                              aarch64                                                 Subscribed repositories:                                # sources.list                                          deb https://packages-cf.termux.dev/apt/termux-main/ stable main                                                 # root-repo (sources.list.d/root.list)
deb https://packages-cf.termux.dev/apt/termux-root/ root stable                                                 Updatable packages:                                     All packages up to date
termux-tools version:                                   1.42.4                                                  Android version:
35                                                      Kernel build information:
Linux localhost 4.14.336-perf-gbd8f1c4cdb06-dirty #2 SMP PREEMPT Tue Mar 12 13:01:34 UTC 2024 aarch64 Android   Device manufacturer:
Xiaomi                                                  Device model:                                           Unknown                                                 LD Variables:
LD_LIBRARY_PATH=                                        LD_PRELOAD=/data/data/com.termux/files/usr/lib/libtermux-exec.so
twaik commented 4 months ago

You should add a flag to LDFLAGS, see https://github.com/termux/termux-packages/pull/12299/files .

mast3rz3ro commented 4 months ago

Thanks for your quick reply!

I have added the LDFLAG from the link you have motioned but I'm still getting the same error: Output from configure:

./configure: 18123: LDFLAGS+= /data/data/com.termux/files/usr/lib/clang/18/lib/linux/libclang_rt.builtins-aarch64-android.a: not found
twaik commented 4 months ago

Are you really sure you added it right?

mast3rz3ro commented 4 months ago

Are you really sure you added it right?

Yes, I have add: LDFLAGS+=" $($CC -print-libgcc-file-name)" into configure file from libgeneral

mast3rz3ro commented 3 months ago

I have started suspecting that my architecture is the issue, Can somebody please confirm if it's could be compiled on arm64 ?

mast3rz3ro commented 1 month ago

@agnostic-apollo

What do I'm missing here?

Please enlighten us.

mast3rz3ro commented 1 month ago

Well than, the issue has been fixed in 5b0b65c

The latest commit should compile normally however I was serious about this issue so I have start investigating about it.

After investigating for a while, I was successfully able to reproduce the issue.

sed -i 's/AM_LDFLAGS =.*/AM_LDFLAGS = \$(curl_LIBS) \$(libgeneral_LIBS) \$(zlib_LIBS)/' 'libfragmentzip/Makefile.am'

From my understanding the issue happens because of incorrectly linking against libgeneral

Please feel free to close the issue.

Best regards.