Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do I build static libs? Especially libvchiq_arm! #667

Open
Fredrum opened this issue Dec 4, 2020 · 1 comment
Open

How do I build static libs? Especially libvchiq_arm! #667

Fredrum opened this issue Dec 4, 2020 · 1 comment

Comments

@Fredrum
Copy link

Fredrum commented Dec 4, 2020

Describe the bug
I'm passing the options in CMakeFiles.txt to build static libs but they don't seem to work.
I managed to build libbcm_host and libvcos by editing the CMakefiles in those directories but for libvchiq_arm I get error messages.

To reproduce

  1. cd userland/interface/vchiq_arm
  2. Add to CMakeLists.txt
SET(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
SET(BUILD_SHARED_LIBS OFF)
SET(CMAKE_EXE_LINKER_FLAGS "-static")
  1. cmake .
  2. make

I get:

[ 20%] Building C object CMakeFiles/vchiq_arm.dir/vchiq_lib.o
/home/pi/hardwarez/userland/interface/vchiq_arm/vchiq_lib.c: In function ‘completion_thread’:
/home/pi/hardwarez/userland/interface/vchiq_arm/vchiq_lib.c:1507:7: error: ‘VCHI_CALLBACK_SERVICE_OPENED’ undeclared (first use in this function); did you mean ‘VCHI_CALLBACK_SERVICE_CLOSED’?
       VCHI_CALLBACK_SERVICE_OPENED,        // VCHIQ_SERVICE_OPENED
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
       VCHI_CALLBACK_SERVICE_CLOSED
/home/pi/hardwarez/userland/interface/vchiq_arm/vchiq_lib.c:1507:7: note: each undeclared identifier is reported only once for each function it appears in
/home/pi/hardwarez/userland/interface/vchiq_arm/vchiq_lib.c:1512:7: error: ‘VCHI_CALLBACK_BULK_TRANSMIT_ABORTED’ undeclared (first use in this function); did you mean ‘VCHIQ_BULK_TRANSMIT_ABORTED’?
       VCHI_CALLBACK_BULK_TRANSMIT_ABORTED, // VCHIQ_BULK_TRANSMIT_ABORTED
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       VCHIQ_BULK_TRANSMIT_ABORTED
/home/pi/hardwarez/userland/interface/vchiq_arm/vchiq_lib.c:1513:7: error: ‘VCHI_CALLBACK_BULK_RECEIVE_ABORTED’ undeclared (first use in this function); did you mean ‘VCHI_CALLBACK_BULK_RECEIVED’?
       VCHI_CALLBACK_BULK_RECEIVE_ABORTED,  // VCHIQ_BULK_RECEIVE_ABORTED
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       VCHI_CALLBACK_BULK_RECEIVED
make[2]: *** [CMakeFiles/vchiq_arm.dir/build.make:63: CMakeFiles/vchiq_arm.dir/vchiq_lib.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:110: CMakeFiles/vchiq_arm.dir/all] Error 2
make: *** [Makefile:130: all] Error 2

I also tried adding the same lines to the CMakeLists.txt in the userland root and 'make' from there but that didn't work either.

Expected behaviour
I need to be able to build 'libvchiq_arm' as a static library.

Actual behaviour
See above

System
RPi 4b 4GB - Raspbian Buster 32bit. Working from standard Desktop.

  • Which firmware version (vcgencmd version)?
Oct 22 2020 14:00:27 
Copyright (c) 2012 Broadcom
version 74e754ff8947c58d2773253f77f6f68a303188f8 (clean) (release) (start_x
  • Which kernel version (uname -a)?
    Linux sensitpi 5.4.72-v7l+ #1356 SMP Thu Oct 22 13:57:51 BST 2020 armv7l GNU/Linux

Cheers!
Fred

@Fredrum
Copy link
Author

Fredrum commented Dec 5, 2020

Actually I just got it to work. I did a bunch of things and not exactly sure what contributed.
But it got the .a file I was looking for! Thank You.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant