* [PATCH 1/2] libssp-nonshared: Use a different implementation for __stack_chk_fail
@ 2021-06-11 2:44 Khem Raj
2021-06-11 2:44 ` [PATCH 2/2] qemuriscv: Enable 4 core emulation Khem Raj
0 siblings, 1 reply; 3+ messages in thread
From: Khem Raj @ 2021-06-11 2:44 UTC (permalink / raw)
To: openembedded-core; +Cc: Khem Raj
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
meta/recipes-core/musl/libssp-nonshared.bb | 11 ++---
.../musl/libssp-nonshared/ssp-local.c | 45 -------------------
.../musl/libssp-nonshared/stack_chk.c | 40 +++++++++++++++++
3 files changed, 46 insertions(+), 50 deletions(-)
delete mode 100644 meta/recipes-core/musl/libssp-nonshared/ssp-local.c
create mode 100644 meta/recipes-core/musl/libssp-nonshared/stack_chk.c
diff --git a/meta/recipes-core/musl/libssp-nonshared.bb b/meta/recipes-core/musl/libssp-nonshared.bb
index bae8c81cc7..81c87e8e8d 100644
--- a/meta/recipes-core/musl/libssp-nonshared.bb
+++ b/meta/recipes-core/musl/libssp-nonshared.bb
@@ -2,11 +2,12 @@
# 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"
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://stack_chk.c;beginline=1;endline=30;md5=97e59d9deee678a9332c9ddb2ab6360d"
SECTION = "libs"
-SRC_URI = "file://ssp-local.c"
+# Sourced from https://github.com/intel/linux-sgx/blob/master/sdk/compiler-rt/stack_chk.c
+SRC_URI = "file://stack_chk.c"
INHIBIT_DEFAULT_DEPS = "1"
@@ -19,8 +20,8 @@ do_configure[noexec] = "1"
S = "${WORKDIR}"
do_compile() {
- ${CC} ${CPPFLAGS} ${CFLAGS} -fPIE -c ssp-local.c -o ssp-local.o
- ${AR} r libssp_nonshared.a ssp-local.o
+ ${CC} ${CPPFLAGS} ${CFLAGS} -fPIE -c stack_chk.c -o stack_chk.o
+ ${AR} r libssp_nonshared.a stack_chk.o
}
do_install() {
install -Dm 0644 ${B}/libssp_nonshared.a ${D}${base_libdir}/libssp_nonshared.a
diff --git a/meta/recipes-core/musl/libssp-nonshared/ssp-local.c b/meta/recipes-core/musl/libssp-nonshared/ssp-local.c
deleted file mode 100644
index 8f51afa2c1..0000000000
--- a/meta/recipes-core/musl/libssp-nonshared/ssp-local.c
+++ /dev/null
@@ -1,45 +0,0 @@
-/* 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 ();
-}
diff --git a/meta/recipes-core/musl/libssp-nonshared/stack_chk.c b/meta/recipes-core/musl/libssp-nonshared/stack_chk.c
new file mode 100644
index 0000000000..097aae24b6
--- /dev/null
+++ b/meta/recipes-core/musl/libssp-nonshared/stack_chk.c
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2011-2021 Intel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in
+ * the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Intel Corporation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+extern void __attribute__((noreturn)) __stack_chk_fail(void);
+
+void
+__attribute__((noreturn))
+__attribute__((visibility ("hidden")))
+__stack_chk_fail_local (void)
+{
+ __stack_chk_fail ();
+}
--
2.32.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 2/2] qemuriscv: Enable 4 core emulation
2021-06-11 2:44 [PATCH 1/2] libssp-nonshared: Use a different implementation for __stack_chk_fail Khem Raj
@ 2021-06-11 2:44 ` Khem Raj
2021-06-11 6:03 ` [OE-core] " Alistair Francis
0 siblings, 1 reply; 3+ messages in thread
From: Khem Raj @ 2021-06-11 2:44 UTC (permalink / raw)
To: openembedded-core; +Cc: Khem Raj
Helps in running tests a bit faster
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
meta/conf/machine/include/riscv/qemuriscv.inc | 1 +
1 file changed, 1 insertion(+)
diff --git a/meta/conf/machine/include/riscv/qemuriscv.inc b/meta/conf/machine/include/riscv/qemuriscv.inc
index 428d28bde1..20e2d465a1 100644
--- a/meta/conf/machine/include/riscv/qemuriscv.inc
+++ b/meta/conf/machine/include/riscv/qemuriscv.inc
@@ -26,6 +26,7 @@ UBOOT_ENTRYPOINT_riscv32 = "0x80400000"
UBOOT_ENTRYPOINT_riscv64 = "0x80200000"
# qemuboot options
+QB_SMP = "-smp 4"
QB_KERNEL_CMDLINE_APPEND = "earlycon=sbi"
QB_MACHINE = "-machine virt"
QB_DEFAULT_BIOS = "fw_jump.elf"
--
2.32.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [OE-core] [PATCH 2/2] qemuriscv: Enable 4 core emulation
2021-06-11 2:44 ` [PATCH 2/2] qemuriscv: Enable 4 core emulation Khem Raj
@ 2021-06-11 6:03 ` Alistair Francis
0 siblings, 0 replies; 3+ messages in thread
From: Alistair Francis @ 2021-06-11 6:03 UTC (permalink / raw)
To: Khem Raj; +Cc: OE-core
On Fri, Jun 11, 2021 at 12:44 PM Khem Raj <raj.khem@gmail.com> wrote:
>
> Helps in running tests a bit faster
>
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Alistair
> ---
> meta/conf/machine/include/riscv/qemuriscv.inc | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/meta/conf/machine/include/riscv/qemuriscv.inc b/meta/conf/machine/include/riscv/qemuriscv.inc
> index 428d28bde1..20e2d465a1 100644
> --- a/meta/conf/machine/include/riscv/qemuriscv.inc
> +++ b/meta/conf/machine/include/riscv/qemuriscv.inc
> @@ -26,6 +26,7 @@ UBOOT_ENTRYPOINT_riscv32 = "0x80400000"
> UBOOT_ENTRYPOINT_riscv64 = "0x80200000"
>
> # qemuboot options
> +QB_SMP = "-smp 4"
> QB_KERNEL_CMDLINE_APPEND = "earlycon=sbi"
> QB_MACHINE = "-machine virt"
> QB_DEFAULT_BIOS = "fw_jump.elf"
> --
> 2.32.0
>
>
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-06-11 6:03 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-11 2:44 [PATCH 1/2] libssp-nonshared: Use a different implementation for __stack_chk_fail Khem Raj
2021-06-11 2:44 ` [PATCH 2/2] qemuriscv: Enable 4 core emulation Khem Raj
2021-06-11 6:03 ` [OE-core] " Alistair Francis
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.