All of lore.kernel.org
 help / color / mirror / Atom feed
* [meta-oe][PATCH v4] abseil-cpp: add recipe for git version
@ 2020-02-11 16:41 Sinan Kaya
  2020-02-11 16:46 ` Khem Raj
  0 siblings, 1 reply; 5+ messages in thread
From: Sinan Kaya @ 2020-02-11 16:41 UTC (permalink / raw)
  To: openembedded-devel; +Cc: Sinan Kaya, Changyu Li

The repository contains the Abseil C++ library code. Abseil is an
open-source collection of C++ code (compliant to C++11) designed to
augment the C++ standard library.

https://github.com/abseil/abseil-cpp

Signed-off-by: Changyu Li <Changyu.Li@microsoft.com>
Signed-off-by: Sinan Kaya <sinan.kaya@microsoft.com>
---
 ...e-maes-option-from-cross-compilation.patch | 53 +++++++++++++++++++
 ...n-ABSL_HAVE_VDSO_SUPPORT-conditional.patch | 35 ++++++++++++
 .../abseil-cpp/abseil-cpp_git.bb              | 52 ++++++++++++++++++
 3 files changed, 140 insertions(+)
 create mode 100644 meta-oe/recipes-devtools/abseil-cpp/abseil-cpp/0001-Remove-maes-option-from-cross-compilation.patch
 create mode 100644 meta-oe/recipes-devtools/abseil-cpp/abseil-cpp/0002-Add-forgotten-ABSL_HAVE_VDSO_SUPPORT-conditional.patch
 create mode 100644 meta-oe/recipes-devtools/abseil-cpp/abseil-cpp_git.bb

diff --git a/meta-oe/recipes-devtools/abseil-cpp/abseil-cpp/0001-Remove-maes-option-from-cross-compilation.patch b/meta-oe/recipes-devtools/abseil-cpp/abseil-cpp/0001-Remove-maes-option-from-cross-compilation.patch
new file mode 100644
index 0000000000..4c41cd8902
--- /dev/null
+++ b/meta-oe/recipes-devtools/abseil-cpp/abseil-cpp/0001-Remove-maes-option-from-cross-compilation.patch
@@ -0,0 +1,53 @@
+From 70926666f7c5c35add363e3bcade6eaabace7206 Mon Sep 17 00:00:00 2001
+From: Sinan Kaya <sinan.kaya@microsoft.com>
+Date: Mon, 3 Feb 2020 03:25:57 +0000
+Subject: [PATCH] Remove maes option from cross-compilation
+
+---
+ absl/copts/GENERATED_AbseilCopts.cmake | 4 ----
+ absl/copts/GENERATED_copts.bzl         | 4 ----
+ absl/copts/copts.py                    | 4 ----
+ 3 files changed, 12 deletions(-)
+
+diff --git a/absl/copts/GENERATED_AbseilCopts.cmake b/absl/copts/GENERATED_AbseilCopts.cmake
+index 01bd40b..af99694 100644
+--- a/absl/copts/GENERATED_AbseilCopts.cmake
++++ b/absl/copts/GENERATED_AbseilCopts.cmake
+@@ -230,7 +230,3 @@ list(APPEND ABSL_RANDOM_HWAES_MSVC_X64_FLAGS
+     "/Ob2"
+ )
+ 
+-list(APPEND ABSL_RANDOM_HWAES_X64_FLAGS
+-    "-maes"
+-    "-msse4.1"
+-)
+diff --git a/absl/copts/GENERATED_copts.bzl b/absl/copts/GENERATED_copts.bzl
+index 82f332f..9a548d1 100644
+--- a/absl/copts/GENERATED_copts.bzl
++++ b/absl/copts/GENERATED_copts.bzl
+@@ -231,7 +231,3 @@ ABSL_RANDOM_HWAES_MSVC_X64_FLAGS = [
+     "/Ob2",
+ ]
+ 
+-ABSL_RANDOM_HWAES_X64_FLAGS = [
+-    "-maes",
+-    "-msse4.1",
+-]
+diff --git a/absl/copts/copts.py b/absl/copts/copts.py
+index 068abce..c2f70fb 100644
+--- a/absl/copts/copts.py
++++ b/absl/copts/copts.py
+@@ -203,10 +203,6 @@ COPT_VARS = {
+     # to improve performance of some random bit generators.
+     "ABSL_RANDOM_HWAES_ARM64_FLAGS": ["-march=armv8-a+crypto"],
+     "ABSL_RANDOM_HWAES_ARM32_FLAGS": ["-mfpu=neon"],
+-    "ABSL_RANDOM_HWAES_X64_FLAGS": [
+-        "-maes",
+-        "-msse4.1",
+-    ],
+     "ABSL_RANDOM_HWAES_MSVC_X64_FLAGS": [
+         "/O2",  # Maximize speed
+         "/Ob2",  # Aggressive inlining
+-- 
+2.23.0
+
diff --git a/meta-oe/recipes-devtools/abseil-cpp/abseil-cpp/0002-Add-forgotten-ABSL_HAVE_VDSO_SUPPORT-conditional.patch b/meta-oe/recipes-devtools/abseil-cpp/abseil-cpp/0002-Add-forgotten-ABSL_HAVE_VDSO_SUPPORT-conditional.patch
new file mode 100644
index 0000000000..fab4a738ea
--- /dev/null
+++ b/meta-oe/recipes-devtools/abseil-cpp/abseil-cpp/0002-Add-forgotten-ABSL_HAVE_VDSO_SUPPORT-conditional.patch
@@ -0,0 +1,35 @@
+From 9384735383a0b8688e3f05ed23a53f18863eae20 Mon Sep 17 00:00:00 2001
+From: Sinan Kaya <sinan.kaya@microsoft.com>
+Date: Tue, 11 Feb 2020 11:36:00 -0500
+Subject: [PATCH] Add forgotten ABSL_HAVE_VDSO_SUPPORT conditional
+
+Signed-off-by: Sinan Kaya <sinan.kaya@microsoft.com>
+---
+ absl/debugging/internal/stacktrace_x86-inl.inc | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/absl/debugging/internal/stacktrace_x86-inl.inc b/absl/debugging/internal/stacktrace_x86-inl.inc
+index ff0fd31..28607c3 100644
+--- a/absl/debugging/internal/stacktrace_x86-inl.inc
++++ b/absl/debugging/internal/stacktrace_x86-inl.inc
+@@ -171,6 +171,7 @@ static void **NextStackFrame(void **old_fp, const void *uc) {
+     static const unsigned char *kernel_rt_sigreturn_address = nullptr;
+     static const unsigned char *kernel_vsyscall_address = nullptr;
+     if (num_push_instructions == -1) {
++#ifdef ABSL_HAVE_VDSO_SUPPORT
+       absl::debugging_internal::VDSOSupport vdso;
+       if (vdso.IsPresent()) {
+         absl::debugging_internal::VDSOSupport::SymbolInfo
+@@ -199,6 +200,9 @@ static void **NextStackFrame(void **old_fp, const void *uc) {
+       } else {
+         num_push_instructions = 0;
+       }
++#else
++      num_push_instructions = 0;
++#endif
+     }
+     if (num_push_instructions != 0 && kernel_rt_sigreturn_address != nullptr &&
+         old_fp[1] == kernel_rt_sigreturn_address) {
+-- 
+2.20.1.windows.1
+
diff --git a/meta-oe/recipes-devtools/abseil-cpp/abseil-cpp_git.bb b/meta-oe/recipes-devtools/abseil-cpp/abseil-cpp_git.bb
new file mode 100644
index 0000000000..1f7681a563
--- /dev/null
+++ b/meta-oe/recipes-devtools/abseil-cpp/abseil-cpp_git.bb
@@ -0,0 +1,52 @@
+SUMMARY = "Abseil is a cpp library like STL"
+DESCRIPTION = "Abseil provides pieces missing from the C++ standard. Contains \
+additional useful libraries like algorithm, container, debugging, hash, memory, \
+meta, numeric, strings, synchronization, time, types and utility"
+HOMEPAGE = "https://abseil.io/"
+SECTION = "libs"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=df52c6edb7adc22e533b2bacc3bd3915"
+
+SRCREV = "aa844899c937bde5d2b24f276b59997e5b668bde"
+BRANCH = "lts_2019_08_08"
+SRC_URI = "git://github.com/abseil/abseil-cpp;branch=${BRANCH}                \
+           file://0001-Remove-maes-option-from-cross-compilation.patch        \
+           file://0002-Add-forgotten-ABSL_HAVE_VDSO_SUPPORT-conditional.patch \
+          "
+
+S = "${WORKDIR}/git"
+
+TARGET_CXXFLAGS += "${@bb.utils.contains('TARGET_ARCH', 'x64', ' -maes -msse4.1', '', d)}"
+
+CXXFLAGS_append = " -fPIC"
+ASNEEDED_class-native = ""
+ASNEEDED_class-nativesdk = ""
+
+inherit cmake
+
+BBCLASSEXTEND = "native nativesdk"
+ALLOW_EMPTY_${PN} = "1"
+
+python () {
+    arch = d.getVar("TARGET_ARCH")
+
+    if arch == "aarch64":
+        tunes = d.getVar("TUNE_FEATURES")
+        if not tunes:
+            return
+        pkgn = d.getVar("PN")
+        pkgv = d.getVar("PV")
+        if "crypto" not in tunes:
+            raise bb.parse.SkipPackage("%s-%s Needs support for crypto on armv8" % (pkgn, pkgv))
+
+    if arch == "x86_64":
+        tunes = d.getVar("TUNE_FEATURES")
+        if not tunes:
+            return
+        pkgn = d.getVar("PN")
+        pkgv = d.getVar("PV")
+        if "corei7" not in tunes:
+            raise bb.parse.SkipPackage("%s-%s Needs support for corei7 on x86_64" % (pkgn, pkgv))
+
+}
+
-- 
2.23.0



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

* Re: [meta-oe][PATCH v4] abseil-cpp: add recipe for git version
  2020-02-11 16:41 [meta-oe][PATCH v4] abseil-cpp: add recipe for git version Sinan Kaya
@ 2020-02-11 16:46 ` Khem Raj
  2020-02-11 16:48   ` Sinan Kaya
  0 siblings, 1 reply; 5+ messages in thread
From: Khem Raj @ 2020-02-11 16:46 UTC (permalink / raw)
  To: Sinan Kaya; +Cc: Sinan Kaya, openembeded-devel, Changyu Li

Thanks Sinan, this looks good. Although I wonder why do we need to add
-fPIC manually.

On Tue, Feb 11, 2020 at 8:41 AM Sinan Kaya <okaya@kernel.org> wrote:
>
> The repository contains the Abseil C++ library code. Abseil is an
> open-source collection of C++ code (compliant to C++11) designed to
> augment the C++ standard library.
>
> https://github.com/abseil/abseil-cpp
>
> Signed-off-by: Changyu Li <Changyu.Li@microsoft.com>
> Signed-off-by: Sinan Kaya <sinan.kaya@microsoft.com>
> ---
>  ...e-maes-option-from-cross-compilation.patch | 53 +++++++++++++++++++
>  ...n-ABSL_HAVE_VDSO_SUPPORT-conditional.patch | 35 ++++++++++++
>  .../abseil-cpp/abseil-cpp_git.bb              | 52 ++++++++++++++++++
>  3 files changed, 140 insertions(+)
>  create mode 100644 meta-oe/recipes-devtools/abseil-cpp/abseil-cpp/0001-Remove-maes-option-from-cross-compilation.patch
>  create mode 100644 meta-oe/recipes-devtools/abseil-cpp/abseil-cpp/0002-Add-forgotten-ABSL_HAVE_VDSO_SUPPORT-conditional.patch
>  create mode 100644 meta-oe/recipes-devtools/abseil-cpp/abseil-cpp_git.bb
>
> diff --git a/meta-oe/recipes-devtools/abseil-cpp/abseil-cpp/0001-Remove-maes-option-from-cross-compilation.patch b/meta-oe/recipes-devtools/abseil-cpp/abseil-cpp/0001-Remove-maes-option-from-cross-compilation.patch
> new file mode 100644
> index 0000000000..4c41cd8902
> --- /dev/null
> +++ b/meta-oe/recipes-devtools/abseil-cpp/abseil-cpp/0001-Remove-maes-option-from-cross-compilation.patch
> @@ -0,0 +1,53 @@
> +From 70926666f7c5c35add363e3bcade6eaabace7206 Mon Sep 17 00:00:00 2001
> +From: Sinan Kaya <sinan.kaya@microsoft.com>
> +Date: Mon, 3 Feb 2020 03:25:57 +0000
> +Subject: [PATCH] Remove maes option from cross-compilation
> +
> +---
> + absl/copts/GENERATED_AbseilCopts.cmake | 4 ----
> + absl/copts/GENERATED_copts.bzl         | 4 ----
> + absl/copts/copts.py                    | 4 ----
> + 3 files changed, 12 deletions(-)
> +
> +diff --git a/absl/copts/GENERATED_AbseilCopts.cmake b/absl/copts/GENERATED_AbseilCopts.cmake
> +index 01bd40b..af99694 100644
> +--- a/absl/copts/GENERATED_AbseilCopts.cmake
> ++++ b/absl/copts/GENERATED_AbseilCopts.cmake
> +@@ -230,7 +230,3 @@ list(APPEND ABSL_RANDOM_HWAES_MSVC_X64_FLAGS
> +     "/Ob2"
> + )
> +
> +-list(APPEND ABSL_RANDOM_HWAES_X64_FLAGS
> +-    "-maes"
> +-    "-msse4.1"
> +-)
> +diff --git a/absl/copts/GENERATED_copts.bzl b/absl/copts/GENERATED_copts.bzl
> +index 82f332f..9a548d1 100644
> +--- a/absl/copts/GENERATED_copts.bzl
> ++++ b/absl/copts/GENERATED_copts.bzl
> +@@ -231,7 +231,3 @@ ABSL_RANDOM_HWAES_MSVC_X64_FLAGS = [
> +     "/Ob2",
> + ]
> +
> +-ABSL_RANDOM_HWAES_X64_FLAGS = [
> +-    "-maes",
> +-    "-msse4.1",
> +-]
> +diff --git a/absl/copts/copts.py b/absl/copts/copts.py
> +index 068abce..c2f70fb 100644
> +--- a/absl/copts/copts.py
> ++++ b/absl/copts/copts.py
> +@@ -203,10 +203,6 @@ COPT_VARS = {
> +     # to improve performance of some random bit generators.
> +     "ABSL_RANDOM_HWAES_ARM64_FLAGS": ["-march=armv8-a+crypto"],
> +     "ABSL_RANDOM_HWAES_ARM32_FLAGS": ["-mfpu=neon"],
> +-    "ABSL_RANDOM_HWAES_X64_FLAGS": [
> +-        "-maes",
> +-        "-msse4.1",
> +-    ],
> +     "ABSL_RANDOM_HWAES_MSVC_X64_FLAGS": [
> +         "/O2",  # Maximize speed
> +         "/Ob2",  # Aggressive inlining
> +--
> +2.23.0
> +
> diff --git a/meta-oe/recipes-devtools/abseil-cpp/abseil-cpp/0002-Add-forgotten-ABSL_HAVE_VDSO_SUPPORT-conditional.patch b/meta-oe/recipes-devtools/abseil-cpp/abseil-cpp/0002-Add-forgotten-ABSL_HAVE_VDSO_SUPPORT-conditional.patch
> new file mode 100644
> index 0000000000..fab4a738ea
> --- /dev/null
> +++ b/meta-oe/recipes-devtools/abseil-cpp/abseil-cpp/0002-Add-forgotten-ABSL_HAVE_VDSO_SUPPORT-conditional.patch
> @@ -0,0 +1,35 @@
> +From 9384735383a0b8688e3f05ed23a53f18863eae20 Mon Sep 17 00:00:00 2001
> +From: Sinan Kaya <sinan.kaya@microsoft.com>
> +Date: Tue, 11 Feb 2020 11:36:00 -0500
> +Subject: [PATCH] Add forgotten ABSL_HAVE_VDSO_SUPPORT conditional
> +
> +Signed-off-by: Sinan Kaya <sinan.kaya@microsoft.com>
> +---
> + absl/debugging/internal/stacktrace_x86-inl.inc | 4 ++++
> + 1 file changed, 4 insertions(+)
> +
> +diff --git a/absl/debugging/internal/stacktrace_x86-inl.inc b/absl/debugging/internal/stacktrace_x86-inl.inc
> +index ff0fd31..28607c3 100644
> +--- a/absl/debugging/internal/stacktrace_x86-inl.inc
> ++++ b/absl/debugging/internal/stacktrace_x86-inl.inc
> +@@ -171,6 +171,7 @@ static void **NextStackFrame(void **old_fp, const void *uc) {
> +     static const unsigned char *kernel_rt_sigreturn_address = nullptr;
> +     static const unsigned char *kernel_vsyscall_address = nullptr;
> +     if (num_push_instructions == -1) {
> ++#ifdef ABSL_HAVE_VDSO_SUPPORT
> +       absl::debugging_internal::VDSOSupport vdso;
> +       if (vdso.IsPresent()) {
> +         absl::debugging_internal::VDSOSupport::SymbolInfo
> +@@ -199,6 +200,9 @@ static void **NextStackFrame(void **old_fp, const void *uc) {
> +       } else {
> +         num_push_instructions = 0;
> +       }
> ++#else
> ++      num_push_instructions = 0;
> ++#endif
> +     }
> +     if (num_push_instructions != 0 && kernel_rt_sigreturn_address != nullptr &&
> +         old_fp[1] == kernel_rt_sigreturn_address) {
> +--
> +2.20.1.windows.1
> +
> diff --git a/meta-oe/recipes-devtools/abseil-cpp/abseil-cpp_git.bb b/meta-oe/recipes-devtools/abseil-cpp/abseil-cpp_git.bb
> new file mode 100644
> index 0000000000..1f7681a563
> --- /dev/null
> +++ b/meta-oe/recipes-devtools/abseil-cpp/abseil-cpp_git.bb
> @@ -0,0 +1,52 @@
> +SUMMARY = "Abseil is a cpp library like STL"
> +DESCRIPTION = "Abseil provides pieces missing from the C++ standard. Contains \
> +additional useful libraries like algorithm, container, debugging, hash, memory, \
> +meta, numeric, strings, synchronization, time, types and utility"
> +HOMEPAGE = "https://abseil.io/"
> +SECTION = "libs"
> +LICENSE = "Apache-2.0"
> +LIC_FILES_CHKSUM = "file://LICENSE;md5=df52c6edb7adc22e533b2bacc3bd3915"
> +
> +SRCREV = "aa844899c937bde5d2b24f276b59997e5b668bde"
> +BRANCH = "lts_2019_08_08"
> +SRC_URI = "git://github.com/abseil/abseil-cpp;branch=${BRANCH}                \
> +           file://0001-Remove-maes-option-from-cross-compilation.patch        \
> +           file://0002-Add-forgotten-ABSL_HAVE_VDSO_SUPPORT-conditional.patch \
> +          "
> +
> +S = "${WORKDIR}/git"
> +
> +TARGET_CXXFLAGS += "${@bb.utils.contains('TARGET_ARCH', 'x64', ' -maes -msse4.1', '', d)}"
> +
> +CXXFLAGS_append = " -fPIC"
> +ASNEEDED_class-native = ""
> +ASNEEDED_class-nativesdk = ""
> +
> +inherit cmake
> +
> +BBCLASSEXTEND = "native nativesdk"
> +ALLOW_EMPTY_${PN} = "1"
> +
> +python () {
> +    arch = d.getVar("TARGET_ARCH")
> +
> +    if arch == "aarch64":
> +        tunes = d.getVar("TUNE_FEATURES")
> +        if not tunes:
> +            return
> +        pkgn = d.getVar("PN")
> +        pkgv = d.getVar("PV")
> +        if "crypto" not in tunes:
> +            raise bb.parse.SkipPackage("%s-%s Needs support for crypto on armv8" % (pkgn, pkgv))
> +
> +    if arch == "x86_64":
> +        tunes = d.getVar("TUNE_FEATURES")
> +        if not tunes:
> +            return
> +        pkgn = d.getVar("PN")
> +        pkgv = d.getVar("PV")
> +        if "corei7" not in tunes:
> +            raise bb.parse.SkipPackage("%s-%s Needs support for corei7 on x86_64" % (pkgn, pkgv))
> +
> +}
> +
> --
> 2.23.0
>
> --
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-devel


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

* Re: [meta-oe][PATCH v4] abseil-cpp: add recipe for git version
  2020-02-11 16:46 ` Khem Raj
@ 2020-02-11 16:48   ` Sinan Kaya
  2020-02-11 16:53     ` Khem Raj
  0 siblings, 1 reply; 5+ messages in thread
From: Sinan Kaya @ 2020-02-11 16:48 UTC (permalink / raw)
  To: Khem Raj; +Cc: Sinan Kaya, openembeded-devel, Changyu Li

On 2/11/2020 11:46 AM, Khem Raj wrote:
> Thanks Sinan, this looks good. Although I wonder why do we need to add
> -fPIC manually.

I searched the library. It is not being set there and I had linker
errors on both arm64 and x86_64 without it.


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

* Re: [meta-oe][PATCH v4] abseil-cpp: add recipe for git version
  2020-02-11 16:48   ` Sinan Kaya
@ 2020-02-11 16:53     ` Khem Raj
  2020-02-11 16:55       ` Sinan Kaya
  0 siblings, 1 reply; 5+ messages in thread
From: Khem Raj @ 2020-02-11 16:53 UTC (permalink / raw)
  To: Sinan Kaya; +Cc: Sinan Kaya, openembeded-devel, Changyu Li

On Tue, Feb 11, 2020 at 8:48 AM Sinan Kaya <okaya@kernel.org> wrote:
>
> On 2/11/2020 11:46 AM, Khem Raj wrote:
> > Thanks Sinan, this looks good. Although I wonder why do we need to add
> > -fPIC manually.
>
> I searched the library. It is not being set there and I had linker
> errors on both arm64 and x86_64 without it.

right, so I wonder if it should be patches in the makery of the
component separately and sent upstream


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

* Re: [meta-oe][PATCH v4] abseil-cpp: add recipe for git version
  2020-02-11 16:53     ` Khem Raj
@ 2020-02-11 16:55       ` Sinan Kaya
  0 siblings, 0 replies; 5+ messages in thread
From: Sinan Kaya @ 2020-02-11 16:55 UTC (permalink / raw)
  To: Khem Raj; +Cc: Sinan Kaya, openembeded-devel, Changyu Li

On 2/11/2020 11:53 AM, Khem Raj wrote:
> right, so I wonder if it should be patches in the makery of the
> component separately and sent upstream

Yes, I can do that.



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

end of thread, other threads:[~2020-02-11 16:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-11 16:41 [meta-oe][PATCH v4] abseil-cpp: add recipe for git version Sinan Kaya
2020-02-11 16:46 ` Khem Raj
2020-02-11 16:48   ` Sinan Kaya
2020-02-11 16:53     ` Khem Raj
2020-02-11 16:55       ` Sinan Kaya

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.