diff options
| -rw-r--r-- | meta-oe/recipes-support/fltk/fltk-native.bb | 5 | ||||
| -rw-r--r-- | meta-oe/recipes-support/fltk/fltk/fltk-native-link-libdl.patch | 44 |
2 files changed, 46 insertions, 3 deletions
diff --git a/meta-oe/recipes-support/fltk/fltk-native.bb b/meta-oe/recipes-support/fltk/fltk-native.bb index 8d3992a6ec..3e8e2cdf77 100644 --- a/meta-oe/recipes-support/fltk/fltk-native.bb +++ b/meta-oe/recipes-support/fltk/fltk-native.bb | |||
| @@ -2,6 +2,8 @@ require ${BPN}.inc | |||
| 2 | 2 | ||
| 3 | DEPENDS = "zlib-native jpeg-native libpng-native libxext-native libxft-native" | 3 | DEPENDS = "zlib-native jpeg-native libpng-native libxext-native libxft-native" |
| 4 | 4 | ||
| 5 | SRC_URI += "file://fltk-native-link-libdl.patch" | ||
| 6 | |||
| 5 | inherit native | 7 | inherit native |
| 6 | 8 | ||
| 7 | EXTRA_OECMAKE += " \ | 9 | EXTRA_OECMAKE += " \ |
| @@ -15,9 +17,6 @@ EXTRA_OECMAKE += " \ | |||
| 15 | -DOPTION_USE_XCURSOR=OFF \ | 17 | -DOPTION_USE_XCURSOR=OFF \ |
| 16 | " | 18 | " |
| 17 | 19 | ||
| 18 | # lib/libfltk.a(Fl_Native_File_Chooser.cxx.o): undefined reference to symbol 'dlsym@@GLIBC_2.2.5' | ||
| 19 | LDFLAGS += "-ldl" | ||
| 20 | |||
| 21 | do_install:append() { | 20 | do_install:append() { |
| 22 | # make sure native fltk-config is not used accidentaly | 21 | # make sure native fltk-config is not used accidentaly |
| 23 | rm -f ${D}${bindir}/fltk-config | 22 | rm -f ${D}${bindir}/fltk-config |
diff --git a/meta-oe/recipes-support/fltk/fltk/fltk-native-link-libdl.patch b/meta-oe/recipes-support/fltk/fltk/fltk-native-link-libdl.patch new file mode 100644 index 0000000000..e140ce2166 --- /dev/null +++ b/meta-oe/recipes-support/fltk/fltk/fltk-native-link-libdl.patch | |||
| @@ -0,0 +1,44 @@ | |||
| 1 | Upstream-Status: Inappropriate [cross build specific] | ||
| 2 | |||
| 3 | It fails to build fltk-native on Ubuntu 20.04 with glibc 2.31: | ||
| 4 | |||
| 5 | | /path_to/tmp/hosttools/ld: lib/libfltk.a(Fl_Native_File_Chooser.cxx.o): in function `fl_dlopen(char const*, char const*)': | ||
| 6 | | Fl_Native_File_Chooser.cxx:(.text+0x61a): undefined reference to `dlopen' | ||
| 7 | | /path_to/tmp/hosttools/ld: lib/libfltk.a(Fl_Native_File_Chooser.cxx.o): in function `Fl_GTK_File_Chooser::probe_for_GTK_libs()': | ||
| 8 | | Fl_Native_File_Chooser.cxx:(.text+0xf92): undefined reference to `dlerror' | ||
| 9 | |||
| 10 | The original fix in fltk-native recipe does not work any more because '-ldl' | ||
| 11 | appears before lib/libfltk.a and causes dlopen() unresolved. The reason why it | ||
| 12 | doesn't fail on other hosts is that the functions dlopen(), dlerror() etc. have | ||
| 13 | been moved to libc.so since glibc 2.34 via the commits in glibc: | ||
| 14 | |||
| 15 | 0c1c3a771e dlfcn: Move dlopen into libc | ||
| 16 | add8d7ea01 dlfcn: Move dlvsym into libc | ||
| 17 | 6dfc0207eb dlfcn: Move dlinfo into libc | ||
| 18 | 492560a32e dlfcn: Move dladdr1 into libc | ||
| 19 | 6a1ed32789 dlfcn: Move dlmopen into libc | ||
| 20 | 77f876c0e3 dlfcn: Move dlsym into libc | ||
| 21 | 602252b553 dlfcn: Move dladdr into libc | ||
| 22 | d8cce17d2a dlfcn: Move dlclose into libc | ||
| 23 | |||
| 24 | Append 'dl' to fltk link items explictly to fix the error. | ||
| 25 | |||
| 26 | Signed-off-by: Kai Kang <kai.kang@windriver.com> | ||
| 27 | |||
| 28 | --- | ||
| 29 | src/CMakeLists.txt | 2 +- | ||
| 30 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 31 | |||
| 32 | diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt | ||
| 33 | index d153b1c..0fe5c11 100644 | ||
| 34 | --- a/src/CMakeLists.txt | ||
| 35 | +++ b/src/CMakeLists.txt | ||
| 36 | @@ -306,7 +306,7 @@ endif (USE_XFT) | ||
| 37 | ####################################################################### | ||
| 38 | |||
| 39 | FL_ADD_LIBRARY (fltk STATIC "${STATIC_FILES}") | ||
| 40 | -target_link_libraries (fltk ${OPTIONAL_LIBS}) | ||
| 41 | +target_link_libraries (fltk ${OPTIONAL_LIBS} dl) | ||
| 42 | |||
| 43 | ####################################################################### | ||
| 44 | |||
