android / ndk

The Android Native Development Kit
1.93k stars 253 forks source link

[BUG] CMake Toolchain file does not recognize android targets #1543

Closed Martmists-GH closed 2 years ago

Martmists-GH commented 2 years ago

Description

When configuring CMake to use the NDK toolchain files, it gives the following error:

/opt/clion/bin/cmake/linux/bin/cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=~/Android/Sdk/ndk/21.4.7075529/build/cmake/android.toolchain.cmake -DANDROID_ABI=armeabi-v7a -G "CodeBlocks - Unix Makefiles" /home/mart/git/v4a_reworked
-- ANDROID_PLATFORM not set. Defaulting to minimum supported version
16.
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /home/mart/Android/Sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/linux-x86_64/bin/clang - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /home/mart/Android/Sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/mart/git/v4a_reworked

Cannot get compiler information:
    Compiler exited with error code 1: /home/mart/Android/Sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ -xc++ -Dv4a_r_EXPORTS -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -march=armv7-a -mthumb -Wformat -O0 -fno-limit-debug-info -fPIC -fpch-preprocess -v -dD -E
    Android (7019983 based on r365631c3) clang version 9.0.9 (https://android.googlesource.com/toolchain/llvm-project a2a1e703c0edb03ba29944e529ccbf457742737b) (based on LLVM 9.0.9svn)
    Target: x86_64-unknown-linux-gnu
    Thread model: posix
    InstalledDir: /home/mart/Android/Sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/linux-x86_64/bin
    Found candidate GCC installation: /home/mart/Android/Sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/linux-x86_64/bin/../lib/gcc/i686-linux-android/4.9.x
    Found candidate GCC installation: /home/mart/Android/Sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/linux-x86_64/bin/../lib/gcc/x86_64-linux-android/4.9.x
    Found candidate GCC installation: /usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0
    Found candidate GCC installation: /usr/lib64/gcc/x86_64-pc-linux-gnu/11.1.0
    Selected GCC installation: /usr/lib64/gcc/x86_64-pc-linux-gnu/11.1.0
    Candidate multilib: .;@m64
    Candidate multilib: 32;@m32
    Selected multilib: .;@m64
    clang++: warning: argument unused during compilation: '-mthumb' [-Wunused-command-line-argument]
     "/home/mart/Android/Sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++" -cc1 -triple x86_64-unknown-linux-gnu -E -disable-free -disable-llvm-verifier -discard-value-names -main-file-name compiler-file12762154365352717275 -mrelocation-model pic -pic-level 2 -mthread-model posix -mdisable-fp-elim -fmath-errno -masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu armv7-a -dwarf-column-info -debug-info-kind=standalone -dwarf-version=4 -debugger-tuning=gdb -v -ffunction-sections -fdata-sections -resource-dir /home/mart/Android/Sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/linux-x86_64/lib64/clang/9.0.9 -D v4a_r_EXPORTS -D ANDROID -D _FORTIFY_SOURCE=2 -D ___CIDR_DEFINITIONS_END -internal-isystem /usr/lib64/gcc/x86_64-pc-linux-gnu/11.1.0/../../../../include/c++/11.1.0 -internal-isystem /usr/lib64/gcc/x86_64-pc-linux-gnu/11.1.0/../../../../include/c++/11.1.0/x86_64-pc-linux-gnu -internal-isystem /usr/lib64/gcc/x86_64-pc-linux-gnu/11.1.0/../../../../include/c++/11.1.0/backward -internal-isystem /usr/local/include -internal-isystem /home/mart/Android/Sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/linux-x86_64/lib64/clang/9.0.9/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -O0 -Wformat -fdeprecated-macro -fdebug-compilation-dir /home/mart/git/v4a_reworked -ferror-limit 19 -fmessage-length 0 -stack-protector 2 -fobjc-runtime=gcc -fcxx-exceptions -fexceptions -fdiagnostics-show-option -dD -faddrsig -o - -x c++ /tmp/compiler-file12762154365352717275
    error: unknown target CPU 'armv7-a'
    note: valid target CPU values are: nocona, core2, penryn, bonnell, atom, silvermont, slm, goldmont, goldmont-plus, tremont, nehalem, corei7, westmere, sandybridge, corei7-avx, ivybridge, core-avx-i, haswell, core-avx2, broadwell, skylake, skylake-avx512, skx, cascadelake, cooperlake, cannonlake, icelake-client, icelake-server, knl, knm, k8, athlon64, athlon-fx, opteron, k8-sse3, athlon64-sse3, opteron-sse3, amdfam10, barcelona, btver1, btver2, bdver1, bdver2, bdver3, bdver4, znver1, znver2, x86-64

[Failed to reload]

Environment Details

Not all of these will be relevant to every bug, but please provide as much information as you can.

DanAlbert commented 2 years ago

Which version of CMake?

Martmists-GH commented 2 years ago

CMake 3.21.0

DanAlbert commented 2 years ago

Works fine for me. We're going to need a repro case. We pretty much always do. If it was simple our tests would have caught it.

Martmists-GH commented 2 years ago

Installed packages:

Installed packages (pacman -Qq)
a52dec
aalib
aarch64-linux-gnu-binutils
aarch64-linux-gnu-gcc
aarch64-linux-gnu-glibc
aarch64-linux-gnu-linux-api-headers
accounts-qml-module
accountsservice
acl
adduser
adobe-source-code-pro-fonts
adwaita-icon-theme
alsa-card-profiles
alsa-lib
alsa-plugins
alsa-topology-conf
alsa-ucm-conf
alsa-utils
android-studio
android-tools
android-udev
aom
appstream
appstream-qt
apr
apr-util
archlinux-appstream-data
archlinux-keyring
argon2
aribb24
ark
asp
assimp
at-spi2-atk
at-spi2-core
atk
atkmm
attica
attica-qt4
attr
audiofile
audit
auracle-git
autoconf
automake
automoc4
avahi
avidemux-cli
avidemux-qt
awesome-terminal-fonts
babl
baloo
baloo-widgets
base
bash
bc
binutils
bison
blas
bless
blockbench-git
blueberry
bluedevil
bluez
bluez-libs
bluez-qt
bluez-tools
bluez-utils
bolt
boost-libs
box2d
breeze
breeze-gtk
breeze-icons
bridge-utils
brotli
btrfs-progs
bubblewrap
bzip2
c-ares
ca-certificates
ca-certificates-mozilla
ca-certificates-utils
cabextract
cairo
cairomm
cantarell-fonts
cava
cblas
ccid
cdparanoia
celt
cfitsio
cfr
chromaprint
chromium
cifs-utils
clang
clazy
clion
clion-cmake
clucene
cmake
cmark-gfm
colord
compiler-rt
composer
consolas-font
containerd
convertlit
coreutils
cracklib
cryptsetup
cups
cups-filters
curl
cython
dav1d
db
dbus
dbus-glib
dbus-python
dconf
ddcutil
debtap
desktop-file-utils
desmume
device-mapper
dialog
diffutils
discount
discover
dmraid
dnsmasq
dnssec-anchors
docbook-xml
docbook-xsl
docker
dolphin
dolphin-plugins
dosfstools
dotnet-host
dotnet-runtime
double-conversion
doxygen
drkonqi
dyalog-unicode-180
e2fsprogs
ebook-tools
editorconfig-core-c
efibootmgr
efivar
egl-wayland
eglexternalplatform
electron
elfutils
enchant
exiv2
expac
expat
ext4magic
extra-cmake-modules
faac
faad2
fakechroot
fakeroot
faudio
ffmpeg
fftw
file
filesystem
findutils
flac
flex
fluidsynth
fontconfig
frameworkintegration
freeglut
freetype2
fribidi
fuse-common
fuse2
fuse3
fusee-interfacee-tk-bin
gawk
gc
gcc
gcc-libs
gd
gdb
gdb-common
gdbm
gdk-pixbuf2
gegl
gettext
ghc-libs
ghidra
ghidra-desktop
ghidra-extension-ghidra-cpp-class-analyzer-git
ghidra-extension-ghidra-firmware-utils-git
ghostscript
giflib
gimp
git
gitbrute-git
glew
glew1.10
glib-networking
glib2
glibc
glibmm
glslang
glu
gmp
gnome-bluetooth
gnupg
gnustep-base
gnutls
go
gobject-introspection-runtime
google-chrome
gpgme
gpm
gptfdisk
gradle
graphene
graphite
graphviz
grep
groff
grub
grub-customizer
gsettings-desktop-schemas
gsfonts
gsm
gssdp
gst-libav
gst-plugins-bad
gst-plugins-bad-libs
gst-plugins-base
gst-plugins-base-libs
gst-plugins-good
gstreamer
gtest
gtk-sharp-2
gtk-update-icon-cache
gtk2
gtk3
gtkmm3
gts
guile
guile2.0
gupnp
gupnp-igd
gwenview
gzip
harfbuzz
harfbuzz-icu
haskell-aeson
haskell-aeson-pretty
haskell-ansi-terminal
haskell-appar
haskell-asn1-encoding
haskell-asn1-parse
haskell-asn1-types
haskell-assoc
haskell-async
haskell-attoparsec
haskell-base-compat
haskell-base-compat-batteries
haskell-base-orphans
haskell-base16-bytestring
haskell-base64-bytestring
haskell-basement
haskell-bifunctors
haskell-bitarray
haskell-blaze-builder
haskell-blaze-html
haskell-blaze-markup
haskell-byteable
haskell-byteorder
haskell-case-insensitive
haskell-cereal
haskell-citeproc
haskell-cmark-gfm
haskell-cmdargs
haskell-colour
haskell-commonmark
haskell-commonmark-extensions
haskell-commonmark-pandoc
haskell-comonad
haskell-conduit
haskell-conduit-extra
haskell-connection
haskell-cookie
haskell-cryptonite
haskell-data-default
haskell-data-default-class
haskell-data-default-instances-containers
haskell-data-default-instances-dlist
haskell-data-default-instances-old-locale
haskell-data-fix
haskell-digest
haskell-distributive
haskell-dlist
haskell-doclayout
haskell-doctemplates
haskell-emojis
haskell-erf
haskell-errors
haskell-file-embed
haskell-glob
haskell-haddock-library
haskell-haddock-library1.9
haskell-hashable
haskell-hourglass
haskell-hslua
haskell-hslua-module-path
haskell-hslua-module-system
haskell-hslua-module-text
haskell-hsyaml
haskell-http
haskell-http-client
haskell-http-client-tls
haskell-http-types
haskell-hxt
haskell-hxt-charproperties
haskell-hxt-regex-xmlschema
haskell-hxt-unicode
haskell-indexed-traversable
haskell-integer-logarithms
haskell-iproute
haskell-ipynb
haskell-jira-wiki-markup
haskell-juicypixels
haskell-memory
haskell-mime-types
haskell-mono-traversable
haskell-network
haskell-network-uri
haskell-old-locale
haskell-old-time
haskell-pandoc-types
haskell-pem
haskell-primitive
haskell-quickcheck
haskell-random
haskell-regex-base
haskell-regex-pcre
haskell-resourcet
haskell-safe
haskell-scientific
haskell-sha
haskell-skylighting
haskell-skylighting-core
haskell-socks
haskell-split
haskell-splitmix
haskell-streaming-commons
haskell-strict
haskell-syb
haskell-tagged
haskell-tagsoup
haskell-temporary
haskell-texmath
haskell-text-conversions
haskell-text-icu
haskell-th-abstraction
haskell-th-compat
haskell-th-lift
haskell-th-lift-instances
haskell-these
haskell-time-compat
haskell-tls
haskell-transformers-compat
haskell-typed-process
haskell-unicode-collation
haskell-unicode-transforms
haskell-uniplate
haskell-unliftio-core
haskell-unordered-containers
haskell-utf8-string
haskell-uuid-types
haskell-vector
haskell-vector-algorithms
haskell-x509
haskell-x509-store
haskell-x509-system
haskell-x509-validation
haskell-xml
haskell-xml-conduit
haskell-xml-types
haskell-zip-archive
haskell-zlib
hdparm
hicolor-icon-theme
hidapi
hostapd
htop
http-parser
hunspell
hwids
hwloc
hyphen
iana-etc
icu
id3lib
ijs
imagemagick
imath
imlib2
inetutils
iniparser
intellij-idea-ultimate-edition
intellij-idea-ultimate-edition-jre
iproute2
iptables
iputils
ipython
irony-mod-manager-bin
iso-codes
iw
jack2
jansson
jasper
java-environment-common
java-runtime-common
jbig2dec
jdk
jdk-openjdk
jdk11-openjdk
jdk8-openjdk
jemalloc
jq
jre
jre-openjdk
jre-openjdk-headless
jre11-openjdk
jre11-openjdk-headless
jre8-openjdk
jre8-openjdk-headless
js60
js68
js78
json-c
json-glib
jsoncpp
jupyter
jupyter-nbclassic
jupyter-nbclient
jupyter-nbconvert
jupyter-nbformat
jupyter-notebook
jupyter-server
jupyter-widgetsnbextension
jupyter_console
jupyterlab
jupyterlab_pygments
kaccounts-integration
kactivities
kactivities-stats
kactivitymanagerd
kamoso
karchive
kate
kauth
kbd
kbookmarks
kcalc
kcmutils
kcodecs
kcolorpicker
kcompletion
kconfig
kconfigwidgets
kcontacts
kcoreaddons
kcrash
kdbusaddons
kde-cli-tools
kde-gtk-config
kdeclarative
kdeconnect
kdecoration
kded
kdelibs4support
kdeplasma-addons
kdesignerplugin
kdesu
kdialog
kdnssd
kdsoap
kdsoap-ws-discovery-client
kemoticons
keyutils
kfilemetadata
kgamma5
kglobalaccel
kgraphviewer
kguiaddons
kholidays
khotkeys
ki18n
kiconthemes
kidletime
kimageannotator
kimageformats
kinfocenter
kinit
kio
kio-extras
kio-fuse
kirigami2
kitemmodels
kitemviews
kjobwidgets
kmenuedit
kmod
knewstuff
knotifications
knotifyconfig
kolourpaint
kpackage
kparts
kpeople
kpeoplevcard
kpty
kquickcharts
krb5
kross
krunner
kscreen
kscreenlocker
kservice
ksshaskpass
ksysguard
ksystemstats
ktexteditor
ktextwidgets
ktorrent
kunitconversion
kuserfeedback
kwallet
kwallet-pam
kwave
kwayland
kwayland-integration
kwayland-server
kwidgetsaddons
kwin
kwindowsystem
kwrited
kxmlgui
l-smash
lame
lapack
layer-shell-qt
lcms2
ldb
ldns
lensfun
less
lhasa
lib32-acl
lib32-alsa-lib
lib32-alsa-plugins
lib32-at-spi2-atk
lib32-at-spi2-core
lib32-atk
lib32-attr
lib32-brotli
lib32-bzip2
lib32-cairo
lib32-cdparanoia
lib32-colord
lib32-curl
lib32-dbus
lib32-dbus-glib
lib32-dconf
lib32-e2fsprogs
lib32-expat
lib32-faudio
lib32-flac
lib32-fontconfig
lib32-freeglut
lib32-freetype2
lib32-fribidi
lib32-gcc-libs
lib32-gdk-pixbuf2
lib32-gettext
lib32-giflib
lib32-glew1.10
lib32-glib-networking
lib32-glib2
lib32-glibc
lib32-glu
lib32-gmp
lib32-gnutls
lib32-gst-plugins-base
lib32-gst-plugins-base-libs
lib32-gstreamer
lib32-gtk2
lib32-gtk3
lib32-harfbuzz
lib32-icu
lib32-imlib2
lib32-json-glib
lib32-keyutils
lib32-krb5
lib32-lcms2
lib32-libappindicator-gtk2
lib32-libasyncns
lib32-libcaca
lib32-libcanberra
lib32-libcap
lib32-libcups
lib32-libcurl-compat
lib32-libcurl-gnutls
lib32-libdatrie
lib32-libdbusmenu-glib
lib32-libdbusmenu-gtk2
lib32-libdrm
lib32-libelf
lib32-libepoxy
lib32-libffi
lib32-libgcrypt
lib32-libgcrypt15
lib32-libglvnd
lib32-libgpg-error
lib32-libgudev
lib32-libgusb
lib32-libice
lib32-libid3tag
lib32-libidn11
lib32-libidn2
lib32-libindicator-gtk2
lib32-libjpeg-turbo
lib32-libjpeg6-turbo
lib32-libldap
lib32-libltdl
lib32-libmikmod
lib32-libmodplug
lib32-libnl
lib32-libnm
lib32-libnm-glib
lib32-libnsl
lib32-libogg
lib32-libpcap
lib32-libpciaccess
lib32-libpng
lib32-libpng12
lib32-libproxy
lib32-libpsl
lib32-libpulse
lib32-librsvg
lib32-librtmp0
lib32-libsm
lib32-libsndfile
lib32-libsoup
lib32-libssh2
lib32-libtasn1
lib32-libthai
lib32-libtheora
lib32-libtiff
lib32-libtiff4
lib32-libtirpc
lib32-libudev0-shim
lib32-libunistring
lib32-libunwind
lib32-libusb
lib32-libva
lib32-libvdpau
lib32-libvisual
lib32-libvorbis
lib32-libvpx1.3
lib32-libwebp
lib32-libwrap
lib32-libx11
lib32-libxau
lib32-libxcb
lib32-libxcomposite
lib32-libxcrypt
lib32-libxcursor
lib32-libxdamage
lib32-libxdmcp
lib32-libxext
lib32-libxfixes
lib32-libxft
lib32-libxi
lib32-libxinerama
lib32-libxkbcommon
lib32-libxml2
lib32-libxmu
lib32-libxrandr
lib32-libxrender
lib32-libxshmfence
lib32-libxss
lib32-libxt
lib32-libxtst
lib32-libxv
lib32-libxxf86vm
lib32-llvm-libs
lib32-lm_sensors
lib32-lz4
lib32-mesa
lib32-mpg123
lib32-ncurses
lib32-nettle
lib32-nspr
lib32-nss
lib32-nvidia-utils
lib32-openal
lib32-openssl
lib32-openssl-1.0
lib32-opus
lib32-orc
lib32-p11-kit
lib32-pam
lib32-pango
lib32-pcre
lib32-pipewire
lib32-pixman
lib32-polkit
lib32-readline
lib32-rest
lib32-sdl
lib32-sdl2
lib32-sdl2_image
lib32-sdl2_mixer
lib32-sdl2_ttf
lib32-sdl_image
lib32-sdl_mixer
lib32-sdl_ttf
lib32-smpeg
lib32-sqlite
lib32-systemd
lib32-tdb
lib32-util-linux
lib32-vulkan-icd-loader
lib32-wayland
lib32-xz
lib32-zlib
lib32-zstd
libabw
libaccounts-glib
libaccounts-qt
libaio
libarchive
libass
libassuan
libasyncns
libatasmart
libatomic_ops
libavc1394
libavif
libavtp
libblockdev
libbluray
libbs2b
libbsd
libbytesize
libcaca
libcanberra
libcap
libcap-ng
libcdr
libcloudproviders
libcmis
libcolord
libcroco
libcups
libcurl-compat
libcurl-gnutls
libdaemon
libdatrie
libdbusmenu-glib
libdbusmenu-gtk2
libdbusmenu-gtk3
libdbusmenu-qt4
libdbusmenu-qt5
libdc1394
libdca
libde265
libdmtx
libdrm
libdv
libdvbpsi
libdvdnav
libdvdread
libe-book
libebml
libedit
libelf
libepoxy
libepubgen
libetonyek
libevdev
libevent
libexif
libexttextcat
libfakekey
libfbclient
libfdk-aac
libffi
libfontenc
libfreehand
libgcrypt
libgcrypt15
libgdiplus
libgexiv2
libgit2
libglade
libglvnd
libgme
libgnomekbd
libgpg-error
libgphoto2
libgudev
libgusb
libheif
libibus
libical
libice
libid3tag
libidn
libidn11
libidn2
libiec61883
libieee1284
libimobiledevice
libindicator-gtk2
libinih
libinput
libinstpatch
libixion
libjpeg-turbo
libjpeg6-turbo
libkate
libkdcraw
libkipi
libksane
libksba
libkscreen
libksysguard
libktorrent
liblangtag
libldac
libldap
liblouis
liblqr
liblrdf
libluv
libmad
libmanette
libmatroska
libmbim
libmfx
libmicrodns
libmicrohttpd
libmikmod
libmm-glib
libmms
libmng
libmnl
libmodplug
libmpc
libmpcdec
libmpeg2
libmspub
libmtp
libmwaw
libmypaint
libndp
libnet
libnetfilter_conntrack
libnewt
libnfnetlink
libnftnl
libnghttp2
libnice
libnl
libnm
libnm-glib
libnotify
libnsl
libnumbertext
libodfgen
libofa
libogg
libomxil-bellagio
libopenaptx
liborcus
libp11-kit
libpagemaker
libpaper
libpcap
libpciaccess
libpgm
libpipeline
libplacebo
libplist
libpng
libpng12
libproxy
libpsl
libpulse
libpwquality
libqaccessibilityclient
libqalculate
libqmi
libqrtr-glib
libqxp
libraqm
libraw
libraw1394
libreoffice-fresh
librevenge
librsvg
librtmp0
libsamplerate
libsasl
libseccomp
libsecret
libshout
libsigc++
libsigsegv
libsm
libsndfile
libsodium
libsoup
libsoxr
libspiro
libsrtp
libssh
libssh2
libstaroffice
libstemmer
libsynctex
libtar
libtasn1
libteam
libtermkey
libthai
libtheora
libtiff
libtiff4
libtirpc
libtommath
libtool
libu2f-host
libudev0-shim
libunistring
libunwind
libupnp
liburcu
libusb
libusbmuxd
libutempter
libutf8proc
libuv
libva
libvdpau
libvisio
libvisual
libvorbis
libvpx
libvpx1.3
libvterm
libwacom
libwebp
libwmf
libwpd
libwpe
libwpg
libwps
libwrap
libx11
libxau
libxaw
libxcb
libxcomposite
libxcrypt
libxcursor
libxdamage
libxdmcp
libxext
libxfixes
libxfont2
libxft
libxi
libxinerama
libxkbcommon
libxkbcommon-x11
libxkbfile
libxklavier
libxml2
libxmu
libxnvctrl
libxpm
libxrandr
libxrender
libxres
libxshmfence
libxslt
libxss
libxt
libxtst
libxv
libxvmc
libxxf86vm
libyaml
libyuv
libzip
libzmf
licenses
lilv
linux
linux-api-headers
linux-firmware
linux-wifi-hotspot
llvm-libs
lm_sensors
lmdb
lpsolve
lrzip
lsb-release
lsof
lttng-ust
lua
lua52
lua53
luajit
luit
lvm2
lwjgl
lz4
lzo
lzop
m4
make
man-db
mariadb
mariadb-clients
mariadb-libs
mathjax2
mbedtls
md4c
mdadm
media-player-info
mesa
mesa-demos
meson
metis
milou
minizip
mjpegtools
mkinitcpio
mkinitcpio-busybox
mobile-broadband-provider-info
modemmanager
modemmanager-qt
mono
mpfr
mpg123
msgpack-c
mtdev
multimc5
mypaint-brushes1
ncurses
ndctl
neofetch
neon
neovim
nerd-fonts-complete
net-snmp
net-tools
netpbm
nettle
networkmanager
networkmanager-qt
ninja
nmap
node-gyp
nodejs
nodejs-nopt
nodenv
nodenv-node-build
noto-fonts
noto-fonts-cjk
noto-fonts-emoji
npm
npth
nspr
nss
ntfs-3g
numactl
nvidia
nvidia-settings
nvidia-utils
obs-studio
ocs-url
oh-my-zsh-git
okteta
oniguruma
openal
opencore-amr
opencv
openexr
openjpeg2
openmpi
openssh
openssl
openssl-1.0
openvpn
optimus-manager
optimus-manager-qt
opus
opusfile
orc
os-prober
owncloud-client
oxygen
p11-kit
p7zip
pacaur-git
pacman
pacman-contrib
pacman-mirrorlist
pagraphcontrol-git
pam
pambase
pandoc
pango
pangomm
papeaks-git
parted
patch
pciutils
pcre
pcre2
pcsclite
pepper-flash
perl
perl-error
perl-file-which
perl-mailtools
perl-timedate
phonon-qt4
phonon-qt5
phonon-qt5-gstreamer
php
php-fpm
php-gd
phpstorm
pinentry
pipewire
pixman
pkcs11-helper
pkgconf
pkgfile
plasma-browser-integration
plasma-desktop
plasma-disks
plasma-firewall
plasma-framework
plasma-integration
plasma-meta
plasma-nm
plasma-pa
plasma-sdk
plasma-systemmonitor
plasma-thunderbolt
plasma-vault
plasma-workspace
plasma-workspace-wallpapers
plasma5-applets-thermal-monitor
polkit
polkit-kde-agent
polkit-qt4
polkit-qt5
poppler
poppler-data
poppler-glib
poppler-qt5
popt
portaudio
postgresql
postgresql-libs
potrace
powercord-git
powerdevil
powerline-common
powerline-fonts
ppp
prison
procps-ng
progsreiserfs
protobuf
psmisc
pulseaudio
pulseaudio-alsa
pulseaudio-bluetooth
pulseaudio-qt
purpose
pycharm-professional
pyenv
pyside2
python
python-anyio
python-appdirs
python-argon2_cffi
python-asn1crypto
python-async_generator
python-attrs
python-babel
python-backcall
python-bleach
python-cachecontrol
python-cffi
python-chardet
python-click
python-colorama
python-contextlib2
python-cryptography
python-dateutil
python-decorator
python-defusedxml
python-deprecation
python-distlib
python-distro
python-dnspython
python-entrypoints
python-fido2
python-gobject
python-html5lib
python-idna
python-importlib-metadata
python-ipykernel
python-ipywidgets
python-jedi
python-jinja
python-json5
python-jsonschema
python-jupyter_client
python-jupyter_core
python-jupyter_packaging
python-jupyterlab_server
python-markdown
python-markupsafe
python-matplotlib-inline
python-mistune
python-more-itertools
python-msgpack
python-nest_asyncio
python-ordered-set
python-packaging
python-pandocfilters
python-parso
python-pep517
python-pexpect
python-pickleshare
python-pip
python-ply
python-progress
python-prometheus_client
python-prompt_toolkit
python-ptyprocess
python-pycparser
python-pygments
python-pyopenssl
python-pyotherside
python-pyparsing
python-pyrsistent
python-pyscard
python-pytz
python-pyusb
python-pyzmq
python-requests
python-requests-unixsocket
python-resolvelib
python-retrying
python-send2trash
python-setproctitle
python-setuptools
python-shiboken2
python-six
python-sniffio
python-terminado
python-testpath
python-toml
python-tomli
python-tomlkit
python-tornado
python-traitlets
python-urllib3
python-wcwidth
python-webencodings
python-websocket-client
python-wheel
python-zipp
python2
qbs
qca-qt5
qjson
qpdf
qqc2-desktop-style
qrencode
qt4-bin
qt5-3d
qt5-base
qt5-charts
qt5-connectivity
qt5-datavis3d
qt5-declarative
qt5-doc
qt5-examples
qt5-gamepad
qt5-graphicaleffects
qt5-imageformats
qt5-location
qt5-lottie
qt5-multimedia
qt5-networkauth
qt5-purchasing
qt5-quick3d
qt5-quickcontrols
qt5-quickcontrols2
qt5-quicktimeline
qt5-remoteobjects
qt5-script
qt5-scxml
qt5-sensors
qt5-serialbus
qt5-serialport
qt5-speech
qt5-svg
qt5-tools
qt5-translations
qt5-virtualkeyboard
qt5-wayland
qt5-webchannel
qt5-webengine
qt5-webglplugin
qt5-websockets
qt5-webview
qt5-x11extras
qt5-xmlpatterns
qtcreator
qtkeychain-qt5
qwt
raptor
rasqal
rav1e
re2
readline
redland
rest
ret-sync-ghidra-git
rhash
rnnoise
rsync
rtkit
rtmpdump
ruby
ruby-irb
ruby-reline
rubygems
run-parts
runc
runescape-launcher
rust
sane
sbc
screen
sddm
sddm-kcm
sdl
sdl2
sdl2_image
sdl2_mixer
sdl2_ttf
sdl_image
sdl_mixer
sdl_ttf
sed
semver
serd
serf
shaderc
shadow
shared-mime-info
signon-kwallet-extension
signon-plugin-oauth2
signon-ui
signond
slack-desktop
slang
smartmontools
smbclient
smpeg
snappy
socat
solid
sonnet
sord
sound-theme-freedesktop
soundtouch
source-highlight
spandsp
spectacle
speex
speexdsp
spirv-tools
sqlite
sratom
srt
sshfs
steam
steam-native-runtime
strace
subversion
sudo
suitesparse
svt-av1
svt-hevc
syndication
synergy
syntax-highlighting
sysfsutils
syslog-ng
systemd
systemd-libs
systemd-sysvcompat
systemsettings
t1lib
taglib
talloc
tar
tbb
tcl
tdb
telegram-desktop
termite
termite-terminfo
testdisk
tevent
texinfo
texlive-bibtexextra
texlive-bin
texlive-core
texlive-fontsextra
texlive-formatsextra
texlive-games
texlive-humanities
texlive-latexextra
texlive-music
texlive-pictures
texlive-pstricks
texlive-publishers
texlive-science
thin-provisioning-tools
threadweaver
tk
tlp
tlp-rdw
tracker3
tree
tree-sitter
tslib
ttf-fira-code
ttf-hack
ttf-liberation
ttf-opensans
twolame
tzdata
udisks2
unarchiver
unibilium
unixodbc
unrar
unzip
upower
usbmuxd
usbutils
util-linux
util-linux-libs
v4l-utils
valgrind
vid.stab
vim
vim-runtime
virtualbox
virtualbox-host-modules-arch
vlc
vmaf
volume_key
vte-common
vulkan-icd-loader
w3m
wavpack
wayland
wayland-protocols
webkit2gtk
webrtc-audio-processing
wget
which
wildmidi
windscribe-cli
wine
winetricks
woff2
wpa_supplicant
wpebackend-fdo
x264
x265
xapp
xbitmaps
xcb-proto
xcb-util
xcb-util-cursor
xcb-util-image
xcb-util-keysyms
xcb-util-renderutil
xcb-util-wm
xdg-dbus-proxy
xdg-desktop-portal-kde
xdg-user-dirs
xdg-utils
xf86-input-libinput
xf86-video-intel
xf86-video-nouveau
xfsprogs
xkeyboard-config
xmlsec
xorg-bdftopcf
xorg-font-util
xorg-fonts-encodings
xorg-iceauth
xorg-mkfontscale
xorg-server
xorg-server-common
xorg-sessreg
xorg-setxkbmap
xorg-smproxy
xorg-x11perf
xorg-xauth
xorg-xbacklight
xorg-xcmsdb
xorg-xcursorgen
xorg-xdpyinfo
xorg-xdriinfo
xorg-xev
xorg-xgamma
xorg-xhost
xorg-xinit
xorg-xinput
xorg-xkbcomp
xorg-xkbevd
xorg-xkbutils
xorg-xkill
xorg-xlsatoms
xorg-xlsclients
xorg-xmessage
xorg-xmodmap
xorg-xpr
xorg-xprop
xorg-xrandr
xorg-xrdb
xorg-xrefresh
xorg-xset
xorg-xsetroot
xorg-xvinfo
xorg-xwd
xorg-xwininfo
xorg-xwud
xorgproto
xterm
xvidcore
xxhash
xz
yaml-cpp
yarn
yay
yubico-c
yubico-c-client
yubikey-manager
yubikey-personalization
yubioath-desktop
zbar
zenity
zeromq
zimg
zip
zita-alsa-pcmi
zita-resampler
zlib
zsh
zsh-theme-powerlevel10k
zstd
zvbi
zxing-cpp
zziplib
CMakeLists.txt
cmake_minimum_required(VERSION 3.19)

project("ViPER4Android Reworked")

set(CMAKE_CXX_COMPILER_VERSION 20)

include_directories("include/")

set(FILES
        # Main
        src/Effect.cpp
        src/ProcessUnit_FX.cpp
        src/viper.cpp

        # Effects
        src/effects/Cure.cpp
        src/effects/TubeSimulator.cpp

        # Utils
        src/utils/CAllpassFilter.cpp
        src/utils/Crossfeed.cpp
        src/utils/FixedBiquad.cpp
        src/utils/IIR_1st.cpp
        src/utils/IIR_NOrder_BW_BP.cpp
        src/utils/IIR_NOrder_BW_LH.cpp
        src/utils/MultiBiquad.cpp
        src/utils/PassFilter.cpp
        src/utils/TimeConstDelay.cpp
)

add_library(
        # Sets the name of the library.
        v4afx_r

    # Sets the library as a shared library.
        SHARED

        # Provides a relative path to your source file(s).
        ${FILES})

CMake arguments: -DCMAKE_TOOLCHAIN_FILE=/home/mart/Android/Sdk/ndk/22.1.7171670/build/cmake/android.toolchain.cmake -DANDROID_ABI=armeabi-v7a -DANDROID_PLATFORM=16


After some testing, it seems this happens only(?) when CLion attempts to load it, and works fine in terminal. The odd thing here is that CLion is configured to use the NDK's provided compilers and such.

DanAlbert commented 2 years ago

CLion bug then? Your CMake appears to come from your CLion distribution, so might have some modifications?

I didn't have set(CMAKE_CXX_COMPILER_VERSION 20) in my test (I didn't see it in the OP if it was there). Will try that tomorrow. If it's not that there's something about your environment that's exposing the issue.

Martmists-GH commented 2 years ago

After setting CLion to use native CMake instead of bundled:

/usr/bin/cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=/home/mart/Android/Sdk/ndk/23.0.7196353/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -DCMAKE_CXX_COMPILER=/home/mart/Android/Sdk/ndk/23.0.7196353/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ -DCMAKE_TOOLCHAIN_FILE=~/Android/Sdk/ndk/23.0.7196353/build/cmake/android.toolchain.cmake -DANDROID_ABI=armeabi-v7a -DCMAKE_DEPENDS_USE_COMPILER=FALSE -G "CodeBlocks - Unix Makefiles" /home/mart/git/ViPERFX_RE
-- Android: Targeting API '16' with architecture 'arm', ABI 'armeabi-v7a', and processor 'armv7-a'
-- Android: Selected unified Clang toolchain
-- The C compiler identification is Clang 11.0.5
-- The CXX compiler identification is Clang 11.0.5
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /home/mart/Android/Sdk/ndk/23.0.7196353/toolchains/llvm/prebuilt/linux-x86_64/bin/clang - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /home/mart/Android/Sdk/ndk/23.0.7196353/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/mart/git/ViPERFX_RE

Cannot get compiler information:
    Compiler exited with error code 1: /home/mart/Android/Sdk/ndk/23.0.7196353/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ -xc++ -Dv4afx_r_EXPORTS -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -march=armv7-a -mthumb -Wformat -fexceptions -frtti -stdlib=libc++ -g -fno-limit-debug-info -fPIC -fpch-preprocess -v -dD -E
    Android (6875598, based on r399163b) clang version 11.0.5 (https://android.googlesource.com/toolchain/llvm-project 87f1315dfbea7c137aa2e6d362dbb457e388158d)
    Target: x86_64-unknown-linux-gnu
    Thread model: posix
    InstalledDir: /home/mart/Android/Sdk/ndk/23.0.7196353/toolchains/llvm/prebuilt/linux-x86_64/bin
    Found candidate GCC installation: /home/mart/Android/Sdk/ndk/23.0.7196353/toolchains/llvm/prebuilt/linux-x86_64/bin/../lib/gcc/i686-linux-android/4.9.x
    Found candidate GCC installation: /home/mart/Android/Sdk/ndk/23.0.7196353/toolchains/llvm/prebuilt/linux-x86_64/bin/../lib/gcc/x86_64-linux-android/4.9.x
    Found candidate GCC installation: /usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0
    Found candidate GCC installation: /usr/lib64/gcc/x86_64-pc-linux-gnu/11.1.0
    Selected GCC installation: /usr/lib64/gcc/x86_64-pc-linux-gnu/11.1.0
    Candidate multilib: .;@m64
    Candidate multilib: 32;@m32
    Selected multilib: .;@m64
    clang++: warning: argument unused during compilation: '-mthumb' [-Wunused-command-line-argument]
     (in-process)
     "/home/mart/Android/Sdk/ndk/23.0.7196353/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++" -cc1 -triple x86_64-unknown-linux-gnu -E -disable-free -disable-llvm-verifier -discard-value-names -main-file-name compiler-file412296049548030883 -mrelocation-model pic -pic-level 2 -mframe-pointer=all -fmath-errno -fno-rounding-math -mconstructor-aliases -munwind-tables -target-cpu armv7-a -fno-split-dwarf-inlining -debug-info-kind=standalone -dwarf-version=4 -debugger-tuning=gdb -v -ffunction-sections -fdata-sections -resource-dir /home/mart/Android/Sdk/ndk/23.0.7196353/toolchains/llvm/prebuilt/linux-x86_64/lib64/clang/11.0.5 -D v4afx_r_EXPORTS -D ANDROID -D _FORTIFY_SOURCE=2 -D ___CIDR_DEFINITIONS_END -internal-isystem /usr/local/include -internal-isystem /home/mart/Android/Sdk/ndk/23.0.7196353/toolchains/llvm/prebuilt/linux-x86_64/lib64/clang/11.0.5/include -internal-externc-isystem /include -internal-externc-isystem /usr/include -Wformat -fdeprecated-macro -fdebug-compilation-dir /home/mart/git/ViPERFX_RE -ferror-limit 19 -stack-protector 2 -fgnuc-version=4.2.1 -fcxx-exceptions -fexceptions -dD -faddrsig -o - -x c++ /tmp/compiler-file412296049548030883
    error: unknown target CPU 'armv7-a'
    note: valid target CPU values are: nocona, core2, penryn, bonnell, atom, silvermont, slm, goldmont, goldmont-plus, tremont, nehalem, corei7, westmere, sandybridge, corei7-avx, ivybridge, core-avx-i, haswell, core-avx2, broadwell, skylake, skylake-avx512, skx, cascadelake, cooperlake, cannonlake, icelake-client, icelake-server, tigerlake, knl, knm, k8, athlon64, athlon-fx, opteron, k8-sse3, athlon64-sse3, opteron-sse3, amdfam10, barcelona, btver1, btver2, bdver1, bdver2, bdver3, bdver4, znver1, znver2, x86-64

[Failed to reload]

based on Selected GCC installation: /usr/lib64/gcc/x86_64-pc-linux-gnu/11.1.0 I'm guessing it decides to use my native gcc rather than the ndk-provided one, any clue as to why?

DanAlbert commented 2 years ago

Thanks for ruling that out 👍

I didn't have set(CMAKE_CXX_COMPILER_VERSION 20) in my test

Tested this, no difference.

based on Selected GCC installation: /usr/lib64/gcc/x86_64-pc-linux-gnu/11.1.0 I'm guessing it decides to use my native gcc rather than the ndk-provided one, any clue as to why?

That message is coming from Clang. It's logging where it found your system's CRT objects, libstdc++, etc. For whatever reason Clang isn't getting the -target flag, so it isn't actually building for Android. That's the real problem, but so far I have no idea what's causing it.

Have you tried -DANDROID_USE_LEGACY_TOOLCHAIN_FILE=ON?

Martmists-GH commented 2 years ago

-DANDROID_USE_LEGACY_TOOLCHAIN_FILE=ON did not change anything, neither did manually selecting android-legacy.toolchain.cmake

DanAlbert commented 2 years ago

That rules out it being a problem with the updated CMake integration.

Without a repro case that works outside CLion I'm leaning toward it being a CLion bug. I don't have any ideas what that would be unless it's hiding something from you, but as you say, it works without CLion, so it doesn't sound like something we can fix.

If you come up with a repro case that works outside CLion let us know and we'll reopen, but I've been unable to cause the problem.