All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/6] Add riscv64 build host support
@ 2023-11-02 19:02 Khem Raj
  2023-11-02 19:02 ` [PATCH 1/6] poky: Do not inherit uninative on ppc64le and riscv64 hosts Khem Raj
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Khem Raj @ 2023-11-02 19:02 UTC (permalink / raw)
  To: openembedded-core

These are initial general fixes which helps in building OE/YP on RISCV64 build
hosts.

Khem Raj (6):
  poky: Do not inherit uninative on ppc64le and riscv64 hosts
  meson: Add check for riscv64 in link template
  machine-sdk: Add SDK_ARCH for riscv64
  uninative.bbclass: Add ldso information for riscv64
  rust-cross-canadian: Add riscv64 to cross-canadian hosts
  cdrtools: Fix build on riscv64

 meta-poky/conf/distro/poky.conf               |  2 +-
 meta/classes-global/uninative.bbclass         |  2 +-
 meta/conf/machine-sdk/riscv64.conf            |  2 +
 .../cdrtools/cdrtools-native_3.01.bb          |  9 +++
 .../cdrtools/cdrtools/riscv64-linux-gcc.rul   | 65 +++++++++++++++++++
 meta/recipes-devtools/meson/meson_1.2.2.bb    |  2 +
 .../rust/rust-cross-canadian.inc              |  2 +-
 7 files changed, 81 insertions(+), 3 deletions(-)
 create mode 100644 meta/conf/machine-sdk/riscv64.conf
 create mode 100644 meta/recipes-devtools/cdrtools/cdrtools/riscv64-linux-gcc.rul

-- 
2.42.0



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

* [PATCH 1/6] poky: Do not inherit uninative on ppc64le and riscv64 hosts
  2023-11-02 19:02 [PATCH 0/6] Add riscv64 build host support Khem Raj
@ 2023-11-02 19:02 ` Khem Raj
  2023-11-02 19:02 ` [PATCH 2/6] meson: Add check for riscv64 in link template Khem Raj
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Khem Raj @ 2023-11-02 19:02 UTC (permalink / raw)
  To: openembedded-core

uninative tarballs for these architectures is not available

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 meta-poky/conf/distro/poky.conf | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta-poky/conf/distro/poky.conf b/meta-poky/conf/distro/poky.conf
index e742666b4e5..ccad9c835a7 100644
--- a/meta-poky/conf/distro/poky.conf
+++ b/meta-poky/conf/distro/poky.conf
@@ -62,7 +62,7 @@ require conf/distro/include/poky-world-exclude.inc
 require conf/distro/include/no-static-libs.inc
 require conf/distro/include/yocto-uninative.inc
 require conf/distro/include/security_flags.inc
-INHERIT += "uninative"
+INHERIT += "${@bb.utils.contains_any('BUILD_ARCH', 'ppc64le riscv64', '', 'uninative', d)}"
 
 BB_SIGNATURE_HANDLER ?= "OEEquivHash"
 BB_HASHSERVE ??= "auto"
-- 
2.42.0



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

* [PATCH 2/6] meson: Add check for riscv64 in link template
  2023-11-02 19:02 [PATCH 0/6] Add riscv64 build host support Khem Raj
  2023-11-02 19:02 ` [PATCH 1/6] poky: Do not inherit uninative on ppc64le and riscv64 hosts Khem Raj
@ 2023-11-02 19:02 ` Khem Raj
  2023-11-02 19:02 ` [PATCH 3/6] machine-sdk: Add SDK_ARCH for riscv64 Khem Raj
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Khem Raj @ 2023-11-02 19:02 UTC (permalink / raw)
  To: openembedded-core

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 meta/recipes-devtools/meson/meson_1.2.2.bb | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/meta/recipes-devtools/meson/meson_1.2.2.bb b/meta/recipes-devtools/meson/meson_1.2.2.bb
index 6a07168ee1b..c38d88fe61f 100644
--- a/meta/recipes-devtools/meson/meson_1.2.2.bb
+++ b/meta/recipes-devtools/meson/meson_1.2.2.bb
@@ -66,6 +66,8 @@ def generate_native_link_template(d):
         loader = 'ld64.so.2'
     elif 'loongarch64' in build_arch:
         loader = 'ld-linux-loongarch-lp64d.so.1'
+    elif 'riscv64' in build_arch:
+        loader = 'ld-linux-riscv64-lp64d.so.1'
 
     if loader:
         val += ['-Wl,--dynamic-linker=@{OECORE_NATIVE_SYSROOT}${base_libdir_native}/' + loader]
-- 
2.42.0



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

* [PATCH 3/6] machine-sdk: Add SDK_ARCH for riscv64
  2023-11-02 19:02 [PATCH 0/6] Add riscv64 build host support Khem Raj
  2023-11-02 19:02 ` [PATCH 1/6] poky: Do not inherit uninative on ppc64le and riscv64 hosts Khem Raj
  2023-11-02 19:02 ` [PATCH 2/6] meson: Add check for riscv64 in link template Khem Raj
@ 2023-11-02 19:02 ` Khem Raj
  2023-11-02 19:02 ` [PATCH 4/6] uninative.bbclass: Add ldso information " Khem Raj
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Khem Raj @ 2023-11-02 19:02 UTC (permalink / raw)
  To: openembedded-core

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 meta/conf/machine-sdk/riscv64.conf | 2 ++
 1 file changed, 2 insertions(+)
 create mode 100644 meta/conf/machine-sdk/riscv64.conf

diff --git a/meta/conf/machine-sdk/riscv64.conf b/meta/conf/machine-sdk/riscv64.conf
new file mode 100644
index 00000000000..3f4a5af0af7
--- /dev/null
+++ b/meta/conf/machine-sdk/riscv64.conf
@@ -0,0 +1,2 @@
+SDK_ARCH = "riscv64"
+ABIEXTENSION:class-nativesdk = ""
-- 
2.42.0



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

* [PATCH 4/6] uninative.bbclass: Add ldso information for riscv64
  2023-11-02 19:02 [PATCH 0/6] Add riscv64 build host support Khem Raj
                   ` (2 preceding siblings ...)
  2023-11-02 19:02 ` [PATCH 3/6] machine-sdk: Add SDK_ARCH for riscv64 Khem Raj
@ 2023-11-02 19:02 ` Khem Raj
  2023-11-02 19:02 ` [PATCH 5/6] rust-cross-canadian: Add riscv64 to cross-canadian hosts Khem Raj
  2023-11-02 19:02 ` [PATCH 6/6] cdrtools: Fix build on riscv64 Khem Raj
  5 siblings, 0 replies; 7+ messages in thread
From: Khem Raj @ 2023-11-02 19:02 UTC (permalink / raw)
  To: openembedded-core

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 meta/classes-global/uninative.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/classes-global/uninative.bbclass b/meta/classes-global/uninative.bbclass
index 9630726f330..9b8b4565dd4 100644
--- a/meta/classes-global/uninative.bbclass
+++ b/meta/classes-global/uninative.bbclass
@@ -4,7 +4,7 @@
 # SPDX-License-Identifier: MIT
 #
 
-UNINATIVE_LOADER ?= "${UNINATIVE_STAGING_DIR}-uninative/${BUILD_ARCH}-linux/lib/${@bb.utils.contains('BUILD_ARCH', 'x86_64', 'ld-linux-x86-64.so.2', '', d)}${@bb.utils.contains('BUILD_ARCH', 'i686', 'ld-linux.so.2', '', d)}${@bb.utils.contains('BUILD_ARCH', 'aarch64', 'ld-linux-aarch64.so.1', '', d)}${@bb.utils.contains('BUILD_ARCH', 'ppc64le', 'ld64.so.2', '', d)}"
+UNINATIVE_LOADER ?= "${UNINATIVE_STAGING_DIR}-uninative/${BUILD_ARCH}-linux/lib/${@bb.utils.contains('BUILD_ARCH', 'x86_64', 'ld-linux-x86-64.so.2', '', d)}${@bb.utils.contains('BUILD_ARCH', 'i686', 'ld-linux.so.2', '', d)}${@bb.utils.contains('BUILD_ARCH', 'aarch64', 'ld-linux-aarch64.so.1', '', d)}${@bb.utils.contains('BUILD_ARCH', 'ppc64le', 'ld64.so.2', '', d)}${@bb.utils.contains('BUILD_ARCH', 'riscv64', 'ld-linux-riscv64-lp64d.so.1', '', d)}"
 UNINATIVE_STAGING_DIR ?= "${STAGING_DIR}"
 
 UNINATIVE_URL ?= "unset"
-- 
2.42.0



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

* [PATCH 5/6] rust-cross-canadian: Add riscv64 to cross-canadian hosts
  2023-11-02 19:02 [PATCH 0/6] Add riscv64 build host support Khem Raj
                   ` (3 preceding siblings ...)
  2023-11-02 19:02 ` [PATCH 4/6] uninative.bbclass: Add ldso information " Khem Raj
@ 2023-11-02 19:02 ` Khem Raj
  2023-11-02 19:02 ` [PATCH 6/6] cdrtools: Fix build on riscv64 Khem Raj
  5 siblings, 0 replies; 7+ messages in thread
From: Khem Raj @ 2023-11-02 19:02 UTC (permalink / raw)
  To: openembedded-core

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 meta/recipes-devtools/rust/rust-cross-canadian.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/recipes-devtools/rust/rust-cross-canadian.inc b/meta/recipes-devtools/rust/rust-cross-canadian.inc
index baa58e98385..7bfef6d1759 100644
--- a/meta/recipes-devtools/rust/rust-cross-canadian.inc
+++ b/meta/recipes-devtools/rust/rust-cross-canadian.inc
@@ -56,7 +56,7 @@ do_install () {
 
     RUST_TARGET_TRIPLE=`echo ${RUST_TARGET_SYS} | tr '[:lower:]' '[:upper:]' | sed 's/-/_/g'`
     RUST_HOST_TRIPLE=`echo ${RUST_HOST_SYS} | tr '[:lower:]' '[:upper:]' | sed 's/-/_/g'`
-    SDKLOADER=${@bb.utils.contains('SDK_ARCH', 'x86_64', 'ld-linux-x86-64.so.2', '', d)}${@bb.utils.contains('SDK_ARCH', 'i686', 'ld-linux.so.2', '', d)}${@bb.utils.contains('SDK_ARCH', 'aarch64', 'ld-linux-aarch64.so.1', '', d)}${@bb.utils.contains('SDK_ARCH', 'ppc64le', 'ld64.so.2', '', d)}
+    SDKLOADER=${@bb.utils.contains('SDK_ARCH', 'x86_64', 'ld-linux-x86-64.so.2', '', d)}${@bb.utils.contains('SDK_ARCH', 'i686', 'ld-linux.so.2', '', d)}${@bb.utils.contains('SDK_ARCH', 'aarch64', 'ld-linux-aarch64.so.1', '', d)}${@bb.utils.contains('SDK_ARCH', 'ppc64le', 'ld64.so.2', '', d)}${@bb.utils.contains('SDK_ARCH', 'riscv64', 'ld-linux-riscv64-lp64d.so.1', '', d)}
 
     cat <<- EOF > "${RUST_ENV_SETUP_SH}"
 	export CARGO_TARGET_${RUST_TARGET_TRIPLE}_RUSTFLAGS="--sysroot=\$OECORE_TARGET_SYSROOT/usr -C link-arg=--sysroot=\$OECORE_TARGET_SYSROOT"
-- 
2.42.0



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

* [PATCH 6/6] cdrtools: Fix build on riscv64
  2023-11-02 19:02 [PATCH 0/6] Add riscv64 build host support Khem Raj
                   ` (4 preceding siblings ...)
  2023-11-02 19:02 ` [PATCH 5/6] rust-cross-canadian: Add riscv64 to cross-canadian hosts Khem Raj
@ 2023-11-02 19:02 ` Khem Raj
  5 siblings, 0 replies; 7+ messages in thread
From: Khem Raj @ 2023-11-02 19:02 UTC (permalink / raw)
  To: openembedded-core

Copy riscv64 gcc config from schilytools

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 .../cdrtools/cdrtools-native_3.01.bb          |  9 +++
 .../cdrtools/cdrtools/riscv64-linux-gcc.rul   | 65 +++++++++++++++++++
 2 files changed, 74 insertions(+)
 create mode 100644 meta/recipes-devtools/cdrtools/cdrtools/riscv64-linux-gcc.rul

diff --git a/meta/recipes-devtools/cdrtools/cdrtools-native_3.01.bb b/meta/recipes-devtools/cdrtools/cdrtools-native_3.01.bb
index 757132eae64..bf8be1ad0c0 100644
--- a/meta/recipes-devtools/cdrtools/cdrtools-native_3.01.bb
+++ b/meta/recipes-devtools/cdrtools/cdrtools-native_3.01.bb
@@ -8,9 +8,12 @@ SECTION = "console/utils"
 LICENSE = "GPL-2.0-only & CDDL-1.0 & LGPL-2.1-or-later"
 LIC_FILES_CHKSUM = "file://COPYING;md5=32f68170be424c2cd64804337726b312"
 
+DEPENDS += "gnu-config-native"
+
 SRC_URI = " \
 	${SOURCEFORGE_MIRROR}/project/cdrtools/cdrtools-${PV}.tar.bz2 \
 	file://0001-Don-t-set-uid-gid-during-install.patch \
+        file://riscv64-linux-gcc.rul \
 	"
 
 SRC_URI[md5sum] = "7d45c5b7e1f78d85d1583b361aee6e8b"
@@ -23,6 +26,12 @@ export ac_cv_prog_CC = "${CC}"
 
 inherit native
 
+do_configure() {
+        install -m 0755 ${STAGING_DATADIR_NATIVE}/gnu-config/config.sub ${S}/autoconf
+        install -m 0755 ${STAGING_DATADIR_NATIVE}/gnu-config/config.guess ${S}/autoconf
+        install -m 0644 ${WORKDIR}/riscv64-linux-gcc.rul ${S}/RULES/
+}
+
 do_install() {
 	make install GMAKE_NOWARN=true INS_BASE=${prefix} DESTDIR=${D}
 }
diff --git a/meta/recipes-devtools/cdrtools/cdrtools/riscv64-linux-gcc.rul b/meta/recipes-devtools/cdrtools/cdrtools/riscv64-linux-gcc.rul
new file mode 100644
index 00000000000..3e930225dce
--- /dev/null
+++ b/meta/recipes-devtools/cdrtools/cdrtools/riscv64-linux-gcc.rul
@@ -0,0 +1,65 @@
+#ident "@(#)i586-linux-gcc.rul	1.18 18/11/07 "
+###########################################################################
+# Written 1996-2018 by J. Schilling
+###########################################################################
+#
+# Platform dependent MACROS for Linux
+#
+###########################################################################
+# Copyright (c) J. Schilling
+###########################################################################
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License, Version 1.0 only
+# (the "License").  You may not use this file except in compliance
+# with the License.
+#
+# See the file CDDL.Schily.txt in this distribution for details.
+# A copy of the CDDL is also available via the Internet at
+# http://www.opensource.org/licenses/cddl1.txt
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file CDDL.Schily.txt from this distribution.
+###########################################################################
+include $(SRCROOT)/$(RULESDIR)/rules.prg
+###########################################################################
+include $(SRCROOT)/$(RULESDIR)/cc-$(C_ARCH).rul
+
+#
+# LINUX_SRC_INCLUDE is defined in DEFAULTS/Defaults.linux
+#
+INCDIRSX +=	$(LINUX_SRC_INCLUDE)
+OSDEFS +=
+
+KDEFINES=	-DKERNEL -D_KERNEL
+
+LIB_PREFIX=	lib
+LIB_SUFFIX=	.a
+SHL_SUFFIX=	.so.$(DYNMAJOR).$(DYNMINOR)
+
+LIB_SOCKET=	
+LIB_MATH=	-lm
+LIB_KVM=	
+
+#
+# Sunpro C/C++ run on Solaris and Linux and both have linkers
+# that support mapfiles
+#
+MAPVERS=	$(_MAPVERS) # This enables to use mapfiles
+#
+# The GNU linker is buggy and does not like the official order in linker map
+# files for symbol versioning. The following command reverses the order of
+# the version names in the linker map file.
+#
+MAPFILE_POST=	| sed 's/^SCHILY/+SCHILY/' | tr '\012' '@' | tr '+' '\012' | sort -V |  tr '@' '\012'
+
+#LDOPTS=		$(LIBS_PATH) $(LDPATH) $(RUNPATH:-R%=-Wl,-R%)
+#
+# Uncomment the next line in case you are on an old Linux version that
+# does not support the -R linker flag.
+#
+#LDOPTS=		$(LIBS_PATH) $(LDPATH)
+LDOPTMAP=	$(PMAPVERS:%=-Wl,--version-script=%)
+LDOPTDYN=	-shared -Wl,-soname,$(TARGET) $(LDOPTMAP)
+
+LORDER=		echo
+TSORT=		cat
-- 
2.42.0



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

end of thread, other threads:[~2023-11-02 19:03 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-02 19:02 [PATCH 0/6] Add riscv64 build host support Khem Raj
2023-11-02 19:02 ` [PATCH 1/6] poky: Do not inherit uninative on ppc64le and riscv64 hosts Khem Raj
2023-11-02 19:02 ` [PATCH 2/6] meson: Add check for riscv64 in link template Khem Raj
2023-11-02 19:02 ` [PATCH 3/6] machine-sdk: Add SDK_ARCH for riscv64 Khem Raj
2023-11-02 19:02 ` [PATCH 4/6] uninative.bbclass: Add ldso information " Khem Raj
2023-11-02 19:02 ` [PATCH 5/6] rust-cross-canadian: Add riscv64 to cross-canadian hosts Khem Raj
2023-11-02 19:02 ` [PATCH 6/6] cdrtools: Fix build on riscv64 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.