All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [poky] Weird Compilation issue with a c++ recipe
       [not found] <Groupsio.1.pwb1.1616605380917082275.iIyZ@lists.yoctoproject.org>
@ 2021-03-24 18:43 ` Khem Raj
  2021-03-24 20:06   ` arunlee
       [not found]   ` <12874.1616616288995699304@lists.yoctoproject.org>
  0 siblings, 2 replies; 10+ messages in thread
From: Khem Raj @ 2021-03-24 18:43 UTC (permalink / raw)
  To: poky

Looks like CMake file is not keeping the CC/CXX variables that yocto is 
passing. Look into that aspect e.g. you can do

bitbake -e <your-recipe> | grep -e "^CXX="
and see whats the value of CXX that yocto wants to pass and compare it
with what you see in final Makefile

On 3/24/21 10:03 AM, arunlee@gmail.com wrote:
> [Edited Message Follows]
> 
> Hi,
> 
> I am facing an issue with compiling a recipe which has c++ sources.
> 
> The CMakeList.txt is has the following
> ---------------------------------------------------------------------------------------------------------------------------
> 
> # Set minimum required CMake version
> cmake_minimum_required(VERSION 3.5.1)
> 
> # Name the project Intel RealSense D400 camera server
> project (rs-camera-master)
> 
> # Integrity
> if (${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
>          MESSAGE( FATAL_ERROR "In-source builds not allowed. Please 
> specify a build directory!")
> endif()
> 
> SET (EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR})
> SET (LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR})
> 
> # Enable C++11
> set(CMAKE_CXX_STANDARD 11)
> set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
> 
> if(COMPILER_SUPPORTS_CXX11)
>      set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
> elseif(COMPILER_SUPPORTS_CXX0X)
>      set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
> endif()
> 
> 
> if(MSVC)
>      if(BUILD_WITH_STATIC_CRT)
>        set(CMAKE_CXX_FLAGS_RELEASE "/MT")
>      else()
>        set(CMAKE_CXX_FLAGS_RELEASE "/MD")
>      endif()
> 
>      add_definitions(-D_WIN32)
> elseif(ANDROID)
>      SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pipe -fPIC -pie -llog 
> -pedantic -std=gnu++11 -O2 -W -Wl,--no-undefined -fopenmp -ldl")
> else()
>      EXEC_PROGRAM(uname ARGS -p OUTPUT_VARIABLE CMAKE_SYSTEM_PROCCESSOR)
>      message(STATUS "CMAKE_SYSTEM_PROCCESSOR=${CMAKE_SYSTEM_PROCCESSOR}")
>      SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pipe -pedantic 
> -std=gnu++11 -W -Wl,--no-undefined -fopenmp")
> endif()
> 
> # calibration api include and library paths
> set (DCAPI_INCLUDE_DIR 
> ${CMAKE_CURRENT_SOURCE_DIR}/librscalibrationapi/Include)
> 
> if(MSVC)
>      set (DCAPI_LIBS_DIR 
> ${CMAKE_CURRENT_SOURCE_DIR}/librscalibrationapi/lib/windows/x64)
> elseif(${CMAKE_SYSTEM_PROCCESSOR} MATCHES "aarch64|AARCH64")
>      set (DCAPI_LIBS_DIR 
> ${CMAKE_CURRENT_SOURCE_DIR}/librscalibrationapi/lib/linux/aarch64)
> else()
>      set (DCAPI_LIBS_DIR 
> ${CMAKE_CURRENT_SOURCE_DIR}/librscalibrationapi/lib/linux/x86_64)
> endif()
> 
> INCLUDE_DIRECTORIES(include)
> 
> # Add the sources to the target
> add_subdirectory(src)
> 
> 
> 
> ---------------------------------------------------------------------------------------------------------------------------
> 
> the bb file is
> ----------------------------------------------------------------------------------------------------------------------------------------
> 
> LICENSE = "Unknown"
> LIC_FILES_CHKSUM = "file://License.txt;md5=65a9f55463db06e17a43396aa0c4ed4b"
> 
> SRC_URI = "http://myserver.com/temp/rs-oem-kit-server-${PV}.tar.gz"
> SRC_URI[md5sum] = "58bee3aff61140b53bc94884b872eab4"
> SRC_URI[sha1sum] = "6d4febf4bb32072078c4f67d0e7672a97e6fb5be"
> SRC_URI[sha256sum] = 
> "0aa975e73248e20e07aaf124e46fb92292f083f85a043c4b6a1f7dcb538b88a6"
> SRC_URI[sha384sum] = 
> "180d259fb3c8bdc79265e9643577e6883d6c85c31bb2df8751af26937c02279e8c85d3fb72ebf053f58894904371377b"
> SRC_URI[sha512sum] = 
> "7c808c053103d39a97de6f25519e4733a417d9e61d1dc6ce7cfdb11d16bcedde8341f9f1904eae76188c939f3e7daf35cb0ce7c5f0046474718bd6aa7119ab98"
> 
> S = "${WORKDIR}/${BPN}"
> CXXFLAGS_append = " -lstdc++"
> # NOTE: the following library dependencies are unknown, ignoring: usb
> #       (this is based on recipes that have previously been built and 
> packaged)
> inherit cmake pkgconfig
> 
> # Specify any options you want to pass to cmake using EXTRA_OECMAKE:
> EXTRA_OECMAKE = ""
> 
> ----------------------------------------------------------------------------------------------------------------------------------------
> 
> I am getting a compilation error for bitbake rs-oem-kit-server
> ----------------------------------------------------------------------------------------------------------------------------------------
> 
> | [8/34] 
> /home/aravind2/work/mevolve-yocto/mvdevice/build/tmp/work/aarch64-poky-linux/rs-oem-kit-server/1.8.2.0-r0/recipe-sysroot-native/usr/bin/aarch64-poky-linux/aarch64-poky-linux-g++   
> -I/home/aravind2/work/mevolve-yocto/mvdevice/build/tmp/work/aarch64-poky-linux/rs-oem-kit-server/1.8.2.0-r0/rs-oem-kit-server/include 
> -I/home/aravind2/work/mevolve-yocto/mvdevice/build/tmp/work/aarch64-poky-linux/rs-oem-kit-server/1.8.2.0-r0/rs-oem-kit-server/src/writer/../common 
> -std=gnu++11 -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat 
> -Wformat-security -fstack-protector-strong -lpthread -fpermissive   
> -std=gnu++11 -MD -MT 
> src/writer/CMakeFiles/rs-calibration-writer.dir/__/device/d400_dev.cpp.o 
> -MF 
> src/writer/CMakeFiles/rs-calibration-writer.dir/__/device/d400_dev.cpp.o.d 
> -o 
> src/writer/CMakeFiles/rs-calibration-writer.dir/__/device/d400_dev.cpp.o 
> -c 
> /home/aravind2/work/mevolve-yocto/mvdevice/build/tmp/work/aarch64-poky-linux/rs-oem-kit-server/1.8.2.0-r0/rs-oem-kit-server/src/device/d400_dev.cpp
> | FAILED: 
> src/writer/CMakeFiles/rs-calibration-writer.dir/__/device/d400_dev.cpp.o
> | 
> /home/aravind2/work/mevolve-yocto/mvdevice/build/tmp/work/aarch64-poky-linux/rs-oem-kit-server/1.8.2.0-r0/recipe-sysroot-native/usr/bin/aarch64-poky-linux/aarch64-poky-linux-g++   
> -I/home/aravind2/work/mevolve-yocto/mvdevice/build/tmp/work/aarch64-poky-linux/rs-oem-kit-server/1.8.2.0-r0/rs-oem-kit-server/include 
> -I/home/aravind2/work/mevolve-yocto/mvdevice/build/tmp/work/aarch64-poky-linux/rs-oem-kit-server/1.8.2.0-r0/rs-oem-kit-server/src/writer/../common 
> -std=gnu++11 -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat 
> -Wformat-security -fstack-protector-strong -lpthread -fpermissive   
> -std=gnu++11 -MD -MT 
> src/writer/CMakeFiles/rs-calibration-writer.dir/__/device/d400_dev.cpp.o 
> -MF 
> src/writer/CMakeFiles/rs-calibration-writer.dir/__/device/d400_dev.cpp.o.d 
> -o 
> src/writer/CMakeFiles/rs-calibration-writer.dir/__/device/d400_dev.cpp.o 
> -c 
> /home/aravind2/work/mevolve-yocto/mvdevice/build/tmp/work/aarch64-poky-linux/rs-oem-kit-server/1.8.2.0-r0/rs-oem-kit-server/src/device/d400_dev.cpp
> | 
> /home/aravind2/work/mevolve-yocto/mvdevice/build/tmp/work/aarch64-poky-linux/rs-oem-kit-server/1.8.2.0-r0/rs-oem-kit-server/src/device/d400_dev.cpp:15:10: 
> fatal error: iostream: No such file or directory
> |    15 | #include <iostream>
> |       |          ^~~~~~~~~~
> | compilation terminated.
> 
> ---------------------------------------------------------------------------------------------------------------------------------------
> 
> Could you please see what i am doing wrong here?
> 
> Host: Ubuntu 18.04
> Yocto: poky dunfell, with raspberrypi meta layers
> 
> regards
> Arun
> 
> 
> 
> 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Weird Compilation issue with a c++ recipe
  2021-03-24 18:43 ` [poky] Weird Compilation issue with a c++ recipe Khem Raj
@ 2021-03-24 20:06   ` arunlee
  2021-03-24 20:43     ` Arun Ravindran
       [not found]   ` <12874.1616616288995699304@lists.yoctoproject.org>
  1 sibling, 1 reply; 10+ messages in thread
From: arunlee @ 2021-03-24 20:06 UTC (permalink / raw)
  To: poky

[-- Attachment #1: Type: text/plain, Size: 486 bytes --]

This is what i see:

/build$ bitbake -e rs-oem-kit-server | grep -e "CXX="
export BUILD_CXX="g++ "
export CXX="aarch64-poky-linux-g++  -mcpu=cortex-a72+crc+crypto -fstack-protector-strong  -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/home/aravind2/work/mevolve-yocto/mvdevice/build/tmp/work/aarch64-poky-linux/rs-oem-kit-server/1.8.2.0-r0/recipe-sysroot"

And the Makefiles have the following

INCLUDES = -I./ -I../common -I../../include

[-- Attachment #2: Type: text/html, Size: 526 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Private: Re: [poky] Weird Compilation issue with a c++ recipe
       [not found]   ` <12874.1616616288995699304@lists.yoctoproject.org>
@ 2021-03-24 20:10     ` Khem Raj
  2021-03-24 20:33       ` arunlee
  0 siblings, 1 reply; 10+ messages in thread
From: Khem Raj @ 2021-03-24 20:10 UTC (permalink / raw)
  To: arunlee, Yocto-mailing-list

Adding yp mailing list back.

On Wed, Mar 24, 2021 at 1:04 PM <arunlee@gmail.com> wrote:
>
> This what i see:
>
> /build$ bitbake -e rs-oem-kit-server | grep -e "CXX="
> export BUILD_CXX="g++ "
> export CXX="aarch64-poky-linux-g++  -mcpu=cortex-a72+crc+crypto -fstack-protector-strong  -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/home/aravind2/work/mevolve-yocto/mvdevice/build/tmp/work/aarch64-poky-linux/rs-oem-kit-server/1.8.2.0-r0/recipe-sysroot"

but the logs you posted doesn't show this as CXX, so somewhere its
being overwritten. Are there more CMakeFiles that are in play ?

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Private: Re: [poky] Weird Compilation issue with a c++ recipe
  2021-03-24 20:10     ` Private: Re: [poky] " Khem Raj
@ 2021-03-24 20:33       ` arunlee
  0 siblings, 0 replies; 10+ messages in thread
From: arunlee @ 2021-03-24 20:33 UTC (permalink / raw)
  To: Khem Raj; +Cc: Yocto-mailing-list

>
> Adding yp mailing list back.
>
> On Wed, Mar 24, 2021 at 1:04 PM <arunlee@gmail.com> wrote:
> >
> > This what i see:
> >
> > /build$ bitbake -e rs-oem-kit-server | grep -e "CXX="
> > export BUILD_CXX="g++ "
> > export CXX="aarch64-poky-linux-g++  -mcpu=cortex-a72+crc+crypto -fstack-protector-strong  -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/home/aravind2/work/mevolve-yocto/mvdevice/build/tmp/work/aarch64-poky-linux/rs-oem-kit-server/1.8.2.0-r0/recipe-sysroot"
>
> but the logs you posted doesn't show this as CXX, so somewhere its
> being overwritten. Are there more CMakeFiles that are in play ?

I have posted the top level CMakeList.txt in the first post, which
added a sub directory

INCLUDE_DIRECTORIES(include)

# Add the sources to the target
add_subdirectory(src)


that has one CMakeList.txt.


# Set minimum required CMake version
cmake_minimum_required(VERSION 3.5.1)

# Name the project
project (sources)

add_subdirectory(calsimple)
add_subdirectory(calibinfo)
add_subdirectory(writer)
add_subdirectory(converter)
add_subdirectory(server)

regards
Arun

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Weird Compilation issue with a c++ recipe
  2021-03-24 20:06   ` arunlee
@ 2021-03-24 20:43     ` Arun Ravindran
  2021-03-24 21:02       ` [poky] " Khem Raj
  2021-03-24 21:08       ` Arun Ravindran
  0 siblings, 2 replies; 10+ messages in thread
From: Arun Ravindran @ 2021-03-24 20:43 UTC (permalink / raw)
  To: poky

[-- Attachment #1: Type: text/plain, Size: 702 bytes --]

/home/aravind2/work/mevolve-yocto/mvdevice/build/tmp/work/aarch64-poky-linux/rs-oem-kit-server/1.8.2.0-r0/recipe-sysroot-native/usr/bin/aarch64-poky-linux/aarch64-poky-linux-g++
Include dirs:

-I/home/aravind2/work/mevolve-yocto/mvdevice/build/tmp/work/aarch64-poky-linux/rs-oem-kit-server/1.8.2.0-r0/rs-oem-kit-server/include
-I/home/aravind2/work/mevolve-yocto/mvdevice/build/tmp/work/aarch64-poky-linux/rs-oem-kit-server/1.8.2.0-r0/rs-oem-kit-server/src/writer/../common

where as iostream is in

/home/aravind2/work/mevolve-yocto/mvdevice/build/tmp/work/aarch64-poky-linux/rs-oem-kit-server/1.8.2.0-r0/recipe-sysroot/usr/include/c++/9.3.0/

But somehow that include path is not taken...

[-- Attachment #2: Type: text/html, Size: 760 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [poky] Weird Compilation issue with a c++ recipe
  2021-03-24 20:43     ` Arun Ravindran
@ 2021-03-24 21:02       ` Khem Raj
  2021-03-24 21:08       ` Arun Ravindran
  1 sibling, 0 replies; 10+ messages in thread
From: Khem Raj @ 2021-03-24 21:02 UTC (permalink / raw)
  To: Arun Ravindran; +Cc: poky

it needs to use --sysroot option, but question is why CMake is
ignoring it for your package. we have many CMake based recipes and it
all works fine. So inspect the cmakefiles and other scripts your
package is using to build itself.

On Wed, Mar 24, 2021 at 1:43 PM Arun Ravindran <arunlee@gmail.com> wrote:
>
> /home/aravind2/work/mevolve-yocto/mvdevice/build/tmp/work/aarch64-poky-linux/rs-oem-kit-server/1.8.2.0-r0/recipe-sysroot-native/usr/bin/aarch64-poky-linux/aarch64-poky-linux-g++
> Include dirs:
>
>  -I/home/aravind2/work/mevolve-yocto/mvdevice/build/tmp/work/aarch64-poky-linux/rs-oem-kit-server/1.8.2.0-r0/rs-oem-kit-server/include
> -I/home/aravind2/work/mevolve-yocto/mvdevice/build/tmp/work/aarch64-poky-linux/rs-oem-kit-server/1.8.2.0-r0/rs-oem-kit-server/src/writer/../common
>
> where as iostream is in
>
> /home/aravind2/work/mevolve-yocto/mvdevice/build/tmp/work/aarch64-poky-linux/rs-oem-kit-server/1.8.2.0-r0/recipe-sysroot/usr/include/c++/9.3.0/
>
> But somehow that include path is not taken...
>
> 
>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Weird Compilation issue with a c++ recipe
  2021-03-24 20:43     ` Arun Ravindran
  2021-03-24 21:02       ` [poky] " Khem Raj
@ 2021-03-24 21:08       ` Arun Ravindran
  2021-03-25  5:48         ` Arun Ravindran
  1 sibling, 1 reply; 10+ messages in thread
From: Arun Ravindran @ 2021-03-24 21:08 UTC (permalink / raw)
  To: poky

[-- Attachment #1: Type: text/plain, Size: 1637 bytes --]

I think i found the issue for the include problem.

In one of the CMakeList.txt, i have the following

set( CMAKE_CXX_FLAGS " -std=gnu++11 -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -fstack-protector-strong -lpthread -fpermissive" )

i changed it to

set( CMAKE_CXX_FLAGS " ${CMAKE_CXX_FLAGS} -std=gnu++11 -fPIE -fPIC -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -fstack-protector-strong -lpthread -fpermissive" )

and the compilation issue seems to have gone away.

But i do have the following

if(MSVC)
if(BUILD_WITH_STATIC_CRT)
set(CMAKE_CXX_FLAGS_RELEASE "/MT")
else()
set(CMAKE_CXX_FLAGS_RELEASE "/MD")
endif()

add_definitions(-D_WIN32)
elseif(ANDROID)
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pipe -fPIC -pie -llog -pedantic -std=gnu++11 -O2 -W -Wl,--no-undefined -fopenmp -ldl")
else()
EXEC_PROGRAM(uname ARGS -p OUTPUT_VARIABLE CMAKE_SYSTEM_PROCCESSOR)
message(STATUS "CMAKE_SYSTEM_PROCCESSOR=${CMAKE_SYSTEM_PROCCESSOR}")
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pipe -pedantic -std=gnu++11 -W -Wl,--no-undefined -fopenmp")
endif()

# calibration api include and library paths
set (DCAPI_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/librscalibrationapi/Include)

if(MSVC)
set (DCAPI_LIBS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/librscalibrationapi/lib/windows/x64)
elseif(${CMAKE_SYSTEM_PROCCESSOR} MATCHES "aarch64|AARCH64")
set (DCAPI_LIBS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/librscalibrationapi/lib/linux/aarch64)
else()
set (DCAPI_LIBS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/librscalibrationapi/lib/linux/x86_64)
endif()

where CMAKE_SYSTEM_PROCCESSOR never matches to aarch64.

[-- Attachment #2: Type: text/html, Size: 2093 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Weird Compilation issue with a c++ recipe
  2021-03-24 21:08       ` Arun Ravindran
@ 2021-03-25  5:48         ` Arun Ravindran
  2021-03-25  6:33           ` [poky] " Khem Raj
  0 siblings, 1 reply; 10+ messages in thread
From: Arun Ravindran @ 2021-03-25  5:48 UTC (permalink / raw)
  To: poky

[-- Attachment #1: Type: text/plain, Size: 2582 bytes --]

I have a new issue now. The package i am trying to build has this dependency on a pre compiled .so file which is part of the source tree.
The dependency is mentioned in the CMakeList.txt as

if(MSVC)
set (DCAPI_LIBS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/librscalibrationapi/lib/windows/x64)
elseif(${CMAKE_SYSTEM_PROCCESSOR} MATCHES "aarch64|AARCH64")
set (DCAPI_LIBS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/librscalibrationapi/lib/linux/aarch64)
else()
set (DCAPI_LIBS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/librscalibrationapi/lib/linux/x86_64)
endif()

But the build is failing with a QA issue.

ERROR: rs-oem-kit-server-1.8.2.0-r0 do_package_qa: QA Issue: package rs-oem-kit-server contains bad RPATH /home/aravind2/work/mevolve-yocto/mvdevice/build/tmp/work/aarch64-poky-linux/rs-oem-kit-server/1.8.2.0-r0/rs-oem-kit-server/librscalibrationapi/lib/linux/aarch64 in file /home/aravind2/work/mevolve-yocto/mvdevice/build/tmp/work/aarch64-poky-linux/rs-oem-kit-server/1.8.2.0-r0/packages-split/rs-oem-kit-server/usr/bin/rs-calibration-simple
package rs-oem-kit-server contains bad RPATH /home/aravind2/work/mevolve-yocto/mvdevice/build/tmp/work/aarch64-poky-linux/rs-oem-kit-server/1.8.2.0-r0/rs-oem-kit-server/librscalibrationapi/lib/linux/aarch64 in file /home/aravind2/work/mevolve-yocto/mvdevice/build/tmp/work/aarch64-poky-linux/rs-oem-kit-server/1.8.2.0-r0/packages-split/rs-oem-kit-server/usr/bin/rs-calibration-converter
package rs-oem-kit-server contains bad RPATH /home/aravind2/work/mevolve-yocto/mvdevice/build/tmp/work/aarch64-poky-linux/rs-oem-kit-server/1.8.2.0-r0/rs-oem-kit-server/librscalibrationapi/lib/linux/aarch64 in file /home/aravind2/work/mevolve-yocto/mvdevice/build/tmp/work/aarch64-poky-linux/rs-oem-kit-server/1.8.2.0-r0/packages-split/rs-oem-kit-server/usr/bin/rs-calibration-info [rpaths]
ERROR: rs-oem-kit-server-1.8.2.0-r0 do_package_qa: QA Issue: /usr/bin/rs-calibration-simple contained in package rs-oem-kit-server requires libDSDynamicCalibrationAPI.so()(64bit), but no providers found in RDEPENDS_rs-oem-kit-server? [file-rdeps]
ERROR: rs-oem-kit-server-1.8.2.0-r0 do_package_qa: QA run found fatal errors. Please consider fixing them.
ERROR: Logfile of failure stored in: /home/aravind2/work/mevolve-yocto/mvdevice/build/tmp/work/aarch64-poky-linux/rs-oem-kit-server/1.8.2.0-r0/temp/log.do_package_qa.13723
ERROR: Task (/home/aravind2/work/mevolve-yocto/poky/../meta-mevolveapps/recipes-production/rs-oem-kit-server/rs-oem-kit-server_1.8.2.0.bb:do_package_qa) failed with exit code '1'

Could you please suggest a fix for this?

Thanks..

[-- Attachment #2: Type: text/html, Size: 2732 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [poky] Weird Compilation issue with a c++ recipe
  2021-03-25  5:48         ` Arun Ravindran
@ 2021-03-25  6:33           ` Khem Raj
  2021-03-25 19:39             ` Arun Ravindran
  0 siblings, 1 reply; 10+ messages in thread
From: Khem Raj @ 2021-03-25  6:33 UTC (permalink / raw)
  To: Arun Ravindran; +Cc: poky

On Wed, Mar 24, 2021 at 10:48 PM Arun Ravindran <arunlee@gmail.com> wrote:
>
> I have a new issue now. The package i am trying to build has this dependency on a pre compiled .so file which is part of the source tree.
> The dependency is mentioned in the CMakeList.txt as
>
> if(MSVC)
>     set (DCAPI_LIBS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/librscalibrationapi/lib/windows/x64)
> elseif(${CMAKE_SYSTEM_PROCCESSOR} MATCHES "aarch64|AARCH64")
>     set (DCAPI_LIBS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/librscalibrationapi/lib/linux/aarch64)
> else()
>     set (DCAPI_LIBS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/librscalibrationapi/lib/linux/x86_64)
> endif()
>
> But the build is failing with a QA issue.
>
> ERROR: rs-oem-kit-server-1.8.2.0-r0 do_package_qa: QA Issue: package rs-oem-kit-server contains bad RPATH /home/aravind2/work/mevolve-yocto/mvdevice/build/tmp/work/aarch64-poky-linux/rs-oem-kit-server/1.8.2.0-r0/rs-oem-kit-server/librscalibrationapi/lib/linux/aarch64 in file /home/aravind2/work/mevolve-yocto/mvdevice/build/tmp/work/aarch64-poky-linux/rs-oem-kit-server/1.8.2.0-r0/packages-split/rs-oem-kit-server/usr/bin/rs-calibration-simple
> package rs-oem-kit-server contains bad RPATH /home/aravind2/work/mevolve-yocto/mvdevice/build/tmp/work/aarch64-poky-linux/rs-oem-kit-server/1.8.2.0-r0/rs-oem-kit-server/librscalibrationapi/lib/linux/aarch64 in file /home/aravind2/work/mevolve-yocto/mvdevice/build/tmp/work/aarch64-poky-linux/rs-oem-kit-server/1.8.2.0-r0/packages-split/rs-oem-kit-server/usr/bin/rs-calibration-converter
> package rs-oem-kit-server contains bad RPATH /home/aravind2/work/mevolve-yocto/mvdevice/build/tmp/work/aarch64-poky-linux/rs-oem-kit-server/1.8.2.0-r0/rs-oem-kit-server/librscalibrationapi/lib/linux/aarch64 in file /home/aravind2/work/mevolve-yocto/mvdevice/build/tmp/work/aarch64-poky-linux/rs-oem-kit-server/1.8.2.0-r0/packages-split/rs-oem-kit-server/usr/bin/rs-calibration-info [rpaths]
> ERROR: rs-oem-kit-server-1.8.2.0-r0 do_package_qa: QA Issue: /usr/bin/rs-calibration-simple contained in package rs-oem-kit-server requires libDSDynamicCalibrationAPI.so()(64bit), but no providers found in RDEPENDS_rs-oem-kit-server? [file-rdeps]
> ERROR: rs-oem-kit-server-1.8.2.0-r0 do_package_qa: QA run found fatal errors. Please consider fixing them.
> ERROR: Logfile of failure stored in: /home/aravind2/work/mevolve-yocto/mvdevice/build/tmp/work/aarch64-poky-linux/rs-oem-kit-server/1.8.2.0-r0/temp/log.do_package_qa.13723
> ERROR: Task (/home/aravind2/work/mevolve-yocto/poky/../meta-mevolveapps/recipes-production/rs-oem-kit-server/rs-oem-kit-server_1.8.2.0.bb:do_package_qa) failed with exit cod
>
> Could you please suggest a fix for this?
>

Firstly package the right version into staging area in do_install

MYARCH_aarch64 = "aarch64"
MYARCH_x86-64 = "x86_64"

do_insall_append() {
  install -Dm0755
${S}//librscalibrationapi/lib/linux/${MYARCH}/libDSDynamicCalibrationAPI.so
${D}{libdir}/libDSDynamicCalibrationAPI.so
}

secondly search your CMakeFiles and they must be setting -rpath via
linker options, you can disable doing that.

if you don't want to do that then you might have to edit it out in
recipe with patchelf

DEPENDS += "patchelf-native"

do_install_append() {
   patchelf --remove-rpath ${D}${bindir}/rs-calibration-info
   patchelf --remove-rpath ${D}${bindir}/rs-calibration-simple
   patchelf --remove-rpath ${D}${bindir}/rs-calibration-converter
}



> Thanks..
> 
>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Weird Compilation issue with a c++ recipe
  2021-03-25  6:33           ` [poky] " Khem Raj
@ 2021-03-25 19:39             ` Arun Ravindran
  0 siblings, 0 replies; 10+ messages in thread
From: Arun Ravindran @ 2021-03-25 19:39 UTC (permalink / raw)
  To: poky

[-- Attachment #1: Type: text/plain, Size: 285 bytes --]

Along with the changes you suggested. i also had to do the following

INSANE_SKIP_${PN} = "ldflags"
INHIBIT_PACKAGE_STRIP = "1"
INHIBIT_SYSROOT_STRIP = "1"
SOLIBS = ".so"
FILES_SOLIBSDEV = ""

But the module now compiles and is running as expected.

Thanks for all the help

[-- Attachment #2: Type: text/html, Size: 325 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2021-03-25 19:39 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <Groupsio.1.pwb1.1616605380917082275.iIyZ@lists.yoctoproject.org>
2021-03-24 18:43 ` [poky] Weird Compilation issue with a c++ recipe Khem Raj
2021-03-24 20:06   ` arunlee
2021-03-24 20:43     ` Arun Ravindran
2021-03-24 21:02       ` [poky] " Khem Raj
2021-03-24 21:08       ` Arun Ravindran
2021-03-25  5:48         ` Arun Ravindran
2021-03-25  6:33           ` [poky] " Khem Raj
2021-03-25 19:39             ` Arun Ravindran
     [not found]   ` <12874.1616616288995699304@lists.yoctoproject.org>
2021-03-24 20:10     ` Private: Re: [poky] " Khem Raj
2021-03-24 20:33       ` arunlee

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.