tesla-android / issue-tracker

Place for reporting issues and discussion with the community
18 stars 1 forks source link

Cannot build from android-manifests due to implicit declaration of 'drmGetDeviceFromDevId' error #142

Closed jasonparekh closed 2 years ago

jasonparekh commented 2 years ago

Thanks for the hard work on this project!

I'm looking to add the ability to have the Tesla-Android itself project onto another Android Auto display but need to add the Android Auto APK to the privileged system apps.

I'm attempting to build using the instructions in the android-manifests project.

Build host: Ubuntu 20.04 LTS in a VM set up according to the snippets of code from the android-manifests README.

On the make images step, I'm hitting this failure:

[  0% 8/80355] //external/mesa3d:libgbm_mesa clang src/loader/loader.c [arm]
FAILED: out/soong/.intermediates/external/mesa3d/libgbm_mesa/android_vendor.32_arm_armv7-a-neon_cortex-a15_shared/obj/external/mesa3d/src/loader/loader.o
PWD=/proc/self/cwd prebuilts/clang/host/linux-x86/clang-r416183b1/bin/clang -c -D__ANDROID_VNDK__ -D__ANDROID_VENDOR__ -mthumb -Os -fomit-frame-pointer -DANDROID -fmessage-length=0 -W -Wall -Wno-unused -Winit-self -Wpointer-arith -Wunreachable-code-loop-increment -no-canonical-prefixes -DNDEBUG -UDEBUG -fno-exceptions -Wno-multichar -O2 -g -fdebug-info-for-profiling -fno-strict-aliasing -Werror=date-time -Werror=pragma-pack -Werror=pragma-pack-suspicious-include -Werror=string-plus-int -Werror=unreachable-code-loop-increment -fdebug-prefix-map=/proc/self/cwd= -D__compiler_offsetof=__builtin_offsetof -faddrsig -fcommon -Werror=int-conversion -fexperimental-new-pass-manager -Wno-reserved-id-macro -Wno-unused-command-line-argument -fcolor-diagnostics -Wno-sign-compare -Wno-defaulted-function-deleted -Wno-inconsistent-missing-override -Wno-c99-designator -Wno-gnu-folding-constant -Wunguarded-availability -D__ANDROID_UNAVAILABLE_SYMBOLS_ARE_WEAK__ -ftrivial-auto-var-init=zero -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang -ffunction-sections -fdata-sections -fno-short-enums -funwind-tables -fstack-protector-strong -Wa,--noexecstack -D_FORTIFY_SOURCE=2 -Wstrict-aliasing=2 -Werror=return-type -Werror=non-virtual-dtor -Werror=address -Werror=sequence-point -Werror=format-security -nostdlibinc -Wno-enum-compare -Wno-enum-compare-switch -Wno-null-pointer-arithmetic -Wno-null-dereference -Wno-pointer-compare -Wno-xor-used-as-pow -Wno-final-dtor-non-final-class -Wno-psabi -msoft-float -march=armv7-a -mfloat-abi=softfp -mfpu=neon -mcpu=cortex-a15 -mfpu=neon-vfpv4 -D__ARM_FEATURE_LPAE=1 -target armv7a-linux-androideabi32 -Bprebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9/arm-linux-androideabi/bin -fPIC  -Iexternal/mesa3d/src/gbm/main -Iexternal/mesa3d/include -Iexternal/mesa3d/src/loader -Iexternal/mesa3d/src/util -Iexternal/mesa3d/src -Iexternal/mesa3d -Iexternal/libcxxabi/include -Iexternal/libdrm/include/drm -Iexternal/libdrm/android -Iexternal/libcxx/include -isystem external/libdrm -isystem out/soong/.intermediates/bionic/libc/libc/android_vendor.32_arm_armv7-a-neon_cortex-a15_shared/gen/include -isystem bionic/libc/kernel/uapi -isystem bionic/libc/kernel/android/scsi -isystem bionic/libc/kernel/android/uapi -isystem bionic/libc/kernel/uapi/asm-arm -Wall -Werror -DHAVE_TIMESPEC_GET -DHAVE_LIBDRM -DMAJOR_IN_SYSMACROS -Wno-missing-field-initializers -Wno-sign-compare -DHAVE_PTHREAD=1 -Wno-unused-parameter -Wno-missing-field-initializers '-DDEFAULT_DRIVER_DIR="/vendor/lib/dri"' '-DDEFAULT_BACKENDS_PATH="/vendor/lib/gbm"' -std=gnu99  -Werror=bool-operation -Werror=implicit-int-float-conversion -Werror=int-in-bool-context -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast -Werror=string-compare -Werror=xor-used-as-pow -Wno-void-pointer-to-enum-cast -Wno-void-pointer-to-int-cast -Wno-pointer-to-int-cast -Werror=fortify-source -Werror=address-of-temporary -Werror=return-type -Wno-tautological-constant-compare -Wno-tautological-type-limit-compare -Wno-reorder-init-list -Wno-implicit-int-float-conversion -Wno-int-in-bool-context -Wno-sizeof-array-div -Wno-tautological-overlap-compare -Wno-deprecated-copy -Wno-range-loop-construct -Wno-misleading-indentation -Wno-zero-as-null-pointer-constant -Wno-deprecated-anon-enum-enum-conversion -Wno-deprecated-enum-enum-conversion -Wno-string-compare -Wno-enum-enum-conversion -Wno-enum-float-conversion -Wno-pessimizing-move -Wno-non-c-typedef-for-linkage -Wno-string-concatenation -MD -MF out/soong/.intermediates/external/mesa3d/libgbm_mesa/android_vendor.32_arm_armv7-a-neon_cortex-a15_shared/obj/external/mesa3d/src/loader/loader.o.d -o out/soong/.intermediates/external/mesa3d/libgbm_mesa/android_vendor.32_arm_armv7-a-neon_cortex-a15_shared/obj/external/mesa3d/src/loader/loader.o external/mesa3d/src/loader/loader.c
external/mesa3d/src/loader/loader.c:187:8: error: implicit declaration of function 'drmGetDeviceFromDevId' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
   if (drmGetDeviceFromDevId(device, 0, &dev_ptr) < 0)
       ^
1 error generated.
15:12:29 ninja failed with: exit status 1

#### failed to build some targets (9 seconds) ####

Have you run into this?

Separately, do you have any build scripts, build actions or Dockerfiles that I could follow as a reference (or use outright?)

Thanks again.

mikegapinski commented 2 years ago

can you tell me the branch you checked out from? Main currently contains work in progress version of 45.1, and I recently switched from building on macOS to building on ubuntu so it might not build without little changes.

In your case it would be best to build Glodroid directly, since you don't need all the Tesla android stuff(tethering, virtual display and other things) to project onto Android Auto displays. https://github.com/GloDroid/glodroid_manifest, this manifest will build you an Android 13 base that works on rpi4 and already supports headless operation(booting without HDMI cable). Tesla Android is currently based on an older version of Glodroid and I am transitioning to the most current one.

If you want to build Tesla Android considering even considering that Glodroid itself would be a better match for you give me a heads up. I'll make sure it builds on a clean manifest and update the guide, it can be a little bit outdated. Nobody builds this except for me, so I don't run a clean checkout CI on my Jenkins all the time :)

BTW: Know any OSS projects that create an Android Auto Receiver - the other way around of what you need? Headunit is outdated and Headunit Reloaded is closed source - I need to make some Tesla specific changes.

jasonparekh commented 2 years ago

It was main branch (I don't recall seeing any other branches when I checked it out).

Forgot to mention that I still want the Tesla android additions. I'm adding a HUD as a driver display to use CANDash (will be adding android auto support to it), and would have less headaches if I can get the Tesla and added devices to work on their own without my phone.

So, if you could update the guide, would be much appreciated!

No unfortunately don't know of any other receivera for AA.

ciatedSwipeov 8, 2022, 1:59 PM Michał Gapiński @.***> wrote:

can you tell me the branch you checked out from? Main currently contains work in progress version of 45.1, and I recently switched from building on macOS to building on ubuntu so it might not build without little changes.

In your case it would be best to build Glodroid directly, since you don't need all the Tesla android stuff(tethering, virtual display and other things) to project onto Android Auto displays. https://github.com/GloDroid/glodroid_manifest, this manifest will build you an Android 13 base that works on rpi4 and already supports headless operation(booting without HDMI cable). Tesla Android is currently based on an older version of Glodroid and I am transitioning to the most current one.

If you want to build Tesla Android considering even considering that Glodroid itself would be a better match for you give me a heads up. I'll make sure it builds on a clean manifest and update the guide, it can be a little bit outdated. Nobody builds this except for me, so I don't run a clean checkout CI on my Jenkins all the time :)

BTW: Know any OSS projects that create an Android Auto Receiver - the other way around of what you need? Headunit is outdated and Headunit Reloaded is closed source - I need to make some Tesla specific changes.

— Reply to this email directly, view it on GitHub https://github.com/tesla-android/issue-tracker/issues/142#issuecomment-1307688149, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADUAAOT5RBF4AS6EVUOAZ3WHKPJJANCNFSM6AAAAAAR2OWBK4 . You are receiving this because you authored the thread.Message ID: @.***>