Changes required after commit 514df444e
dri_gbm module is installed as /vendor/lib{64}/dri_gbm.so
to avoid changes in system/linkerconfig AOSP project
gbm-backends-path option is set as /vendor/$(MESA3D_LIB_DIR)
MESA3D_GBM_BINS variable simplifies dependencies declarations
Test results: gbm_gralloc works again
Fixes: 514df444e ("gbm: split the DRI backend into a separate library and unify backend handling")
Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Roman Stratiienko <r.stratiienko@gmail.com>
Tested-by: Mauro Rossi <issor.oruam@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31428>
In commit 41e83b243c (meson: remove dri-search-path, 2024-09-18) the
`dri-search-path` meson option was removed but its usage in the Android
build files was left there, resulting in the following error when
building for Android:
-----------------------------------------------------------------------
FAILED: out/target/product/vsoc_x86_64/obj_x86/MESON_MESA3D/.build.timestamp
...
meson.build:4:0: ERROR: Unknown options: "dri-search-path"
-----------------------------------------------------------------------
Remove the usage of the option when building for Android, and while at
it remove also any mention of if in docs/drivers/llvmpipe.rst
Remove also the MESA3D_LIB_DIR variable which was used only for
dri-search-path.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31266>
The versioned libgallium library can be confusing on Android, and it is
probably not even needed there, so simplify the build on Android by
always build the unversioned `libgallium_dri.so` overriding the
`-Dunversion-libgallium=true` option added in
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30579
Remove also all the bits that deal with the versioned library which are
not needed anymore.
Fixes: 9568976c52 ("android: fix build in multiple ways")
Acked-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Mauro Rossi <issor.oruam@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30641>
Fixes the following libarchive error when building with the libarchive wrap subproject:
In file included from ../subprojects/libarchive-3.7.2/libarchive/archive_write_open_memory.c:33:
../subprojects/libarchive-3.7.2/libarchive/archive.h:101:10: fatal error: 'android_lf.h' file not found
This also removes the version suffixes from the .so's that are referenced
in the mesa3d_cross.mk file as those are not present on the Android target.
Signed-off-by: Joshua Ashton <joshua@froggi.es>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27648>
Android libbacktrace is not available in Android 14
Fixes the following build error:
FAILED: src/util/libmesa_util.a.p/u_debug_stack_android.cpp.o
...
../src/util/u_debug_stack_android.cpp:28:10: fatal error: 'backtrace/Backtrace.h' file not found
^~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
Cc: mesa-stable
Reviewed-by: Roman Stratiienko <r.stratiienko@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25963>
Android 14 uses prebuild clang version 17.0.2
By filtering these cflags there are no building errors on previous Android releases.
Fixes the following building errors:
../src/c11/time.h:54:8: error: redefinition of 'timespec'
struct timespec
^
/media/bigblissdrive/u-x86/out/soong/.intermediates/bionic/libc/libc/android_vendor.34_x86_x86_64_shared/gen/include/bits/timespec.h:46:8: note: previous definition is here
struct timespec {
^
1 error generated.
In file included from ../src/util/disk_cache.c:50:
../src/util/disk_cache.h:86:4: error: use of undeclared identifier 'Dl_info'
Dl_info info;
^
...
./src/util/disk_cache.h:114:30: error: incompatible integer to pointer conversion passing 'int' to parameter of type 'const void *' [-Wint-conversion]
_mesa_sha1_update(ctx, build_id_data(note), build_id_length(note));
^~~~~~~~~~~~~~~~~~~
10 errors generated.
../src/intel/perf/intel_perf.c:91:10: error: call to undeclared function 'major'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
maj = major(sb.st_rdev);
^
../src/intel/perf/intel_perf.c:92:10: error: call to undeclared function 'minor'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
min = minor(sb.st_rdev);
^
2 errors generated.
../src/intel/vulkan/anv_allocator.c:295:13: error: call to undeclared function 'futex_wake'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
futex_wake(&table->state.end, INT_MAX);
^
...
../src/intel/vulkan/anv_allocator.c:711:7: error: call to undeclared function 'futex_wait'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
futex_wait(&pool->block.end, block.end, NULL);
^
6 errors generated.
Cc: mesa-stable
Reviewed-by: Roman Stratiienko <r.stratiienko@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25963>
The AMD Vulkan driver uses LLVM by default, but it is possible to build
the driver without the LLVM dependency. In this case, we must explicitly
disable LLVM support, or else meson will die after failing to find LLVM.
The Android build system already knows when to link libLLVM, so forward
that information to meson.
Cc: mesa-stable
Acked-by: Mauro Rossi <issor.oruam@gmail.com>
Reviewed-by: Roman Stratiienko <r.stratiienko@gmail.com>
Change-Id: I7489d3811625b390aaaf2e84e666b4a8d98328b0
Signed-off-by: Samuel Holland <samuel.holland@sifive.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24007>
Android bundles ANGLE for implementing OpenGL ES and EGL on top of
Vulkan. When using ANGLE, mesa is only needed for its Vulkan drivers.
Cc: mesa-stable
Acked-by: Mauro Rossi <issor.oruam@gmail.com>
Reviewed-by: Roman Stratiienko <r.stratiienko@gmail.com>
Change-Id: I034a0af52f9216bc5f1322f584bc591c90222327
Signed-off-by: Samuel Holland <samuel.holland@sifive.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24007>
This patch filters-out '-std=gnu++14' from the cflags obtained
from AOSP/KATI dummy target output to avoid the following building errors:
FAILED: src/gallium/drivers/r600/45f68e3@@r600@sta/sfn_sfn_assembler.cpp.o
...
clang++ ... -std=c++17 ... -std=gnu++14
...
In file included from ../src/gallium/drivers/r600/sfn/sfn_assembler.cpp:27:
In file included from ../src/gallium/drivers/r600/sfn/sfn_assembler.h:32:
In file included from ../src/gallium/drivers/r600/sfn/sfn_shader.h:31:
../src/gallium/drivers/r600/sfn/sfn_instr.h:369:56: error: no template named 'is_base_of_v' in namespace 'std'; did you mean 'is_base_of'?
template <typename T, typename = std::enable_if_t<std::is_base_of_v<Instr, T>>>
~~~~~^~~~~~~~~~~~
is_base_of
/home/utente/pie-x86_kernel/external/libcxx/include/type_traits:1412:29: note: 'is_base_of' declared here
struct _LIBCPP_TEMPLATE_VIS is_base_of
^
In file included from ../src/gallium/drivers/r600/sfn/sfn_assembler.cpp:27:
In file included from ../src/gallium/drivers/r600/sfn/sfn_assembler.h:32:
In file included from ../src/gallium/drivers/r600/sfn/sfn_shader.h:31:
../src/gallium/drivers/r600/sfn/sfn_instr.h:369:51: error: template argument for non-type template parameter must be an expression
template <typename T, typename = std::enable_if_t<std::is_base_of_v<Instr, T>>>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/utente/pie-x86_kernel/external/libcxx/include/type_traits:439:16: note: template parameter is declared here
template <bool _Bp, class _Tp = void> using enable_if_t = typename enable_if<_Bp, _Tp>::type;
^
2 errors generated.
Cc: "22.2" "22.3" mesa-stable
Reviewed-by: Roman Stratiienko <r.stratiienko@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19563>
libgbm.so name has been occupied in AOSP by minigbm starting from
Android-11 (SDKv30).
In AOSP's mesa3d fork, libgbm was renamed to libgbm_mesa.
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18533>
When meson tests for the compability of some linker flags, not having
the default entry symbol "_start" defined makes the check fail for
a warning unrelated to the linker flag meson is testing.
Since these tests normally just try to compile a C program with a main,
use "main" as the ficticious entry point.
Specifically, this makes "-Wl,--build-id=sha1" recognised as valid
and allows its use for drivers that rely on it.
This is a temporary workaround that is required until Android.mk is
changed to support both shared libraries and executables.
Cc: "22.0" "22.1" "22.2" mesa-stable
Reviewed-by: Roman Stratiienko <r.stratiienko@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17715>
When building with Android.mk we are ending-up with:
gcc ..... -std=gnu99 .... -std=c11 .... target.o
^^^^^^^^^^ ^^^^^^^^
| |
_______________^_____ _____^___________
AOSP/KATI GENERATED MESON GENERATED
Some compilers uses first -std=gnu99 option and ignores second,
which results:
c99 implicit declaration of function static_assert()
This patch filters-out the first '-std=gnu99' from the cflags obtained
from AOSP/KATI dummy target output to avoid such kind of errors.
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Mauro Rossi <issor.oruam@gmail.com>
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17078>
libLLVM for Android is built without RTTI, but after commit ad86267
mesa inherits meson default RTTI enabled state.
cpp_rtti=false is added to meson options in android/mesa3d_cross.mk
(v2) Add Fixes tag and use spaces instead of tabs for aligning the trailing \
Signed-off-by: Mauro Rossi <issor.oruam@gmail.com>
Fixes: ad862674 ("meson: Don't override built-in cpp_rtti option, error if it's invalid")
Cc: "21.3" "21.2" mesa-stable
Reviewed-by: Marijn Suijten <marijn.suijten@somainline.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13901>
Android build system may use different internal variables to specify
cflags/cppflags.
Small change in product confguration may force Android to use diffrent
set of variables, therefore we should keep all of them attached to the
make rule's target.
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5549
Fixes: 8621bd8d5e ("android: Add scripts to build using meson")
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Acked-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Marijn Suijten <marijn.suijten@somainline.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13914>
libLLVM for Android is built without RTTI, but after commit ad86267
mesa inherits meson default RTTI enabled state
cpp_rtti=false is added to meson options in android/mesa3d_cross.mk
Signed-off-by: Mauro Rossi <issor.oruam@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13888>
Fixes warning during the build and unnecessary rule execution:
***
ninja: Missing `restat`? An output file is older than the most recent input:
***
Fixes: 8621bd8d5e ("android: Add scripts to build using meson")
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Tested-by: Mauro Rossi <issor.oruam@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12304>
With '-Wl,--gc-sections' meson.build cc.has_function() will never fail,
providing wrong input to the build system.
Fixes: 8621bd8d5e ("android: Add scripts to build using meson")
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Tested-by: Mauro Rossi <issor.oruam@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11637>
How to use:
- For GALLIUM drivers:
1. Add gallium drivers into your board.mk file:
board.mk:
BOARD_MESA3D_USES_MESON_BUILD := true
BOARD_MESA3D_GALLIUM_DRIVERS := lima panfrost v3d
2. Add the following packages into your device.mk file:
device.mk:
PRODUCT_PACKAGES += \
libEGL_mesa \
libGLESv1_CM_mesa \
libGLESv2_mesa \
libgallium_dri \
libglapi
- For VULKAN drivers:
1. Add single vulkan driver into your board.mk file:
board.mk:
BOARD_MESA3D_USES_MESON_BUILD := true
BOARD_MESA3D_VULKAN_DRIVERS := freedreno broadcom
2. Add the following package configuration into your device.mk file:
device.mk:
PRODUCT_PACKAGES += \
vulkan.freedreno
PRODUCT_PROPERTY_OVERRIDES += \
ro.hardware.vulkan=freedreno
- To build 'libgbm' set definition in the board.mk:
BOARD_MESA3D_BUILD_LIBGBM := true
And add a package to the device.mk:
PRODUCT_PACKAGES += libgbm
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tested-by: Mauro Rossi <issor.oruam@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10183>