mirror of
https://github.com/gentoo-mirror/guru.git
synced 2026-07-19 20:13:01 -04:00
dev-libs/xdna-driver: build against eselect-ed kernel, not booted one
This fixes build, when active kernel is Clang-built and ebuild uses GCC-built one (and vice versa). Signed-off-by: Sv. Lockal <lockalsash@gmail.com>
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
Build using the configuration of the chosen kernel, not /proc/config.gz
|
||||
|
||||
Upstream PR: https://github.com/amd/xdna-driver/pull/1285
|
||||
--- a/src/driver/tools/configure_kernel.sh
|
||||
+++ b/src/driver/tools/configure_kernel.sh
|
||||
@@ -67,7 +67,11 @@ try_compile() {
|
||||
conftest_c="$tmpdir/conftest.c"
|
||||
conftest_mk="$tmpdir/Makefile"
|
||||
USE_LLVM=""
|
||||
- if [ -e /proc/config.gz ]; then
|
||||
+ if [ -e "${KERNEL_SRC}/.config" ]; then
|
||||
+ if grep -q "CONFIG_CC_IS_CLANG=y" "${KERNEL_SRC}/.config" 2>/dev/null; then
|
||||
+ USE_LLVM="LLVM=1"
|
||||
+ fi
|
||||
+ elif [ -e /proc/config.gz ]; then
|
||||
if zgrep -q "CONFIG_CC_IS_CLANG=y" /proc/config.gz 2>/dev/null; then
|
||||
USE_LLVM="LLVM=1"
|
||||
fi
|
||||
@@ -119,6 +119,7 @@ src_prepare() {
|
||||
|
||||
pushd "${WORKDIR}/${P}" || die
|
||||
eapply "${FILESDIR}/${PN}-2.21.75-llvm-support.patch"
|
||||
eapply "${FILESDIR}/${PN}-2.21.75-try-compile-config.patch"
|
||||
popd || die
|
||||
|
||||
default
|
||||
|
||||
@@ -119,6 +119,11 @@ src_unpack() {
|
||||
|
||||
src_prepare() {
|
||||
sed -e "s/-Werror//" -i Kbuild || die
|
||||
|
||||
pushd "${WORKDIR}/${P}" || die
|
||||
eapply "${FILESDIR}/${PN}-2.21.75-try-compile-config.patch"
|
||||
popd || die
|
||||
|
||||
default
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user