* [gentoo-alt] [PATCH 1/7] scripts/bootstrap-prefix.sh: add OpenBSD CHOST detection
2022-06-04 4:33 [gentoo-alt] [PATCH 0/7] scripts/bootstrap-prefix.sh: initial OpenBSD support Anna Vyalkova
@ 2022-06-04 4:33 ` Anna Vyalkova
2022-06-04 4:33 ` [gentoo-alt] [PATCH 2/7] scripts/bootstrap-prefix.sh: add OpenBSD toolchain Anna Vyalkova
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Anna Vyalkova @ 2022-06-04 4:33 UTC (permalink / raw
To: gentoo-alt
Signed-off-by: Anna Vyalkova <cyber+gentoo@sysrq.in>
---
scripts/bootstrap-prefix.sh | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/scripts/bootstrap-prefix.sh b/scripts/bootstrap-prefix.sh
index 3b5d911680..5b1bfbd598 100755
--- a/scripts/bootstrap-prefix.sh
+++ b/scripts/bootstrap-prefix.sh
@@ -3186,6 +3186,13 @@ if [[ -z ${CHOST} ]]; then
;;
esac
;;
+ OpenBSD)
+ case `uname -m` in
+ amd64)
+ CHOST="x86_64-pc-openbsd`uname -r | sed 's|-.*$||'`"
+ ;;
+ esac
+ ;;
*)
eerror "Nothing known about platform `uname -s`."
eerror "Please set CHOST appropriately for your system"
--
2.35.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [gentoo-alt] [PATCH 2/7] scripts/bootstrap-prefix.sh: add OpenBSD toolchain
2022-06-04 4:33 [gentoo-alt] [PATCH 0/7] scripts/bootstrap-prefix.sh: initial OpenBSD support Anna Vyalkova
2022-06-04 4:33 ` [gentoo-alt] [PATCH 1/7] scripts/bootstrap-prefix.sh: add OpenBSD CHOST detection Anna Vyalkova
@ 2022-06-04 4:33 ` Anna Vyalkova
2022-06-04 4:33 ` [gentoo-alt] [PATCH 3/7] scripts/bootstrap-prefix.sh: enable ncpu detection for OpenBSD Anna Vyalkova
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Anna Vyalkova @ 2022-06-04 4:33 UTC (permalink / raw
To: gentoo-alt
Signed-off-by: Anna Vyalkova <cyber+gentoo@sysrq.in>
---
scripts/bootstrap-prefix.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/scripts/bootstrap-prefix.sh b/scripts/bootstrap-prefix.sh
index 5b1bfbd598..769c54c650 100755
--- a/scripts/bootstrap-prefix.sh
+++ b/scripts/bootstrap-prefix.sh
@@ -160,7 +160,7 @@ configure_toolchain() {
*-darwin*)
# handled below
;;
- *-freebsd*)
+ *-freebsd* | *-openbsd*)
# comes with clang, handled below
;;
*)
@@ -267,7 +267,7 @@ configure_toolchain() {
sys-devel/llvm
sys-devel/clang"
;;
- *-freebsd*)
+ *-freebsd* | *-openbsd*)
CC=clang
CXX=clang++
# TODO: target clang toolchain someday?
--
2.35.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [gentoo-alt] [PATCH 3/7] scripts/bootstrap-prefix.sh: enable ncpu detection for OpenBSD
2022-06-04 4:33 [gentoo-alt] [PATCH 0/7] scripts/bootstrap-prefix.sh: initial OpenBSD support Anna Vyalkova
2022-06-04 4:33 ` [gentoo-alt] [PATCH 1/7] scripts/bootstrap-prefix.sh: add OpenBSD CHOST detection Anna Vyalkova
2022-06-04 4:33 ` [gentoo-alt] [PATCH 2/7] scripts/bootstrap-prefix.sh: add OpenBSD toolchain Anna Vyalkova
@ 2022-06-04 4:33 ` Anna Vyalkova
2022-06-04 4:33 ` [gentoo-alt] [PATCH 4/7] scripts/bootstrap-prefix.sh: use BSD stat syntax " Anna Vyalkova
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Anna Vyalkova @ 2022-06-04 4:33 UTC (permalink / raw
To: gentoo-alt
Signed-off-by: Anna Vyalkova <cyber+gentoo@sysrq.in>
---
scripts/bootstrap-prefix.sh | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/scripts/bootstrap-prefix.sh b/scripts/bootstrap-prefix.sh
index 769c54c650..9303d3ae0c 100755
--- a/scripts/bootstrap-prefix.sh
+++ b/scripts/bootstrap-prefix.sh
@@ -2626,12 +2626,18 @@ EOF
echo
local ncpu=
case "${CHOST}" in
- *-cygwin*) ncpu=$(cmd /D /Q /C 'echo %NUMBER_OF_PROCESSORS%' | tr -d "\\r") ;;
- *-darwin*) ncpu=$(/usr/sbin/sysctl -n hw.ncpu) ;;
- *-freebsd*) ncpu=$(/sbin/sysctl -n hw.ncpu) ;;
- *-solaris*) ncpu=$(/usr/sbin/psrinfo | wc -l) ;;
- *-linux-gnu*) ncpu=$(cat /proc/cpuinfo | grep processor | wc -l) ;;
- *) ncpu=1 ;;
+ *-cygwin*)
+ ncpu=$(cmd /D /Q /C 'echo %NUMBER_OF_PROCESSORS%' | tr -d "\\r") ;;
+ *-darwin*)
+ ncpu=$(/usr/sbin/sysctl -n hw.ncpu) ;;
+ *-freebsd* | *-openbsd*)
+ ncpu=$(/sbin/sysctl -n hw.ncpu) ;;
+ *-solaris*)
+ ncpu=$(/usr/sbin/psrinfo | wc -l) ;;
+ *-linux-gnu*)
+ ncpu=$(cat /proc/cpuinfo | grep processor | wc -l) ;;
+ *)
+ ncpu=1 ;;
esac
# get rid of excess spaces (at least Solaris wc does)
ncpu=$((ncpu + 0))
--
2.35.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [gentoo-alt] [PATCH 4/7] scripts/bootstrap-prefix.sh: use BSD stat syntax for OpenBSD
2022-06-04 4:33 [gentoo-alt] [PATCH 0/7] scripts/bootstrap-prefix.sh: initial OpenBSD support Anna Vyalkova
` (2 preceding siblings ...)
2022-06-04 4:33 ` [gentoo-alt] [PATCH 3/7] scripts/bootstrap-prefix.sh: enable ncpu detection for OpenBSD Anna Vyalkova
@ 2022-06-04 4:33 ` Anna Vyalkova
2022-06-04 4:33 ` [gentoo-alt] [PATCH 5/7] scripts/bootstrap-prefix.sh: fix bash build on OpenBSD Anna Vyalkova
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Anna Vyalkova @ 2022-06-04 4:33 UTC (permalink / raw
To: gentoo-alt
Signed-off-by: Anna Vyalkova <cyber+gentoo@sysrq.in>
---
scripts/bootstrap-prefix.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/scripts/bootstrap-prefix.sh b/scripts/bootstrap-prefix.sh
index 9303d3ae0c..d0f740be87 100755
--- a/scripts/bootstrap-prefix.sh
+++ b/scripts/bootstrap-prefix.sh
@@ -2895,8 +2895,8 @@ EOF
# GNU and BSD variants of stat take different arguments (and
# format specifiers are not equivalent)
case "${CHOST}" in
- *-darwin* | *-freebsd*) STAT='stat -f %u/%g' ;;
- *) STAT='stat -c %U/%G' ;;
+ *-darwin* | *-freebsd* | *-openbsd*) STAT='stat -f %u/%g' ;;
+ *) STAT='stat -c %U/%G' ;;
esac
if [[ $(${STAT} "${EPREFIX}"/.canihaswrite) != \
--
2.35.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [gentoo-alt] [PATCH 5/7] scripts/bootstrap-prefix.sh: fix bash build on OpenBSD
2022-06-04 4:33 [gentoo-alt] [PATCH 0/7] scripts/bootstrap-prefix.sh: initial OpenBSD support Anna Vyalkova
` (3 preceding siblings ...)
2022-06-04 4:33 ` [gentoo-alt] [PATCH 4/7] scripts/bootstrap-prefix.sh: use BSD stat syntax " Anna Vyalkova
@ 2022-06-04 4:33 ` Anna Vyalkova
2022-06-04 4:33 ` [gentoo-alt] [PATCH 6/7] scripts/bootstrap-prefix.sh: fix Python " Anna Vyalkova
2022-06-04 4:33 ` [gentoo-alt] [PATCH 7/7] scripts/bootstrap-prefix.sh: use cp from GNU coreutils Anna Vyalkova
6 siblings, 0 replies; 8+ messages in thread
From: Anna Vyalkova @ 2022-06-04 4:33 UTC (permalink / raw
To: gentoo-alt
Signed-off-by: Anna Vyalkova <cyber+gentoo@sysrq.in>
---
scripts/bootstrap-prefix.sh | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/scripts/bootstrap-prefix.sh b/scripts/bootstrap-prefix.sh
index d0f740be87..c9886b6a43 100755
--- a/scripts/bootstrap-prefix.sh
+++ b/scripts/bootstrap-prefix.sh
@@ -952,9 +952,10 @@ bootstrap_gnu() {
# ensure we don't read system-wide shell initialisation, it may
# contain cruft, bug #650284
[[ ${PN} == "bash" ]] && \
- export CPPFLAGS="${CPPFLAGS} \
- -DSYS_BASHRC=\'\"${ROOT}/etc/bash/bashrc\"\' \
- -DSYS_BASH_LOGOUT=\'\"${ROOT}/etc/bash/bash_logout\"\'"
+ export CPPFLAGS="${CPPFLAGS} -DSYS_BASH_LOGOUT=\'\"${ROOT}/etc/bash/bash_logout\"\'"
+ # -DSYS_BASHRC causes bash to segfault on OpenBSD
+ [[ ${PN} == "bash" && ${CHOST} != *-openbsd* ]] && \
+ export CPPFLAGS="${CPPFLAGS} -DSYS_BASHRC=\'\"${ROOT}/etc/bash/bashrc\"\'"
# Don't do ACL stuff on Darwin, especially Darwin9 will make
# coreutils completely useless (install failing on everything)
--
2.35.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [gentoo-alt] [PATCH 6/7] scripts/bootstrap-prefix.sh: fix Python build on OpenBSD
2022-06-04 4:33 [gentoo-alt] [PATCH 0/7] scripts/bootstrap-prefix.sh: initial OpenBSD support Anna Vyalkova
` (4 preceding siblings ...)
2022-06-04 4:33 ` [gentoo-alt] [PATCH 5/7] scripts/bootstrap-prefix.sh: fix bash build on OpenBSD Anna Vyalkova
@ 2022-06-04 4:33 ` Anna Vyalkova
2022-06-04 4:33 ` [gentoo-alt] [PATCH 7/7] scripts/bootstrap-prefix.sh: use cp from GNU coreutils Anna Vyalkova
6 siblings, 0 replies; 8+ messages in thread
From: Anna Vyalkova @ 2022-06-04 4:33 UTC (permalink / raw
To: gentoo-alt
Signed-off-by: Anna Vyalkova <cyber+gentoo@sysrq.in>
---
scripts/bootstrap-prefix.sh | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/scripts/bootstrap-prefix.sh b/scripts/bootstrap-prefix.sh
index c9886b6a43..30e3ccb448 100755
--- a/scripts/bootstrap-prefix.sh
+++ b/scripts/bootstrap-prefix.sh
@@ -1159,6 +1159,10 @@ bootstrap_python() {
LDFLAGS="${LDFLAGS} -Wl,-rpath,${ROOT}/tmp/usr/lib ${libdir}"
LDFLAGS="${LDFLAGS} -Wl,-rpath,${libdir#-L}"
;;
+ *-openbsd*)
+ # LLD
+ LDFLAGS="${LDFLAGS} -Wl,-rpath,${ROOT}/tmp/usr/lib"
+ ;;
*-solaris*)
# Sun ld
LDFLAGS="${LDFLAGS} -R${ROOT}/tmp/usr/lib ${libdir}"
--
2.35.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [gentoo-alt] [PATCH 7/7] scripts/bootstrap-prefix.sh: use cp from GNU coreutils
2022-06-04 4:33 [gentoo-alt] [PATCH 0/7] scripts/bootstrap-prefix.sh: initial OpenBSD support Anna Vyalkova
` (5 preceding siblings ...)
2022-06-04 4:33 ` [gentoo-alt] [PATCH 6/7] scripts/bootstrap-prefix.sh: fix Python " Anna Vyalkova
@ 2022-06-04 4:33 ` Anna Vyalkova
6 siblings, 0 replies; 8+ messages in thread
From: Anna Vyalkova @ 2022-06-04 4:33 UTC (permalink / raw
To: gentoo-alt
BSD cp doesn't support "-d" flag.
Signed-off-by: Anna Vyalkova <cyber+gentoo@sysrq.in>
---
scripts/bootstrap-prefix.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/bootstrap-prefix.sh b/scripts/bootstrap-prefix.sh
index 30e3ccb448..fcb50dc040 100755
--- a/scripts/bootstrap-prefix.sh
+++ b/scripts/bootstrap-prefix.sh
@@ -1634,7 +1634,7 @@ bootstrap_stage1() {
-e ${MAKE_CONF_DIR}/0100_bootstrap_prefix_make.conf ]] \
|| (bootstrap_setup) || return 1
mkdir -p "${ROOT}"/tmp/etc/. || return 1
- [[ -e ${ROOT}/tmp/etc/portage/make.profile ]] || cp -dpR "${ROOT}"/etc/portage "${ROOT}"/tmp/etc || return 1
+ [[ -e ${ROOT}/tmp/etc/portage/make.profile ]] || "${ROOT}"/tmp/bin/cp -dpR "${ROOT}"/etc/portage "${ROOT}"/tmp/etc || return 1
# setup portage
[[ -e ${ROOT}/tmp/usr/bin/emerge ]] || (bootstrap_portage) || return 1
--
2.35.1
^ permalink raw reply related [flat|nested] 8+ messages in thread