Re: [Piglit] [PATCH v5] CMake: define GBM_BO_MAP only when symbol is found
Pushed. Quoting Daniel Díaz Rodríguez (2017-06-07 07:14:22) > Ping. > > -- > ddiaz > > > On 30 May 2017 at 12:52, Dylan Bakerwrote: > > Quoting Daniel Díaz (2017-05-16 17:06:40) > >> gbm_bo_map() and _unmap() have been added recently to Mesa, > >> and this update may not have reached all implementations of > >> GBM, such as the one provided by Mali r6, where said > >> definitions can be found in the header file but not in the > >> library itself. This leads to errors like the following when > >> linking: > >> ../../../../lib/libpiglitutil_gl.so.0: undefined reference to > >> `gbm_bo_unmap' > >> ../../../../lib/libpiglitutil_gl.so.0: undefined reference to > >> `gbm_bo_map' > >> collect2: error: ld returned 1 exit status > >> make[2]: *** [bin/point-sprite] Error 1 > >> > >> Instead of relying on the header file, actually try to link > >> using that symbol to determine if PIGLIT_HAS_GBM_BO_MAP > >> should be defined. > >> > >> Signed-off-by: Daniel Díaz > >> Reviewed-by: Jan Vesely > >> --- > >> v2: Use CHECK_SYMBOL_EXISTS as suggested by Jan Vesely. > >> v3: Back to CHECK_FUNCTION_EXISTS. > >> v4: Use ${GBM_LIBRARIES} instead of 'gbm'. > >> v5: Add reviewed-by; hopefully final version. > >> > >> CMakeLists.txt | 5 +++-- > >> 1 file changed, 3 insertions(+), 2 deletions(-) > >> > >> diff --git a/CMakeLists.txt b/CMakeLists.txt > >> index a4ff99e..cc26fa8 100644 > >> --- a/CMakeLists.txt > >> +++ b/CMakeLists.txt > >> @@ -141,8 +141,9 @@ IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux") > >> if(GBM_FOUND) > >> set(PIGLIT_HAS_GBM True) > >> add_definitions(-DPIGLIT_HAS_GBM) > >> - if (GBM_VERSION VERSION_EQUAL "12.1" OR GBM_VERSION > >> VERSION_GREATER "12.1") > >> - set(PIGLIT_HAS_GBM_BO_MAP True) > >> + set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} > >> ${GBM_LIBRARIES}) > >> + CHECK_FUNCTION_EXISTS(gbm_bo_map PIGLIT_HAS_GBM_BO_MAP) > >> + if (PIGLIT_HAS_GBM_BO_MAP) > >> add_definitions(-DPIGLIT_HAS_GBM_BO_MAP) > >> endif() > >> endif(GBM_FOUND) > >> -- > >> 1.9.1 > >> > > > > Sorry, I've been on vacation. I checked that this does still find > > GBM_BO_MAP on > > my system, and that it still compiles, > > > > Reviewed-by: Dylan Baker > ___ > Piglit mailing list > Piglit@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/piglit signature.asc Description: signature ___ Piglit mailing list Piglit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/piglit
Re: [Piglit] [PATCH v5] CMake: define GBM_BO_MAP only when symbol is found
Ping. -- ddiaz On 16 May 2017 at 19:06, Daniel Díazwrote: > gbm_bo_map() and _unmap() have been added recently to Mesa, > and this update may not have reached all implementations of > GBM, such as the one provided by Mali r6, where said > definitions can be found in the header file but not in the > library itself. This leads to errors like the following when > linking: > ../../../../lib/libpiglitutil_gl.so.0: undefined reference to `gbm_bo_unmap' > ../../../../lib/libpiglitutil_gl.so.0: undefined reference to `gbm_bo_map' > collect2: error: ld returned 1 exit status > make[2]: *** [bin/point-sprite] Error 1 > > Instead of relying on the header file, actually try to link > using that symbol to determine if PIGLIT_HAS_GBM_BO_MAP > should be defined. > > Signed-off-by: Daniel Díaz > Reviewed-by: Jan Vesely > --- > v2: Use CHECK_SYMBOL_EXISTS as suggested by Jan Vesely. > v3: Back to CHECK_FUNCTION_EXISTS. > v4: Use ${GBM_LIBRARIES} instead of 'gbm'. > v5: Add reviewed-by; hopefully final version. > > CMakeLists.txt | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/CMakeLists.txt b/CMakeLists.txt > index a4ff99e..cc26fa8 100644 > --- a/CMakeLists.txt > +++ b/CMakeLists.txt > @@ -141,8 +141,9 @@ IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux") > if(GBM_FOUND) > set(PIGLIT_HAS_GBM True) > add_definitions(-DPIGLIT_HAS_GBM) > - if (GBM_VERSION VERSION_EQUAL "12.1" OR GBM_VERSION > VERSION_GREATER "12.1") > - set(PIGLIT_HAS_GBM_BO_MAP True) > + set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} > ${GBM_LIBRARIES}) > + CHECK_FUNCTION_EXISTS(gbm_bo_map PIGLIT_HAS_GBM_BO_MAP) > + if (PIGLIT_HAS_GBM_BO_MAP) > add_definitions(-DPIGLIT_HAS_GBM_BO_MAP) > endif() > endif(GBM_FOUND) > -- > 1.9.1 > ___ Piglit mailing list Piglit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/piglit
[Piglit] [PATCH v5] CMake: define GBM_BO_MAP only when symbol is found
gbm_bo_map() and _unmap() have been added recently to Mesa, and this update may not have reached all implementations of GBM, such as the one provided by Mali r6, where said definitions can be found in the header file but not in the library itself. This leads to errors like the following when linking: ../../../../lib/libpiglitutil_gl.so.0: undefined reference to `gbm_bo_unmap' ../../../../lib/libpiglitutil_gl.so.0: undefined reference to `gbm_bo_map' collect2: error: ld returned 1 exit status make[2]: *** [bin/point-sprite] Error 1 Instead of relying on the header file, actually try to link using that symbol to determine if PIGLIT_HAS_GBM_BO_MAP should be defined. Signed-off-by: Daniel DíazReviewed-by: Jan Vesely --- v2: Use CHECK_SYMBOL_EXISTS as suggested by Jan Vesely. v3: Back to CHECK_FUNCTION_EXISTS. v4: Use ${GBM_LIBRARIES} instead of 'gbm'. v5: Add reviewed-by; hopefully final version. CMakeLists.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a4ff99e..cc26fa8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -141,8 +141,9 @@ IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux") if(GBM_FOUND) set(PIGLIT_HAS_GBM True) add_definitions(-DPIGLIT_HAS_GBM) - if (GBM_VERSION VERSION_EQUAL "12.1" OR GBM_VERSION VERSION_GREATER "12.1") - set(PIGLIT_HAS_GBM_BO_MAP True) + set(CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${GBM_LIBRARIES}) + CHECK_FUNCTION_EXISTS(gbm_bo_map PIGLIT_HAS_GBM_BO_MAP) + if (PIGLIT_HAS_GBM_BO_MAP) add_definitions(-DPIGLIT_HAS_GBM_BO_MAP) endif() endif(GBM_FOUND) -- 1.9.1 ___ Piglit mailing list Piglit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/piglit