Skip to contentSkip to conversation

klibc: Pass -fno-builtin-bcmp with musl/clang combo

PATCH New Khem Raj 1 participant 3 messages Aug 7, 2019

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/3 klibc: Pass -fno-builtin-bcmp with musl/clang combo

clang would emit bcmp built-in for musl bases system but here we do not link in musl C library, so its best to disable it

Fixes
git/usr/klibc/memmem.c:38: undefined reference to `bcmp'

Cc Andrea Adami <[email protected]>
---
 meta-initramfs/recipes-devtools/klibc/klibc.inc | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
meta-initramfs/recipes-devtools/klibc/klibc.inc +4 -1
index 5805448671..7faf0cabbf 100644
@@ -33,6 +33,9 @@ ARMPATCHES_arm = "file://klibc-config-eabi.patch \
 
 S = "${WORKDIR}/git"
 
+OPTFLAGS = "${TUNE_CCARGS} -Os"
+OPTFLAGS_append_libc-musl_toolchain-clang = " -fno-builtin-bcmp"
+
 PARALLEL_MAKE = ""
 EXTRA_OEMAKE = "'KLIBCARCH=${KLIBC_ARCH}' \
                 'CROSS_COMPILE=${TARGET_PREFIX}' \
@@ -43,7 +46,7 @@ EXTRA_OEMAKE = "'KLIBCARCH=${KLIBC_ARCH}' \
                 'INSTALLDIR=${libdir}/klibc' \
                 'SHLIBDIR=${libdir}' \
                 '${KLIBCTHUMB}' \
-                'KLIBCOPTFLAGS=${TUNE_CCARGS} -Os' \
+                'KLIBCOPTFLAGS=${OPTFLAGS}' \
                  V=1 \
                 "
 
Signature · 1 line
2.22.0
author
#1 lore raw

PATCH 2/3 graphviz: Fix build error that surfaced with latest pango

---
 ...-Include-freetype-headers-explicitly.patch | 38 +++++++++++++++++++
 .../graphviz/graphviz_2.40.1.bb               |  1 +
 2 files changed, 39 insertions(+)
 create mode 100644 meta-oe/recipes-graphics/graphviz/graphviz/0001-plugin-pango-Include-freetype-headers-explicitly.patch
meta-oe/recipes-graphics/graphviz/graphviz/0001-plugin-pango-Include-freetype-headers-explicitly.patch new file +38 -0
new file mode 100644
index 0000000000..a9b0352435
@@ -0,0 +1,38 @@
+From 926d9285f3367ae1bdb9ce1dce95f7de73b3a980 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Tue, 6 Aug 2019 12:42:19 -0700
+Subject: [PATCH] plugin/pango: Include freetype headers explicitly
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Do not depend on pango automatically adding these headers
+Fixes
+| gvtextlayout_pango.c:140:10: error: unknown type name ‘FT_Face’
+|          FT_Face face;
+|          ^~~~~~~
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <[email protected]>
+---
+ plugin/pango/gvtextlayout_pango.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/plugin/pango/gvtextlayout_pango.c b/plugin/pango/gvtextlayout_pango.c
+index d620b29..b0da11c 100644
+--- a/plugin/pango/gvtextlayout_pango.c
++++ b/plugin/pango/gvtextlayout_pango.c
+@@ -15,6 +15,10 @@
+ 
+ #include <stdlib.h>
+ #include <string.h>
++
++#include <ft2build.h>
++#include FT_FREETYPE_H
++
+ #include "gvplugin_render.h"
+ #include "agxbuf.h"
+ #include "utils.h"
+-- 
+2.22.0
+
meta-oe/recipes-graphics/graphviz/graphviz_2.40.1.bb +1 -0
index a9efffaca2..fb8ea2a5b3 100644
@@ -26,6 +26,7 @@ inherit autotools-brokensep pkgconfig gettext
 # source - see https://src.fedoraproject.org/cgit/rpms/graphviz.git/tree/graphviz.spec
 
 SRC_URI = "https://gitlab.com/graphviz/graphviz/-/archive/stable_release_${PV}/graphviz-stable_release_${PV}.tar.gz \
+           file://0001-plugin-pango-Include-freetype-headers-explicitly.patch \
 "
 # Use native mkdefs
 SRC_URI_append_class-target = " file://0001-Use-native-mkdefs.patch"
Signature · 1 line
2.22.0
author
#2 lore raw

PATCH 3/3 graphviz: Do not build tcl support for target

In reply to Khem Raj

tclpkg looks for tclsh on buildhost and if we try to use the native version then it groks the paths from the native sysroot and builds and installs the target tcl packages into the same path, in the end it ends up being wrongly packaged. Therefore its best to disable tcl

Secondly, package python and perl pieces into independent packages so the runtime dependencies are also set accordingly.

---
 ...o-be-empty-string-if-tcl-is-disabled.patch | 33 +++++++++++++++++++
 .../graphviz/graphviz_2.40.1.bb               | 19 ++++++++++-
 2 files changed, 51 insertions(+), 1 deletion(-)
 create mode 100644 meta-oe/recipes-graphics/graphviz/graphviz/0001-Set-use_tcl-to-be-empty-string-if-tcl-is-disabled.patch
meta-oe/recipes-graphics/graphviz/graphviz/0001-Set-use_tcl-to-be-empty-string-if-tcl-is-disabled.patch new file +33 -0
new file mode 100644
index 0000000000..21bf1bcd5c
@@ -0,0 +1,33 @@
+From 564901ab78da2b2b1bed92351dc3c102dc0a8154 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Tue, 6 Aug 2019 17:51:39 -0700
+Subject: [PATCH] Set use_tcl to be empty string if tcl is disabled
+
+Upstream-Status: Inappropriate [Cross-compile specific]
+Signed-off-by: Khem Raj <[email protected]>
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/configure.ac
++++ b/configure.ac
+@@ -1676,7 +1676,7 @@ AC_ARG_ENABLE(tcl,
+   [], [enable_tcl=yes])
+ 
+ if test "x$enable_tcl" != "xyes"; then
+-  use_tcl="No (disabled)"
++  use_tcl=""
+ fi
+ 
+ if test "x$use_tcl" = "x"; then
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -19,7 +19,7 @@ pkginclude_HEADERS = $(top_builddir)/gra
+ man_MANS = graphviz.7
+ 
+ # $(subdirs) contains the list from: AC_CONFIG_SUBDIRS
+-SUBDIRS = $(subdirs) lib plugin cmd tclpkg doc contrib share graphs rtest tests
++SUBDIRS = $(subdirs) lib plugin cmd doc contrib share graphs rtest tests
+ 
+ .PHONY: doxygen
+ doxygen:
meta-oe/recipes-graphics/graphviz/graphviz_2.40.1.bb +18 -1
index fb8ea2a5b3..176cf4498a 100644
@@ -29,7 +29,10 @@ SRC_URI = "https://gitlab.com/graphviz/graphviz/-/archive/stable_release_${PV}/g
            file://0001-plugin-pango-Include-freetype-headers-explicitly.patch \
 "
 # Use native mkdefs
-SRC_URI_append_class-target = " file://0001-Use-native-mkdefs.patch"
+SRC_URI_append_class-target = "\
+           file://0001-Use-native-mkdefs.patch \
+           file://0001-Set-use_tcl-to-be-empty-string-if-tcl-is-disabled.patch \
+"
 SRC_URI[md5sum] = "2acf30ca8e6cc8b001b0334db65fd072"
 SRC_URI[sha256sum] = "e6c3f8dbfde1c4523055403927bef29f97f9fc12715c1042b5dcf648a2c1c62a"
 
@@ -40,6 +43,7 @@ EXTRA_OECONF_class-target = "\
                 --with-expatlibdir=${STAGING_LIBDIR} \
                 --without-included-ltdl \
                 --disable-java \
+                --disable-tcl \
                 --disable-r \
                 --disable-sharp \
                 "
@@ -55,6 +59,19 @@ do_install_append_class-native() {
     install -m755 ${B}/lib/gvpr/mkdefs ${D}${bindir}
 }
 
+PACKAGES =+ "${PN}-python ${PN}-perl ${PN}-demo"
+
+FILES_${PN}-python += "${libdir}/python*/site-packages/ ${libdir}/graphviz/python/"
+FILES_${PN}-perl += "${libdir}/perl5/*/vendor_perl/ ${libdir}/graphviz/perl/"
+FILES_${PN}-demo += "${datadir}/graphviz/demo/"
+
+RDEPENDS_${PN}-perl += "perl"
+RDEPENDS_${PN}-python += "python"
+RDEPENDS_${PN}-demo += "python perl"
+
+INSANE_SKIP_${PN}-perl = "dev-so"
+INSANE_SKIP_${PN}-python = "dev-so"
+
 FILES_SOLIBSDEV_append = " ${libdir}/graphviz/lib*${SOLIBSDEV}"
 
 BBCLASSEXTEND = "native"
Signature · 1 line
2.22.0