fix(toolchain/{23c,27c}): add -isystem${TERMUX_PREFIX}/include/c++/v1 to $CPPFLAGS before -isystem${TERMUX_PREFIX}/include#23579
Conversation
|
The reason why this has to stay as |
|
Since #23513 breaks the on-device build, after |
cb96518 to
43d23f1
Compare
|
@licy183 Thank you for explaining, I do see that after you showed me. Python does store the Do you know of a This other way passes these test cases while using the same
and this change should do nothing for cross-compiling of all normal C or C++ packages, because the cross-compiler will continue to include the correct C++ headers, in the correct order, in its own way that has been successful so far, from I think that these two already-existing parts of the repository code save me from the frightening idea of termux-packages/scripts/build/termux_step_get_dependencies.sh Lines 28 to 29 in fe7adf6 termux-packages/packages/ndk-sysroot/build.sh Lines 75 to 76 in fe7adf6 and I am pretty sure that on-device, the headers in |
43d23f1 to
3fd89bb
Compare
3fd89bb to
c874e7c
Compare
|
licy183 you are completely right, because, very unfortunately, after db889e1, it has already happened to
So it must be revision-bumped in this PR, to make that error go away. I am very sorry for causing the error.
|
3fc0d4d to
94ec9cc
Compare
|
I did something to Octave that made the third error, After that, it turned into a fourth error, " which is a The text of the fourth error itself, comes from inside of a C++ function, so I think it serves as proof that compiling C++ code inside of Octave started working. What is remaining is that OpenCL itself is not working, and possibly just not working on my particular device. However, the patch I made is extremely weird looking and hard to explain. It is patching a feature Also I did not want to touch even more files in this PR, so I have not messed with it, but it looks to me like |
|
Also, in the future version of Octave, they tested it on Windows and had some kind of a similar problem, so they modified the file adding a Windows block into the same spot, so the patch will fail and need to be rebased at that time. I hope I have explained it well enough that it will not be frustrating when that happens. |
a35153e to
54dd2dc
Compare
852ee6d to
562471c
Compare
|
Please separate these changes into three commits. It is better to write a brief comment of each change in |
|
Ok, I will reorganize the commit structure soon |
… to $CPPFLAGS before -isystem${TERMUX_PREFIX}/include
- Fixes termux#23578
-isystem${TERMUX_PREFIX}/include/c++/v1 is necessary because, while ${TERMUX_PREFIX}/include/c++/v1
is never present in $TERMUX_ON_DEVICE_BUILD=false mode (because of this line:
https://github.com/termux/termux-packages/blob/fe7adf6ea2c7e5305c1213cbda919c17f251685d/scripts/build/termux_step_get_dependencies.sh#L28-L29
), it is present in $TERMUX_ON_DEVICE_BUILD=true
mode, and must be in the include path before ${TERMUX_PREFIX}/include, otherwise C++ programs will
fail to compile on-device (but not in the cross-compiler), and also python, ruby, octave and ecl
store the compiler arguments they were built with into their packages and reuse them when invoking
clang and clang++ on-device, so this ensures that on-device pip builds will have the correct include order.
…N_DEVICE_BUILD=true` support this package's configure script checks only for $PKGCONFIG, but that variable is currently only set globally in $TERMUX_ON_DEVICE_BUILD=false mode. In $TERMUX_ON_DEVICE_BUILD=true mode, only $PKG_CONFIG is set globally. ld.lld: error: undefined symbol: libiconv many packages manually set this universally without comment, but a pattern can be observed that reverse dependencies of libiconv seem to always require this in $TERMUX_ON_DEVICE_BUILD=true mode, and it gets set whenever someone creates $TERMUX_ON_DEVICE_BUILD=true support for one of them. see the commit message here: termux@bab423c
revbump after termux@db889e1 to fix propagated $CPPFLAGS using $TERMUX_PKG_TMPDIR/_deps to only have needed libraries in the search path prevents ld.lld: error: duplicate symbol: tzalloc in $flang_libs_dir/libc.a putting -l:$_libgcc_name only in $LIBS instead of $LDFLAGS prevents ld.lld: error: unable to find library -l:libclang_rt.builtins-aarch64-android.a on-device during the pkg function https://octave.sourceforge.io/octave/function/pkg.html prevents this error: clang++: error: no such file or directory: '/home/builder/.termux-build/_cache/android-r27c-api-24-v1/lib/clang/18/lib/linux/libclang_rt.builtins-aarch64-android.a'
562471c to
302f7f0
Compare
|
I separated the commits, reduced the comments, and moved the information into the commit messages, I hope this makes it more organized and readable |
|
Ok I will merge this in 24 hours, if nothing else is found wrong with it. I have been testing the addition of |
Fixes [Bug]: building C++ packages on-device broken #23578
ghostscript: cleans up$CPPFLAGSand adds tested$TERMUX_ON_DEVICE_BUILD=truesupportoctave,octave-x: revbump after db889e1 to fix propagated$CPPFLAGS, also adjusts the propagated linker flags so that thepkgfunction of Octave (https://octave.sourceforge.io/octave/function/pkg.html) can successfully compile C++ code inside of Octave without this error: