mirror of
git://git.openembedded.org/meta-openembedded
synced 2026-01-01 13:58:06 +00:00
fltk-native: fix libdl link issue
It fails to build fltk-native on Ubuntu 20.04 with glibc 2.31: | /path_to/tmp/hosttools/ld: lib/libfltk.a(Fl_Native_File_Chooser.cxx.o): in function `fl_dlopen(char const*, char const*)': | Fl_Native_File_Chooser.cxx:(.text+0x61a): undefined reference to `dlopen' | /path_to/tmp/hosttools/ld: lib/libfltk.a(Fl_Native_File_Chooser.cxx.o): in function `Fl_GTK_File_Chooser::probe_for_GTK_libs()': | Fl_Native_File_Chooser.cxx:(.text+0xf92): undefined reference to `dlerror' The original fix in fltk-native recipe does not work any more because '-ldl' appears before lib/libfltk.a and causes dlopen() unresolved. The reason why it doesn't fail on other hosts is that the functions dlopen(), dlerror() etc. have been moved to libc.so since glibc 2.34 via the commits in glibc: 0c1c3a771e dlfcn: Move dlopen into libc add8d7ea01 dlfcn: Move dlvsym into libc 6dfc0207eb dlfcn: Move dlinfo into libc 492560a32e dlfcn: Move dladdr1 into libc 6a1ed32789 dlfcn: Move dlmopen into libc 77f876c0e3 dlfcn: Move dlsym into libc 602252b553 dlfcn: Move dladdr into libc d8cce17d2a dlfcn: Move dlclose into libc Append 'dl' to fltk link items explictly to fix the error. Signed-off-by: Kai Kang <kai.kang@windriver.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
parent
b4bdb5849e
commit
e3606c223e
|
|
@ -2,6 +2,8 @@ require ${BPN}.inc
|
|||
|
||||
DEPENDS = "zlib-native jpeg-native libpng-native libxext-native libxft-native"
|
||||
|
||||
SRC_URI += "file://fltk-native-link-libdl.patch"
|
||||
|
||||
inherit native
|
||||
|
||||
EXTRA_OECMAKE += " \
|
||||
|
|
@ -15,9 +17,6 @@ EXTRA_OECMAKE += " \
|
|||
-DOPTION_USE_XCURSOR=OFF \
|
||||
"
|
||||
|
||||
# lib/libfltk.a(Fl_Native_File_Chooser.cxx.o): undefined reference to symbol 'dlsym@@GLIBC_2.2.5'
|
||||
LDFLAGS += "-ldl"
|
||||
|
||||
do_install:append() {
|
||||
# make sure native fltk-config is not used accidentaly
|
||||
rm -f ${D}${bindir}/fltk-config
|
||||
|
|
|
|||
|
|
@ -0,0 +1,44 @@
|
|||
Upstream-Status: Inappropriate [cross build specific]
|
||||
|
||||
It fails to build fltk-native on Ubuntu 20.04 with glibc 2.31:
|
||||
|
||||
| /path_to/tmp/hosttools/ld: lib/libfltk.a(Fl_Native_File_Chooser.cxx.o): in function `fl_dlopen(char const*, char const*)':
|
||||
| Fl_Native_File_Chooser.cxx:(.text+0x61a): undefined reference to `dlopen'
|
||||
| /path_to/tmp/hosttools/ld: lib/libfltk.a(Fl_Native_File_Chooser.cxx.o): in function `Fl_GTK_File_Chooser::probe_for_GTK_libs()':
|
||||
| Fl_Native_File_Chooser.cxx:(.text+0xf92): undefined reference to `dlerror'
|
||||
|
||||
The original fix in fltk-native recipe does not work any more because '-ldl'
|
||||
appears before lib/libfltk.a and causes dlopen() unresolved. The reason why it
|
||||
doesn't fail on other hosts is that the functions dlopen(), dlerror() etc. have
|
||||
been moved to libc.so since glibc 2.34 via the commits in glibc:
|
||||
|
||||
0c1c3a771e dlfcn: Move dlopen into libc
|
||||
add8d7ea01 dlfcn: Move dlvsym into libc
|
||||
6dfc0207eb dlfcn: Move dlinfo into libc
|
||||
492560a32e dlfcn: Move dladdr1 into libc
|
||||
6a1ed32789 dlfcn: Move dlmopen into libc
|
||||
77f876c0e3 dlfcn: Move dlsym into libc
|
||||
602252b553 dlfcn: Move dladdr into libc
|
||||
d8cce17d2a dlfcn: Move dlclose into libc
|
||||
|
||||
Append 'dl' to fltk link items explictly to fix the error.
|
||||
|
||||
Signed-off-by: Kai Kang <kai.kang@windriver.com>
|
||||
|
||||
---
|
||||
src/CMakeLists.txt | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
|
||||
index d153b1c..0fe5c11 100644
|
||||
--- a/src/CMakeLists.txt
|
||||
+++ b/src/CMakeLists.txt
|
||||
@@ -306,7 +306,7 @@ endif (USE_XFT)
|
||||
#######################################################################
|
||||
|
||||
FL_ADD_LIBRARY (fltk STATIC "${STATIC_FILES}")
|
||||
-target_link_libraries (fltk ${OPTIONAL_LIBS})
|
||||
+target_link_libraries (fltk ${OPTIONAL_LIBS} dl)
|
||||
|
||||
#######################################################################
|
||||
|
||||
Loading…
Reference in New Issue
Block a user