* [gentoo-commits] repo/gentoo:master commit in: sys-libs/netbsd-csu/
@ 2017-06-14 17:04 Michał Górny
0 siblings, 0 replies; 8+ messages in thread
From: Michał Górny @ 2017-06-14 17:04 UTC (permalink / raw
To: gentoo-commits
commit: 437e37bbdbaa7623f9efda4464818568f5ea1e01
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed Jun 14 13:41:22 2017 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Jun 14 17:04:28 2017 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=437e37bb
sys-libs/netbsd-csu: Add a self-test phase
sys-libs/netbsd-csu/netbsd-csu-7.1.ebuild | 64 +++++++++++++++++++++++++++++++
1 file changed, 64 insertions(+)
diff --git a/sys-libs/netbsd-csu/netbsd-csu-7.1.ebuild b/sys-libs/netbsd-csu/netbsd-csu-7.1.ebuild
index 9586ae34bed..bacdd60d24f 100644
--- a/sys-libs/netbsd-csu/netbsd-csu-7.1.ebuild
+++ b/sys-libs/netbsd-csu/netbsd-csu-7.1.ebuild
@@ -59,6 +59,70 @@ multilib_src_compile() {
bsdmk_src_compile "${opts[@]}"
}
+multilib_src_test() {
+ local cc=(
+ # -B sets prefix for internal gcc/clang file lookup
+ $(tc-getCC) -B"${BUILD_DIR}"
+ )
+
+ # 1. figure out the correct location for crt* files
+ if tc-is-gcc; then
+ # gcc requires crt*.o in multi-dir
+ local multidir=$("${cc[@]}" -print-multi-directory)
+ if [[ ${multidir} != . ]]; then
+ ln -s . "${multidir}" || die
+ fi
+ elif tc-is-clang; then
+ # clang is entirely happy with crt*.o in -B
+ :
+ else
+ eerror "Unsupported compiler for tests ($(tc-getCC))"
+ return
+ fi
+
+ # 2. verify that the compiler can use our crtbegin/crtend
+ local crtbegin=$("${cc[@]}" -print-file-name=crtbegin.o) || die
+ local crtend=$("${cc[@]}" -print-file-name=crtend.o) || die
+ if [[ ! ${crtbegin} -ef ${BUILD_DIR}/crtbegin.o ]]; then
+ die "Compiler uses wrong crtbegin: ${crtbegin}"
+ fi
+ if [[ ! ${crtend} -ef ${BUILD_DIR}/crtend.o ]]; then
+ die "Compiler uses wrong crtend: ${crtend}"
+ fi
+
+ cat > hello.c <<-EOF || die
+ #include <stdio.h>
+
+ __attribute__((constructor))
+ static void ctor_test()
+ {
+ fputs("ctor:", stdout);
+ }
+
+ __attribute__((destructor))
+ static void dtor_test()
+ {
+ fputs(":dtor", stdout);
+ }
+
+ int main()
+ {
+ fputs("main", stdout);
+ return 0;
+ }
+ EOF
+
+ emake -f /dev/null CC="${cc[*]}" hello
+
+ local out=$(./hello) || die
+ if [[ ${out} != ctor:main:dtor ]]; then
+ eerror "Invalid output from the test case."
+ eerror " Expected: ctor:main:dtor"
+ eerror " Output : ${out}"
+ die "Test failed for ${ABI:-${ARCH}}"
+ fi
+}
+
multilib_src_install() {
dolib crtbegin.o crtbeginS.o crtend.o
dosym crtbegin.o "/usr/$(get_libdir)/crtbeginT.o"
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-libs/netbsd-csu/
@ 2017-06-14 17:04 Michał Górny
0 siblings, 0 replies; 8+ messages in thread
From: Michał Górny @ 2017-06-14 17:04 UTC (permalink / raw
To: gentoo-commits
commit: 3e6f9ff84c9b189605b91cf69e96d4231b1976f8
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue Jun 13 14:18:25 2017 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Jun 14 17:04:27 2017 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3e6f9ff8
sys-libs/netbsd-csu: Package crt{begin,end} from NetBSD, for clang
sys-libs/netbsd-csu/Manifest | 1 +
sys-libs/netbsd-csu/metadata.xml | 7 ++++
sys-libs/netbsd-csu/netbsd-csu-7.1.ebuild | 66 +++++++++++++++++++++++++++++++
3 files changed, 74 insertions(+)
diff --git a/sys-libs/netbsd-csu/Manifest b/sys-libs/netbsd-csu/Manifest
new file mode 100644
index 00000000000..0849efe1419
--- /dev/null
+++ b/sys-libs/netbsd-csu/Manifest
@@ -0,0 +1 @@
+DIST netbsd-csu-7.1.tar.xz 993460 SHA256 8e0adb83d9fe0954b4b361eb317e6e56f202ddf3830034739875b4f08a04687b SHA512 834524a3ada2a4c02e7eb17d8be09cf023b91e64627f3b2abc32d4f3302e982dcf0939406dc8d6c0ec7ca5e641d2d1845885bb22a165b3d6a1979c2945e2aaad WHIRLPOOL 7a965d81d6a0d7116c2f4b34019cad0293f2d72a8953827dc4d951452e81bae4af3e96fb6528501353de9b07b5abff8dcd532bb4e65d66de337aa97b97e1142e
diff --git a/sys-libs/netbsd-csu/metadata.xml b/sys-libs/netbsd-csu/metadata.xml
new file mode 100644
index 00000000000..89c4bdb9604
--- /dev/null
+++ b/sys-libs/netbsd-csu/metadata.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>llvm@gentoo.org</email>
+ </maintainer>
+</pkgmetadata>
diff --git a/sys-libs/netbsd-csu/netbsd-csu-7.1.ebuild b/sys-libs/netbsd-csu/netbsd-csu-7.1.ebuild
new file mode 100644
index 00000000000..9586ae34bed
--- /dev/null
+++ b/sys-libs/netbsd-csu/netbsd-csu-7.1.ebuild
@@ -0,0 +1,66 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit bsdmk multilib-minimal toolchain-funcs
+
+DESCRIPTION="crtbegin.o/crtend.o from NetBSD CSU for GCC-free toolchain"
+HOMEPAGE="http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/csu/"
+SRC_URI="https://dev.gentoo.org/~mgorny/dist/${P}.tar.xz"
+
+LICENSE="BSD-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE=""
+
+DEPEND="app-arch/xz-utils"
+
+S=${WORKDIR}/${P}/lib/csu
+
+src_prepare() {
+ default
+ multilib_copy_sources
+}
+
+multilib_src_compile() {
+ local inc_arch=${ABI:-${ARCH}}
+
+ # rewrite ARCH to match NetBSD includes
+ case "${inc_arch}" in
+ x86) inc_arch=i386;;
+ # x32 seems to be equivalent to amd64 as far as we're concerned
+ x32) inc_arch=amd64;;
+ arm64) inc_arch=aarch64;;
+ esac
+
+ # we need arch-specific headers for some assembler macros
+ if [[ ! -d ${WORKDIR}/${P}/sys/arch/${inc_arch} ]]; then
+ die "Unexpected ABI/ARCH: ${inc_arch}, please report"
+ fi
+ ln -s "${WORKDIR}/${P}/sys/arch/${inc_arch}/include" common/machine || die
+
+ local opts=(
+ CC="$(tc-getCC)"
+ OBJCOPY="$(tc-getOBJCOPY)"
+
+ MKPIC=yes
+ MKSTRIPIDENT=no
+ )
+ # rewrite MACHINE_ARCH to match names used in CSU
+ case "${inc_arch}" in
+ amd64) opts+=( MACHINE_ARCH=x86_64 );;
+ *) opts+=( MACHINE_ARCH="${inc_arch}" );;
+ esac
+
+ # we only need those files; crt1 and friends are provided by libc
+ opts+=( crtbegin.o crtbeginS.o crtend.o )
+
+ bsdmk_src_compile "${opts[@]}"
+}
+
+multilib_src_install() {
+ dolib crtbegin.o crtbeginS.o crtend.o
+ dosym crtbegin.o "/usr/$(get_libdir)/crtbeginT.o"
+ dosym crtend.o "/usr/$(get_libdir)/crtendS.o"
+}
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-libs/netbsd-csu/
@ 2019-09-25 17:27 Michał Górny
0 siblings, 0 replies; 8+ messages in thread
From: Michał Górny @ 2019-09-25 17:27 UTC (permalink / raw
To: gentoo-commits
commit: 07502a84076fd04b1fbc16d9be04edd1bd270b27
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Aug 17 10:00:06 2019 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Sep 25 17:27:02 2019 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=07502a84
sys-libs/netbsd-csu: Provide more complete test suite
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
sys-libs/netbsd-csu/Manifest | 1 +
sys-libs/netbsd-csu/netbsd-csu-7.1.ebuild | 66 ++++++++++++++++---------------
2 files changed, 35 insertions(+), 32 deletions(-)
diff --git a/sys-libs/netbsd-csu/Manifest b/sys-libs/netbsd-csu/Manifest
index ae2aca3085d..16f23ab3c5d 100644
--- a/sys-libs/netbsd-csu/Manifest
+++ b/sys-libs/netbsd-csu/Manifest
@@ -1 +1,2 @@
+DIST netbsd-csu-7.1-tests.tar.bz2 579 BLAKE2B 6d042b3b549ce6ffe0bd0ce908d042e4501a95c21958710078f587d9f52316a52f4bcc219f694ee60066a427a84c027c34906b76c7b8ca151766e5b476152708 SHA512 f2aa7d2340e2545a99cb88e104aaca77b64fd5bfea42bbe5e34d790ae120a749245099a550728f3b7ca2ca5a29fd1f426ddd2e8d5a7bc1a44921c308f1cb12db
DIST netbsd-csu-7.1.tar.xz 993460 BLAKE2B 013dd56eb5c49289f68518bee3f72afb42b264f7be869c7dda69f12c98ff782246fcee22c84a51719ab7ed45258cf5c06b43ee9d9da31879187bc0025b8e8c02 SHA512 834524a3ada2a4c02e7eb17d8be09cf023b91e64627f3b2abc32d4f3302e982dcf0939406dc8d6c0ec7ca5e641d2d1845885bb22a165b3d6a1979c2945e2aaad
diff --git a/sys-libs/netbsd-csu/netbsd-csu-7.1.ebuild b/sys-libs/netbsd-csu/netbsd-csu-7.1.ebuild
index c3b117bb577..dae26e9e001 100644
--- a/sys-libs/netbsd-csu/netbsd-csu-7.1.ebuild
+++ b/sys-libs/netbsd-csu/netbsd-csu-7.1.ebuild
@@ -7,7 +7,8 @@ inherit bsdmk multilib-minimal toolchain-funcs
DESCRIPTION="crtbegin.o/crtend.o from NetBSD CSU for GCC-free toolchain"
HOMEPAGE="http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/csu/"
-SRC_URI="https://dev.gentoo.org/~mgorny/dist/${P}.tar.xz"
+SRC_URI="https://dev.gentoo.org/~mgorny/dist/${P}.tar.xz
+ test? ( https://dev.gentoo.org/~mgorny/dist/${P}-tests.tar.bz2 )"
LICENSE="BSD-2"
SLOT="0"
@@ -59,9 +60,14 @@ multilib_src_compile() {
opts+=( crtbegin.o crtbeginS.o crtend.o )
bsdmk_src_compile "${opts[@]}"
+
+ ln -s crtbegin.o crtbeginT.o || die
+ ln -s crtend.o crtendS.o || die
}
multilib_src_test() {
+ cd "${WORKDIR}"/*-tests || die
+
# TODO: fix gcc support
local -x CC=${CHOST}-clang
local -x CXX=${CHOST}-clang++
@@ -97,37 +103,33 @@ multilib_src_test() {
die "Compiler uses wrong crtend: ${crtend}"
fi
- cat > hello.c <<-EOF || die
- #include <stdio.h>
-
- __attribute__((constructor))
- static void ctor_test()
- {
- fputs("ctor:", stdout);
- }
-
- __attribute__((destructor))
- static void dtor_test()
- {
- fputs(":dtor", stdout);
- }
-
- int main()
- {
- fputs("main", stdout);
- return 0;
- }
- EOF
-
- emake -f /dev/null CC="${cc[*]}" hello
-
- local out=$(./hello) || die
- if [[ ${out} != ctor:main:dtor ]]; then
- eerror "Invalid output from the test case."
- eerror " Expected: ctor:main:dtor"
- eerror " Output : ${out}"
- die "Test failed for ${ABI:-${ARCH}}"
- fi
+ # 3. build and run the tests
+ emake CC="${cc[*]}"
+
+ local p out exp
+ for p in ./hello{,-static,-dyn}; do
+ if [[ ${p} == ./hello-dyn && ${ABI} == x32 ]]; then
+ einfo "Skipping ${p} on x32 -- known to crash"
+ continue
+ fi
+
+ ebegin "Testing ${p}"
+ exp='ctor:main:dtor'
+ [[ ${p} == ./hello-dyn ]] && exp=libctor:${exp}:libdtor
+ if ! out=$("${p}"); then
+ eend 1
+ die "Test ${p} crashed for ${ABI:-${ARCH}}"
+ fi
+
+ [[ ${out} == ${exp} ]]
+ if ! eend "${?}"; then
+ eerror " Expected: ${exp}"
+ eerror " Output : ${out}"
+ die "Test ${p} failed for ${ABI:-${ARCH}}"
+ fi
+ done
+
+ emake clean
}
multilib_src_install() {
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-libs/netbsd-csu/
@ 2019-09-25 17:27 Michał Górny
0 siblings, 0 replies; 8+ messages in thread
From: Michał Górny @ 2019-09-25 17:27 UTC (permalink / raw
To: gentoo-commits
commit: 346582f7a2577eccae15fc20d77812bfcce40c3c
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Aug 17 08:32:06 2019 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Sep 25 17:27:07 2019 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=346582f7
sys-libs/netbsd-csu: Bump to EAPI 7
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
sys-libs/netbsd-csu/netbsd-csu-9.0_beta.ebuild | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/sys-libs/netbsd-csu/netbsd-csu-9.0_beta.ebuild b/sys-libs/netbsd-csu/netbsd-csu-9.0_beta.ebuild
index b1a2e3b5f9e..51311c325c2 100644
--- a/sys-libs/netbsd-csu/netbsd-csu-9.0_beta.ebuild
+++ b/sys-libs/netbsd-csu/netbsd-csu-9.0_beta.ebuild
@@ -1,7 +1,7 @@
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI=6
+EAPI=7
inherit bsdmk multilib-minimal toolchain-funcs
@@ -16,7 +16,7 @@ KEYWORDS="~amd64 ~x86"
IUSE="test"
RESTRICT="!test? ( test )"
-DEPEND="app-arch/xz-utils
+BDEPEND="app-arch/xz-utils
test? ( sys-devel/clang )"
S=${WORKDIR}/${P}/lib/csu
@@ -133,7 +133,7 @@ multilib_src_test() {
}
multilib_src_install() {
- dolib crtbegin.o crtbeginS.o crtend.o
+ dolib.a crtbegin.o crtbeginS.o crtend.o
dosym crtbegin.o "/usr/$(get_libdir)/crtbeginT.o"
dosym crtend.o "/usr/$(get_libdir)/crtendS.o"
}
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-libs/netbsd-csu/
@ 2019-09-25 17:27 Michał Górny
0 siblings, 0 replies; 8+ messages in thread
From: Michał Górny @ 2019-09-25 17:27 UTC (permalink / raw
To: gentoo-commits
commit: 3f90f9953de87db24b84a0bfb32aaa2f78c99776
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Aug 17 08:38:41 2019 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Sep 25 17:26:59 2019 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3f90f995
sys-libs/netbsd-csu: Force testing with sys-devel/clang
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
sys-libs/netbsd-csu/netbsd-csu-7.1.ebuild | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/sys-libs/netbsd-csu/netbsd-csu-7.1.ebuild b/sys-libs/netbsd-csu/netbsd-csu-7.1.ebuild
index bacdd60d24f..c3b117bb577 100644
--- a/sys-libs/netbsd-csu/netbsd-csu-7.1.ebuild
+++ b/sys-libs/netbsd-csu/netbsd-csu-7.1.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2017 Gentoo Foundation
+# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=6
@@ -12,9 +12,11 @@ SRC_URI="https://dev.gentoo.org/~mgorny/dist/${P}.tar.xz"
LICENSE="BSD-2"
SLOT="0"
KEYWORDS="~amd64 ~x86"
-IUSE=""
+IUSE="test"
+RESTRICT="!test? ( test )"
-DEPEND="app-arch/xz-utils"
+DEPEND="app-arch/xz-utils
+ test? ( sys-devel/clang )"
S=${WORKDIR}/${P}/lib/csu
@@ -60,9 +62,14 @@ multilib_src_compile() {
}
multilib_src_test() {
+ # TODO: fix gcc support
+ local -x CC=${CHOST}-clang
+ local -x CXX=${CHOST}-clang++
+ strip-unsupported-flags
+
local cc=(
# -B sets prefix for internal gcc/clang file lookup
- $(tc-getCC) -B"${BUILD_DIR}"
+ "${CC}" -B"${BUILD_DIR}"
)
# 1. figure out the correct location for crt* files
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-libs/netbsd-csu/
@ 2019-09-25 17:27 Michał Górny
0 siblings, 0 replies; 8+ messages in thread
From: Michał Górny @ 2019-09-25 17:27 UTC (permalink / raw
To: gentoo-commits
commit: b5a52d6edf58b3f419dca5170625dba3e097181e
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Aug 17 08:28:41 2019 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Sep 25 17:27:05 2019 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b5a52d6e
sys-libs/netbsd-csu: Bump to 9.0_beta
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
sys-libs/netbsd-csu/Manifest | 1 +
sys-libs/netbsd-csu/netbsd-csu-9.0_beta.ebuild | 139 +++++++++++++++++++++++++
2 files changed, 140 insertions(+)
diff --git a/sys-libs/netbsd-csu/Manifest b/sys-libs/netbsd-csu/Manifest
index 16f23ab3c5d..c7b5b25b418 100644
--- a/sys-libs/netbsd-csu/Manifest
+++ b/sys-libs/netbsd-csu/Manifest
@@ -1,2 +1,3 @@
DIST netbsd-csu-7.1-tests.tar.bz2 579 BLAKE2B 6d042b3b549ce6ffe0bd0ce908d042e4501a95c21958710078f587d9f52316a52f4bcc219f694ee60066a427a84c027c34906b76c7b8ca151766e5b476152708 SHA512 f2aa7d2340e2545a99cb88e104aaca77b64fd5bfea42bbe5e34d790ae120a749245099a550728f3b7ca2ca5a29fd1f426ddd2e8d5a7bc1a44921c308f1cb12db
DIST netbsd-csu-7.1.tar.xz 993460 BLAKE2B 013dd56eb5c49289f68518bee3f72afb42b264f7be869c7dda69f12c98ff782246fcee22c84a51719ab7ed45258cf5c06b43ee9d9da31879187bc0025b8e8c02 SHA512 834524a3ada2a4c02e7eb17d8be09cf023b91e64627f3b2abc32d4f3302e982dcf0939406dc8d6c0ec7ca5e641d2d1845885bb22a165b3d6a1979c2945e2aaad
+DIST netbsd-csu-9.0_beta.tar.xz 846120 BLAKE2B 59257e72766279ec043cbee39e2056345348088fbb9af097815c381d6cc5d2bf74c24c0ffd91f45da7384ad6df74a1a4bb0a283b3fb44976f7a59ad2f3bbbb24 SHA512 497ea33ac49338cf32bc265f5d9e7f3ba19c58009717af8505f07d9e2ec9bd3a3c72f85ec37924659509111aca20a6552fd8a06c765fa442b414bd6160815e1a
diff --git a/sys-libs/netbsd-csu/netbsd-csu-9.0_beta.ebuild b/sys-libs/netbsd-csu/netbsd-csu-9.0_beta.ebuild
new file mode 100644
index 00000000000..b1a2e3b5f9e
--- /dev/null
+++ b/sys-libs/netbsd-csu/netbsd-csu-9.0_beta.ebuild
@@ -0,0 +1,139 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit bsdmk multilib-minimal toolchain-funcs
+
+DESCRIPTION="crtbegin.o/crtend.o from NetBSD CSU for GCC-free toolchain"
+HOMEPAGE="http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/csu/"
+SRC_URI="https://dev.gentoo.org/~mgorny/dist/${P}.tar.xz
+ test? ( https://dev.gentoo.org/~mgorny/dist/netbsd-csu-7.1-tests.tar.bz2 )"
+
+LICENSE="BSD-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="test"
+RESTRICT="!test? ( test )"
+
+DEPEND="app-arch/xz-utils
+ test? ( sys-devel/clang )"
+
+S=${WORKDIR}/${P}/lib/csu
+
+src_prepare() {
+ default
+ multilib_copy_sources
+}
+
+multilib_src_compile() {
+ local inc_arch=${ABI:-${ARCH}}
+
+ # rewrite ARCH to match NetBSD includes
+ case "${inc_arch}" in
+ x86) inc_arch=i386;;
+ # x32 seems to be equivalent to amd64 as far as we're concerned
+ x32) inc_arch=amd64;;
+ arm64) inc_arch=aarch64;;
+ esac
+
+ # we need arch-specific headers for some assembler macros
+ if [[ ! -d ${WORKDIR}/${P}/sys/arch/${inc_arch} ]]; then
+ die "Unexpected ABI/ARCH: ${inc_arch}, please report"
+ fi
+ ln -s "${WORKDIR}/${P}/sys/arch/${inc_arch}/include" common/machine || die
+
+ local opts=(
+ CC="$(tc-getCC)"
+ OBJCOPY="$(tc-getOBJCOPY)"
+
+ MKPIC=yes
+ MKSTRIPIDENT=no
+ )
+ # rewrite MACHINE_ARCH to match names used in CSU
+ case "${inc_arch}" in
+ amd64) opts+=( MACHINE_ARCH=x86_64 );;
+ *) opts+=( MACHINE_ARCH="${inc_arch}" );;
+ esac
+
+ # we only need those files; crt1 and friends are provided by libc
+ opts+=( crtbegin.o crtbeginS.o crtend.o )
+
+ bsdmk_src_compile "${opts[@]}"
+
+ ln -s crtbegin.o crtbeginT.o || die
+ ln -s crtend.o crtendS.o || die
+}
+
+multilib_src_test() {
+ cd "${WORKDIR}"/*-tests || die
+
+ # TODO: fix gcc support
+ local -x CC=${CHOST}-clang
+ local -x CXX=${CHOST}-clang++
+ strip-unsupported-flags
+
+ local cc=(
+ # -B sets prefix for internal gcc/clang file lookup
+ "${CC}" -B"${BUILD_DIR}"
+ )
+
+ # 1. figure out the correct location for crt* files
+ if tc-is-gcc; then
+ # gcc requires crt*.o in multi-dir
+ local multidir=$("${cc[@]}" -print-multi-directory)
+ if [[ ${multidir} != . ]]; then
+ ln -s . "${multidir}" || die
+ fi
+ elif tc-is-clang; then
+ # clang is entirely happy with crt*.o in -B
+ :
+ else
+ eerror "Unsupported compiler for tests ($(tc-getCC))"
+ return
+ fi
+
+ # 2. verify that the compiler can use our crtbegin/crtend
+ local crtbegin=$("${cc[@]}" -print-file-name=crtbegin.o) || die
+ local crtend=$("${cc[@]}" -print-file-name=crtend.o) || die
+ if [[ ! ${crtbegin} -ef ${BUILD_DIR}/crtbegin.o ]]; then
+ die "Compiler uses wrong crtbegin: ${crtbegin}"
+ fi
+ if [[ ! ${crtend} -ef ${BUILD_DIR}/crtend.o ]]; then
+ die "Compiler uses wrong crtend: ${crtend}"
+ fi
+
+ # 3. build and run the tests
+ emake CC="${cc[*]}"
+
+ local p out exp
+ for p in ./hello{,-static,-dyn}; do
+ if [[ ${p} == ./hello-dyn && ${ABI} == x32 ]]; then
+ einfo "Skipping ${p} on x32 -- known to crash"
+ continue
+ fi
+
+ ebegin "Testing ${p}"
+ exp='ctor:main:dtor'
+ [[ ${p} == ./hello-dyn ]] && exp=libctor:${exp}:libdtor
+ if ! out=$("${p}"); then
+ eend 1
+ die "Test ${p} crashed for ${ABI:-${ARCH}}"
+ fi
+
+ [[ ${out} == ${exp} ]]
+ if ! eend "${?}"; then
+ eerror " Expected: ${exp}"
+ eerror " Output : ${out}"
+ die "Test ${p} failed for ${ABI:-${ARCH}}"
+ fi
+ done
+
+ emake clean
+}
+
+multilib_src_install() {
+ dolib crtbegin.o crtbeginS.o crtend.o
+ dosym crtbegin.o "/usr/$(get_libdir)/crtbeginT.o"
+ dosym crtend.o "/usr/$(get_libdir)/crtendS.o"
+}
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-libs/netbsd-csu/
@ 2019-12-10 16:13 Michał Górny
0 siblings, 0 replies; 8+ messages in thread
From: Michał Górny @ 2019-12-10 16:13 UTC (permalink / raw
To: gentoo-commits
commit: 3ba8374cc4ac3ae37f124c4b704ffaaa34bcc484
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue Dec 10 15:58:19 2019 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Dec 10 16:13:27 2019 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3ba8374c
sys-libs/netbsd-csu: Inline bmake use, remove bsdmk inherit
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
sys-libs/netbsd-csu/netbsd-csu-9.0_beta.ebuild | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/sys-libs/netbsd-csu/netbsd-csu-9.0_beta.ebuild b/sys-libs/netbsd-csu/netbsd-csu-9.0_beta.ebuild
index 51311c325c2..99981172ddd 100644
--- a/sys-libs/netbsd-csu/netbsd-csu-9.0_beta.ebuild
+++ b/sys-libs/netbsd-csu/netbsd-csu-9.0_beta.ebuild
@@ -3,7 +3,7 @@
EAPI=7
-inherit bsdmk multilib-minimal toolchain-funcs
+inherit flag-o-matic multilib-minimal toolchain-funcs
DESCRIPTION="crtbegin.o/crtend.o from NetBSD CSU for GCC-free toolchain"
HOMEPAGE="http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/csu/"
@@ -17,6 +17,7 @@ IUSE="test"
RESTRICT="!test? ( test )"
BDEPEND="app-arch/xz-utils
+ virtual/pmake
test? ( sys-devel/clang )"
S=${WORKDIR}/${P}/lib/csu
@@ -59,7 +60,7 @@ multilib_src_compile() {
# we only need those files; crt1 and friends are provided by libc
opts+=( crtbegin.o crtbeginS.o crtend.o )
- bsdmk_src_compile "${opts[@]}"
+ bmake ${MAKEOPTS} "${opts[@]}" ${EXTRA_EMAKE} || die
ln -s crtbegin.o crtbeginT.o || die
ln -s crtend.o crtendS.o || die
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sys-libs/netbsd-csu/
@ 2019-12-10 16:13 Michał Górny
0 siblings, 0 replies; 8+ messages in thread
From: Michał Górny @ 2019-12-10 16:13 UTC (permalink / raw
To: gentoo-commits
commit: 538c2c3f4f9be5df1e7a6368c342b558761b68ab
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue Dec 10 15:39:53 2019 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Dec 10 16:13:26 2019 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=538c2c3f
sys-libs/netbsd-csu: Remove old
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
sys-libs/netbsd-csu/Manifest | 1 -
sys-libs/netbsd-csu/netbsd-csu-7.1.ebuild | 139 ------------------------------
2 files changed, 140 deletions(-)
diff --git a/sys-libs/netbsd-csu/Manifest b/sys-libs/netbsd-csu/Manifest
index c7b5b25b418..765cdd91779 100644
--- a/sys-libs/netbsd-csu/Manifest
+++ b/sys-libs/netbsd-csu/Manifest
@@ -1,3 +1,2 @@
DIST netbsd-csu-7.1-tests.tar.bz2 579 BLAKE2B 6d042b3b549ce6ffe0bd0ce908d042e4501a95c21958710078f587d9f52316a52f4bcc219f694ee60066a427a84c027c34906b76c7b8ca151766e5b476152708 SHA512 f2aa7d2340e2545a99cb88e104aaca77b64fd5bfea42bbe5e34d790ae120a749245099a550728f3b7ca2ca5a29fd1f426ddd2e8d5a7bc1a44921c308f1cb12db
-DIST netbsd-csu-7.1.tar.xz 993460 BLAKE2B 013dd56eb5c49289f68518bee3f72afb42b264f7be869c7dda69f12c98ff782246fcee22c84a51719ab7ed45258cf5c06b43ee9d9da31879187bc0025b8e8c02 SHA512 834524a3ada2a4c02e7eb17d8be09cf023b91e64627f3b2abc32d4f3302e982dcf0939406dc8d6c0ec7ca5e641d2d1845885bb22a165b3d6a1979c2945e2aaad
DIST netbsd-csu-9.0_beta.tar.xz 846120 BLAKE2B 59257e72766279ec043cbee39e2056345348088fbb9af097815c381d6cc5d2bf74c24c0ffd91f45da7384ad6df74a1a4bb0a283b3fb44976f7a59ad2f3bbbb24 SHA512 497ea33ac49338cf32bc265f5d9e7f3ba19c58009717af8505f07d9e2ec9bd3a3c72f85ec37924659509111aca20a6552fd8a06c765fa442b414bd6160815e1a
diff --git a/sys-libs/netbsd-csu/netbsd-csu-7.1.ebuild b/sys-libs/netbsd-csu/netbsd-csu-7.1.ebuild
deleted file mode 100644
index dae26e9e001..00000000000
--- a/sys-libs/netbsd-csu/netbsd-csu-7.1.ebuild
+++ /dev/null
@@ -1,139 +0,0 @@
-# Copyright 1999-2019 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-inherit bsdmk multilib-minimal toolchain-funcs
-
-DESCRIPTION="crtbegin.o/crtend.o from NetBSD CSU for GCC-free toolchain"
-HOMEPAGE="http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/csu/"
-SRC_URI="https://dev.gentoo.org/~mgorny/dist/${P}.tar.xz
- test? ( https://dev.gentoo.org/~mgorny/dist/${P}-tests.tar.bz2 )"
-
-LICENSE="BSD-2"
-SLOT="0"
-KEYWORDS="~amd64 ~x86"
-IUSE="test"
-RESTRICT="!test? ( test )"
-
-DEPEND="app-arch/xz-utils
- test? ( sys-devel/clang )"
-
-S=${WORKDIR}/${P}/lib/csu
-
-src_prepare() {
- default
- multilib_copy_sources
-}
-
-multilib_src_compile() {
- local inc_arch=${ABI:-${ARCH}}
-
- # rewrite ARCH to match NetBSD includes
- case "${inc_arch}" in
- x86) inc_arch=i386;;
- # x32 seems to be equivalent to amd64 as far as we're concerned
- x32) inc_arch=amd64;;
- arm64) inc_arch=aarch64;;
- esac
-
- # we need arch-specific headers for some assembler macros
- if [[ ! -d ${WORKDIR}/${P}/sys/arch/${inc_arch} ]]; then
- die "Unexpected ABI/ARCH: ${inc_arch}, please report"
- fi
- ln -s "${WORKDIR}/${P}/sys/arch/${inc_arch}/include" common/machine || die
-
- local opts=(
- CC="$(tc-getCC)"
- OBJCOPY="$(tc-getOBJCOPY)"
-
- MKPIC=yes
- MKSTRIPIDENT=no
- )
- # rewrite MACHINE_ARCH to match names used in CSU
- case "${inc_arch}" in
- amd64) opts+=( MACHINE_ARCH=x86_64 );;
- *) opts+=( MACHINE_ARCH="${inc_arch}" );;
- esac
-
- # we only need those files; crt1 and friends are provided by libc
- opts+=( crtbegin.o crtbeginS.o crtend.o )
-
- bsdmk_src_compile "${opts[@]}"
-
- ln -s crtbegin.o crtbeginT.o || die
- ln -s crtend.o crtendS.o || die
-}
-
-multilib_src_test() {
- cd "${WORKDIR}"/*-tests || die
-
- # TODO: fix gcc support
- local -x CC=${CHOST}-clang
- local -x CXX=${CHOST}-clang++
- strip-unsupported-flags
-
- local cc=(
- # -B sets prefix for internal gcc/clang file lookup
- "${CC}" -B"${BUILD_DIR}"
- )
-
- # 1. figure out the correct location for crt* files
- if tc-is-gcc; then
- # gcc requires crt*.o in multi-dir
- local multidir=$("${cc[@]}" -print-multi-directory)
- if [[ ${multidir} != . ]]; then
- ln -s . "${multidir}" || die
- fi
- elif tc-is-clang; then
- # clang is entirely happy with crt*.o in -B
- :
- else
- eerror "Unsupported compiler for tests ($(tc-getCC))"
- return
- fi
-
- # 2. verify that the compiler can use our crtbegin/crtend
- local crtbegin=$("${cc[@]}" -print-file-name=crtbegin.o) || die
- local crtend=$("${cc[@]}" -print-file-name=crtend.o) || die
- if [[ ! ${crtbegin} -ef ${BUILD_DIR}/crtbegin.o ]]; then
- die "Compiler uses wrong crtbegin: ${crtbegin}"
- fi
- if [[ ! ${crtend} -ef ${BUILD_DIR}/crtend.o ]]; then
- die "Compiler uses wrong crtend: ${crtend}"
- fi
-
- # 3. build and run the tests
- emake CC="${cc[*]}"
-
- local p out exp
- for p in ./hello{,-static,-dyn}; do
- if [[ ${p} == ./hello-dyn && ${ABI} == x32 ]]; then
- einfo "Skipping ${p} on x32 -- known to crash"
- continue
- fi
-
- ebegin "Testing ${p}"
- exp='ctor:main:dtor'
- [[ ${p} == ./hello-dyn ]] && exp=libctor:${exp}:libdtor
- if ! out=$("${p}"); then
- eend 1
- die "Test ${p} crashed for ${ABI:-${ARCH}}"
- fi
-
- [[ ${out} == ${exp} ]]
- if ! eend "${?}"; then
- eerror " Expected: ${exp}"
- eerror " Output : ${out}"
- die "Test ${p} failed for ${ABI:-${ARCH}}"
- fi
- done
-
- emake clean
-}
-
-multilib_src_install() {
- dolib crtbegin.o crtbeginS.o crtend.o
- dosym crtbegin.o "/usr/$(get_libdir)/crtbeginT.o"
- dosym crtend.o "/usr/$(get_libdir)/crtendS.o"
-}
^ permalink raw reply related [flat|nested] 8+ messages in thread
end of thread, other threads:[~2019-12-10 16:13 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-12-10 16:13 [gentoo-commits] repo/gentoo:master commit in: sys-libs/netbsd-csu/ Michał Górny
-- strict thread matches above, loose matches on Subject: below --
2019-12-10 16:13 Michał Górny
2019-09-25 17:27 Michał Górny
2019-09-25 17:27 Michał Górny
2019-09-25 17:27 Michał Górny
2019-09-25 17:27 Michał Górny
2017-06-14 17:04 Michał Górny
2017-06-14 17:04 Michał Górny
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox