All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V2 1/6] libssp-nonshared: Add recipe
@ 2018-04-20 16:33 Khem Raj
  2018-04-20 16:33 ` [PATCH V2 2/6] musl: Depend on libssp-nonshared Khem Raj
                   ` (5 more replies)
  0 siblings, 6 replies; 11+ messages in thread
From: Khem Raj @ 2018-04-20 16:33 UTC (permalink / raw)
  To: openembedded-core

libssp-nonshared is a minimal gcc runtime piece which is needed
on non-glibc systems which do implement libssp APIs in libc

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
Changes since v1:
- Package into staticdev package

 meta/recipes-core/musl/libssp-nonshared.bb    | 39 ++++++++++++++++
 .../musl/libssp-nonshared/ssp-local.c         | 45 +++++++++++++++++++
 2 files changed, 84 insertions(+)
 create mode 100644 meta/recipes-core/musl/libssp-nonshared.bb
 create mode 100644 meta/recipes-core/musl/libssp-nonshared/ssp-local.c

diff --git a/meta/recipes-core/musl/libssp-nonshared.bb b/meta/recipes-core/musl/libssp-nonshared.bb
new file mode 100644
index 0000000000..00a0a3d411
--- /dev/null
+++ b/meta/recipes-core/musl/libssp-nonshared.bb
@@ -0,0 +1,39 @@
+# Copyright (C) 2018 Khem Raj <raj.khem@gmail.com>
+# Released under the MIT license (see COPYING.MIT for the terms)
+
+SUMMARY = "Minimal libssp_nonshared.a must needed for ssp to work with gcc on musl"
+LICENSE = "GPL-3.0-with-GCC-exception"
+LIC_FILES_CHKSUM = "file://ssp-local.c;beginline=1;endline=32;md5=c06d391208c0cfcbc541a6728ed65cc4"
+SECTION = "libs"
+
+SRC_URI = "file://ssp-local.c"
+
+PATH_prepend = "${STAGING_BINDIR_TOOLCHAIN}.${STAGINGCC}:"
+
+INHIBIT_DEFAULT_DEPS = "1"
+
+STAGINGCC = "gcc-cross-initial-${TARGET_ARCH}"
+STAGINGCC_class-nativesdk = "gcc-crosssdk-initial-${SDK_SYS}"
+
+DEPENDS = "virtual/${TARGET_PREFIX}binutils \
+           virtual/${TARGET_PREFIX}gcc-initial \
+"
+
+do_configure[noexec] = "1"
+
+S = "${WORKDIR}"
+
+do_compile() {
+	${CC} ${CPPFLAGS} ${CFLAGS} -c ssp-local.c -o ssp-local.o
+	${AR} r libssp_nonshared.a ssp-local.o
+}
+do_install() {
+	install -Dm 0644 ${B}/libssp_nonshared.a ${D}${base_libdir}/libssp_nonshared.a
+}
+#
+# We will skip parsing for non-musl systems
+#
+COMPATIBLE_HOST = ".*-musl.*"
+RDEPENDS_${PN}-staticdev = ""
+RDEPENDS_${PN}-dev = ""
+RRECOMMENDS_${PN}-dbg = "${PN}-staticdev (= ${EXTENDPKGV})"
diff --git a/meta/recipes-core/musl/libssp-nonshared/ssp-local.c b/meta/recipes-core/musl/libssp-nonshared/ssp-local.c
new file mode 100644
index 0000000000..8f51afa2c1
--- /dev/null
+++ b/meta/recipes-core/musl/libssp-nonshared/ssp-local.c
@@ -0,0 +1,45 @@
+/* Stack protector support.
+   Copyright (C) 2005-2018 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+In addition to the permissions in the GNU General Public License, the
+Free Software Foundation gives you unlimited permission to link the
+compiled version of this file into combinations with other programs,
+and to distribute those combinations without any restriction coming
+from the use of this file.  (The General Public License restrictions
+do apply in other respects; for example, they cover modification of
+the file, and distribution when not linked into a combine
+executable.)
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
+
+Under Section 7 of GPL version 3, you are granted additional
+permissions described in the GCC Runtime Library Exception, version
+3.1, as published by the Free Software Foundation.
+
+You should have received a copy of the GNU General Public License and
+a copy of the GCC Runtime Library Exception along with this program;
+see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+<http://www.gnu.org/licenses/>.  */
+
+extern void __stack_chk_fail (void);
+
+/* Some targets can avoid loading a GP for calls to hidden functions.
+   Using this entry point may avoid the load of a GP entirely for the
+   function, making the overall code smaller.  */
+
+void
+__attribute__((visibility ("hidden")))
+__stack_chk_fail_local (void)
+{
+  __stack_chk_fail ();
+}
-- 
2.17.0



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

* [PATCH V2 2/6] musl: Depend on libssp-nonshared
  2018-04-20 16:33 [PATCH V2 1/6] libssp-nonshared: Add recipe Khem Raj
@ 2018-04-20 16:33 ` Khem Raj
  2018-04-20 16:33 ` [PATCH v3 3/6] gcc-runtime: Disable gcc version of libssp Khem Raj
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 11+ messages in thread
From: Khem Raj @ 2018-04-20 16:33 UTC (permalink / raw)
  To: openembedded-core

libssp-nonshared is required on musl since
it does not implement the gcc runtime piece of
libssp, which actually it a gcc optimization to
reach to __stack_chk_fail

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
Changes since v1:
- Depend on libssp-noshared-staticdev

 meta/recipes-core/musl/musl_git.bb | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/meta/recipes-core/musl/musl_git.bb b/meta/recipes-core/musl/musl_git.bb
index 9f8c5126e8..a57460ddd2 100644
--- a/meta/recipes-core/musl/musl_git.bb
+++ b/meta/recipes-core/musl/musl_git.bb
@@ -22,6 +22,7 @@ DEPENDS = "virtual/${TARGET_PREFIX}binutils \
            libgcc-initial \
            linux-libc-headers \
            bsd-headers \
+           libssp-nonshared \
           "
 
 export CROSS_COMPILE="${TARGET_PREFIX}"
@@ -65,7 +66,7 @@ do_install() {
 	done
 }
 
-RDEPENDS_${PN}-dev += "linux-libc-headers-dev bsd-headers-dev"
+RDEPENDS_${PN}-dev += "linux-libc-headers-dev bsd-headers-dev libssp-nonshared-staticdev"
 RPROVIDES_${PN}-dev += "libc-dev virtual-libc-dev"
 RPROVIDES_${PN} += "ldd libsegfault rtld(GNU_HASH)"
 
-- 
2.17.0



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

* [PATCH v3 3/6] gcc-runtime: Disable gcc version of libssp
  2018-04-20 16:33 [PATCH V2 1/6] libssp-nonshared: Add recipe Khem Raj
  2018-04-20 16:33 ` [PATCH V2 2/6] musl: Depend on libssp-nonshared Khem Raj
@ 2018-04-20 16:33 ` Khem Raj
  2018-04-20 16:33 ` [PATCH V2 4/6] libunwind: Drop adding libssp to linker flags Khem Raj
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 11+ messages in thread
From: Khem Raj @ 2018-04-20 16:33 UTC (permalink / raw)
  To: openembedded-core

libssp is implemented fully in glibc as well as in musl
so we really do not need the gcc version of this library
except may be for mingw, where we keep it enabled anyway
gcc in OE is built with the knowledge that C library
already provides libssp implementation, we should therefore
not need the gcc implementation of same.

libssp_nonshared piece is a detail which is needed when gcc
is the compiler, in glibc this is part of libc_nonshared.a
already and libc_nonshared.a is linked always when linking
with -lc becuase libc.so in glibc is actually a linker script

GROUP ( /usr/lib/libc.so.6 /usr/lib/libc_nonshared.a  AS_NEEDED ( /usr/lib/ld-linux-x86-64.so.2 ) )

which automatically links in the needed runtime bits, this however
is not the case for musl, where core SSP APIs are implemented in full
but compiler specific runtime isn't, for this we add a new package
called libssp_nonshared which generate the needed runtime stub
and gcc is already carrying patch to link to libssp_nonshared.a
on musl

This should fix a long standing problem where static PIE executable
were not buildable with OE since it was conflicting SSP implementation
one from C library and the other one from gcc and we end up with
duplicate symbol errors during linking.

Backport a patch from trunk which enhances enable|disable-libssp
to not only disable building libssp but also not emit the gcc
specs to use it for subsequent linking when stack-protector options
are used on compiler cmdline

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
Changes since v2:
- None

 meta/recipes-devtools/gcc/gcc-7.3.inc         |   7 +-
 ...cc-override-TARGET_LIBC_PROVIDES_SSP.patch | 204 ++++++++++++++++++
 meta/recipes-devtools/gcc/gcc-runtime.inc     |   4 +-
 3 files changed, 212 insertions(+), 3 deletions(-)
 create mode 100644 meta/recipes-devtools/gcc/gcc-7.3/0049-gcc-override-TARGET_LIBC_PROVIDES_SSP.patch

diff --git a/meta/recipes-devtools/gcc/gcc-7.3.inc b/meta/recipes-devtools/gcc/gcc-7.3.inc
index d968c322d2..98e5383b3c 100644
--- a/meta/recipes-devtools/gcc/gcc-7.3.inc
+++ b/meta/recipes-devtools/gcc/gcc-7.3.inc
@@ -72,6 +72,7 @@ SRC_URI = "\
            file://0045-Link-libgcc-using-LDFLAGS-not-just-SHLIB_LDFLAGS.patch \
            file://0047-sync-gcc-stddef.h-with-musl.patch \
            file://0048-gcc-Enable-static-PIE.patch \
+           file://0049-gcc-override-TARGET_LIBC_PROVIDES_SSP.patch \
            file://fix-segmentation-fault-precompiled-hdr.patch \
            file://no-sse-fix-test-case-failures.patch \
            ${BACKPORTS} \
@@ -93,10 +94,12 @@ FORTRAN = ""
 JAVA = ""
 
 LTO = "--enable-lto"
+SSP ?= "--disable-libssp"
+SSP_mingw = "--enable-libssp"
 
 EXTRA_OECONF_BASE = "\
     ${LTO} \
-    --enable-libssp \
+    ${SSP} \
     --enable-libitm \
     --disable-bootstrap \
     --disable-libmudflap \
@@ -120,7 +123,7 @@ EXTRA_OECONF_INITIAL = "\
     --disable-plugin \
     --enable-decimal-float=no \
     --without-isl \
-    gcc_cv_libc_provides_ssp=yes \
+    ${SSP} \
 "
 
 EXTRA_OECONF_PATHS = "\
diff --git a/meta/recipes-devtools/gcc/gcc-7.3/0049-gcc-override-TARGET_LIBC_PROVIDES_SSP.patch b/meta/recipes-devtools/gcc/gcc-7.3/0049-gcc-override-TARGET_LIBC_PROVIDES_SSP.patch
new file mode 100644
index 0000000000..7c53c95c3a
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-7.3/0049-gcc-override-TARGET_LIBC_PROVIDES_SSP.patch
@@ -0,0 +1,204 @@
+From 9815bd97561c778ee0bc0c17f245e88e66570111 Mon Sep 17 00:00:00 2001
+From: sandra <sandra@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Wed, 1 Nov 2017 02:14:19 +0000
+Subject: [PATCH] 2017-10-31  Sandra Loosemore  <sandra@codesourcery.com>
+
+	gcc/
+	* configure.ac (--enable-libssp): New.
+	(gcc_cv_libc_provides_ssp): Check for explicit setting before
+	trying to determine target-specific default.  Adjust indentation.
+	* configure: Regenerated.
+	* doc/install.texi (Configuration): Expand --disable-libssp
+	documentation.
+
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@254288 138bc75d-0d04-0410-961f-82ee72b054a4
+---
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+Upstream-Status: Backport [https://patchwork.ozlabs.org/patch/823049/]
+
+ gcc/ChangeLog        |  9 +++++++++
+ gcc/configure        | 26 +++++++++++++++++++++++---
+ gcc/configure.ac     | 24 ++++++++++++++++++++----
+ gcc/doc/install.texi |  3 ++-
+ 4 files changed, 54 insertions(+), 8 deletions(-)
+
+Index: gcc-7.3.0/gcc/configure.ac
+===================================================================
+--- gcc-7.3.0.orig/gcc/configure.ac
++++ gcc-7.3.0/gcc/configure.ac
+@@ -5719,10 +5719,25 @@ if test x$gcc_cv_solaris_crts = xyes; th
+   	    [Define if the system-provided CRTs are present on Solaris.])
+ fi
+ 
++AC_ARG_ENABLE(libssp,
++[AS_HELP_STRING([--enable-libssp], [enable linking against libssp])],
++[case "${enableval}" in
++  yes|no)
++    ;;
++  *)
++    AC_MSG_ERROR([unknown libssp setting $enableval])
++    ;;
++esac], [])
++
+ # Test for stack protector support in target C library.
+ AC_CACHE_CHECK(__stack_chk_fail in target C library,
+-      gcc_cv_libc_provides_ssp,
+-      [gcc_cv_libc_provides_ssp=no
++  gcc_cv_libc_provides_ssp,
++  [gcc_cv_libc_provides_ssp=no
++  if test "x$enable_libssp" = "xno"; then
++    gcc_cv_libc_provides_ssp=yes
++  elif test "x$enable_libssp" = "xyes"; then
++    gcc_cv_libc_provides_ssp=no
++  else
+     case "$target" in
+        *-*-musl*)
+ 	 # All versions of musl provide stack protector
+@@ -5759,8 +5774,9 @@ AC_CACHE_CHECK(__stack_chk_fail in targe
+ 	 AC_CHECK_FUNC(__stack_chk_fail,[gcc_cv_libc_provides_ssp=yes],
+            [echo "no __stack_chk_fail on this target"])
+         ;;
+-  *) gcc_cv_libc_provides_ssp=no ;;
+-    esac])
++       *) gcc_cv_libc_provides_ssp=no ;;
++    esac
++  fi])
+ 
+ if test x$gcc_cv_libc_provides_ssp = xyes; then
+   AC_DEFINE(TARGET_LIBC_PROVIDES_SSP, 1,
+Index: gcc-7.3.0/gcc/doc/install.texi
+===================================================================
+--- gcc-7.3.0.orig/gcc/doc/install.texi
++++ gcc-7.3.0/gcc/doc/install.texi
+@@ -1658,7 +1658,8 @@ not be built.
+ 
+ @item --disable-libssp
+ Specify that the run-time libraries for stack smashing protection
+-should not be built.
++should not be built or linked against.  On many targets library support
++is provided by the C library instead.
+ 
+ @item --disable-libquadmath
+ Specify that the GCC quad-precision math library should not be built.
+Index: gcc-7.3.0/gcc/configure
+===================================================================
+--- gcc-7.3.0.orig/gcc/configure
++++ gcc-7.3.0/gcc/configure
+@@ -940,6 +940,7 @@ enable_fix_cortex_a53_843419
+ with_glibc_version
+ enable_gnu_unique_object
+ enable_linker_build_id
++enable_libssp
+ enable_default_ssp
+ with_long_double_128
+ with_gc
+@@ -1679,6 +1680,7 @@ Optional Features:
+                           extension on glibc systems
+   --enable-linker-build-id
+                           compiler will always pass --build-id to linker
++  --enable-libssp         enable linking against libssp
+   --enable-default-ssp    enable Stack Smashing Protection as default
+   --enable-maintainer-mode
+                           enable make rules and dependencies not useful (and
+@@ -18450,7 +18452,7 @@ else
+   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+   lt_status=$lt_dlunknown
+   cat > conftest.$ac_ext <<_LT_EOF
+-#line 18436 "configure"
++#line 18455 "configure"
+ #include "confdefs.h"
+ 
+ #if HAVE_DLFCN_H
+@@ -18556,7 +18558,7 @@ else
+   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+   lt_status=$lt_dlunknown
+   cat > conftest.$ac_ext <<_LT_EOF
+-#line 18542 "configure"
++#line 18561 "configure"
+ #include "confdefs.h"
+ 
+ #if HAVE_DLFCN_H
+@@ -25234,6 +25236,7 @@ $as_echo "#define HAVE_AS_SPARC5_VIS4 1"
+ 
+ fi
+ 
++
+     { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for SPARC6 instructions" >&5
+ $as_echo_n "checking assembler for SPARC6 instructions... " >&6; }
+ if test "${gcc_cv_as_sparc_sparc6+set}" = set; then :
+@@ -25270,6 +25273,7 @@ $as_echo "#define HAVE_AS_SPARC6 1" >>co
+ 
+ fi
+ 
++
+     { $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler for LEON instructions" >&5
+ $as_echo_n "checking assembler for LEON instructions... " >&6; }
+ if test "${gcc_cv_as_sparc_leon+set}" = set; then :
+@@ -28947,6 +28951,18 @@ $as_echo "#define HAVE_SOLARIS_CRTS 1" >
+ 
+ fi
+ 
++# Check whether --enable-libssp was given.
++if test "${enable_libssp+set}" = set; then :
++  enableval=$enable_libssp; case "${enableval}" in
++  yes|no)
++    ;;
++  *)
++    as_fn_error "unknown libssp setting $enableval" "$LINENO" 5
++    ;;
++esac
++fi
++
++
+ # Test for stack protector support in target C library.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking __stack_chk_fail in target C library" >&5
+ $as_echo_n "checking __stack_chk_fail in target C library... " >&6; }
+@@ -28954,6 +28970,11 @@ if test "${gcc_cv_libc_provides_ssp+set}
+   $as_echo_n "(cached) " >&6
+ else
+   gcc_cv_libc_provides_ssp=no
++  if test "x$enable_libssp" = "xno"; then
++    gcc_cv_libc_provides_ssp=yes
++  elif test "x$enable_libssp" = "xyes"; then
++    gcc_cv_libc_provides_ssp=no
++  else
+     case "$target" in
+        *-*-musl*)
+ 	 # All versions of musl provide stack protector
+@@ -29001,8 +29022,9 @@ else
+ fi
+ 
+         ;;
+-  *) gcc_cv_libc_provides_ssp=no ;;
++       *) gcc_cv_libc_provides_ssp=no ;;
+     esac
++  fi
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_libc_provides_ssp" >&5
+ $as_echo "$gcc_cv_libc_provides_ssp" >&6; }
+@@ -29037,18 +29059,15 @@ fi
+ 
+ 
+ # Test for <sys/sdt.h> on the target.
+-
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking sys/sdt.h in the target C library" >&5
+-$as_echo_n "checking sys/sdt.h in the target C library... " >&6; }
+-have_sys_sdt_h=no
++#GCC_TARGET_TEMPLATE([HAVE_SYS_SDT_H])
++#AC_MSG_CHECKING(sys/sdt.h in the target C library)
++#have_sys_sdt_h=no
+ #if test -f $target_header_dir/sys/sdt.h; then
+ #  have_sys_sdt_h=yes
+-#
+-#$as_echo "#define HAVE_SYS_SDT_H 1" >>confdefs.h
+-#
++#  AC_DEFINE(HAVE_SYS_SDT_H, 1,
++#            [Define if your target C library provides sys/sdt.h])
+ #fi
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_sys_sdt_h" >&5
+-$as_echo "$have_sys_sdt_h" >&6; }
++#AC_MSG_RESULT($have_sys_sdt_h)
+ 
+ # Check if TFmode long double should be used by default or not.
+ # Some glibc targets used DFmode long double, but with glibc 2.4
diff --git a/meta/recipes-devtools/gcc/gcc-runtime.inc b/meta/recipes-devtools/gcc/gcc-runtime.inc
index 97365a21dc..b4e5539575 100644
--- a/meta/recipes-devtools/gcc/gcc-runtime.inc
+++ b/meta/recipes-devtools/gcc/gcc-runtime.inc
@@ -24,8 +24,10 @@ RUNTIMELIBITM_nios2 = ""
 RUNTIMELIBITM_microblaze = ""
 RUNTIMELIBITM_riscv32 = ""
 RUNTIMELIBITM_riscv64 = ""
+RUNTIMELIBSSP ?= ""
+RUNTIMELIBSSP_mingw ?= "libssp"
 
-RUNTIMETARGET = "libssp libstdc++-v3 libgomp libatomic ${RUNTIMELIBITM} \
+RUNTIMETARGET = "libstdc++-v3 libgomp libatomic ${RUNTIMELIBITM} \
     ${@bb.utils.contains_any('FORTRAN', [',fortran',',f77'], 'libquadmath', '', d)} \
 "
 RUNTIMETARGET_append_x86 = " libmpx"
-- 
2.17.0



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

* [PATCH V2 4/6] libunwind: Drop adding libssp to linker flags
  2018-04-20 16:33 [PATCH V2 1/6] libssp-nonshared: Add recipe Khem Raj
  2018-04-20 16:33 ` [PATCH V2 2/6] musl: Depend on libssp-nonshared Khem Raj
  2018-04-20 16:33 ` [PATCH v3 3/6] gcc-runtime: Disable gcc version of libssp Khem Raj
@ 2018-04-20 16:33 ` Khem Raj
  2018-04-20 16:33 ` [PATCH V3 5/6] musl: Upgrade to latest Khem Raj
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 11+ messages in thread
From: Khem Raj @ 2018-04-20 16:33 UTC (permalink / raw)
  To: openembedded-core

This is no longer needed as gcc provided libssp
is not built

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
Changes since v1:
- Rebased

 meta/recipes-support/libunwind/libunwind.inc | 2 --
 1 file changed, 2 deletions(-)

diff --git a/meta/recipes-support/libunwind/libunwind.inc b/meta/recipes-support/libunwind/libunwind.inc
index b9c532d3ad..36851d07ed 100644
--- a/meta/recipes-support/libunwind/libunwind.inc
+++ b/meta/recipes-support/libunwind/libunwind.inc
@@ -14,8 +14,6 @@ PACKAGECONFIG[latexdocs] = "--enable-documentation, --disable-documentation, lat
 EXTRA_OECONF_arm = "--enable-debug-frame"
 EXTRA_OECONF_aarch64 = "--enable-debug-frame"
 
-SECURITY_LDFLAGS_append_libc-musl = " -lssp_nonshared -lssp"
-
 do_install_append () {
 	oe_multilib_header libunwind.h
 }
-- 
2.17.0



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

* [PATCH V3 5/6] musl: Upgrade to latest
  2018-04-20 16:33 [PATCH V2 1/6] libssp-nonshared: Add recipe Khem Raj
                   ` (2 preceding siblings ...)
  2018-04-20 16:33 ` [PATCH V2 4/6] libunwind: Drop adding libssp to linker flags Khem Raj
@ 2018-04-20 16:33 ` Khem Raj
  2018-04-20 16:33 ` [PATCH 6/6] llvm: Fix [compile-host-path] QA issue Khem Raj
  2018-04-30 13:08 ` [PATCH V2 1/6] libssp-nonshared: Add recipe Burton, Ross
  5 siblings, 0 replies; 11+ messages in thread
From: Khem Raj @ 2018-04-20 16:33 UTC (permalink / raw)
  To: openembedded-core

Changes are here

https://git.musl-libc.org/cgit/musl/log/?qt=range&q=55df09bfccbfe21fc9dd7d8f94550c0ff25ace04..618b18c78e33acfe54a4434e91aa57b8e171df89

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
Changes since v2:
- Rebased

 meta/recipes-core/musl/musl_git.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/recipes-core/musl/musl_git.bb b/meta/recipes-core/musl/musl_git.bb
index a57460ddd2..01fec69aeb 100644
--- a/meta/recipes-core/musl/musl_git.bb
+++ b/meta/recipes-core/musl/musl_git.bb
@@ -3,7 +3,7 @@
 
 require musl.inc
 
-SRCREV = "55df09bfccbfe21fc9dd7d8f94550c0ff25ace04"
+SRCREV = "618b18c78e33acfe54a4434e91aa57b8e171df89"
 
 PV = "1.1.19+git${SRCPV}"
 
-- 
2.17.0



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

* [PATCH 6/6] llvm: Fix [compile-host-path] QA issue
  2018-04-20 16:33 [PATCH V2 1/6] libssp-nonshared: Add recipe Khem Raj
                   ` (3 preceding siblings ...)
  2018-04-20 16:33 ` [PATCH V3 5/6] musl: Upgrade to latest Khem Raj
@ 2018-04-20 16:33 ` Khem Raj
  2018-04-30 13:08 ` [PATCH V2 1/6] libssp-nonshared: Add recipe Burton, Ross
  5 siblings, 0 replies; 11+ messages in thread
From: Khem Raj @ 2018-04-20 16:33 UTC (permalink / raw)
  To: openembedded-core

Its trying to build NATIVE llvm-config which is
already built with llvm-native so we do not need
to rebuild it

Drop setting NINJA_STATUS explicitly, its no longer
needed, on the contrary it hinders the task status
update

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
Changes since v1:
- Rebased

 ...able-generating-a-native-llvm-config.patch | 41 +++++++++++++++++++
 meta/recipes-devtools/llvm/llvm_git.bb        |  7 ++--
 2 files changed, 45 insertions(+), 3 deletions(-)
 create mode 100644 meta/recipes-devtools/llvm/llvm/0001-Disable-generating-a-native-llvm-config.patch

diff --git a/meta/recipes-devtools/llvm/llvm/0001-Disable-generating-a-native-llvm-config.patch b/meta/recipes-devtools/llvm/llvm/0001-Disable-generating-a-native-llvm-config.patch
new file mode 100644
index 0000000000..2809e4c594
--- /dev/null
+++ b/meta/recipes-devtools/llvm/llvm/0001-Disable-generating-a-native-llvm-config.patch
@@ -0,0 +1,41 @@
+From 7f7743ce233fcd735ec580c75270413493658aa6 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 19 Apr 2018 18:08:31 -0700
+Subject: [PATCH] Disable generating a native llvm-config
+
+OpenEmbedded already builds this as part of llvm-native
+
+Upstream-Status: Inappropriate [OE-Specific]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ tools/llvm-config/CMakeLists.txt | 16 ----------------
+ 1 file changed, 16 deletions(-)
+
+diff --git a/tools/llvm-config/CMakeLists.txt b/tools/llvm-config/CMakeLists.txt
+index 25f99cec978..c45e9b642a8 100644
+--- a/tools/llvm-config/CMakeLists.txt
++++ b/tools/llvm-config/CMakeLists.txt
+@@ -63,19 +63,3 @@ endif()
+ 
+ # Add the dependency on the generation step.
+ add_file_dependencies(${CMAKE_CURRENT_SOURCE_DIR}/llvm-config.cpp ${BUILDVARIABLES_OBJPATH})
+-
+-if(CMAKE_CROSSCOMPILING)
+-  set(${project}_LLVM_CONFIG_EXE "${LLVM_NATIVE_BUILD}/bin/llvm-config")
+-  set(${project}_LLVM_CONFIG_EXE ${${project}_LLVM_CONFIG_EXE} PARENT_SCOPE)
+-
+-  add_custom_command(OUTPUT "${${project}_LLVM_CONFIG_EXE}"
+-    COMMAND ${CMAKE_COMMAND} --build . --target llvm-config --config $<CONFIGURATION>
+-    DEPENDS ${LLVM_NATIVE_BUILD}/CMakeCache.txt
+-    WORKING_DIRECTORY ${LLVM_NATIVE_BUILD}
+-    COMMENT "Building native llvm-config..."
+-    USES_TERMINAL)
+-  add_custom_target(${project}NativeLLVMConfig DEPENDS ${${project}_LLVM_CONFIG_EXE})
+-  add_dependencies(${project}NativeLLVMConfig CONFIGURE_LLVM_NATIVE)
+-
+-  add_dependencies(llvm-config ${project}NativeLLVMConfig)
+-endif(CMAKE_CROSSCOMPILING)
+-- 
+2.17.0
+
diff --git a/meta/recipes-devtools/llvm/llvm_git.bb b/meta/recipes-devtools/llvm/llvm_git.bb
index 77c095d9a3..cb3bba6fab 100644
--- a/meta/recipes-devtools/llvm/llvm_git.bb
+++ b/meta/recipes-devtools/llvm/llvm_git.bb
@@ -26,6 +26,7 @@ PATCH_VERSION = "0"
 SRC_URI = "git://github.com/llvm-mirror/llvm.git;branch=${BRANCH};protocol=http \
            file://0001-llvm-TargetLibraryInfo-Undefine-libc-functions-if-th.patch \
            file://0002-llvm-allow-env-override-of-exe-path.patch \
+           file://0001-Disable-generating-a-native-llvm-config.patch \
           "
 UPSTREAM_CHECK_COMMITS = "1"
 S = "${WORKDIR}/git"
@@ -85,15 +86,15 @@ do_configure_prepend() {
 }
 
 do_compile() {
-	NINJA_STATUS="[%p] " ninja -v ${PARALLEL_MAKE}
+	ninja -v ${PARALLEL_MAKE}
 }
 
 do_compile_class-native() {
-	NINJA_STATUS="[%p] " ninja -v ${PARALLEL_MAKE} llvm-config llvm-tblgen
+	ninja -v ${PARALLEL_MAKE} llvm-config llvm-tblgen
 }
 
 do_install() {
-	NINJA_STATUS="[%p] " DESTDIR=${LLVM_INSTALL_DIR} ninja -v install
+	DESTDIR=${LLVM_INSTALL_DIR} ninja -v install
 	install -D -m 0755 ${B}/bin/llvm-config ${D}${libdir}/${LLVM_DIR}/llvm-config
 
 	install -d ${D}${bindir}/${LLVM_DIR}
-- 
2.17.0



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

* Re: [PATCH V2 1/6] libssp-nonshared: Add recipe
  2018-04-20 16:33 [PATCH V2 1/6] libssp-nonshared: Add recipe Khem Raj
                   ` (4 preceding siblings ...)
  2018-04-20 16:33 ` [PATCH 6/6] llvm: Fix [compile-host-path] QA issue Khem Raj
@ 2018-04-30 13:08 ` Burton, Ross
  2018-04-30 14:17   ` Khem Raj
  5 siblings, 1 reply; 11+ messages in thread
From: Burton, Ross @ 2018-04-30 13:08 UTC (permalink / raw)
  To: Khem Raj; +Cc: OE-core

build-appliance is failing at SDK creation time:

 Problem: package packagegroup-self-hosted-1.0-r13.0.noarch requires
packagegroup-self-hosted-sdk, but none of the providers can be
installed
  - conflicting requests
  - nothing provides libssp-dev needed by
packagegroup-self-hosted-sdk-1.0-r13.0.noarch

Ross

On 20 April 2018 at 17:33, Khem Raj <raj.khem@gmail.com> wrote:
> libssp-nonshared is a minimal gcc runtime piece which is needed
> on non-glibc systems which do implement libssp APIs in libc
>
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> ---
> Changes since v1:
> - Package into staticdev package
>
>  meta/recipes-core/musl/libssp-nonshared.bb    | 39 ++++++++++++++++
>  .../musl/libssp-nonshared/ssp-local.c         | 45 +++++++++++++++++++
>  2 files changed, 84 insertions(+)
>  create mode 100644 meta/recipes-core/musl/libssp-nonshared.bb
>  create mode 100644 meta/recipes-core/musl/libssp-nonshared/ssp-local.c
>
> diff --git a/meta/recipes-core/musl/libssp-nonshared.bb b/meta/recipes-core/musl/libssp-nonshared.bb
> new file mode 100644
> index 0000000000..00a0a3d411
> --- /dev/null
> +++ b/meta/recipes-core/musl/libssp-nonshared.bb
> @@ -0,0 +1,39 @@
> +# Copyright (C) 2018 Khem Raj <raj.khem@gmail.com>
> +# Released under the MIT license (see COPYING.MIT for the terms)
> +
> +SUMMARY = "Minimal libssp_nonshared.a must needed for ssp to work with gcc on musl"
> +LICENSE = "GPL-3.0-with-GCC-exception"
> +LIC_FILES_CHKSUM = "file://ssp-local.c;beginline=1;endline=32;md5=c06d391208c0cfcbc541a6728ed65cc4"
> +SECTION = "libs"
> +
> +SRC_URI = "file://ssp-local.c"
> +
> +PATH_prepend = "${STAGING_BINDIR_TOOLCHAIN}.${STAGINGCC}:"
> +
> +INHIBIT_DEFAULT_DEPS = "1"
> +
> +STAGINGCC = "gcc-cross-initial-${TARGET_ARCH}"
> +STAGINGCC_class-nativesdk = "gcc-crosssdk-initial-${SDK_SYS}"
> +
> +DEPENDS = "virtual/${TARGET_PREFIX}binutils \
> +           virtual/${TARGET_PREFIX}gcc-initial \
> +"
> +
> +do_configure[noexec] = "1"
> +
> +S = "${WORKDIR}"
> +
> +do_compile() {
> +       ${CC} ${CPPFLAGS} ${CFLAGS} -c ssp-local.c -o ssp-local.o
> +       ${AR} r libssp_nonshared.a ssp-local.o
> +}
> +do_install() {
> +       install -Dm 0644 ${B}/libssp_nonshared.a ${D}${base_libdir}/libssp_nonshared.a
> +}
> +#
> +# We will skip parsing for non-musl systems
> +#
> +COMPATIBLE_HOST = ".*-musl.*"
> +RDEPENDS_${PN}-staticdev = ""
> +RDEPENDS_${PN}-dev = ""
> +RRECOMMENDS_${PN}-dbg = "${PN}-staticdev (= ${EXTENDPKGV})"
> diff --git a/meta/recipes-core/musl/libssp-nonshared/ssp-local.c b/meta/recipes-core/musl/libssp-nonshared/ssp-local.c
> new file mode 100644
> index 0000000000..8f51afa2c1
> --- /dev/null
> +++ b/meta/recipes-core/musl/libssp-nonshared/ssp-local.c
> @@ -0,0 +1,45 @@
> +/* Stack protector support.
> +   Copyright (C) 2005-2018 Free Software Foundation, Inc.
> +
> +This file is part of GCC.
> +
> +GCC is free software; you can redistribute it and/or modify it under
> +the terms of the GNU General Public License as published by the Free
> +Software Foundation; either version 3, or (at your option) any later
> +version.
> +
> +In addition to the permissions in the GNU General Public License, the
> +Free Software Foundation gives you unlimited permission to link the
> +compiled version of this file into combinations with other programs,
> +and to distribute those combinations without any restriction coming
> +from the use of this file.  (The General Public License restrictions
> +do apply in other respects; for example, they cover modification of
> +the file, and distribution when not linked into a combine
> +executable.)
> +
> +GCC is distributed in the hope that it will be useful, but WITHOUT ANY
> +WARRANTY; without even the implied warranty of MERCHANTABILITY or
> +FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
> +for more details.
> +
> +Under Section 7 of GPL version 3, you are granted additional
> +permissions described in the GCC Runtime Library Exception, version
> +3.1, as published by the Free Software Foundation.
> +
> +You should have received a copy of the GNU General Public License and
> +a copy of the GCC Runtime Library Exception along with this program;
> +see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
> +<http://www.gnu.org/licenses/>.  */
> +
> +extern void __stack_chk_fail (void);
> +
> +/* Some targets can avoid loading a GP for calls to hidden functions.
> +   Using this entry point may avoid the load of a GP entirely for the
> +   function, making the overall code smaller.  */
> +
> +void
> +__attribute__((visibility ("hidden")))
> +__stack_chk_fail_local (void)
> +{
> +  __stack_chk_fail ();
> +}
> --
> 2.17.0
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core


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

* Re: [PATCH V2 1/6] libssp-nonshared: Add recipe
  2018-04-30 13:08 ` [PATCH V2 1/6] libssp-nonshared: Add recipe Burton, Ross
@ 2018-04-30 14:17   ` Khem Raj
  2018-04-30 15:05     ` Burton, Ross
  0 siblings, 1 reply; 11+ messages in thread
From: Khem Raj @ 2018-04-30 14:17 UTC (permalink / raw)
  To: Burton, Ross; +Cc: OE-core

On Mon, Apr 30, 2018 at 6:08 AM, Burton, Ross <ross.burton@intel.com> wrote:
> build-appliance is failing at SDK creation time:
>
>  Problem: package packagegroup-self-hosted-1.0-r13.0.noarch requires
> packagegroup-self-hosted-sdk, but none of the providers can be
> installed
>   - conflicting requests
>   - nothing provides libssp-dev needed by
> packagegroup-self-hosted-sdk-1.0-r13.0.noarch
>

we do not need libssp there, I have sent a patch to remove it from packagegroup
http://git.openembedded.org/openembedded-core-contrib/commit/?h=kraj/pu&id=03e113aedd069ea97f2f3ce96fc8337e3601732b

> Ross
>
> On 20 April 2018 at 17:33, Khem Raj <raj.khem@gmail.com> wrote:
>> libssp-nonshared is a minimal gcc runtime piece which is needed
>> on non-glibc systems which do implement libssp APIs in libc
>>
>> Signed-off-by: Khem Raj <raj.khem@gmail.com>
>> ---
>> Changes since v1:
>> - Package into staticdev package
>>
>>  meta/recipes-core/musl/libssp-nonshared.bb    | 39 ++++++++++++++++
>>  .../musl/libssp-nonshared/ssp-local.c         | 45 +++++++++++++++++++
>>  2 files changed, 84 insertions(+)
>>  create mode 100644 meta/recipes-core/musl/libssp-nonshared.bb
>>  create mode 100644 meta/recipes-core/musl/libssp-nonshared/ssp-local.c
>>
>> diff --git a/meta/recipes-core/musl/libssp-nonshared.bb b/meta/recipes-core/musl/libssp-nonshared.bb
>> new file mode 100644
>> index 0000000000..00a0a3d411
>> --- /dev/null
>> +++ b/meta/recipes-core/musl/libssp-nonshared.bb
>> @@ -0,0 +1,39 @@
>> +# Copyright (C) 2018 Khem Raj <raj.khem@gmail.com>
>> +# Released under the MIT license (see COPYING.MIT for the terms)
>> +
>> +SUMMARY = "Minimal libssp_nonshared.a must needed for ssp to work with gcc on musl"
>> +LICENSE = "GPL-3.0-with-GCC-exception"
>> +LIC_FILES_CHKSUM = "file://ssp-local.c;beginline=1;endline=32;md5=c06d391208c0cfcbc541a6728ed65cc4"
>> +SECTION = "libs"
>> +
>> +SRC_URI = "file://ssp-local.c"
>> +
>> +PATH_prepend = "${STAGING_BINDIR_TOOLCHAIN}.${STAGINGCC}:"
>> +
>> +INHIBIT_DEFAULT_DEPS = "1"
>> +
>> +STAGINGCC = "gcc-cross-initial-${TARGET_ARCH}"
>> +STAGINGCC_class-nativesdk = "gcc-crosssdk-initial-${SDK_SYS}"
>> +
>> +DEPENDS = "virtual/${TARGET_PREFIX}binutils \
>> +           virtual/${TARGET_PREFIX}gcc-initial \
>> +"
>> +
>> +do_configure[noexec] = "1"
>> +
>> +S = "${WORKDIR}"
>> +
>> +do_compile() {
>> +       ${CC} ${CPPFLAGS} ${CFLAGS} -c ssp-local.c -o ssp-local.o
>> +       ${AR} r libssp_nonshared.a ssp-local.o
>> +}
>> +do_install() {
>> +       install -Dm 0644 ${B}/libssp_nonshared.a ${D}${base_libdir}/libssp_nonshared.a
>> +}
>> +#
>> +# We will skip parsing for non-musl systems
>> +#
>> +COMPATIBLE_HOST = ".*-musl.*"
>> +RDEPENDS_${PN}-staticdev = ""
>> +RDEPENDS_${PN}-dev = ""
>> +RRECOMMENDS_${PN}-dbg = "${PN}-staticdev (= ${EXTENDPKGV})"
>> diff --git a/meta/recipes-core/musl/libssp-nonshared/ssp-local.c b/meta/recipes-core/musl/libssp-nonshared/ssp-local.c
>> new file mode 100644
>> index 0000000000..8f51afa2c1
>> --- /dev/null
>> +++ b/meta/recipes-core/musl/libssp-nonshared/ssp-local.c
>> @@ -0,0 +1,45 @@
>> +/* Stack protector support.
>> +   Copyright (C) 2005-2018 Free Software Foundation, Inc.
>> +
>> +This file is part of GCC.
>> +
>> +GCC is free software; you can redistribute it and/or modify it under
>> +the terms of the GNU General Public License as published by the Free
>> +Software Foundation; either version 3, or (at your option) any later
>> +version.
>> +
>> +In addition to the permissions in the GNU General Public License, the
>> +Free Software Foundation gives you unlimited permission to link the
>> +compiled version of this file into combinations with other programs,
>> +and to distribute those combinations without any restriction coming
>> +from the use of this file.  (The General Public License restrictions
>> +do apply in other respects; for example, they cover modification of
>> +the file, and distribution when not linked into a combine
>> +executable.)
>> +
>> +GCC is distributed in the hope that it will be useful, but WITHOUT ANY
>> +WARRANTY; without even the implied warranty of MERCHANTABILITY or
>> +FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
>> +for more details.
>> +
>> +Under Section 7 of GPL version 3, you are granted additional
>> +permissions described in the GCC Runtime Library Exception, version
>> +3.1, as published by the Free Software Foundation.
>> +
>> +You should have received a copy of the GNU General Public License and
>> +a copy of the GCC Runtime Library Exception along with this program;
>> +see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
>> +<http://www.gnu.org/licenses/>.  */
>> +
>> +extern void __stack_chk_fail (void);
>> +
>> +/* Some targets can avoid loading a GP for calls to hidden functions.
>> +   Using this entry point may avoid the load of a GP entirely for the
>> +   function, making the overall code smaller.  */
>> +
>> +void
>> +__attribute__((visibility ("hidden")))
>> +__stack_chk_fail_local (void)
>> +{
>> +  __stack_chk_fail ();
>> +}
>> --
>> 2.17.0
>>
>> --
>> _______________________________________________
>> Openembedded-core mailing list
>> Openembedded-core@lists.openembedded.org
>> http://lists.openembedded.org/mailman/listinfo/openembedded-core


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

* Re: [PATCH V2 1/6] libssp-nonshared: Add recipe
  2018-04-30 14:17   ` Khem Raj
@ 2018-04-30 15:05     ` Burton, Ross
  2018-04-30 15:21       ` Burton, Ross
  0 siblings, 1 reply; 11+ messages in thread
From: Burton, Ross @ 2018-04-30 15:05 UTC (permalink / raw)
  To: Khem Raj; +Cc: OE-core

Oh yes, sorry missed that when I was trying to pick up just the SSP changes.

Ross

On 30 April 2018 at 15:17, Khem Raj <raj.khem@gmail.com> wrote:
> On Mon, Apr 30, 2018 at 6:08 AM, Burton, Ross <ross.burton@intel.com> wrote:
>> build-appliance is failing at SDK creation time:
>>
>>  Problem: package packagegroup-self-hosted-1.0-r13.0.noarch requires
>> packagegroup-self-hosted-sdk, but none of the providers can be
>> installed
>>   - conflicting requests
>>   - nothing provides libssp-dev needed by
>> packagegroup-self-hosted-sdk-1.0-r13.0.noarch
>>
>
> we do not need libssp there, I have sent a patch to remove it from packagegroup
> http://git.openembedded.org/openembedded-core-contrib/commit/?h=kraj/pu&id=03e113aedd069ea97f2f3ce96fc8337e3601732b
>
>> Ross
>>
>> On 20 April 2018 at 17:33, Khem Raj <raj.khem@gmail.com> wrote:
>>> libssp-nonshared is a minimal gcc runtime piece which is needed
>>> on non-glibc systems which do implement libssp APIs in libc
>>>
>>> Signed-off-by: Khem Raj <raj.khem@gmail.com>
>>> ---
>>> Changes since v1:
>>> - Package into staticdev package
>>>
>>>  meta/recipes-core/musl/libssp-nonshared.bb    | 39 ++++++++++++++++
>>>  .../musl/libssp-nonshared/ssp-local.c         | 45 +++++++++++++++++++
>>>  2 files changed, 84 insertions(+)
>>>  create mode 100644 meta/recipes-core/musl/libssp-nonshared.bb
>>>  create mode 100644 meta/recipes-core/musl/libssp-nonshared/ssp-local.c
>>>
>>> diff --git a/meta/recipes-core/musl/libssp-nonshared.bb b/meta/recipes-core/musl/libssp-nonshared.bb
>>> new file mode 100644
>>> index 0000000000..00a0a3d411
>>> --- /dev/null
>>> +++ b/meta/recipes-core/musl/libssp-nonshared.bb
>>> @@ -0,0 +1,39 @@
>>> +# Copyright (C) 2018 Khem Raj <raj.khem@gmail.com>
>>> +# Released under the MIT license (see COPYING.MIT for the terms)
>>> +
>>> +SUMMARY = "Minimal libssp_nonshared.a must needed for ssp to work with gcc on musl"
>>> +LICENSE = "GPL-3.0-with-GCC-exception"
>>> +LIC_FILES_CHKSUM = "file://ssp-local.c;beginline=1;endline=32;md5=c06d391208c0cfcbc541a6728ed65cc4"
>>> +SECTION = "libs"
>>> +
>>> +SRC_URI = "file://ssp-local.c"
>>> +
>>> +PATH_prepend = "${STAGING_BINDIR_TOOLCHAIN}.${STAGINGCC}:"
>>> +
>>> +INHIBIT_DEFAULT_DEPS = "1"
>>> +
>>> +STAGINGCC = "gcc-cross-initial-${TARGET_ARCH}"
>>> +STAGINGCC_class-nativesdk = "gcc-crosssdk-initial-${SDK_SYS}"
>>> +
>>> +DEPENDS = "virtual/${TARGET_PREFIX}binutils \
>>> +           virtual/${TARGET_PREFIX}gcc-initial \
>>> +"
>>> +
>>> +do_configure[noexec] = "1"
>>> +
>>> +S = "${WORKDIR}"
>>> +
>>> +do_compile() {
>>> +       ${CC} ${CPPFLAGS} ${CFLAGS} -c ssp-local.c -o ssp-local.o
>>> +       ${AR} r libssp_nonshared.a ssp-local.o
>>> +}
>>> +do_install() {
>>> +       install -Dm 0644 ${B}/libssp_nonshared.a ${D}${base_libdir}/libssp_nonshared.a
>>> +}
>>> +#
>>> +# We will skip parsing for non-musl systems
>>> +#
>>> +COMPATIBLE_HOST = ".*-musl.*"
>>> +RDEPENDS_${PN}-staticdev = ""
>>> +RDEPENDS_${PN}-dev = ""
>>> +RRECOMMENDS_${PN}-dbg = "${PN}-staticdev (= ${EXTENDPKGV})"
>>> diff --git a/meta/recipes-core/musl/libssp-nonshared/ssp-local.c b/meta/recipes-core/musl/libssp-nonshared/ssp-local.c
>>> new file mode 100644
>>> index 0000000000..8f51afa2c1
>>> --- /dev/null
>>> +++ b/meta/recipes-core/musl/libssp-nonshared/ssp-local.c
>>> @@ -0,0 +1,45 @@
>>> +/* Stack protector support.
>>> +   Copyright (C) 2005-2018 Free Software Foundation, Inc.
>>> +
>>> +This file is part of GCC.
>>> +
>>> +GCC is free software; you can redistribute it and/or modify it under
>>> +the terms of the GNU General Public License as published by the Free
>>> +Software Foundation; either version 3, or (at your option) any later
>>> +version.
>>> +
>>> +In addition to the permissions in the GNU General Public License, the
>>> +Free Software Foundation gives you unlimited permission to link the
>>> +compiled version of this file into combinations with other programs,
>>> +and to distribute those combinations without any restriction coming
>>> +from the use of this file.  (The General Public License restrictions
>>> +do apply in other respects; for example, they cover modification of
>>> +the file, and distribution when not linked into a combine
>>> +executable.)
>>> +
>>> +GCC is distributed in the hope that it will be useful, but WITHOUT ANY
>>> +WARRANTY; without even the implied warranty of MERCHANTABILITY or
>>> +FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
>>> +for more details.
>>> +
>>> +Under Section 7 of GPL version 3, you are granted additional
>>> +permissions described in the GCC Runtime Library Exception, version
>>> +3.1, as published by the Free Software Foundation.
>>> +
>>> +You should have received a copy of the GNU General Public License and
>>> +a copy of the GCC Runtime Library Exception along with this program;
>>> +see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
>>> +<http://www.gnu.org/licenses/>.  */
>>> +
>>> +extern void __stack_chk_fail (void);
>>> +
>>> +/* Some targets can avoid loading a GP for calls to hidden functions.
>>> +   Using this entry point may avoid the load of a GP entirely for the
>>> +   function, making the overall code smaller.  */
>>> +
>>> +void
>>> +__attribute__((visibility ("hidden")))
>>> +__stack_chk_fail_local (void)
>>> +{
>>> +  __stack_chk_fail ();
>>> +}
>>> --
>>> 2.17.0
>>>
>>> --
>>> _______________________________________________
>>> Openembedded-core mailing list
>>> Openembedded-core@lists.openembedded.org
>>> http://lists.openembedded.org/mailman/listinfo/openembedded-core


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

* Re: [PATCH V2 1/6] libssp-nonshared: Add recipe
  2018-04-30 15:05     ` Burton, Ross
@ 2018-04-30 15:21       ` Burton, Ross
  2018-04-30 15:25         ` Khem Raj
  0 siblings, 1 reply; 11+ messages in thread
From: Burton, Ross @ 2018-04-30 15:21 UTC (permalink / raw)
  To: Khem Raj; +Cc: OE-core

Now I've actually read what you wrote, I see I didn't miss it ;)

Now it fails like this:

ERROR: Nothing RPROVIDES 'rpcsvc-proto' (but
/home/pokybuild/yocto-autobuilder/yocto-worker/build-appliance/build/meta/recipes-core/packagegroups/packagegroup-self-hosted.bb
RDEPENDS on or otherwise requires it)

Also:

NOTE: Multiple providers are available for virtual/crypt (glibc, musl)
Consider defining a PREFERRED_PROVIDER entry to match virtual/crypt

Ross

On 30 April 2018 at 16:05, Burton, Ross <ross.burton@intel.com> wrote:
> Oh yes, sorry missed that when I was trying to pick up just the SSP changes.
>
> Ross
>
> On 30 April 2018 at 15:17, Khem Raj <raj.khem@gmail.com> wrote:
>> On Mon, Apr 30, 2018 at 6:08 AM, Burton, Ross <ross.burton@intel.com> wrote:
>>> build-appliance is failing at SDK creation time:
>>>
>>>  Problem: package packagegroup-self-hosted-1.0-r13.0.noarch requires
>>> packagegroup-self-hosted-sdk, but none of the providers can be
>>> installed
>>>   - conflicting requests
>>>   - nothing provides libssp-dev needed by
>>> packagegroup-self-hosted-sdk-1.0-r13.0.noarch
>>>
>>
>> we do not need libssp there, I have sent a patch to remove it from packagegroup
>> http://git.openembedded.org/openembedded-core-contrib/commit/?h=kraj/pu&id=03e113aedd069ea97f2f3ce96fc8337e3601732b
>>
>>> Ross
>>>
>>> On 20 April 2018 at 17:33, Khem Raj <raj.khem@gmail.com> wrote:
>>>> libssp-nonshared is a minimal gcc runtime piece which is needed
>>>> on non-glibc systems which do implement libssp APIs in libc
>>>>
>>>> Signed-off-by: Khem Raj <raj.khem@gmail.com>
>>>> ---
>>>> Changes since v1:
>>>> - Package into staticdev package
>>>>
>>>>  meta/recipes-core/musl/libssp-nonshared.bb    | 39 ++++++++++++++++
>>>>  .../musl/libssp-nonshared/ssp-local.c         | 45 +++++++++++++++++++
>>>>  2 files changed, 84 insertions(+)
>>>>  create mode 100644 meta/recipes-core/musl/libssp-nonshared.bb
>>>>  create mode 100644 meta/recipes-core/musl/libssp-nonshared/ssp-local.c
>>>>
>>>> diff --git a/meta/recipes-core/musl/libssp-nonshared.bb b/meta/recipes-core/musl/libssp-nonshared.bb
>>>> new file mode 100644
>>>> index 0000000000..00a0a3d411
>>>> --- /dev/null
>>>> +++ b/meta/recipes-core/musl/libssp-nonshared.bb
>>>> @@ -0,0 +1,39 @@
>>>> +# Copyright (C) 2018 Khem Raj <raj.khem@gmail.com>
>>>> +# Released under the MIT license (see COPYING.MIT for the terms)
>>>> +
>>>> +SUMMARY = "Minimal libssp_nonshared.a must needed for ssp to work with gcc on musl"
>>>> +LICENSE = "GPL-3.0-with-GCC-exception"
>>>> +LIC_FILES_CHKSUM = "file://ssp-local.c;beginline=1;endline=32;md5=c06d391208c0cfcbc541a6728ed65cc4"
>>>> +SECTION = "libs"
>>>> +
>>>> +SRC_URI = "file://ssp-local.c"
>>>> +
>>>> +PATH_prepend = "${STAGING_BINDIR_TOOLCHAIN}.${STAGINGCC}:"
>>>> +
>>>> +INHIBIT_DEFAULT_DEPS = "1"
>>>> +
>>>> +STAGINGCC = "gcc-cross-initial-${TARGET_ARCH}"
>>>> +STAGINGCC_class-nativesdk = "gcc-crosssdk-initial-${SDK_SYS}"
>>>> +
>>>> +DEPENDS = "virtual/${TARGET_PREFIX}binutils \
>>>> +           virtual/${TARGET_PREFIX}gcc-initial \
>>>> +"
>>>> +
>>>> +do_configure[noexec] = "1"
>>>> +
>>>> +S = "${WORKDIR}"
>>>> +
>>>> +do_compile() {
>>>> +       ${CC} ${CPPFLAGS} ${CFLAGS} -c ssp-local.c -o ssp-local.o
>>>> +       ${AR} r libssp_nonshared.a ssp-local.o
>>>> +}
>>>> +do_install() {
>>>> +       install -Dm 0644 ${B}/libssp_nonshared.a ${D}${base_libdir}/libssp_nonshared.a
>>>> +}
>>>> +#
>>>> +# We will skip parsing for non-musl systems
>>>> +#
>>>> +COMPATIBLE_HOST = ".*-musl.*"
>>>> +RDEPENDS_${PN}-staticdev = ""
>>>> +RDEPENDS_${PN}-dev = ""
>>>> +RRECOMMENDS_${PN}-dbg = "${PN}-staticdev (= ${EXTENDPKGV})"
>>>> diff --git a/meta/recipes-core/musl/libssp-nonshared/ssp-local.c b/meta/recipes-core/musl/libssp-nonshared/ssp-local.c
>>>> new file mode 100644
>>>> index 0000000000..8f51afa2c1
>>>> --- /dev/null
>>>> +++ b/meta/recipes-core/musl/libssp-nonshared/ssp-local.c
>>>> @@ -0,0 +1,45 @@
>>>> +/* Stack protector support.
>>>> +   Copyright (C) 2005-2018 Free Software Foundation, Inc.
>>>> +
>>>> +This file is part of GCC.
>>>> +
>>>> +GCC is free software; you can redistribute it and/or modify it under
>>>> +the terms of the GNU General Public License as published by the Free
>>>> +Software Foundation; either version 3, or (at your option) any later
>>>> +version.
>>>> +
>>>> +In addition to the permissions in the GNU General Public License, the
>>>> +Free Software Foundation gives you unlimited permission to link the
>>>> +compiled version of this file into combinations with other programs,
>>>> +and to distribute those combinations without any restriction coming
>>>> +from the use of this file.  (The General Public License restrictions
>>>> +do apply in other respects; for example, they cover modification of
>>>> +the file, and distribution when not linked into a combine
>>>> +executable.)
>>>> +
>>>> +GCC is distributed in the hope that it will be useful, but WITHOUT ANY
>>>> +WARRANTY; without even the implied warranty of MERCHANTABILITY or
>>>> +FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
>>>> +for more details.
>>>> +
>>>> +Under Section 7 of GPL version 3, you are granted additional
>>>> +permissions described in the GCC Runtime Library Exception, version
>>>> +3.1, as published by the Free Software Foundation.
>>>> +
>>>> +You should have received a copy of the GNU General Public License and
>>>> +a copy of the GCC Runtime Library Exception along with this program;
>>>> +see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
>>>> +<http://www.gnu.org/licenses/>.  */
>>>> +
>>>> +extern void __stack_chk_fail (void);
>>>> +
>>>> +/* Some targets can avoid loading a GP for calls to hidden functions.
>>>> +   Using this entry point may avoid the load of a GP entirely for the
>>>> +   function, making the overall code smaller.  */
>>>> +
>>>> +void
>>>> +__attribute__((visibility ("hidden")))
>>>> +__stack_chk_fail_local (void)
>>>> +{
>>>> +  __stack_chk_fail ();
>>>> +}
>>>> --
>>>> 2.17.0
>>>>
>>>> --
>>>> _______________________________________________
>>>> Openembedded-core mailing list
>>>> Openembedded-core@lists.openembedded.org
>>>> http://lists.openembedded.org/mailman/listinfo/openembedded-core


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

* Re: [PATCH V2 1/6] libssp-nonshared: Add recipe
  2018-04-30 15:21       ` Burton, Ross
@ 2018-04-30 15:25         ` Khem Raj
  0 siblings, 0 replies; 11+ messages in thread
From: Khem Raj @ 2018-04-30 15:25 UTC (permalink / raw)
  To: Burton, Ross; +Cc: OE-core

On Mon, Apr 30, 2018 at 8:21 AM, Burton, Ross <ross.burton@intel.com> wrote:
> Now I've actually read what you wrote, I see I didn't miss it ;)
>
> Now it fails like this:
>
> ERROR: Nothing RPROVIDES 'rpcsvc-proto' (but
> /home/pokybuild/yocto-autobuilder/yocto-worker/build-appliance/build/meta/recipes-core/packagegroups/packagegroup-self-hosted.bb
> RDEPENDS on or otherwise requires it)
>

yeah, please drop the prior patches from me and pick kraj/pu branch
from oe-core contrib repo. That has all latest changes.

> Also:
>
> NOTE: Multiple providers are available for virtual/crypt (glibc, musl)
> Consider defining a PREFERRED_PROVIDER entry to match virtual/crypt
>
> Ross
>
> On 30 April 2018 at 16:05, Burton, Ross <ross.burton@intel.com> wrote:
>> Oh yes, sorry missed that when I was trying to pick up just the SSP changes.
>>
>> Ross
>>
>> On 30 April 2018 at 15:17, Khem Raj <raj.khem@gmail.com> wrote:
>>> On Mon, Apr 30, 2018 at 6:08 AM, Burton, Ross <ross.burton@intel.com> wrote:
>>>> build-appliance is failing at SDK creation time:
>>>>
>>>>  Problem: package packagegroup-self-hosted-1.0-r13.0.noarch requires
>>>> packagegroup-self-hosted-sdk, but none of the providers can be
>>>> installed
>>>>   - conflicting requests
>>>>   - nothing provides libssp-dev needed by
>>>> packagegroup-self-hosted-sdk-1.0-r13.0.noarch
>>>>
>>>
>>> we do not need libssp there, I have sent a patch to remove it from packagegroup
>>> http://git.openembedded.org/openembedded-core-contrib/commit/?h=kraj/pu&id=03e113aedd069ea97f2f3ce96fc8337e3601732b
>>>
>>>> Ross
>>>>
>>>> On 20 April 2018 at 17:33, Khem Raj <raj.khem@gmail.com> wrote:
>>>>> libssp-nonshared is a minimal gcc runtime piece which is needed
>>>>> on non-glibc systems which do implement libssp APIs in libc
>>>>>
>>>>> Signed-off-by: Khem Raj <raj.khem@gmail.com>
>>>>> ---
>>>>> Changes since v1:
>>>>> - Package into staticdev package
>>>>>
>>>>>  meta/recipes-core/musl/libssp-nonshared.bb    | 39 ++++++++++++++++
>>>>>  .../musl/libssp-nonshared/ssp-local.c         | 45 +++++++++++++++++++
>>>>>  2 files changed, 84 insertions(+)
>>>>>  create mode 100644 meta/recipes-core/musl/libssp-nonshared.bb
>>>>>  create mode 100644 meta/recipes-core/musl/libssp-nonshared/ssp-local.c
>>>>>
>>>>> diff --git a/meta/recipes-core/musl/libssp-nonshared.bb b/meta/recipes-core/musl/libssp-nonshared.bb
>>>>> new file mode 100644
>>>>> index 0000000000..00a0a3d411
>>>>> --- /dev/null
>>>>> +++ b/meta/recipes-core/musl/libssp-nonshared.bb
>>>>> @@ -0,0 +1,39 @@
>>>>> +# Copyright (C) 2018 Khem Raj <raj.khem@gmail.com>
>>>>> +# Released under the MIT license (see COPYING.MIT for the terms)
>>>>> +
>>>>> +SUMMARY = "Minimal libssp_nonshared.a must needed for ssp to work with gcc on musl"
>>>>> +LICENSE = "GPL-3.0-with-GCC-exception"
>>>>> +LIC_FILES_CHKSUM = "file://ssp-local.c;beginline=1;endline=32;md5=c06d391208c0cfcbc541a6728ed65cc4"
>>>>> +SECTION = "libs"
>>>>> +
>>>>> +SRC_URI = "file://ssp-local.c"
>>>>> +
>>>>> +PATH_prepend = "${STAGING_BINDIR_TOOLCHAIN}.${STAGINGCC}:"
>>>>> +
>>>>> +INHIBIT_DEFAULT_DEPS = "1"
>>>>> +
>>>>> +STAGINGCC = "gcc-cross-initial-${TARGET_ARCH}"
>>>>> +STAGINGCC_class-nativesdk = "gcc-crosssdk-initial-${SDK_SYS}"
>>>>> +
>>>>> +DEPENDS = "virtual/${TARGET_PREFIX}binutils \
>>>>> +           virtual/${TARGET_PREFIX}gcc-initial \
>>>>> +"
>>>>> +
>>>>> +do_configure[noexec] = "1"
>>>>> +
>>>>> +S = "${WORKDIR}"
>>>>> +
>>>>> +do_compile() {
>>>>> +       ${CC} ${CPPFLAGS} ${CFLAGS} -c ssp-local.c -o ssp-local.o
>>>>> +       ${AR} r libssp_nonshared.a ssp-local.o
>>>>> +}
>>>>> +do_install() {
>>>>> +       install -Dm 0644 ${B}/libssp_nonshared.a ${D}${base_libdir}/libssp_nonshared.a
>>>>> +}
>>>>> +#
>>>>> +# We will skip parsing for non-musl systems
>>>>> +#
>>>>> +COMPATIBLE_HOST = ".*-musl.*"
>>>>> +RDEPENDS_${PN}-staticdev = ""
>>>>> +RDEPENDS_${PN}-dev = ""
>>>>> +RRECOMMENDS_${PN}-dbg = "${PN}-staticdev (= ${EXTENDPKGV})"
>>>>> diff --git a/meta/recipes-core/musl/libssp-nonshared/ssp-local.c b/meta/recipes-core/musl/libssp-nonshared/ssp-local.c
>>>>> new file mode 100644
>>>>> index 0000000000..8f51afa2c1
>>>>> --- /dev/null
>>>>> +++ b/meta/recipes-core/musl/libssp-nonshared/ssp-local.c
>>>>> @@ -0,0 +1,45 @@
>>>>> +/* Stack protector support.
>>>>> +   Copyright (C) 2005-2018 Free Software Foundation, Inc.
>>>>> +
>>>>> +This file is part of GCC.
>>>>> +
>>>>> +GCC is free software; you can redistribute it and/or modify it under
>>>>> +the terms of the GNU General Public License as published by the Free
>>>>> +Software Foundation; either version 3, or (at your option) any later
>>>>> +version.
>>>>> +
>>>>> +In addition to the permissions in the GNU General Public License, the
>>>>> +Free Software Foundation gives you unlimited permission to link the
>>>>> +compiled version of this file into combinations with other programs,
>>>>> +and to distribute those combinations without any restriction coming
>>>>> +from the use of this file.  (The General Public License restrictions
>>>>> +do apply in other respects; for example, they cover modification of
>>>>> +the file, and distribution when not linked into a combine
>>>>> +executable.)
>>>>> +
>>>>> +GCC is distributed in the hope that it will be useful, but WITHOUT ANY
>>>>> +WARRANTY; without even the implied warranty of MERCHANTABILITY or
>>>>> +FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
>>>>> +for more details.
>>>>> +
>>>>> +Under Section 7 of GPL version 3, you are granted additional
>>>>> +permissions described in the GCC Runtime Library Exception, version
>>>>> +3.1, as published by the Free Software Foundation.
>>>>> +
>>>>> +You should have received a copy of the GNU General Public License and
>>>>> +a copy of the GCC Runtime Library Exception along with this program;
>>>>> +see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
>>>>> +<http://www.gnu.org/licenses/>.  */
>>>>> +
>>>>> +extern void __stack_chk_fail (void);
>>>>> +
>>>>> +/* Some targets can avoid loading a GP for calls to hidden functions.
>>>>> +   Using this entry point may avoid the load of a GP entirely for the
>>>>> +   function, making the overall code smaller.  */
>>>>> +
>>>>> +void
>>>>> +__attribute__((visibility ("hidden")))
>>>>> +__stack_chk_fail_local (void)
>>>>> +{
>>>>> +  __stack_chk_fail ();
>>>>> +}
>>>>> --
>>>>> 2.17.0
>>>>>
>>>>> --
>>>>> _______________________________________________
>>>>> Openembedded-core mailing list
>>>>> Openembedded-core@lists.openembedded.org
>>>>> http://lists.openembedded.org/mailman/listinfo/openembedded-core


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

end of thread, other threads:[~2018-04-30 15:25 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-20 16:33 [PATCH V2 1/6] libssp-nonshared: Add recipe Khem Raj
2018-04-20 16:33 ` [PATCH V2 2/6] musl: Depend on libssp-nonshared Khem Raj
2018-04-20 16:33 ` [PATCH v3 3/6] gcc-runtime: Disable gcc version of libssp Khem Raj
2018-04-20 16:33 ` [PATCH V2 4/6] libunwind: Drop adding libssp to linker flags Khem Raj
2018-04-20 16:33 ` [PATCH V3 5/6] musl: Upgrade to latest Khem Raj
2018-04-20 16:33 ` [PATCH 6/6] llvm: Fix [compile-host-path] QA issue Khem Raj
2018-04-30 13:08 ` [PATCH V2 1/6] libssp-nonshared: Add recipe Burton, Ross
2018-04-30 14:17   ` Khem Raj
2018-04-30 15:05     ` Burton, Ross
2018-04-30 15:21       ` Burton, Ross
2018-04-30 15:25         ` Khem Raj

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.