termux / termux-packages

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

[Bug]: wrong SDL2 include on aarch64 ? #19677

Open Randrianasulu opened 4 months ago

Randrianasulu commented 4 months ago

Problem description

I tried to build bochs git from https://github.com/bochs-emu/Bochs

and run into problems with sdl2

editing /data/data/com.termux/files/usr/include/SDL2/SDL_cpuinfo.h so it does not include include anymore fixed this build error.

What steps will reproduce the bug?

git clone https://github.com/bochs-emu/Bochs

./configure --prefix=/data/data/com.termux/files/usr --with-x11 --enable-usb --enable-ne2000 --enable-clgd54xx --enable-voodoo --enable-sb16 --enable-es1370 --with-sdl2 --enable-usb-ohci --enable-usb-xhci --enable-usb-ehci --enable-all-optimizations

then make -j8

it failed somewhere in cpu code

In file included from main.cc:45:
In file included from /data/data/com.termux/files/usr/include/SDL2/SDL.h:38:
In file included from /data/data/com.termux/files/usr/include/SDL2/SDL_cpuinfo.h:81:
/data/data/com.termux/files/usr/lib/clang/18/include/arm_neon.h:1775:47: error: no matching conversion for C-style cast from 'float32x2_t' (aka 'f32_t') to 'int8x8_t' (vector of 8 'int8_t' values)
 1775 |   __ret = (float32x2_t) __builtin_neon_vabs_v((int8x8_t)__p0, 9);
      |                                               ^~~~~~~~~~~~~~
./cpu/fpu/../softfloat3e/include/softfloat_types.h:59:5: note: candidate function                     59 |     operator uint32_t() const { return v; }
      |     ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.

What is the expected behavior?

compile finished sucessfully (after you set #define BX_HAVE_SOUND_OSS 0 in config.h and fix slirp err)

System information

termux-info:

 Termux Variables:
TERMUX_API_VERSION=0.50.1
TERMUX_APK_RELEASE=F_DROID
TERMUX_APP_PACKAGE_MANAGER=apt
TERMUX_APP_PID=32709
TERMUX_IS_DEBUGGABLE_BUILD=0
TERMUX_MAIN_PACKAGE_FORMAT=debian
TERMUX_VERSION=0.118.0
TERMUX__USER_ID=0
Packages CPU architecture:
aarch64
Subscribed repositories:
# sources.list
deb https://mirrors.sau.edu.cn/termux/apt/termux-main stable main
# x11-repo (sources.list.d/x11.list)
deb https://mirrors.sau.edu.cn/termux/apt/termux-x11 x11 main
# tur-repo (sources.list.d/tur.list)
deb https://tur.kcubeterm.com tur-packages tur tur-on-device tur-continuous
Updatable packages:
All packages up to date
termux-tools version:
1.41.2
Android version:
11
Kernel build information:
Linux localhost 4.14.193 #1 SMP PREEMPT Thu Jul 8 13:58:00 CST 2021 aarch64 Android
Device manufacturer:
DEXP
Device model:
K38
LD Variables:
LD_LIBRARY_PATH=
LD_PRELOAD=/data/data/com.termux/files/usr/lib/libtermux-exec.so
Installed termux plugins:
com.termux.api versionCode:51
Biswa96 commented 4 months ago

Could you provide the required dependencies to reproduce the issue? Also, would it be possible to reproduce the issue with termux provided bochs package here https://github.com/termux/termux-packages/tree/master/x11-packages/bochs ?

Randrianasulu commented 4 months ago

at least x11 and sdl2 -static packages? Sorry, I have quite big installation. Also, I think softfloat3e only appeared in Bochs git (sources from very late December were fine without any alteration of sdl2 headers)

Biswa96 commented 4 months ago

I have reported the issue in upstream https://github.com/bochs-emu/Bochs/issues/300

Randrianasulu commented 4 months ago

@Biswa96 thanks, I pulled Bochs' git up to e1d67d9ce0d7818b32ac983717e36fd22106052d and it compiled clearly.

Biswa96 commented 4 months ago

But I still get the same compiler error as you mentioned.

Biswa96 commented 4 months ago

Are you compiling the project in Android device? The configure script detects the systems as aarch64-unknown-linux-gnu which means normal Linux systems. so, I added --build=aarch64-unknown-linux-android option with configure command for Android system.

Randrianasulu commented 4 months ago

@Biswa96 yes,I compile from termux itself. I still have my hacked system include, but at least oss and slirp errors are gone?

i will try clean rebuild with --build option, but not right now, I want to sleep first.

licy183 commented 4 months ago

Related: ucb-bar/berkeley-softfloat-3#12